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>
4.4 KiB
4.4 KiB
Anubis
Bot di trading personale: azioni USA su Alpaca, crypto spot su OKX Europe, senza leva. C# su .NET 10: ASP.NET Core, interfaccia Blazor, PostgreSQL o SQLite (ADR 0003). Gira in Docker (Unraid) e come applicazione desktop Windows.
A inizio sessione
- Leggi
docs/STATE.md(fase corrente, prossimo passo, blocchi). - Leggi in
docs/SPEC.mdsolo le sezioni che la tabella di SPEC 17 indica per la fase, più 2, 16 e 19, e l'ADR 0003 (che sostituisce la sezione 3 e l'appendice D). - Apri le issue della milestone della fase su Gitea (owner
BalboSoft, repoAnubis, strumentimcp__gitea__*). - Segui
docs/SVILUPPO.md: branchfase-N, commit conrefs #N, chiusura con prove, tagfase-N.
Comandi
Dalla radice del repository: ./tasks.ps1 <comando> (Windows) o sh ./tasks.sh <comando> (Linux); il codice sta in tools/Anubis.Tasks. Niente make.
check: ripristino con--locked-mode,dotnet format --verify-no-changes, build Release con gli analizzatori, test. Va verde prima di ogni commit.test: solo i test; il motore viene daANUBIS_TEST_DB(sqliteopostgres). Esclude la categoriaLiveDemo.dev: il server condotnet watchsu http://localhost:8787 (o--urls). Fuori da Docker usa la configurazione desktop e la cartella dei dati dell'utente (%APPDATA%\Anubis): per provare senza toccarla c'èseed-demo.build: l'immagine Dockergitea.encke-hake.ts.net/balbosoft/anubis:dev.ci: come la CI. Eseguecheck, poi i test su PostgreSQL (avviadocker compose up -d --wait postgres, porta 55432) e infine l'immagine. Richiede Docker.hooks: attiva.githooks/pre-commit, che eseguecheckprima di ogni commit. Si fa una volta per copia del repository.seed-demo: la modalità dimostrativa con i dati dell'appendice F, in una cartella e un database a parte, solo dal computer stesso.screenshots: fotografa Panoramica, Diario e Impostazioni a 1440 px (chiaro e scuro) e a 390 px inartifacts/screenshots/. Usa Edge o Chrome già installati.desktop-win(Fase 10): non ancora disponibile.docker compose up --build: l'applicazione su http://localhost:8787 con PostgreSQL,/healthrispondeok. Primo accesso conANUBIS_ADMIN_PASSWORDdel compose.
Un pacchetto nuovo rompe DependencyPolicyTests finché non è autorizzato (ADR 0004) e presente in Directory.Packages.props e nel file di blocco. Una sua dipendenza di terze parti va aggiunta all'elenco del test e a docs/API-NOTES.md (ADR 0006).
Regole che, se dimenticate, fanno sbagliare
- Mai ordini su conti reali, mai chiavi con prelievo, mai
ANUBIS_ALLOW_LIVE=1oallow_live = true(SPEC 2.2). - Nessun pacchetto NuGet, npm o strumento esterno fuori dall'elenco dell'ADR 0004. Se serve qualcosa di nuovo: fermati e chiedi all'utente cosa aggiungi e perché, prima di aggiungerlo. È l'unica eccezione alla regola sotto.
- Per tutto il resto non chiedere conferme: decidi la via più prudente, scrivi un ADR, prosegui. Fermati solo per ciò che solo l'utente può dare (SPEC 2.1).
docs/SPEC.mdnon si modifica: i cambi di decisione vanno indocs/adr/.- Denaro sempre
decimal; tempo sempre dall'orologio iniettabile; UTC nel database. - Stesso schema e stessi test su PostgreSQL e SQLite.
- Nomi: progetti e namespace
Anubis.*, variabiliANUBIS_*, prefisso ordiniANU(ADR 0001). - Logo: solo i file di
docs/design/logo/(ADR 0005). - Codice e commit in inglese; tutto ciò che l'utente legge in italiano semplice.
- Una fase per sessione; a fine fase aggiorna
docs/ROADMAP.mdedocs/STATE.md, chiudi le issue con la prova, commit. - Il push su Gitea solo quando l'utente lo chiede o lo ha già indicato.
Puntatori
docs/SPEC.md— specifica completadocs/adr/0003-csharp-dotnet.md— stack, struttura del repository, strumentidocs/adr/0004-componenti-esterni.md— pacchetti ammessi e come chiederne altridocs/adr/0007-scelte-fase-1.md— schema per i due motori, interfaccia statica, immagine Dockerdocs/design/— screen di riferimento (SPEC 13.1);docs/design/logo/— logodocs/ROADMAP.md— fasi, issue, criteri di accettazionedocs/STATE.md— stato correntedocs/SVILUPPO.md— flusso di lavoro e regoledeploy/unraid/anubis.xml— template Unraid- Gitea: https://gitea.encke-hake.ts.net/BalboSoft/Anubis (in rete locale http://192.168.30.23:3000)
- Immagine Docker:
gitea.encke-hake.ts.net/balbosoft/anubis