source: Klonkt/.env.example@ 2acdbc5

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

security: bind to 127.0.0.1 by default behind a reverse proxy

New HOST env (default 0.0.0.0 for Docker/back-compat). The VPS installer now
writes HOST=127.0.0.1 and Docker maps the host port to loopback (127.0.0.1:3000:3000)
+ overrides HOST=0.0.0.0 inside the container — so the app is never reachable
directly on its port from the internet, only via the proxy. .env.example defaults
to 127.0.0.1 (manual installs); docs explain it. Existing installs hardened on
re-run of install.sh.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 2.9 KB
Line 
1NODE_ENV=development
2PORT=3000
3
4# Network interface to bind. 127.0.0.1 = only reachable via a reverse proxy on the
5# same machine (recommended for a manual install behind Caddy/nginx — keeps the app
6# off the public internet). Use 0.0.0.0 only if you need direct external access
7# (no proxy/HTTPS — not recommended). Docker sets this to 0.0.0.0 itself.
8HOST=127.0.0.1
9# Secret used to sign login-session cookies. Leave EMPTY to auto-generate a strong
10# one on first start (saved to storage/.session-secret, stays stable across
11# restarts/updates). Or set your own: openssl rand -hex 32
12SESSION_SECRET=
13DATABASE_PATH=./storage/database.sqlite
14MEDIA_PATH=./storage/media
15
16# Canonical public URL of this site (scheme + host, no trailing slash), e.g.
17# https://yourdomain.com . Used to build correct links in emails (password reset)
18# and OAuth redirects instead of trusting request headers (anti-spoofing).
19# Optional: leave empty and it falls back to the request host (fine for local/dev);
20# set it for production so email/login links point at the right place.
21PUBLIC_BASE_URL=
22
23# ── Administrator ───────────────────────────────────────────────────
24# The admin logs in with username + password. On first start you create your
25# admin account via /auth/register; after that, registration is closed.
26# Forgot your password? -> "Forgot password" (email, see SMTP below) or always:
27# `npm run reset-admin` on the server.
28
29# ── Google login for LISTENERS (optional) ───────────────────────────
30# Want listeners to sign in with Google to comment? Create your OWN Google OAuth
31# client (Google Cloud Console -> Credentials -> OAuth client ID -> "Web
32# application") and fill it in below. Your own client = your own Google Cloud
33# project; this site isn't centrally tied to anything. Not set? Then there's
34# simply no Google button. Google login NEVER grants admin rights (commenting only).
35# GOOGLE_REDIRECT_URI = <your domain>/auth/google/callback (set it exactly in the client)
36GOOGLE_CLIENT_ID=
37GOOGLE_CLIENT_SECRET=
38GOOGLE_REDIRECT_URI=https://example.com/auth/google/callback
39
40# ── Email (optional) — for "forgot password" reset links ────────────
41# Not set? Then reset only works via `npm run reset-admin` on the server.
42SMTP_HOST=
43SMTP_PORT=587
44SMTP_USER=
45SMTP_PASS=
46SMTP_FROM=
47
48# ── Lite mode (optional) ────────────────────────────────────────────
49# Set to "off" to disable the whole audio feature (no built-in music hosting/
50# player, no ffmpeg needed). Klonkt then runs as a lightweight blog/photo/EPK
51# site, even on an environment without ffmpeg. Hub and Circles keep working.
52# External embeds (YouTube/SoundCloud/Spotify) keep working too.
53KLONKT_AUDIO=on
Note: See TracBrowser for help on using the repository browser.