Merge branch 't3/implement-auth-deploy'
Integrate auth, config, watcher and terminal wiring in buildApp: auth guards every API route by default, notebook watcher events feed the /api/events hub, the terminal runs in the configured workspace, and SHELLBOOK_DATA_DIR is the single data directory variable. The systemd unit uses KillMode=process so tmux sessions survive service restarts.
This commit is contained in:
+17
-1
@@ -1,7 +1,23 @@
|
||||
import { buildApp } from "./app";
|
||||
import { loadConfig } from "./config";
|
||||
|
||||
const host = process.env.SHELLBOOK_HOST ?? "127.0.0.1";
|
||||
const port = Number(process.env.SHELLBOOK_PORT ?? 8080);
|
||||
|
||||
const app = await buildApp({ logger: true });
|
||||
const proxies = process.env.SHELLBOOK_TRUSTED_PROXIES?.split(",").map(ip => ip.trim()).filter(Boolean) ?? [];
|
||||
const config = loadConfig();
|
||||
const app = await buildApp({
|
||||
logger: true,
|
||||
config,
|
||||
trustProxy: proxies,
|
||||
staticDir: process.env.SHELLBOOK_STATIC_DIR,
|
||||
watchNotebooks: true,
|
||||
auth: {
|
||||
sessionMaxAgeSeconds: Number(process.env.SHELLBOOK_SESSION_SECONDS ?? 2592000),
|
||||
forwardAuth: process.env.SHELLBOOK_FORWARD_AUTH_HEADER ? {
|
||||
header: process.env.SHELLBOOK_FORWARD_AUTH_HEADER,
|
||||
trustedProxyIps: proxies,
|
||||
} : undefined,
|
||||
},
|
||||
});
|
||||
await app.listen({ host, port });
|
||||
|
||||
Reference in New Issue
Block a user