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>
This commit is contained in:
@@ -132,6 +132,12 @@ as parameters for exactly this reason.
|
||||
two marks on one page with identical ids make the second silently reuse the
|
||||
first one's gradients.
|
||||
|
||||
**Two kinds of settings.** `lembas.config` is deployment configuration read
|
||||
from the environment at startup. `services/settings_store.py` is instance
|
||||
settings an admin edits at runtime, stored in the `settings` table. Environment
|
||||
variables seed the latter as an *initial* value only — once stored, the database
|
||||
wins, or a toggle in the UI would silently revert on the next restart.
|
||||
|
||||
**JSON columns need reassignment.** `user.settings_json["theme"] = x` on a
|
||||
plain dict is not detected. The columns use `MutableDict` (`db/types.py`), but
|
||||
the safe habit is `obj.field = {**obj.field, "k": v}`.
|
||||
@@ -165,10 +171,14 @@ inlined and themed. If the mark changes, update both.
|
||||
|
||||
## Deployment
|
||||
|
||||
`deploy/` holds the systemd unit and nginx vhost for the gamebox install at
|
||||
`https://chat.lan`. See `deploy/README.md`. Service user `lembas`, home
|
||||
`/home/lembas` bind-mounted to `/srv/lembas`, mirroring the llama-swap and
|
||||
comfyui conventions on that machine.
|
||||
`deploy/` holds a systemd unit template, an nginx vhost template, and
|
||||
install/update scripts. Both templates are parameterised (`__PREFIX__`,
|
||||
`__SITE_HOST__`, …) and substituted at install time, so nothing host-specific is
|
||||
committed here. See `deploy/README.md`.
|
||||
|
||||
This repository is **public**. Keep deployment-specific hostnames, ports and
|
||||
internal infrastructure detail out of it — those belong in whatever private
|
||||
notes describe the machine.
|
||||
|
||||
## Not built yet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user