source: Klonkt/src/server.js@ 931b4cb

main
Last change on this file since 931b4cb was 931b4cb, checked in by Robin Genis <roboburr@…>, 2 months ago

fix(proxy): tolerate leading double-slash paths (Apache [P] proxy)

A reverse proxy using 'RewriteRule (.*)$ http://localhost:3000/$1' sends for the root and
path for sub-paths (the captured $1 keeps its leading slash), which matched no Express route
→ the whole site 404'd behind such a proxy. Collapse leading duplicate slashes early so Klonkt
is resilient to that common Apache .htaccess setup.

  • Property mode set to 100644
File size: 22.3 KB
Line 
1/**
2 * Klonkt Beta — server bootstrap
3 *
4 * Personal multi-site platform — Node + SQLite + htmx.
5 * Stack: Express + better-sqlite3 + EJS + htmx + ws.
6 */
7
8import 'dotenv/config';
9import express from 'express';
10import helmet from 'helmet';
11import session from 'express-session';
12import bodyParser from 'body-parser';
13import path from 'path';
14import fs from 'fs';
15import crypto from 'crypto';
16import { fileURLToPath } from 'url';
17import http from 'http';
18import db, { initializeDatabase } from './config/database.js';
19import { startScheduler } from './services/Scheduler.js';
20import { SqliteSessionStore } from './services/SqliteSessionStore.js';
21import { ensurePrimarySite } from './services/ensurePrimarySite.js';
22import { resolveSite, loadAudioTracks, loadTheme } from './middleware/site.js';
23import { isViewer } from './middleware/auth.js';
24import { renderPage } from './middleware/render.js';
25import { audioEnabled } from './config/features.js';
26import authRoutes from './routes/auth.js';
27import accountRoutes from './routes/account.js';
28import adminRoutes from './routes/admin.js';
29import adminAudioRoutes from './routes/admin-audio.js';
30import adminPlaylistsRoutes from './routes/admin-playlists.js';
31import adminSitesRoutes from './routes/admin-sites.js';
32import adminUsersRoutes from './routes/admin-users.js';
33import adminSettingsRoutes from './routes/admin-settings.js';
34import adminSeoRoutes from './routes/admin-seo.js';
35import audioRoutes from './routes/audio.js';
36import searchRoutes from './routes/search.js';
37import tagsRoutes from './routes/tags.js';
38import typesRoutes from './routes/types.js';
39import usersRoutes from './routes/users.js';
40import feedRoutes from './routes/feed.js';
41import postsRoutes from './routes/posts.js';
42import langRoutes from './routes/lang.js';
43import adminUpdatesRoutes from './routes/admin-updates.js';
44import adminPatreonRoutes from './routes/admin-patreon.js';
45import adminStatsRoutes from './routes/admin-stats.js';
46import circleRoutes from './routes/circle.js';
47import epkRoutes from './routes/epk.js';
48import newsletterRoutes from './routes/newsletter.js';
49import adminNewsletterRoutes from './routes/admin-newsletter.js';
50import downloadRoutes from './routes/download.js';
51import linkbioRoutes from './routes/linkbio.js';
52import embedRoutes from './routes/embed.js';
53import showsRoutes from './routes/shows.js';
54import adminShowsRoutes from './routes/admin-shows.js';
55import adminEpkRoutes from './routes/admin-epk.js';
56import changelogRoutes from './routes/changelog.js';
57import ogRoutes from './routes/og.js';
58import apRoutes from './routes/activitypub.js';
59import { apWants, startDeliveryWorker, selfHealTimeline } from './services/ActivityPubService.js';
60
61// SESSION_SECRET: use the env var if set. Otherwise auto-generate a strong one
62// and persist it next to the database, so it stays stable across restarts and
63// updates. This lets Docker / bare-Node installs run with zero manual config.
64if (!process.env.SESSION_SECRET) {
65 const dataDir = path.dirname(process.env.DATABASE_PATH || './storage/database.sqlite');
66 const secretFile = path.join(dataDir, '.session-secret');
67 try { process.env.SESSION_SECRET = fs.readFileSync(secretFile, 'utf8').trim(); } catch { /* not yet generated */ }
68 if (!process.env.SESSION_SECRET) {
69 fs.mkdirSync(dataDir, { recursive: true });
70 process.env.SESSION_SECRET = crypto.randomBytes(32).toString('hex');
71 fs.writeFileSync(secretFile, process.env.SESSION_SECRET, { mode: 0o600 });
72 console.log(`🔑 Generated a SESSION_SECRET (stored in ${secretFile})`);
73 }
74}
75
76// A SESSION_SECRET that was explicitly set in the env must still be strong in prod.
77if (process.env.NODE_ENV === 'production' && process.env.SESSION_SECRET.length < 32) {
78 console.error('❌ FATAL: SESSION_SECRET is too weak for production (set a longer, random one in .env)');
79 process.exit(1);
80}
81
82const __dirname = path.dirname(fileURLToPath(import.meta.url));
83const PORT = process.env.PORT || 3000;
84// Interface to bind. Default 0.0.0.0 (needed for Docker port-forwarding). Behind a
85// reverse proxy on the same host, set HOST=127.0.0.1 so the app is NOT reachable
86// directly from the internet (only via the proxy) — see README/install docs.
87const HOST = process.env.HOST || '0.0.0.0';
88const isDev = process.env.NODE_ENV !== 'production';
89
90const app = express();
91const server = http.createServer(app);
92
93app.use(helmet({
94 contentSecurityPolicy: {
95 directives: {
96 defaultSrc: ["'self'"],
97 scriptSrc: [
98 "'self'",
99 "'unsafe-inline'",
100 // Our custom embeds (embed-player.js) load the OFFICIAL player APIs
101 // from these hosts. Without this whitelist the CSP silently blocks them
102 // (only a console error) and the embed player fails.
103 "https://www.youtube.com", // YouTube IFrame Player API (+ www-widgetapi.js)
104 "https://s.ytimg.com", // YouTube player assets
105 "https://w.soundcloud.com", // SoundCloud Widget API (api.js)
106 "https://open.spotify.com", // Spotify iFrame API (loader)
107 "https://*.spotifycdn.com", // Spotify iFrame API (real bundle: embed-cdn.spotifycdn.com)
108 ],
109 // Helmet's default sets script-src-attr to 'none', which blocks ALL inline
110 // event handlers (onchange/onclick/onsubmit) — causing e.g. the avatar
111 // upload (<input onchange="this.form.submit()">) and the role dropdown to
112 // silently do nothing. We explicitly allow inline handlers, consistent with
113 // the already-allowed inline <script> above.
114 scriptSrcAttr: ["'unsafe-inline'"],
115 styleSrc: ["'self'", "'unsafe-inline'"],
116 // blob: required for the image editor (Cropper) — it displays the chosen
117 // photo via URL.createObjectURL(blob:…). Without blob: the CSP silently
118 // blocks the <img> → empty edit window. (media-src already has blob: for audio.)
119 imgSrc: ["'self'", "data:", "https:", "blob:"],
120 connectSrc: ["'self'", "wss:", "ws:", "https://*.spotifycdn.com", "https://*.scdn.co"],
121 // blob: is required for the audio player — it fetch()es track bytes and
122 // plays from a blob: object URL (Spotify-style). Without blob: here the
123 // CSP silently blocks <audio>.src = blob:… → the player fires 'error' and
124 // auto-skips every track. 'self'/https: do NOT imply blob:.
125 mediaSrc: ["'self'", "https:", "blob:"],
126 fontSrc: ["'self'"],
127 // Embeds (platform players + cross-site Klonkt audio players) are framed broadly:
128 // ANY https origin, so embeds work in any context (feed, htmx/PWA nav, public pages).
129 // The sensitive /authorize_interaction page tightens frame-src back to 'self' in
130 // renderPage — it shows untrusted remote content next to the interact buttons.
131 frameSrc: ["'self'", "https:"],
132 },
133 },
134 hsts: { maxAge: 31536000, includeSubDomains: true, preload: true },
135 frameguard: { action: 'sameorigin' },
136 referrerPolicy: { policy: 'no-referrer-when-downgrade' },
137}));
138
139app.set('view engine', 'ejs');
140app.set('views', path.join(__dirname, 'views'));
141
142app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }));
143app.use(bodyParser.json({ limit: '10mb' }));
144
145// Trust one upstream proxy in production. NPM (or Caddy / nginx) terminates
146// HTTPS and forwards to us over plain HTTP, setting X-Forwarded-Proto: https.
147// Without this, Express sees req.protocol === 'http' and won't issue secure
148// cookies — sessions never persist past the redirect after login.
149if (!isDev) app.set('trust proxy', 1);
150
151// Collapse leading duplicate slashes in the path. A reverse proxy that proxies with
152// `RewriteRule ^(.*)$ http://localhost:3000/$1` (Apache [P]) sends "//" for the root and
153// "//path" for sub-paths (the captured $1 keeps its leading slash) → Express matches no
154// route → the whole site 404'd behind such a proxy. Normalising here makes Klonkt resilient
155// to that common reverse-proxy setup. (Only the leading slashes; the query string is intact.)
156app.use((req, res, next) => {
157 if (req.url.startsWith('//')) req.url = req.url.replace(/^\/+/, '/');
158 next();
159});
160
161// Create/migrate the schema BEFORE anything touches the DB: the session store
162// queries the `sessions` table on construction, so on a fresh install the tables
163// must exist first (otherwise: "no such table: sessions" → crash loop on first boot).
164initializeDatabase();
165startScheduler(); // release planning: publish scheduled posts when publish_at is reached
166startDeliveryWorker(); // retry failed fediverse deliveries with backoff
167selfHealTimeline(); // once per SELFHEAL_VERSION bump: re-sync the fediverse cache (covers/edits) after a drastic update
168
169// Safety net: guarantee that there is always a primary site (solo/hub/circle).
170// Idempotent — does nothing if a site already exists or there is no admin yet.
171ensurePrimarySite();
172
173// Session middleware extracted into a variable so the WebSocket upgrade
174// handler can reuse it (it needs req.session to authenticate sockets).
175const sessionMiddleware = session({
176 store: new SqliteSessionStore(),
177 secret: process.env.SESSION_SECRET,
178 resave: false,
179 saveUninitialized: false,
180 name: 'pcms.sid',
181 cookie: {
182 httpOnly: true,
183 secure: !isDev,
184 sameSite: 'lax',
185 maxAge: 30 * 24 * 60 * 60 * 1000,
186 },
187});
188app.use(sessionMiddleware);
189
190app.use('/assets', express.static(path.join(__dirname, 'assets'), { maxAge: isDev ? 0 : '1y' }));
191app.use('/media', express.static(process.env.MEDIA_PATH || './storage/media', {
192 // Public media (post covers, avatars) must be cross-origin embeddable by other
193 // Klonkt sites in their CIRCLE. Helmet sets CORP=same-origin by default, which
194 // causes the browser to block those images (the file arrives, but the browser
195 // refuses to render it). Set cross-origin explicitly for /media.
196 setHeaders: (res) => res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin'),
197}));
198
199// (Removed) TWA / digital-asset-links — only needed for the APK/TWA variant.
200// Klonkt is PWA-only; assetlinks.json is no longer served.
201
202// Bundle HTMX: copy from node_modules into our own assets dir so we can serve
203// it locally (no third-party CDN). Idempotent — only copies if size differs.
204(function ensureLocalHtmx() {
205 const src = path.join(__dirname, '..', 'node_modules', 'htmx.org', 'dist', 'htmx.min.js');
206 const dest = path.join(__dirname, 'assets', 'js', 'htmx.min.js');
207 try {
208 const srcStat = fs.statSync(src);
209 const destStat = fs.existsSync(dest) ? fs.statSync(dest) : null;
210 if (!destStat || destStat.size !== srcStat.size) {
211 fs.copyFileSync(src, dest);
212 console.log(`📦 HTMX bundled locally: ${srcStat.size} bytes`);
213 }
214 } catch (e) {
215 console.warn('⚠️ Could not bundle HTMX:', e.message, '— run `npm install`');
216 }
217})();
218
219// ActivityPub: WebFinger + /ap/* (site-agnostic, resolves the site by slug).
220app.use(apRoutes);
221
222// Themed OG cards (/og/:slug.png) — resolve the site by slug themselves, so they
223// run before resolveSite and need no site context.
224app.use('/og', ogRoutes);
225
226app.use(resolveSite);
227app.use(loadAudioTracks);
228app.use(loadTheme);
229
230// ActivityPub content negotiation on the human URLs: an AP request (Accept:
231// application/activity+json) to a profile/post URL is redirected to its /ap/*
232// representation — same URL serves HTML to browsers, AP-JSON to servers (this is
233// how Mastodon resolves a pasted profile/post URL). Gated on apWants() so normal
234// browser requests pay nothing.
235app.use((req, res, next) => {
236 if (req.method !== 'GET' || !apWants(req)) return next();
237 const site = res.locals.site;
238 if (!site || !site.slug) return next();
239 const seg = req.path.replace(/^\/+|\/+$/g, '');
240 if (seg === '') return res.redirect(302, `/ap/users/${encodeURIComponent(site.slug)}`);
241 if (!seg.includes('/')) {
242 try {
243 const post = db.prepare(
244 "SELECT id FROM posts WHERE site_id = ? AND slug = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)"
245 ).get(site.id, seg);
246 if (post) return res.redirect(302, `/ap/notes/${post.id}`);
247 } catch { /* fall through to normal HTML handling */ }
248 }
249 return next();
250});
251
252// Lightweight CSRF defense: reject cross-origin state-mutating requests.
253// Same-origin forms + HTMX send a matching Origin; missing Origin is allowed
254// through (non-browser clients). sameSite:'lax' on the session cookie is the
255// second layer. (Does not apply to GET/HEAD/OPTIONS.)
256app.use((req, res, next) => {
257 if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') return next();
258 const origin = req.get('origin');
259 if (!origin) return next(); // no Origin → no browser CSRF vector
260 let originHost;
261 try { originHost = new URL(origin).host; } catch { return res.status(403).send('Ongeldige origin'); }
262 // Behind a reverse proxy the raw Host is the backend bind (e.g. localhost:3000, when the
263 // proxy doesn't preserve it — common with Apache .htaccess proxying), so also accept the
264 // operator-configured PUBLIC_BASE_URL host and the proxy's X-Forwarded-Host. Both are
265 // operator/proxy-controlled and can't be forged via a victim's browser, so this is safe.
266 const allowedHosts = [req.get('host'), req.get('x-forwarded-host')];
267 if (process.env.PUBLIC_BASE_URL) { try { allowedHosts.push(new URL(process.env.PUBLIC_BASE_URL).host); } catch { /* ignore bad config */ } }
268 if (!allowedHosts.includes(originHost)) return res.status(403).send('Cross-origin request geweigerd');
269 next();
270});
271
272// Viewer accounts: may view everything (including Admin), change nothing. This is
273// the ONLY write gate — fail-closed, before all route handlers. Every state-mutating
274// method is rejected (the login POST sets the session after this guard, so it is
275// not affected). Instead of raw 403 text we render a clean page (or, for HTMX,
276// a swapped-in message).
277app.use((req, res, next) => {
278 const mutating = req.method !== 'GET' && req.method !== 'HEAD' && req.method !== 'OPTIONS';
279 if (mutating && isViewer(req.session?.user)) {
280 if (req.headers['hx-request'] === 'true') {
281 // htmx doesn't swap on 4xx; send 200 + retarget so the message appears in #pcms-main.
282 res.setHeader('HX-Retarget', '#pcms-main');
283 res.setHeader('HX-Reswap', 'innerHTML');
284 res.status(200);
285 } else {
286 res.status(403);
287 }
288 return renderPage(req, res, 'pages/viewer-blocked', {
289 pageTitle: 'Kijker-modus',
290 bodyClass: 'on-special',
291 });
292 }
293 next();
294});
295
296app.use('/auth', authRoutes);
297app.use('/account', accountRoutes);
298// NB: /notifications is the fediverse notifications page (in postsRoutes). The old
299// user-notifications route was removed — it collided with the fedi route after the
300// /meldingen -> /notifications rename, and the user-notifications system is dead.
301if (audioEnabled()) {
302 app.use('/admin/audio', adminAudioRoutes);
303 app.use('/admin/playlists', adminPlaylistsRoutes);
304}
305app.use('/admin/sites', adminSitesRoutes);
306app.use('/admin/users', adminUsersRoutes);
307app.use('/admin/settings', adminSettingsRoutes);
308app.use('/admin/seo', adminSeoRoutes);
309app.use('/admin/updates', adminUpdatesRoutes);
310app.use('/admin/patreon', adminPatreonRoutes);
311app.use('/admin/stats', adminStatsRoutes);
312app.use('/admin/newsletter', adminNewsletterRoutes);
313app.use('/admin/shows', adminShowsRoutes);
314app.use('/admin/epk', adminEpkRoutes);
315app.use('/admin', adminRoutes);
316if (audioEnabled()) app.use('/audio', audioRoutes);
317app.use('/search', searchRoutes);
318app.use('/tag', tagsRoutes);
319app.use('/type', typesRoutes);
320app.use('/users', usersRoutes);
321// Feed/sitemap routes are mounted at root because they're at well-known paths
322app.use('/', feedRoutes);
323app.use('/', circleRoutes); // /cirkel-feed (solo: next() -> postsRoutes)
324app.use('/', epkRoutes); // /pers perskit (premium; niet-premium: next() -> 404)
325app.use('/', newsletterRoutes); // /nieuwsbrief in/uitschrijven (premium; niet-premium: next())
326if (audioEnabled()) app.use('/', downloadRoutes); // /downloads + /download/:id (audio; lite: uit)
327app.use('/', linkbioRoutes); // /links link-in-bio + klikstats (premium)
328if (audioEnabled()) app.use('/', embedRoutes); // /embed inbedbare audiospeler (audio; lite: uit)
329app.use('/', showsRoutes); // /shows agenda + notify-me (premium)
330app.use('/', changelogRoutes); // /changelog publieke release-/wijzigingen-pagina
331app.use('/', langRoutes); // /lang/:code — interface-taal kiezen (vóór de catch-all)
332app.use('/', postsRoutes);
333
334app.get('/manifest.webmanifest', (req, res) => {
335 const site = res.locals.site;
336
337 // PWA scope: confines installed apps to ONE site. If a user is in the
338 // bedrijf1 PWA and clicks a link to /sites/bedrijf2/..., the browser will
339 // open it in a regular tab (out-of-scope) instead of within the PWA.
340 // Same applies to APK packaging — the WebView is locked to this scope.
341 //
342 // For path-mounted sites: scope = /sites/<slug>/
343 // For root/subdomain sites: scope = /
344 const base = res.locals.siteUrlBase || ''; // '' or '/sites/<slug>'
345 const scope = (base || '') + '/';
346 const startUrl = (base || '') + '/?source=pwa';
347
348 // A stable identity per site so installs don't collide (Chromium uses `id`).
349 // NB: changing the id orphans existing PWA installs (no migration carries an
350 // install across an id change) — anyone who already installed the site as a
351 // PWA will need to reinstall once. Data stays server-side, so nothing is lost.
352 const idBase = site?.slug ? `klonkt-${site.slug}` : 'klonkt';
353
354 res.set('Cache-Control', 'no-cache');
355 res.json({
356 id: idBase,
357 name: site?.title || 'Klonkt',
358 short_name: (site?.title || 'Klonkt').slice(0, 12),
359 description: site?.description || site?.tagline || '',
360 scope,
361 start_url: startUrl,
362 display: 'standalone',
363 display_override: ['standalone', 'minimal-ui'],
364 orientation: 'any',
365 background_color: '#1a1a17',
366 theme_color: site?.accent || '#e8b04b',
367 lang: site?.language || 'nl',
368 icons: [
369 { src: '/favicon.svg', sizes: 'any', type: 'image/svg+xml' },
370 { src: '/favicon.ico', sizes: '64x64', type: 'image/x-icon' },
371 ],
372 // Hint to capable browsers: capture all in-scope links inside the PWA
373 capture_links: 'existing-client-navigate',
374 });
375});
376
377// Favicon — served as SVG so it picks up the site's accent color dynamically.
378// Browsers also request /favicon.ico by convention; we serve the same SVG
379// content there with a forgiving content-type since modern browsers accept it.
380function _renderFavicon(res, accent) {
381 const safeAccent = /^#[0-9a-fA-F]{3,8}$/.test(accent) ? accent : '#e8b04b';
382 // Site mark: rounded square in the site accent + bold white 'K' (Klonkt)
383 const svg = `<?xml version="1.0" encoding="UTF-8"?>
384<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
385 <rect width="64" height="64" rx="14" fill="${safeAccent}"/>
386 <text x="50%" y="50%" dy="0.35em" text-anchor="middle"
387 font-family="Arial, Helvetica, sans-serif"
388 font-size="42" font-weight="800" fill="#fff">K</text>
389</svg>`;
390 res.set('Content-Type', 'image/svg+xml');
391 res.set('Cache-Control', 'public, max-age=86400');
392 res.send(svg);
393}
394
395app.get('/favicon.svg', (req, res) => {
396 _renderFavicon(res, res.locals.site?.accent);
397});
398app.get('/favicon.ico', (req, res) => {
399 // Browsers requesting .ico will accept SVG content; chrome/firefox both fine.
400 // Keeping the route prevents 404 spam in the console.
401 _renderFavicon(res, res.locals.site?.accent);
402});
403
404app.get('/sw.js', (req, res) => {
405 res.set('Content-Type', 'application/javascript');
406 res.set('Cache-Control', 'no-cache');
407 res.send(`
408const CACHE_VERSION = 'pcms-v16-' + new Date().toISOString().split('T')[0];
409self.addEventListener('install', e => {
410 e.waitUntil(caches.open(CACHE_VERSION).then(c => c.addAll(['/'])));
411 self.skipWaiting();
412});
413self.addEventListener('activate', e => {
414 e.waitUntil(caches.keys().then(keys => Promise.all(
415 keys.filter(k => k !== CACHE_VERSION).map(k => caches.delete(k))
416 )));
417 self.clients.claim();
418});
419// ONLY intercept navigations (HTML pages) for an offline fallback.
420// Do NOT touch images, CSS, JS or /media — let the browser handle those natively.
421// Otherwise a failed network fetch could fall back to an empty cache match
422// (undefined) and "break" an image on a normal refresh (hard reload bypasses
423// the SW, which is why that case worked fine).
424self.addEventListener('fetch', e => {
425 if (e.request.method !== 'GET') return;
426 if (e.request.mode !== 'navigate') return; // page loads only
427 // Same-origin ONLY. A cross-origin navigate request is an <iframe> embed
428 // (YouTube/Spotify/SoundCloud …) — routing those through the SW yields an
429 // opaque/altered response the iframe cannot render → blank embeds in the
430 // installed PWA (which is always SW-controlled). Let the browser load them.
431 try { if (new URL(e.request.url).origin !== self.location.origin) return; } catch (err) { return; }
432 e.respondWith(
433 fetch(e.request).catch(() => caches.match('/').then(r => r || Response.error()))
434 );
435});
436 `);
437});
438
439process.on('unhandledRejection', (reason) => {
440 console.error('⚠️ Unhandled Rejection:', reason);
441});
442
443app.use((err, req, res, next) => {
444 console.error('❌ Error:', err);
445 res.status(err.status || 500).send(
446 isDev ? `<pre>${err.stack || err.message}</pre>` : 'Internal Server Error'
447 );
448});
449
450app.use((req, res) => {
451 res.status(404);
452 // Clean, mobile-friendly 404 via the shell (viewport + nav + site theme).
453 // Falls back to bare HTML if rendering unexpectedly fails.
454 try {
455 return renderPage(req, res, 'pages/404', {
456 pageTitle: '404 — niet gevonden',
457 bodyClass: 'on-special on-404',
458 });
459 } catch (e) {
460 return res.send('<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><div style="font-family:system-ui;max-width:500px;margin:4rem auto;text-align:center;padding:2rem"><h1 style="font-size:4rem;margin:0">404</h1><p>Pagina niet gevonden</p><a href="/">← Home</a></div>');
461 }
462});
463
464server.listen(PORT, HOST, () => {
465 const baseUrl = (process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, '');
466 console.log('');
467 console.log('🪶 Klonkt');
468 console.log(` ${baseUrl || `http://localhost:${PORT}`}`);
469 if (baseUrl) console.log(` (bound to ${HOST}:${PORT})`);
470 console.log('');
471 console.log(` ✓ Security: Helmet, CSP, secure sessions`);
472 console.log(` ✓ Privacy: Self-hosted fonts, no third-party requests`);
473 console.log(` ✓ Layout: v9 editorial feel (top nav, profile header)`);
474 console.log(` ✓ Auth: wachtwoord (beheer) + Google (luisteraars) / logout`);
475 console.log(` ✓ Posts: create / edit / view / archive`);
476 console.log('');
477 console.log(` Mode: ${isDev ? 'development' : 'PRODUCTION'}`);
478 console.log('');
479});
480
481export default app;
Note: See TracBrowser for help on using the repository browser.