From 3dfec5d2f90f8c267a17307d783da4b14d37f0e3 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Thu, 14 May 2026 12:03:29 -0500 Subject: [PATCH] feat(config): DISABLE_HOMEPAGE env var to redirect / to the app Self-hosters running internal-only deployments don't need the marketing homepage. With DISABLE_HOMEPAGE=true, requests to / 302-redirect to /app instead of serving the landing page. Unset/false preserves current behavior. Requested via discord feedback. --- README.md | 1 + server/config.js | 3 +++ server/server.js | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21b3cfe..c16a678 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ Schema migrations run automatically on first boot — no manual migration comman | `NODE_ENV` | Runtime env (`production` enables Express production optimizations + stricter error handling) | _(none)_ | | `SELF_HOSTED` | First user gets all features unlocked | `false` | | `DISABLE_REGISTRATION` | Block new account creation (including OAuth auto-signup). First-user setup on an empty DB is still allowed. | `false` | +| `DISABLE_HOMEPAGE` | Redirect `/` to `/app` instead of serving the marketing landing page. For internal-only self-hosted deployments. | `false` | | `APP_URL` | Your public URL (used for Stripe callbacks) | _(none)_ | | `JWT_SECRET` | JWT signing key (auto-generated if not set) | _(auto)_ | | `SSL_CERT` | Path to SSL certificate | `server/certs/cert.pem` | diff --git a/server/config.js b/server/config.js index bffa9e0..5c541bf 100644 --- a/server/config.js +++ b/server/config.js @@ -52,4 +52,7 @@ module.exports = { // Disable public registration (OAuth auto-signup is also blocked when set). // First-user setup is still allowed so a fresh install can be initialized. disableRegistration: ['true', '1'].includes(String(process.env.DISABLE_REGISTRATION || '').toLowerCase()), + // Redirect / -> /app instead of serving the marketing landing page. + // For self-hosted internal deployments that don't want the public homepage. + disableHomepage: ['true', '1'].includes(String(process.env.DISABLE_HOMEPAGE || '').toLowerCase()), }; diff --git a/server/server.js b/server/server.js index bfd702c..2435a42 100644 --- a/server/server.js +++ b/server/server.js @@ -139,8 +139,12 @@ app.use(express.json()); const { sanitizeBody } = require('./middleware/sanitize'); app.use(sanitizeBody); -// Landing page BEFORE static middleware (so / doesn't serve index.html) +// Landing page BEFORE static middleware (so / doesn't serve index.html). +// When DISABLE_HOMEPAGE is set, redirect to the app instead - for self-hosted +// internal deployments that don't want the public marketing page. 302 (not +// 301) so flipping the var back later isn't hard-cached by browsers. app.get('/', (req, res) => { + if (config.disableHomepage) return res.redirect(302, '/app'); res.sendFile(path.join(config.frontendDir, 'landing.html')); });