This commit is contained in:
+30
@@ -11,6 +11,7 @@ variables are optional:
|
||||
| --- | --- | --- |
|
||||
| `GARDOMATIC_ENV` | `development` | Enables confirmations for risky production operations |
|
||||
| `GARDOMATIC_WEB_BASE_URL` | `http://localhost:4040` | Base URL for activation links |
|
||||
| `GARDOMATIC_DEMO_RESET_ENABLED` | `false` | Explicitly enables destructive demo resets |
|
||||
| `GARDOMATIC_SMTP_MODE` | `file` | Mail delivery mode (`file` or `smtp`) |
|
||||
| `GARDOMATIC_SMTP_HOST` | empty | SMTP server hostname |
|
||||
| `GARDOMATIC_SMTP_PORT` | `25` | SMTP server port |
|
||||
@@ -85,3 +86,32 @@ accepts passwords as command-line arguments.
|
||||
Application roles (`application:user`, `application:admin`) are independent of
|
||||
garden roles (`owner`, `admin`, `member`, `viewer`, `worker`). `gardens add-user`
|
||||
uses `member` when `--role` is omitted.
|
||||
|
||||
## Demo data
|
||||
|
||||
`demo reset` atomically removes all sessions, users, gardens, categories, and
|
||||
their dependent content and replaces them with a fresh `Sonnengarten`. It
|
||||
contains three members, a pending invitation, a custom garden role, eight
|
||||
hierarchical locations, twelve richly described species with care instructions
|
||||
and task templates, sixteen plants (including one without a species and several
|
||||
lifecycle states), sixteen current, recurring, completed, and generated tasks,
|
||||
tags, six journal or pinboard entries, and a reusable image library. Task due
|
||||
dates and journal dates are calculated relative to the reset, so the data remains
|
||||
useful over time.
|
||||
|
||||
The command is deliberately guarded twice. It only runs when
|
||||
`GARDOMATIC_DEMO_RESET_ENABLED=true`, and it additionally requires the global
|
||||
`--yes` flag. Never enable it for a database containing real data. The password
|
||||
must be supplied via standard input:
|
||||
|
||||
```sh
|
||||
systemd-ask-password 'Demo password:' | \
|
||||
GARDOMATIC_DEMO_RESET_ENABLED=true \
|
||||
go run ./cmd/cli --yes demo reset \
|
||||
--email demo@example.com \
|
||||
--password-stdin
|
||||
```
|
||||
|
||||
Concurrent resets are serialized with a PostgreSQL advisory transaction lock.
|
||||
The old data remains visible until the complete replacement commits; existing
|
||||
login sessions are invalidated by every reset.
|
||||
|
||||
Reference in New Issue
Block a user