@mateusbmp/backup-manager 0.1.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/cli.js +330 -214
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,6 +145,11 @@ journalctl --user -u bkm -f # scheduler and job log
|
|
|
145
145
|
boot and keep running after you log out. On most systems this needs no root. If your
|
|
146
146
|
system refuses it, the install still succeeds, with a warning that the service only runs
|
|
147
147
|
while you are logged in.
|
|
148
|
+
- **No user session (`su`, `sudo -u`, some SSH setups):** `systemctl --user` needs
|
|
149
|
+
`XDG_RUNTIME_DIR`. If it is missing, bkm takes it (and the D-Bus address) from
|
|
150
|
+
`/run/user/<uid>` itself. If no user manager is running at all, the error says so: log in
|
|
151
|
+
as that user directly (`ssh user@host`), or have an administrator run
|
|
152
|
+
`sudo loginctl enable-linger <user>` once, then retry.
|
|
148
153
|
- **Upgrades:** the unit stores absolute paths to `node` and `bkm`. If either one moves
|
|
149
154
|
(an nvm upgrade or a reinstall), `bkm doctor` and the UI flag the unit as **outdated**.
|
|
150
155
|
Choose **Install / update** on the Service screen to rewrite it.
|
|
@@ -259,7 +264,7 @@ Every key (generated from the schema):
|
|
|
259
264
|
│ Doctor │ │ ✔ production 20261109-033000 complete 1.6 GiB 9h ago │
|
|
260
265
|
│ Settings │ ╰──────────────────────────────────────────────────────────────╯
|
|
261
266
|
╰──────────────────╯
|
|
262
|
-
↑↓ move ⏎ backups r run now n new backup e environments
|
|
267
|
+
↑↓ move ⏎ backups r run now n new backup e environments ctrl+←↓→ zones ? help q quit
|
|
263
268
|
```
|
|
264
269
|
|
|
265
270
|
| Screen | What you can do |
|
|
@@ -280,6 +285,13 @@ Every key (generated from the schema):
|
|
|
280
285
|
field) · `1`–`9` jump to a menu entry · `n` new backup · `e` environments · `s` service ·
|
|
281
286
|
`Ctrl-S` saves a form · `?` help · `q` quit.
|
|
282
287
|
|
|
288
|
+
**Buttons and zones:** every action on the footer line is also a button. `Ctrl+↓` focuses
|
|
289
|
+
the footer as a button bar (`[ save ] [ cancel ] …`); `←→` picks a button, `⏎` presses it,
|
|
290
|
+
and `Esc` or `↑` returns. `Ctrl+←` focuses the sidebar, and `Ctrl+→` or `Ctrl+↑` returns to
|
|
291
|
+
the content. `Alt` works in place of `Ctrl`. Use these in terminals that swallow chords
|
|
292
|
+
like `Ctrl-S` (Termius, or any terminal with XON/XOFF flow control): every form can be
|
|
293
|
+
saved with its **save** button, and screens you reached from another one get a **back** button.
|
|
294
|
+
|
|
283
295
|
Below 90 columns the sidebar becomes a tab bar, and below 60×16 the UI asks you to resize.
|
|
284
296
|
`NO_COLOR` is honored.
|
|
285
297
|
|
|
@@ -460,12 +472,13 @@ JSON config validated by zod. npm.
|
|
|
460
472
|
- Backups: `core/backup/pipeline.ts` (one env; `.tmp-<id>` → manifest → rename; auto-prune), `mariadb.ts`, `archive.ts`, `catalog.ts`, `retention.ts` (pure), `prune.ts`, `lock.ts`.
|
|
461
473
|
- Jobs: `core/jobs/store.ts` (JSON status), `events.ts` (NDJSON), `runner.ts` (`startJob` spawns `bkm __job`: detached from the UI, a normal child from the daemon; `executeJob` runs it).
|
|
462
474
|
- Daemon: `core/daemon/` (scheduler, catch-up via `schedule.json`, reload on file change or SIGHUP, graceful stop) + `src/api/server.ts`.
|
|
463
|
-
- systemd: `core/service/` — every systemctl/journalctl/loginctl call goes through the injectable `CommandRunner` in `systemctl.ts`, always `--user`, never sudo, never a shell.
|
|
475
|
+
- systemd: `core/service/` — every systemctl/journalctl/loginctl call goes through the injectable `CommandRunner` in `systemctl.ts`, always `--user`, never sudo, never a shell; `execRunner` fills a missing `XDG_RUNTIME_DIR`/`DBUS_SESSION_BUS_ADDRESS` from `/run/user/<uid>` (`userBusEnv`).
|
|
464
476
|
- UI: `src/ui/App.tsx` (frame, routing, global keys, toasts, modals), `screens/`, `components/` (Form, TextField, ScrollList/ScrollView, Panel), `hooks/` (usePolling, useJobEvents). `ui/print/` renders doctor output for the CLI.
|
|
465
477
|
|
|
466
478
|
## Conventions
|
|
467
479
|
|
|
468
480
|
- Ink: colors only from `ui/theme.ts`; gate every `useInput` with `isActive` (`useScreenActive()`); forms take the keyboard via `useCaptureKeys`; size from the App context (`width`/`height`), not ad-hoc.
|
|
481
|
+
- Actions: declare each screen action once with `useHints([{ key, label, run }])`. The footer shows it as a hint, and as a button once Ctrl/Alt+↓ focuses the bar, so the key handler and the button share one function. Ctrl/Alt+arrows belong to App's zone switching: arrow handlers ignore them (`isZoneKey`; `isUp`/`isDown` already do).
|
|
469
482
|
- Tests: vitest + ink-testing-library (100 columns; send a no-op key after mount and wait before keys; match frames after `stripVTControlCharacters`, since CI forces color). Temp dirs via `tests/helpers.ts`; fake `mariadb-dump` (`installFakeDump`) and fake systemd (`fakeSystemd`).
|
|
470
483
|
- Every behavior change needs tests; keep README (and this block) in sync in the same change.
|
|
471
484
|
|