feat!: implement redirect for hosting base domain

Redirect the subdomains `""` and `"www"` to a configurable URL, which is
by default `https://developer.puter.com/static-hosting/`.

This is potentially a breaking change for local instances that have a
subdomain called "www". Users hosting their own Puter may want to be
aware of this.

Closes #2214
This commit is contained in:
KernelDeimos
2026-01-06 17:20:21 -05:00
committed by Eric Dubé
parent 678363b0ba
commit 4d60168d2f
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -67,6 +67,7 @@ config.monitor = {
config.max_subdomains_per_user = 2000;
config.storage_capacity = 1 * 1024 * 1024 * 1024;
config.static_hosting_domain = 'site.puter.localhost';
config.static_hosting_base_domain_redirect = 'https://developer.puter.com/static-hosting/';
// Storage limiting is set to false by default
// Storage available on the mountpoint/drive puter is running is the storage available
@@ -116,6 +116,11 @@ class PuterSiteMiddleware extends AdvancedBase {
};
});
if ( subdomain === '' || subdomain === 'www' ) {
// redirect to information page about static hosting
return res.redirect(config.static_hosting_base_domain_redirect);
}
const site =
await get_username_site() ||
await (async () => {