feat(server): web server, interface shell, demo mode and Docker image (refs #11 #12 #13 #14 #15 #16 #17)
Phase 1 completed on top of the library foundations: - Server: startup state machine (config, first run, database down, schema, identity, ready) with an error page that retries by itself; the configured database is the only one ever opened, and a vanished SQLite file is never recreated. REST API and status WebSocket; session cookie auth, CSRF on every form and write call; desktop and demo answer only the computer itself. - Interface: static Blazor rendering with plain forms (no interactive runtime), menu, top bar and phone bottom bar as in the mockups, light and dark themes with appendix C tokens and a contrast test, Panoramica, Diario, Rischio, Impostazioni; service pages for sign-in, first access, desktop first run and the database error page with its choices. - Demo mode (tasks seed-demo): appendix F in a database of its own under the temp folder, frozen clock, never touches the configured installation. - Docker: entrypoint gives /data to PUID:PGID and drops root with setpriv, HEALTHCHECK through bash /dev/tcp; proven with SQLite, PostgreSQL, a wrong configuration and a database that goes away and comes back. - tasks screenshots drives the installed Edge/Chrome through DevTools for exact 1440 and 390 pixel shots; anubis db export|import on the command line. Fixes from the independent review: return paths without control characters, Host check against DNS rebinding, attempt limit counted before the check and also on the error-page password, one-use TOTP codes and a code to switch the second factor off, error-page choices serialized with the startup loop, identity checked before migrating, restore restarts with "Ferma tutto" on, damaged archives reported instead of crashing. Running the server tests on PostgreSQL exposed pages rendered before their data arrived; data-loading components now load first (LoadedComponent). Decisions in ADR 0007. Tests: 100 on SQLite and on PostgreSQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
53ca01b7c3
commit
f9d71559e8
71 files changed
+5853
-80
No files matched your search
+16
-3
@@ -4,7 +4,7 @@ Aggiornato: 2026-11-10
|
||||
|
||||
## Fase corrente
|
||||
|
||||
**Fase 0 — Preparazione: completata.** La prossima è la Fase 1 (Fondamenta), da iniziare con il via dell'utente.
|
||||
**Fase 1 — Fondamenta: completata.** La prossima è la Fase 2 (Dati di mercato), da iniziare con il via dell'utente.
|
||||
|
||||
## Fatto
|
||||
|
||||
@@ -34,6 +34,16 @@ Aggiornato: 2026-11-10
|
||||
- `/health`.
|
||||
- Applicazione minima con `GET /health`, `Dockerfile` e `docker-compose.yml` con PostgreSQL 18.
|
||||
- CI in `.gitea/workflows/ci.yml`: test su SQLite e PostgreSQL, poi l'immagine. Solo passi `run:`.
|
||||
- **Fase 1** (scelte nell'ADR 0007):
|
||||
- Piattaforma: configurazione d'avvio Docker (variabili) e desktop (`config.toml`), cartella dei dati, identità dell'installazione con impronta del database, custodia della chiave dei segreti (DPAPI su Windows).
|
||||
- Database portabile su PostgreSQL e SQLite con ADO.NET: un solo schema con tipi per motore, migrazioni SQL numerate con salvataggio prima, esportazione e importazione tra motori con controllo di conteggi e totali (`Anubis.Server db export|import`), salvataggi notturni (ne tiene 14).
|
||||
- Nucleo: orologio iniettabile, bus degli eventi, pianificatore, impostazioni con registro delle modifiche, segreti cifrati AES-GCM, registri JSON con i segreti oscurati, formati italiani.
|
||||
- Accesso: password PBKDF2, sessioni, CSRF, limite ai tentativi, secondo fattore TOTP facoltativo.
|
||||
- Server: avvio a stati (configurazione, primo avvio, database assente, schema, identità, pronto), pagina d'errore con riprova automatica, API REST e WebSocket dello stato.
|
||||
- Interfaccia: guscio di menu, barra superiore e barra in basso come nei mockup, temi chiaro e scuro, Panoramica, Diario, Rischio, Impostazioni (aspetto, sicurezza, sistema); le altre voci arrivano con le loro fasi.
|
||||
- Modalità dimostrativa (`tasks seed-demo`) con i dati dell'appendice F, in un database a parte.
|
||||
- Immagine Docker definitiva: `PUID`/`PGID`, controllo di salute, l'applicazione non gira come root. Provata con SQLite, PostgreSQL, configurazione sbagliata e database staccato.
|
||||
- `tasks screenshots` per confrontare le schermate con i mockup.
|
||||
|
||||
## In corso
|
||||
|
||||
@@ -41,11 +51,13 @@ Nulla.
|
||||
|
||||
## Prossimo passo
|
||||
|
||||
Fase 1, issue #7–#13: piattaforma, database portabile, salvataggi, nucleo, accesso, guscio dell'interfaccia.
|
||||
Fase 2, dati di mercato: storico e dati dal vivo, controlli di qualità, cambi del giorno. Servono le chiavi del conto paper di Alpaca (vedi sotto); senza, la parte azionaria si prova su dati sintetici.
|
||||
|
||||
## Da sapere
|
||||
|
||||
- Le immagini .NET 10 sono su Ubuntu 24.04, non Debian (ADR 0006).
|
||||
- La modalità dimostrativa mostra solo le parti già costruite: conti, posizioni, strategie e notizie della Panoramica arrivano con le loro fasi.
|
||||
- `tasks dev` fuori da Docker usa la cartella dei dati vera dell'utente: per prove usa `tasks seed-demo`.
|
||||
- Alpaca non ha più conti senza margine: il divieto di leva lo impone Anubis (API-NOTES A14).
|
||||
- OKX: WebSocket sulla porta 443, la 8443 è chiusa (API-NOTES O3).
|
||||
- Gitea ha un esecutore delle Actions attivo: la CI gira a ogni push (prima esecuzione: run 169 del branch `fase-0`, test verdi su SQLite e PostgreSQL). `tasks ci` resta per provarla in locale.
|
||||
@@ -55,7 +67,8 @@ Fase 1, issue #7–#13: piattaforma, database portabile, salvataggi, nucleo, acc
|
||||
|
||||
| Cosa | Da quando serve | Senza |
|
||||
|---|---|---|
|
||||
| Via libera per la Fase 1 | Subito | Non si parte |
|
||||
| Via libera per la Fase 2 | Subito | Non si parte |
|
||||
| Permesso di scaricare il carattere Instrument Sans (licenza SIL OFL, già ammesso dall'ADR 0004) | Quando vuoi | L'interfaccia usa i caratteri di sistema |
|
||||
| Chiavi del conto paper di Alpaca | Fase 2 (dati azionari) | La parte azionaria si prova su dati sintetici; criteri in attesa |
|
||||
| Chiavi demo di OKX Europe | Fase 3 (ordini sui conti di prova) | Batteria di conformità su risposte d'esempio; criteri in attesa |
|
||||
| Un token Gitea con permesso `write:package` come segreto `REGISTRY_TOKEN` | Fase 9 (pubblicazione dell'immagine) | Pubblicazione a mano |
|
||||
|
||||
Reference in new issue
Block a user