GRI-1936: install.sh installs PostgreSQL on request, and gains uninstall and reinstall #141

Merged
vivy merged 2 commits from feature/GRI-1936-install-postgres into dev 2026-11-12 12:01:22 +00:00
Owner

GRI-1936. Two changes to install.sh, both asked for by the product owner.

1. PostgreSQL when the host has none (server --native)

  • Asks before the build: Install PostgreSQL here and set it up for the server? [Y/n].
  • Yes: installs PostgreSQL, waits until it accepts connections, creates user and database signage with a generated password, writes /etc/grimoire-signage/database.env.
  • No: asks for the URL of an existing PostgreSQL (must start with postgres://).
  • --install-postgres / --no-install-postgres, or SCRYGLASS_INSTALL_POSTGRES=ask|yes|no, skip the question. No terminal: installs, as before.
  • No question when PostgreSQL is present, SCRYGLASS_DB_URL is set, or on an upgrade.

2. uninstall and reinstall (server and client)

  • uninstall removes programs, service, source and build toolchains. Keeps config, database and media.
  • --purge also deletes config, the local database and its user, and media (client: config and per-user cache). Asks first; with no terminal it needs --yes. A database on another host is never dropped. PostgreSQL itself stays installed.
  • reinstall = uninstall + fresh download and build, same mode (Docker/native) as before, data kept unless --purge.
  • Docker installs: .env and config.toml are saved to /etc/grimoire-signage/docker and restored by the next install. Volumes go only with --purge.
  • Refuses a source or build path that is / or a top-level directory.

Tested on clean debian:bookworm containers: 9 PostgreSQL decision cases (real pty for interactive ones) plus a real install where the generated URL connects; 9 uninstall cases on native server/client with a real PostgreSQL. Docker uninstall/restore with a stubbed docker. A full reinstall build was not run end to end (about 30 min); it is the tested uninstall followed by the existing install path.

scripts/local-gates.sh: every gate passed.

GRI-1936. Two changes to `install.sh`, both asked for by the product owner. **1. PostgreSQL when the host has none** (`server --native`) - Asks before the build: `Install PostgreSQL here and set it up for the server? [Y/n]`. - Yes: installs PostgreSQL, waits until it accepts connections, creates user and database `signage` with a generated password, writes `/etc/grimoire-signage/database.env`. - No: asks for the URL of an existing PostgreSQL (must start with `postgres://`). - `--install-postgres` / `--no-install-postgres`, or `SCRYGLASS_INSTALL_POSTGRES=ask|yes|no`, skip the question. No terminal: installs, as before. - No question when PostgreSQL is present, `SCRYGLASS_DB_URL` is set, or on an upgrade. **2. `uninstall` and `reinstall`** (`server` and `client`) - `uninstall` removes programs, service, source and build toolchains. Keeps config, database and media. - `--purge` also deletes config, the local database and its user, and media (client: config and per-user cache). Asks first; with no terminal it needs `--yes`. A database on another host is never dropped. PostgreSQL itself stays installed. - `reinstall` = uninstall + fresh download and build, same mode (Docker/native) as before, data kept unless `--purge`. - Docker installs: `.env` and `config.toml` are saved to `/etc/grimoire-signage/docker` and restored by the next install. Volumes go only with `--purge`. - Refuses a source or build path that is `/` or a top-level directory. **Tested** on clean `debian:bookworm` containers: 9 PostgreSQL decision cases (real pty for interactive ones) plus a real install where the generated URL connects; 9 uninstall cases on native server/client with a real PostgreSQL. Docker uninstall/restore with a stubbed `docker`. A full `reinstall` build was not run end to end (about 30 min); it is the tested uninstall followed by the existing install path. `scripts/local-gates.sh`: every gate passed.
GRI-1936: install.sh uninstall and reinstall, keeping the data unless --purge
Some checks failed
CI / the pre-push hook (pull_request) Successful in 14s
CI / cargo fmt (pull_request) Successful in 15s
CI / cargo deny advisories (pull_request) Failing after 2m30s
CI / cargo deny (pull_request) Successful in 2m30s
CI / cargo clippy (pull_request) Successful in 2m56s
CI / repository boundary (pull_request) Successful in 18s
CI / frontend-web (pull_request) Successful in 1m14s
CI / cargo test (pull_request) Successful in 5m12s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 2s
e8c1bb2a14
vivy merged commit 824f4a65c6 into dev 2026-11-12 12:01:22 +00:00
vivy deleted branch feature/GRI-1936-install-postgres 2026-11-12 12:01:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!141
No description provided.