Open registration let anyone with the URL create an account. Two
changes address that:
- REGISTRATION_CODE (.env, optional): when set, registration requires
entering it correctly. Empty/unset keeps registration open, so
existing installs are unaffected until configured.
- is_admin flag on User: the first account ever created on an install
becomes admin automatically (existing installs get their oldest
account promoted via the startup migration, so nobody is locked
out of user management after upgrading).
Admins get a new "Benutzerverwaltung" panel in Einstellungen listing
every account (email, link/prompt counts, join date) with a delete
button per account — deleting cascades to that user's links and
prompts via the existing relationship cascade. Deleting your own
account through this page is blocked (redirects with an error) to
avoid accidental admin lockout. Non-admins get a 403 on the
/settings/users routes.
Also fixes several pre-existing German pluralization bugs found while
writing the new counts ("2 Linke" -> "2 Links", "Kontoen"/"Konton" ->
"Konten") — irregular plurals need a full word swap, not a suffix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
24 lines
814 B
Plaintext
24 lines
814 B
Plaintext
# Kopiere diese Datei nach ".env" und trage deine Werte ein.
|
|
|
|
# Geheimer Schlüssel für Session-Cookies (beliebiger zufälliger String).
|
|
# Erzeugen z.B. mit: python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
SECRET_KEY=change-me-please-set-a-random-secret
|
|
|
|
# OpenAI API-Key (https://platform.openai.com/api-keys)
|
|
OPENAI_API_KEY=
|
|
|
|
# Modelle (Standardwerte sind günstig & gut)
|
|
OPENAI_MODEL=gpt-4o-mini
|
|
EMBEDDING_MODEL=text-embedding-3-small
|
|
|
|
# Datenbank (Standard: lokale SQLite-Datei)
|
|
DATABASE_URL=sqlite:///./linkvault.db
|
|
|
|
# Versionsangabe für die Fußzeile (Standard: 2.1.0)
|
|
APP_VERSION=2.1.0
|
|
|
|
# Wenn gesetzt, muss dieser Code bei der Registrierung eingegeben werden
|
|
# (verhindert, dass Fremde sich einfach so ein Konto anlegen). Leer lassen,
|
|
# um die Registrierung offen zu lassen.
|
|
REGISTRATION_CODE=
|