diff --git a/docs/MODULES.md b/docs/MODULES.md index e810d32..481bdd7 100644 --- a/docs/MODULES.md +++ b/docs/MODULES.md @@ -51,7 +51,12 @@ Register exactly one `Module` in `init()`: - `Secrets(c)` — names of every secret this module's config references (so the UI can show 已设置). Rollback (failed/unconfirmed apply, `mr rollback`) restores files, restarts their services and -reconciles the default runlevel with the restored config (`reconcileRunlevel`). From the snapshot until the +reconciles the default runlevel with the restored config (`reconcileRunlevel`). Every apply records a revision +(`history.go`): `.json` next to its snapshot with rev, time, origin, comment, the config-level diff +(from `gen/applied.yaml` + `gen/applied-secrets`, bookkeeping files the plan writes and a rollback restores; secrets +only as "(changed)") and the result (applying → applied | pending → confirmed | rolled back: why); `mr rollback N` +and the web UI's 回滚到此前 apply the config from before change N as a new change (the web UI password stays the +current one). From the snapshot until the change is accepted (the apply ends without `--confirm`, or `mr confirm`) the marker `/etc/mini-router/confirm-pending` (JSON: snapshot, state applying | pending | reverting, deadline, origin) is on flash: if the router goes down in that window, the next boot restores the snapshot before any service starts diff --git a/docs/modules/sys.md b/docs/modules/sys.md index 861f3fb..36b7f69 100644 --- a/docs/modules/sys.md +++ b/docs/modules/sys.md @@ -32,6 +32,7 @@ system: ntp_server: false # also answer NTP (udp/123) — only the LAN zone gets through the firewall sysctl: {net.ipv4.tcp_congestion_control: bbr} # added to / overriding 90-mini-router.conf zram: true # zram swap (1/4 of RAM, zstd); also MGLRU min_ttl_ms=1000: OOM kill instead of thrashing + history: 20 # config snapshots / change records kept (5-200) services: tailscale: {enabled: true, port: 41641} # tailscaled --port; the same UDP port is opened on the WANs @@ -152,7 +153,7 @@ load; output and exit code go to `/run/mini-router/fw-run.{log,rc}`. directories) rejects the whole archive. 2. Secrets: the backup's are laid over the current ones; `webui_password` always stays the current one. 3. List files that differ are saved first as `