source: Klonkt/.env.example@ 520c993

main
Last change on this file since 520c993 was 96c714f, checked in by Robin <roboburr@…>, 7 weeks ago

Feature: web push slice 4, burst throttle + docs

  • Burst throttle: a wave of likes or a mass-follow becomes one ping, not a wave of pushes. Per (user, type) at most one push per window (like/boost 300s, follow 60s, reply/dm 30s, test never throttled); extras drop silently — the events themselves still land in Berichten, only the ping is deduped. In-memory (one process; a restart costs at most one extra ping). Pure throttled() exported and pinned by test.
  • README: push notifications feature bullet, VAPID_* in the config table, storage/.vapid in the auto-generated-secrets + backup section (restoring without it silently breaks every subscription).
  • .env.example: VAPID block in the SESSION_SECRET/PAID_SECRET style.

Pruning (404/410 → row deleted) and the iOS install hint already landed in
slices 1-2; this closes the plan from docs/webpush-design.md.

Changed files:
src/services/PushService.js

  • throttled() + window table; notifyUser checks it first

test/push.test.js

  • throttle windows, per-type/per-user independence, test bypass

README.md

  • feature bullet, VAPID config row, backup warning

.env.example

  • VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY / VAPID_SUBJECT

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

  • Property mode set to 100644
File size: 3.6 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=
13# Encrypts the stored Patreon secrets for paid posts. Same deal: leave EMPTY to
14# auto-generate on first use (saved to storage/.paid-secret, kept outside the DB
15# so a database dump alone stays useless). Or set your own: openssl rand -base64 32
16PAID_SECRET=
17# Web-push (notificaties) VAPID keys. Leave EMPTY to auto-generate on first use
18# (saved to storage/.vapid). Do NOT rotate: new keys break every subscription.
19VAPID_PUBLIC_KEY=
20VAPID_PRIVATE_KEY=
21VAPID_SUBJECT=
22DATABASE_PATH=./storage/database.sqlite
23MEDIA_PATH=./storage/media
24
25# Canonical public URL of this site (scheme + host, no trailing slash), e.g.
26# https://yourdomain.com . Used to build correct links in emails (password reset)
27# and OAuth redirects instead of trusting request headers (anti-spoofing).
28# Optional: leave empty and it falls back to the request host (fine for local/dev);
29# set it for production so email/login links point at the right place.
30PUBLIC_BASE_URL=
31
32# Strict HSTS. By default Klonkt sends a plain long max-age (safe on any domain).
33# Set HSTS_STRICT=1 ONLY if Klonkt owns the whole domain incl. all its subdomains:
34# it adds `includeSubDomains; preload`, which forces every subdomain to HTTPS and can
35# get your domain baked into browsers near-permanently. Leave unset if unsure.
36# HSTS_STRICT=1
37
38# ── Administrator ───────────────────────────────────────────────────
39# The admin logs in with username + password. On first start you create your
40# admin account via /auth/register; after that, registration is closed.
41# Forgot your password? -> "Forgot password" (email, see SMTP below) or always:
42# `npm run reset-admin` on the server.
43
44# ── Email (optional) — for "forgot password" reset links ────────────
45# Not set? Then reset only works via `npm run reset-admin` on the server.
46SMTP_HOST=
47SMTP_PORT=587
48SMTP_USER=
49SMTP_PASS=
50SMTP_FROM=
51
52# ── Lite mode (optional) ────────────────────────────────────────────
53# Set to "off" to disable the whole audio feature (no built-in music hosting/
54# player, no ffmpeg needed). Klonkt then runs as a lightweight blog/photo/EPK
55# site, even on an environment without ffmpeg. Hub and Circles keep working.
56# External embeds (YouTube/SoundCloud/Spotify) keep working too.
57# Reversible: set back to "on" (or remove) and restart — no reinstall, tracks kept.
58KLONKT_AUDIO=on
59
60# ── Premium extras ──────────────────────────────────────────────────
61# The core app, all updates and Cirkels are free. A handful of extras
62# (newsletter, statistics, EPK, link-in-bio, embeddable player, show agenda,
63# release planning, download-for-email, paid posts) are unlocked by a one-time
64# Patreon supporter link — that's what funds the project:
65# klonkt.com / patreon.com/c/roboburr. Leave this on.
66KLONKT_PREMIUM_ENABLED=on
Note: See TracBrowser for help on using the repository browser.