mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user