fix: use either HEADSCALE_URL or config.server_url

This commit is contained in:
Aarnav Tale 2024-03-30 19:00:59 -04:00
parent a47fb61549
commit 78140927ad
No known key found for this signature in database
3 changed files with 29 additions and 8 deletions

View file

@ -22,11 +22,11 @@ export const links: LinksFunction = () => [
]
export async function loader() {
await getContext()
const context = await getContext()
registerConfigWatcher()
if (!process.env.HEADSCALE_URL) {
throw new Error('The HEADSCALE_URL environment variable is required')
if (context.headscaleUrl.length === 0) {
throw new Error('No headscale URL was provided either by the HEADSCALE_URL environment variable or the config file')
}
if (!process.env.COOKIE_SECRET) {