various bugfixes

This commit is contained in:
Joey Kimsey
2026-09-12 22:47:47 -04:00
parent 2eb64aa186
commit 2248aa14e5
17 changed files with 162 additions and 51 deletions

8
build/defaultSite.mjs Normal file
View File

@ -0,0 +1,8 @@
/** Validate the non-secret default site embedded in the renderer at build time. */
export function defaultSite(value = 'https://ttp.joeykimsey.com') {
const url = new URL(value.trim())
if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password || url.search || url.hash) {
throw new Error('CAPSULE_DEFAULT_SITE must be an HTTP(S) site URL without credentials, query, or fragment.')
}
return url.href.replace(/\/+$/, '')
}