feat: throw explicit error when SITE_DOMAIN is unset

- Throw fatal configuration error in src/_data/site.js if SITE_DOMAIN is missing
- Require SITE_DOMAIN in docker-compose.yml without default fallback
- Require SITE_DOMAIN ARG in Dockerfile with no default fallback
This commit is contained in:
venus
2026-09-13 01:11:28 -05:00
parent 1491d3fa5c
commit fc6c17b541
3 changed files with 19 additions and 9 deletions
+11 -1
View File
@@ -21,7 +21,17 @@ try {
// Silent fallback
}
const siteDomain = process.env.SITE_DOMAIN || "riverrooks.dev";
const siteDomain = process.env.SITE_DOMAIN;
if (!siteDomain) {
throw new Error(
"\n=======================================================================\n" +
"FATAL CONFIGURATION ERROR: SITE_DOMAIN environment variable is not set.\n" +
"The site domain must be explicitly defined in your .env file or environment.\n" +
"Example in .env:\n" +
" SITE_DOMAIN=riverrooks.dev\n" +
"=======================================================================\n"
);
}
const siteUrl = process.env.SITE_URL || `https://${siteDomain}`;
export default {