fix(config-backup): ignore a Docker case's conversation id, list every ignored key, correct the retention and restart docs

This commit is contained in:
Devvyn committed 2026-10-20 18:01:43 +08:00
1 parent a0b9570457
commit 71fcefbaf2
8 files changed
+25 -13

No files matched your search

+11 -6
View File
@@ -37,10 +37,15 @@ cron jobs.
- **Whenever the content changes.** The files are read and hashed every five minutes; a new
backup is written only if the set differs from the latest backup. An idle server writes
nothing, and the history is one entry per real change rather than one per timer tick.
A field a file refreshes by itself is not a change: `custom-model-hosts.json` carries a
`lastDiscoveredAt` per host that the model-discovery poll rewrites every five minutes, and
the comparison looks through it (the snapshot still stores the file exactly as written).
Without that, every tick looked like an edit and 20 copies covered only about 100 minutes.
A field a file rewrites on its own is not a change, and the comparison looks through it (the
snapshot still stores the file exactly as written, and a restore puts those fields back as they
were): `custom-model-hosts.json` `lastDiscoveredAt` (the model-discovery poll, every five
minutes), `users.json` `lastLoginAt`, `settings.json` `lastUsedCase`, `intents.json`
`recentPrompts` and `updatedAt` (every captured prompt) and `docker-cases.json`
`lastClaudeSessionId` (a Docker case's conversation id after a `/clear`). Without that, every
tick looked like an edit and 20 copies covered only about 100 minutes. So Compare shows
`intents.json` as unchanged when only prompts differ, yet a restore drops the prompts captured
since.
- **On demand**, with **Back up now** (always writes one, even if nothing changed).
- **Before a restore**, as a `pre-restore` safety copy of the files about to be replaced.
@@ -155,8 +160,8 @@ Before you restore, or to find out what changed and when, use **Compare** in the
Each file that differs is listed with its changed keys (`theme.mode`, `tags[1]`, a variable name
in `.env`) as before → after, plus files that appeared or vanished between the two states. Files
that are the same are listed on one line. A file that is not JSON shows only that it differs, and
a file with more than 200 changes is cut short, so use the files themselves for a full diff. A
self-refreshed discovery timestamp in `custom-model-hosts.json` is not counted as a change.
a file with more than 200 changes is cut short, so use the files themselves for a full diff. The
self-rewritten fields listed under "When a backup is made" are not counted as changes.
**Credential values are never shown.** `.env`, `users.json`, `push-keys.json`, `webhook.json` (the
URL is a bearer secret) and `intents.json` (captured prompts) list only the names that changed, and in every other file a key that looks like a token, secret, password,
+1 -1
View File
@@ -108,7 +108,7 @@ Two features send data outward, both off by default and both stated where they a
dictation through your Claude login, and the Read My Mind prediction call.
[Config Backups](Config-Backups) copies some credential-bearing files (`.env`, `users.json`,
`custom-model-hosts.json`, `push-keys.json`) into a backup folder. The default folder is inside
`custom-model-hosts.json`, `push-keys.json`, `webhook.json`) into a backup folder. The default folder is inside
the data directory, and every backup is mode `0700`/`0600`, so nothing new is exposed. Only a
folder you choose yourself can move them somewhere less private; admin only in multi-user mode.
+1 -1
View File
@@ -192,7 +192,7 @@ mode, the **Users** administration entry is injected here.
The **Config backups** group controls timestamped copies of your configuration files: an
on/off switch (on by default), the backup folder (default `~/.codeman/backups/config`), how
many backups to keep (1 to 500, default 20) and how many days to keep them (0 to 3650, default
many backups to keep (2 to 500, default 20) and how many days to keep them (0 to 3650, default
30; 0 means no age limit), plus **Back up now** and a list with **Restore**. These are
server-side settings, read fresh. Details, naming and restore behaviour are on
[Config Backups](Config-Backups).
+2 -2
View File
@@ -139,8 +139,8 @@ which is the default, you have copies:
1. Open **Settings → System → Config backups** and pick the newest backup from before the
change. The list shows when each was made and what it holds.
2. **Restore** it, reload the page, and restart Codeman if the response says `clis.json`,
`users.json`, `.env` or `push-keys.json` were restored.
2. **Restore** it, reload the page, and restart Codeman if the response's `restartRequired`
list is not empty.
Without the UI: the backups are plain folders in `~/.codeman/backups/config/`
(`cfg-YYYYMMDD-HHMMSS`); copy the file you need back over the one in `~/.codeman/`.