Files
LLeMbas/.env.example
T
Jaroslav Beneš ba2fb1e13d Add registration toggle and password change; genericise deploy
Two things the running instance needed.

**Registration toggle.** Admin -> General, backed by a new settings table
group rather than the environment. LEMBAS_ALLOW_SIGNUP now seeds only the
initial value: once an administrator saves the setting, the stored value
wins. The alternative -- environment always winning -- means a toggle in
the UI silently reverts on the next restart, which is worse than not
offering one. Closing registration also removes the "Create one" link
from the sign-in page, so the link never leads somewhere that refuses.

**Password change**, on the user settings page. Changing a password
revokes every other session and immediately re-issues a cookie for the
current one: if the reason for the change is that somebody else knows
the password, leaving their session alive defeats the point, but signing
the user out of the tab they are standing in is merely rude.

**deploy/ is now host-agnostic.** This repository is public, so the unit
and vhost became templates with __PREFIX__ / __SITE_HOST__ / __APP_PORT__
substituted at install time, and every path, hostname and port moved to
environment variables. REPO_URL defaults to the checkout's own origin so
a fork deploys itself. Machine-specific values belong in private notes,
not here -- CLAUDE.md now says so.

83 tests, ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 11:14:33 +02:00

37 lines
1.2 KiB
Bash

# LLeMbas configuration
# Copy to .env and edit. All variables are prefixed LEMBAS_.
# REQUIRED. Secret used to sign session cookies and to derive the key that
# encrypts stored API keys at rest. Generate one with:
# python -c "import secrets; print(secrets.token_urlsafe(48))"
# Changing this invalidates all sessions AND makes stored API keys unreadable.
LEMBAS_SECRET_KEY=
# Where the SQLite database and uploaded files live.
LEMBAS_DATA_DIR=./data
# HTTP server bind address.
LEMBAS_HOST=127.0.0.1
LEMBAS_PORT=8080
# Autoreload on code change. Development only.
LEMBAS_RELOAD=false
# debug | info | warning | error
LEMBAS_LOG_LEVEL=info
# Allow new accounts to register themselves. This is only the INITIAL value:
# once an administrator sets it under Admin -> General, the stored setting wins
# and this variable is ignored. The very first account created is always an
# admin regardless.
LEMBAS_ALLOW_SIGNUP=true
# Default theme for signed-out visitors: moria (dark) or shire (light).
LEMBAS_DEFAULT_THEME=moria
# Seconds a login session stays valid. Default 30 days.
LEMBAS_SESSION_TTL=2592000
# Seconds to wait on an upstream LLM endpoint before giving up.
LEMBAS_REQUEST_TIMEOUT=300