Administration backs the server up, downloads, uploads and restores it
A Backups section (for administrators, PrivaPub's /clientapi/admin/backups): the backups kept with their kind, size, media and the logins deleted since, what runs, the restore waiting and the last restore's report. Back up now; download for the password through a link good for ten minutes, which the browser saves to disk; upload a downloaded backup in pieces straight from the picked file (js/transfer.js PUTs file.slice at the offset PrivaPub has, never through .NET's memory, and carries on after a refused or lost piece); delete after asking; restore for the password and the host typed out, saying what it keeps and what it loses, then showing PrivaPub restarting until the ended session sends the page to sign in. e2e: a backup made, downloaded and uploaded again; and, only with --filter "Category=Restore", a real restore of the pasture, which signs the town in again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
70cb389537
commit
dc2190e271
11 files changed
+1058
-3
No files matched your search
@@ -57,6 +57,20 @@ namespace decePubClient.E2E.Support
|
||||
return JsonNode.Parse(output.Trim().Split('\n').Last())!;
|
||||
}
|
||||
|
||||
// the town's PrivaPub accounts signed in again (town.sh renew privapub): a restore ends every session
|
||||
public static async Task RenewTown()
|
||||
{
|
||||
var start = new ProcessStartInfo("python3") { RedirectStandardOutput = true, RedirectStandardError = true };
|
||||
foreach (var arg in new[] { Path.Combine(Root, "town", "town.py"), "renew", "privapub" })
|
||||
start.ArgumentList.Add(arg);
|
||||
using var process = Process.Start(start)!;
|
||||
await process.StandardOutput.ReadToEndAsync();
|
||||
var error = await process.StandardError.ReadToEndAsync();
|
||||
await process.WaitForExitAsync();
|
||||
if (process.ExitCode != 0)
|
||||
throw new InvalidOperationException($"town.sh renew privapub failed: {error}");
|
||||
}
|
||||
|
||||
// a script on PrivaPub's own database in the pasture, to undo what no API undoes
|
||||
public static async Task Mongo(string script)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user