Rebuild the state from the brokers after a restore and refuse an older copy

A restore, an import or an adopted database restarts protected: the engine
stays stopped, reads from the broker what the archive does not know (orders,
stops, executions, also from the OKX history up to 89 days), cancels orders
left working, protects what it finds and waits for the user. Strategies with
real money stay exit only until confirmed again. The database of before the
restore, put back by mistake, is refused by its fingerprint.

A failed migration leaves the engine off with one backup and a way to try
again; an archive is checked whole before the database is touched; a changed
secret key no longer crashes anything, and "anubis access reset" gives the
access back to whoever holds the computer. The image runs the db and access
commands without the guard.

refs #69

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 18:52:08 +01:00
1 parent 3da9b00f44
commit 4897594b87
40 files changed
+1871 -90

No files matched your search

@@ -65,6 +65,25 @@
case HostMode.SchemaProblem:
<p>@_status.Detail</p>
@if (Host.MigrationFailed is not null)
{
var copies = new Backups(Host.Config.Data, Clock).List();
<p>Il motore resta spento.
@if (copies.Count > 0)
{
<text>L'ultimo salvataggio è <code>@copies[0].Name</code>, in <code>@Host.Config.Data.Backups</code>: per tornarci, indica nella configurazione un database nuovo e vuoto e sceglilo in questa pagina.</text>
}
Se il problema è passeggero (spazio sul disco, permessi), risolvilo e riprova.</p>
@if (Host.Config.Platform == PlatformKind.Docker || _local)
{
<form method="post" action="/azioni/servizio/riprova" class="form">
<AntiforgeryToken />
<AdminPassword Docker="Host.Config.Platform == PlatformKind.Docker" />
<button class="btn btn-primary" type="submit">Riprova l'aggiornamento</button>
</form>
}
break;
}
<p>Per non rovinare i dati il motore resta spento. Aggiorna Anubis alla versione che ha creato questo database, oppure ripristina un salvataggio in un database vuoto.</p>
break;
@@ -82,7 +101,7 @@
<p class="notice notice-loss" role="alert"><Icon Name="alert" Size="16" />@(errore switch
{
"password" => "Password della configurazione d'avvio sbagliata, oppure scelta fatta da un altro computer.",
"importazione" => "Il ripristino non è riuscito e non ho cambiato nulla. Controlla l'archivio e riprova.",
"importazione" => "Non ci sono riuscito e nessun dato a metà è in uso. Controlla l'archivio o guarda i log, poi riprova.",
"attesa" => "Troppi tentativi sbagliati. Riprova tra 15 minuti.",
_ => "Questa scelta non è disponibile adesso.",
})</p>