Improved the bootstrap script to write the canonical site origin and also, fixed some nasty bugs.

This commit is contained in:
2026-08-30 09:53:39 +02:00
parent a3d0bc75fd
commit 6c75d5e743
6 changed files with 43 additions and 19 deletions
@@ -56,10 +56,11 @@ extension String {
}
/// A namespace for the site string constants.
public enum Site {
/// The default public origin the site is served at (scheme and host, no trailing slash): empty, which leaves the HTTPS redirect off.
/// The default public origin the site is served at (scheme and host, no trailing slash).
///
/// A deployment that trusts the forwarded-protocol header without also setting `site.origin` would otherwise redirect at a host the
/// template guessed for it, and a `301` is cached for a long time.
/// Bootstrap writes the canonical URL it prompts for here, leaving it empty for the placeholder. An empty or non-HTTPS origin disables
/// the HTTPS redirect, which `https.trustForwardedProto` must enable besides a `301` is cached for a long time, so it is never issued
/// at a host nobody named.
public static let origin = ""
}
}