feat: bootstrap solution, Docker image and Gitea pipelines (M0)
CI / Build and test (SQLite) (pull_request) Successful in 43s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 15s
CI / Docker image (pull_request) Successful in 59s
CI / Build and test (SQLite) (pull_request) Successful in 43s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 15s
CI / Docker image (pull_request) Successful in 59s
Start development with the skeleton every later milestone builds on, so that code, image and release path exist and are verified from day one. - Khaemhat.sln with the ten projects of SPEC section 3 and six MSTest projects; shared build rules with warnings as errors, analyzers and Central Package Management restricted to the allowlist. - Architecture tests and scripts/check-packages.sh fail on any project reference or package that SPEC does not allow. - Khaemhat.Web serves an Italian "under construction" page with the official icons and version, plus /health/live, /health/ready and /health (ADR 0012); honours KHAEMHAT_URLS and KHAEMHAT_LOG_LEVEL. - docker/Dockerfile (non-root app user aligned to PUID/PGID by the entrypoint, pg_dump 17, healthcheck, OCI and Unraid labels) and compose files for PostgreSQL and a standalone SQLite demo. - Gitea Actions: ci.yml (build, tests, image smoke test, PostgreSQL 16/17 on tags, YAML check), release.yml (image and release from a vX.Y.Z tag, skipping versions already published) and wiki.yml. - Development scripts, VS Code launch/tasks for debugging, and ADR 0012-0017 deciding the M0 open points of docs/STATUS.md. Closes #1, #2, #3, #4, #5, #114 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88de272b3e
commit
12277733f5
101 files changed
+3245
-67
No files matched your search
@@ -109,7 +109,7 @@ che non conosce. Il rollback dipende quindi dalle migrazioni:
|
||||
**Caso 2 — la nuova versione ha applicato migrazioni.**
|
||||
|
||||
1. Ferma l'applicazione: `docker compose stop khaemhat`.
|
||||
2. Ripristina il **database di sistema** dal backup fatto prima dell'aggiornamento con `scripts/restore-system.sh`
|
||||
2. Ripristina il **database di sistema** dal backup fatto prima dell'aggiornamento con `restore-system.sh` incluso nell'immagine
|
||||
(vedi [Backup e ripristino](Backup-e-ripristino#ripristino-del-database-di-sistema)).
|
||||
3. Ripristina i **database delle aziende** migrate, dagli stessi backup (con la procedura manuale `pg_restore`
|
||||
descritta in [Backup e ripristino](Backup-e-ripristino#procedura-manuale-equivalente), perché l'applicazione è
|
||||
|
||||
@@ -183,16 +183,19 @@ Khaemhat esegue un backup preventivo anche:
|
||||
## Ripristino del database di sistema
|
||||
|
||||
Il database di sistema non si ripristina dall'interfaccia (l'interfaccia stessa dipende da lui). Si usa lo script
|
||||
`scripts/restore-system.sh` del repository, **con l'istanza ferma**:
|
||||
`restore-system.sh`, incluso nell'immagine in `/app/scripts/`, **con l'istanza ferma**:
|
||||
|
||||
1. Ferma l'applicazione: `docker compose stop khaemhat` (PostgreSQL resta acceso).
|
||||
2. Esegui lo script indicando il file di backup del database di sistema. I parametri esatti sono documentati
|
||||
nell'intestazione dello script, che sarà scritto nella milestone M12.
|
||||
2. Esegui lo script in un container temporaneo, sullo stesso volume e sulla stessa rete, indicando il file di
|
||||
backup del database di sistema:
|
||||
```bash
|
||||
docker compose run --rm --entrypoint /app/scripts/restore-system.sh khaemhat /data/backups/<file-di-backup>
|
||||
```
|
||||
Lo script completo arriva con la milestone M12; fino ad allora spiega l'uso ed esce senza fare nulla.
|
||||
3. Riavvia: `docker compose start khaemhat`. All'avvio vengono applicate le eventuali migrazioni mancanti.
|
||||
4. Accedi come super utente e controlla **Stato sistema** e l'elenco delle aziende.
|
||||
|
||||
Lo script è uno strumento del repository e non è incluso nell'immagine: scaricalo da
|
||||
[`scripts/`](https://gitea.encke-hake.ts.net/BalboSoft/Khaemhat/src/branch/main/scripts) sul server che esegue Docker.
|
||||
Lo script ha sempre la stessa versione dell'applicazione installata, quindi non va scaricato a parte (ADR 0017).
|
||||
|
||||
## Procedura manuale equivalente
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
> **Stato:** bozza · **Ultima revisione:** 2026-11-10
|
||||
> **Stato:** completa per 0.0.1 · **Ultima revisione:** 2026-11-11
|
||||
|
||||
Le novità di ogni versione sono nel file
|
||||
[`CHANGELOG.md`](https://gitea.encke-hake.ts.net/BalboSoft/Khaemhat/src/branch/main/CHANGELOG.md) del repository
|
||||
@@ -11,7 +11,8 @@ Le novità di ogni versione sono nel file
|
||||
|
||||
| Versione | Data | Contenuto |
|
||||
|---|---|---|
|
||||
| *non rilasciata* | 2026-11-10 | Documentazione, specifica, mockup, wiki e pianificazione su Gitea. Nessun software ancora. |
|
||||
| 0.0.1 | 2026-11-11 | M0 — Bootstrap: struttura del codice, immagine Docker con pagina "in costruzione" ed endpoint di salute, compose, CI e rilascio su Gitea Actions. Nessuna funzione gestionale ancora. |
|
||||
| *preparazione* | 2026-11-10 | Documentazione, specifica, mockup, wiki e pianificazione su Gitea. Nessun software. |
|
||||
|
||||
Ogni immagine Docker pubblicata ha lo stesso numero di versione del tag git (senza la `v` iniziale), ad esempio
|
||||
`gitea.encke-hake.ts.net/balbosoft/khaemhat:0.1.0`. Prima di aggiornare leggi [Aggiornamento](Aggiornamento).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Khaemhat
|
||||
|
||||
> **Stato:** bozza · **Ultima revisione:** 2026-11-10 · **Versione software:** non ancora rilasciata (sviluppo da avviare)
|
||||
> **Stato:** bozza · **Ultima revisione:** 2026-11-10 · **Versione software:** 0.0.1 (M0, pagina "in costruzione"; sviluppo in corso)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -65,13 +65,14 @@ Regole pratiche:
|
||||
|
||||
### Il file compose
|
||||
|
||||
Il file definitivo è `deploy/docker-compose.yml` nel repository (sarà creato nella milestone M0). La struttura
|
||||
prevista è questa: applicazione, `postgres:17` e `redis:7` attivabile con un profilo.
|
||||
Il file è [`deploy/docker-compose.yml`](https://gitea.encke-hake.ts.net/BalboSoft/Khaemhat/src/branch/main/deploy/docker-compose.yml)
|
||||
nel repository: applicazione, `postgres:17` e `redis:7` attivabile con un profilo. La versione dell'immagine si
|
||||
sceglie con `KHAEMHAT_VERSION` nel `.env`. In sintesi:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
khaemhat:
|
||||
image: gitea.encke-hake.ts.net/balbosoft/khaemhat:1.0.0
|
||||
image: gitea.encke-hake.ts.net/balbosoft/khaemhat:${KHAEMHAT_VERSION:-0.0.1}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
khaemhat-db: { condition: service_healthy }
|
||||
@@ -128,12 +129,12 @@ Note:
|
||||
## Demo autonoma con SQLite
|
||||
|
||||
Per provare Khaemhat senza PostgreSQL esiste `deploy/docker-compose.sqlite.yml`: un solo container, database di
|
||||
sistema e aziende come file SQLite nel volume `/data`, dati di esempio caricati al primo avvio. Struttura prevista:
|
||||
sistema e aziende come file SQLite nel volume `/data`, dati di esempio caricati al primo avvio. In sintesi:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
khaemhat:
|
||||
image: gitea.encke-hake.ts.net/balbosoft/khaemhat:1.0.0
|
||||
image: gitea.encke-hake.ts.net/balbosoft/khaemhat:${KHAEMHAT_VERSION:-0.0.1}
|
||||
ports: ["8080:8080"]
|
||||
environment:
|
||||
KHAEMHAT_SYSTEM_DB: sqlite:///data/system.db
|
||||
@@ -189,7 +190,7 @@ obbligatoria, termina con un messaggio che indica quale.
|
||||
| `KHAEMHAT_UPDATE_FEED` | no | `https://gitea.encke-hake.ts.net/api/v1/packages/BalboSoft?type=container&q=khaemhat` | API dei pacchetti Gitea per il controllo aggiornamenti |
|
||||
| `KHAEMHAT_UPDATE_TOKEN` | no | token Gitea in sola lettura | solo se il pacchetto non è pubblico |
|
||||
| `TZ` | no | `Europe/Rome` | fuso orario |
|
||||
| `PUID` / `PGID` | no | `99` / `100` | utente e gruppo proprietari dei file in `/data` |
|
||||
| `PUID` / `PGID` | no | `1654` / `1654` (Unraid: `99` / `100`) | utente e gruppo proprietari dei file in `/data`; l'applicazione non gira mai come root |
|
||||
|
||||
Le variabili del super utente e della prima azienda sono lette solo al primo avvio (quando le tabelle
|
||||
corrispondenti sono vuote): cambiarle dopo non ha effetto. `KHAEMHAT_TEST_PG` e `KHAEMHAT_TEST_REDIS` servono solo
|
||||
@@ -198,8 +199,11 @@ ai test automatici e non vanno impostate in un'installazione.
|
||||
## Docker secrets
|
||||
|
||||
Per non scrivere le password in chiaro nel file compose, le variabili sensibili ammettono la variante `_FILE`: invece
|
||||
del valore contengono il percorso di un file da cui leggerlo. La specifica la prevede per `KHAEMHAT_SYSTEM_DB` e per
|
||||
le variabili `KHAEMHAT_SUPERUSER_*`; l'elenco completo delle variabili che la accettano sarà fissato in sviluppo.
|
||||
del valore contengono il percorso di un file da cui leggerlo. La accettano tutte le variabili sensibili: `KHAEMHAT_SYSTEM_DB`,
|
||||
`KHAEMHAT_DB_SERVER`, `KHAEMHAT_SECRET_KEY`, `KHAEMHAT_SECRET_KEY_NEW`, `KHAEMHAT_SUPERUSER`,
|
||||
`KHAEMHAT_SUPERUSER_PASSWORD`, `KHAEMHAT_SUPERUSER_EMAIL`, `KHAEMHAT_LICENSE`, `KHAEMHAT_REDIS`,
|
||||
`KHAEMHAT_SMTP_PASSWORD`, `KHAEMHAT_UPDATE_TOKEN`. Il valore è il contenuto del file senza il fine riga finale;
|
||||
impostare insieme `X` e `X_FILE` è un errore che ferma l'avvio.
|
||||
|
||||
```yaml
|
||||
services:
|
||||
|
||||
@@ -30,8 +30,8 @@ Il lavoro di dettaglio è nelle issue di Gitea, raggruppate per
|
||||
|
||||
## Stato attuale
|
||||
|
||||
La documentazione e la pianificazione sono pronte (2026-11-10). Lo sviluppo parte dalla milestone M0 dopo il via
|
||||
del titolare del progetto. Lo stato aggiornato è in
|
||||
Sviluppo avviato il 2026-11-11. M0 consegna la versione 0.0.1 (struttura, immagine Docker, CI); poi si prosegue
|
||||
milestone dopo milestone, a partire da M1 — Fondamenta dati. Lo stato aggiornato è in
|
||||
[`docs/STATUS.md`](https://gitea.encke-hake.ts.net/BalboSoft/Khaemhat/src/branch/main/docs/STATUS.md).
|
||||
|
||||
## Pagine correlate
|
||||
|
||||
Reference in new issue
Block a user