wutzcalc/deploy/wutzcalc.env.example
iris 9c75ce5243 server: /api/stats endpoint + per-day-per-drink trend data
New GET /api/stats — same computeStats() shared with the existing
/admin/api/stats, so the numbers stay identical. Auth is gated by
STATS_PUBLIC (default: requires the admin session, same as every other
/admin/api endpoint) rather than always-open, so a bare deploy doesn't
expose revenue by default.

Also adds per_drink_by_day (day -> per-drink sold qty) alongside the
existing all-time per_drink totals — the trend-over-time data mara asked
for on #40. Same businessDay() JS bucketing as by_day for DST correctness,
same reasoning as the existing comment on that.

Client page for /stats itself is a follow-up commit.
2026-07-30 11:40:34 +02:00

23 lines
868 B
Text

# Copy to /etc/wutzcalc/wutzcalc.env and edit.
# Keep it readable only by root / the service user — it holds the admin password:
# sudo install -m 600 -o root -g root deploy/wutzcalc.env.example /etc/wutzcalc/wutzcalc.env
# Required: backoffice login password.
ADMIN_PASSWORD=changeme
# SQLite database file. With StateDirectory=wutzcalc this dir is created for you.
DB_PATH=/var/lib/wutzcalc/wutz.db
# Network bind (defaults: 0.0.0.0:3000).
PORT=3000
HOST=0.0.0.0
# Sales-day handling (defaults shown). Hours before the cutoff count toward the
# previous business day, so a 03:00 sale lands on the night before.
#WUTZ_TZ=Europe/Berlin
#WUTZ_DAY_CUTOFF_HOUR=5
# /stats page: by default it requires the same admin login as /admin. Set to
# 1 to make it viewable without logging in (e.g. a screen permanently
# mounted at a festival infopoint).
#STATS_PUBLIC=0