mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 08:02:12 +00:00
docs(backup): say what account copies and the JSON import can do
Several surfaces promised more than the per-account copies deliver: - The full-backup export card said it had the same shape as the weekly copy. It is a portable export with documents as metadata only; it now says so, and that it cannot recreate an account on another server. - The export page offered to "import from a backup". The JSON import adds measurements and mood entries; it is now named that way, and its help states the 16 MB and 10,000-entries-per-list limits from the constants the route enforces. - The weekly copy is labelled an account rollback on this server, and the backups page says a copy cannot rebuild a lost server. The upload says the account must exist here. Two restore refusals pointed to a "disaster-recovery" copy; they now name the copies that exist. - The instance-settings restore option was described as being for rebuilding a host. docs/ops/backup-restore.md is rewritten short and accurate: what each copy is, the deletion grace window, that database dumps keep a deleted account until they age out, how to restore one account, and a link to the disaster-recovery procedure for a lost server.
This commit is contained in:
1 parent
63574b98a6
commit
0c5f29303b
17 files changed
+258
-571
No files matched your search
@@ -64,7 +64,7 @@ describe("RestoreRefusalNotice", () => {
|
||||
const html = render(["documents"]);
|
||||
|
||||
expect(html).toContain("Nothing was changed");
|
||||
expect(html).toContain("disaster-recovery snapshot");
|
||||
expect(html).toContain("account copies or an off-host copy");
|
||||
});
|
||||
|
||||
it("renders nothing when no section was missing", () => {
|
||||
|
||||
@@ -11,6 +11,10 @@ import { useTranslations } from "@/lib/i18n/context";
|
||||
import { apiFetchRaw } from "@/lib/api/api-fetch";
|
||||
import { ImportCardShell } from "./import-card-shell";
|
||||
import { IMPORT_GUIDE_URL, MAX_PASTE_CHARS } from "./constants";
|
||||
import {
|
||||
JSON_IMPORT_MAX_BYTES,
|
||||
JSON_IMPORT_MAX_ROWS,
|
||||
} from "@/lib/import/json/limits";
|
||||
import {
|
||||
EXAMPLE_IMPORT_DOWNLOAD_HREF,
|
||||
parseImportJson,
|
||||
@@ -122,7 +126,7 @@ export function JsonImportResultView({ result }: { result: JsonImportResult }) {
|
||||
}
|
||||
|
||||
export function JsonImportCard() {
|
||||
const { t } = useTranslations();
|
||||
const { t, locale } = useTranslations();
|
||||
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const [text, setText] = useState("");
|
||||
@@ -226,6 +230,15 @@ export function JsonImportCard() {
|
||||
onChange={onFileChange}
|
||||
/>
|
||||
|
||||
{/* What this import is, and its limits: it adds measurements and mood
|
||||
entries; it is not a way back from a full backup. The numbers are
|
||||
the ones the route enforces. */}
|
||||
<p className="text-muted-foreground text-xs">
|
||||
{t("settings.sections.export.import.json.limitsHint", {
|
||||
mb: JSON_IMPORT_MAX_BYTES / (1024 * 1024),
|
||||
rows: JSON_IMPORT_MAX_ROWS.toLocaleString(locale),
|
||||
})}
|
||||
</p>
|
||||
<p className="text-muted-foreground text-xs">
|
||||
{t("settings.sections.export.import.json.schemaHint")}{" "}
|
||||
{/* The import guide lives on the external docs site — the app
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
* reconfigures the host for everybody on it, silently and hours or weeks out
|
||||
* of date: an operator putting a single record back on Wednesday has no
|
||||
* reason to expect Monday's registration switch and Monday's upload cap to
|
||||
* come with it. Rebuilding a host from a snapshot is a real case, so the
|
||||
* write stays available — as an answer the operator gives
|
||||
* (`restoreInstanceSettings`), not one the account restore assumes.
|
||||
* come with it. Putting the instance settings themselves back is a real
|
||||
* case, so the write stays available — as an answer the operator gives
|
||||
* (`restoreInstanceSettings`), not one the account restore assumes. An
|
||||
* account copy does not rebuild a lost host; a database dump and the keys do
|
||||
* (`docs/ops/disaster-recovery.md`).
|
||||
*/
|
||||
import { DEFAULT_REASONING_MAX_EFFORT } from "@/lib/ai/reasoning/levels";
|
||||
import type {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Rows per section, and the file as a whole, as the JSON import route has
|
||||
* always capped them. A leaf module, so the import card states the same
|
||||
* numbers the route enforces without loading the schema.
|
||||
*/
|
||||
export const JSON_IMPORT_MAX_ROWS = 10_000;
|
||||
export const JSON_IMPORT_MAX_BYTES = 16 * 1024 * 1024;
|
||||
@@ -36,9 +36,8 @@ import { SLEEP_STAGE_NAMES } from "@/lib/validations/sleep-stage-entry";
|
||||
|
||||
import { fallbackMoodDateStart } from "./mood-instant";
|
||||
|
||||
/** Rows per section, and the file as a whole, as the route has always capped them. */
|
||||
export const JSON_IMPORT_MAX_ROWS = 10_000;
|
||||
export const JSON_IMPORT_MAX_BYTES = 16 * 1024 * 1024;
|
||||
import { JSON_IMPORT_MAX_ROWS } from "./limits";
|
||||
export { JSON_IMPORT_MAX_BYTES, JSON_IMPORT_MAX_ROWS } from "./limits";
|
||||
|
||||
// The type is the canonical enum, so every type the exporters write comes
|
||||
// back; a hand-kept subset once dropped four of eleven.
|
||||
|
||||
@@ -43,7 +43,7 @@ const restoreRequest = z
|
||||
.meta({
|
||||
id: "AdminBackupRestoreRequest",
|
||||
description:
|
||||
"`confirm` is the literal typed gate; anything else is refused with 422 and nothing is read. `restoreInstanceSettings` defaults to false: the restore then replaces the snapshot owner's data tables and leaves the singleton instance settings — registration, MFA requirement, default locale and timezone, module availability, notification and AI configuration, document cap and quota — exactly as they are. Send `true` only when rebuilding a host from a snapshot, because those settings apply to every account on the installation.",
|
||||
"`confirm` is the literal typed gate; anything else is refused with 422 and nothing is read. `restoreInstanceSettings` defaults to false: the restore then replaces the snapshot owner's data tables and leaves the singleton instance settings — registration, MFA requirement, default locale and timezone, module availability, notification and AI configuration, document cap and quota — exactly as they are. Send `true` only when this server's instance settings themselves need to go back to the ones in the copy, because those settings apply to every account on the installation. An account copy restores one existing account on this server; it does not rebuild a lost server, which takes a database dump and the encryption keys (`docs/ops/disaster-recovery.md`).",
|
||||
});
|
||||
|
||||
const restoreSkipEntry = z
|
||||
|
||||
Reference in new issue
Block a user