Vai al contenuto

Configuration

Targetlog reads environment variables only.

Variable Default Description
DATABASE_URL required PostgreSQL URL, e.g. postgres://user:pass@host:5432/db?sslmode=require
TARGETLOG_LISTEN :8080 listen address of the app
TARGETLOG_METRICS_LISTEN :9090 Prometheus /metrics on a separate listener, so it is never reachable through the ingress. Empty: no metrics
TARGETLOG_LOG_LEVEL info debug, info, warn, error; JSON lines on stderr
TARGETLOG_TRUST_PROXY false take the client address from X-Forwarded-For (only behind your own ingress); used for login rate limits
TARGETLOG_ADMIN_TOKEN empty token for the admin panel, at least 32 characters. Empty: the admin panel is disabled
TARGETLOG_PUBLIC_URL empty base of the links in mails, e.g. https://app.targetlog.ch. Empty: scheme and host of the request
TARGETLOG_SMTP_HOST empty mail server. Empty: mails are only logged
TARGETLOG_SMTP_PORT 587 465 uses implicit TLS, other ports STARTTLS when the server offers it
TARGETLOG_SMTP_USER, TARGETLOG_SMTP_PASSWORD empty login at the mail server, if it needs one
TARGETLOG_SMTP_FROM Targetlog <noreply@targetlog.ch> sender of mails
TARGETLOG_SIGNUP false anyone can create an account for My training
TARGETLOG_BILLING false My training needs a trial, a subscription or a club seat; see Billing. Off: everything is free
TARGETLOG_TRIAL_DAYS 30 length of the free trial of new accounts
TARGETLOG_PRICE_LABEL empty price shown to users, e.g. CHF 4.– / month; display only
TARGETLOG_STRIPE_SECRET_KEY empty Stripe secret key; with the price ID it enables online payment
TARGETLOG_STRIPE_PRICE_ID empty the monthly Stripe price of the subscription
TARGETLOG_STRIPE_WEBHOOK_SECRET empty signing secret of the Stripe webhook /api/billing/stripe

Generate the admin token with openssl rand -base64 32 and keep it in a secret store.

Stateless

Sessions, login rate limits, maintenance mode, print jobs and realtime events all live in PostgreSQL. Any number of replicas can run behind a load balancer without sticky sessions.