diff --git a/server/lib/config.ts b/server/lib/config.ts index e799dea5..a04285d3 100644 --- a/server/lib/config.ts +++ b/server/lib/config.ts @@ -181,6 +181,11 @@ export class Config { } else if (fs.existsSync(configFilePath2)) { environment = loadConfig(configFilePath2); } + + if (process.env.APP_BASE_DOMAIN) { + console.log("You're using deprecated environment variables. Transition to the configuration file. https://docs.fossorial.io/"); + } + if (!environment) { throw new Error( "No configuration file found. Please create one. https://docs.fossorial.io/" diff --git a/server/routers/resource/updateResource.ts b/server/routers/resource/updateResource.ts index 2baa61bc..bade7f09 100644 --- a/server/routers/resource/updateResource.ts +++ b/server/routers/resource/updateResource.ts @@ -215,8 +215,13 @@ async function updateHttpResource( .from(domains) .where(eq(domains.domainId, domainId)); + const isBaseDomain = + updateData.isBaseDomain !== undefined + ? updateData.isBaseDomain + : resource.isBaseDomain; + let fullDomain: string | null = null; - if (updateData.isBaseDomain) { + if (isBaseDomain) { fullDomain = domain.baseDomain; } else if (subdomain && domain) { fullDomain = `${subdomain}.${domain.baseDomain}`;