kp-sync 0.7.1__tar.gz → 0.7.2__tar.gz
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.
- {kp_sync-0.7.1 → kp_sync-0.7.2}/CHANGES.md +21 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/PKG-INFO +1 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/PLAN.md +6 -4
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/configuration-cli.md +1 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/interaction.md +9 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/man/man1/kp-sync.1 +7 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/pyproject.toml +1 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/__init__.py +1 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/baseline.py +17 -9
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/cli.py +11 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/engine.py +92 -13
- kp_sync-0.7.2/src/kp_sync/history_command.py +342 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/integration.py +14 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/PKG-INFO +1 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_cloud_sync.py +125 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_database_identity.py +208 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_engine.py +6 -1
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_integration.py +24 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_skeleton.py +10 -2
- kp_sync-0.7.1/src/kp_sync/history_command.py +0 -171
- {kp_sync-0.7.1 → kp_sync-0.7.2}/.pycodestyle +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/DESIGN.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/LICENSE +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/MANIFEST.in +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/README.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/architecture.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/development.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/endpoints-and-access.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/history-and-sync.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/design/lifecycle.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/_ext/cli_help.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/_ext/module_reference.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/_static/layout.css +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/api.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/cli.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/conf.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/contributing.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/getting-started.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/index.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/integration.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/internals.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/modules.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/docs/reusing-documentation.rst +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/README.md +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/bash-completion/kps +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/cloud-only.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/cloud-rcd.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/dropbox.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/everything.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/pendrives-only.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/configs/persistent-hub-folders.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/keepass +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/main-laptop.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/second-laptop.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/udevmon/main-laptop.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/examples/udevmon/second-laptop.toml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/man/man5/kp-sync-config.5 +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/setup.cfg +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/__main__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/access_op.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/access_ops.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/backups.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/classify.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/cleanup.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/cloud_contact.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/completion.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/config.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/content.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/credentials.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/__init__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/apps.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/client.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/dbus.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/inhibit.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/leases.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/protocol.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/rescue.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/server.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/systemd.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/daemon/triggers.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/drive_retire.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/drive_setup.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/drive_sync.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/drives.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/__init__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/access.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/base.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/command.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/file.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/rclone.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/endpoints/session.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/history.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/idle.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/kdbx.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/keepassxc.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/lock.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/log.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/merge.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/paths.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/pending.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/rclone_credentials.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/rclone_rcd.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/reach.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/repair.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/services.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/__init__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/authkeys.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/diagnostic.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/records.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/session.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/sessions/sftp_serve.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/setup_host.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/state.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/udevmon.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/__init__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/base.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/factory.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/fake.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/gui.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/none.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/progress.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/ui/tty.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync/verify.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/SOURCES.txt +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/dependency_links.txt +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/entry_points.txt +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/requires.txt +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/src/kp_sync.egg-info/top_level.txt +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/__init__.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/acceptance_sessions.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/data/keepassxc.xml +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/fixtures.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_access_ops.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_baseline.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_cleanup.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_cloud_contact.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_compatibility.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_completion.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_config.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_content.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_credentials.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_daemon.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_desktop.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_documentation.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_drive_retire.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_drive_setup.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_drives.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_endpoints.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_examples.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_history.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_history_command.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_idle.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_isolation.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_kdbx.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_keepassxc.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_keepassxc_settings.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_license.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_log.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_merge.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_pending.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_rclone.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_rclone_credentials.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_rclone_rcd.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_reach.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_releases.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_repair.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_run_tests.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_services.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_sessions.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_setup_host.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_status.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_udevmon.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/test_ui.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tests/udevmon_fake.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tools/docs.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tools/releases.py +0 -0
- {kp_sync-0.7.1 → kp_sync-0.7.2}/tools/run_tests.py +0 -0
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
User-visible changes per release, newest first. Commit history and tags
|
|
4
4
|
hold the details; design decisions live in the `design/` chapters.
|
|
5
5
|
|
|
6
|
+
## 0.7.2 (2026-11-30)
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- `kp-sync doctor --history` also reads each history store (the cloud
|
|
11
|
+
and attached drives, read-only) and checks which database it records:
|
|
12
|
+
another database's history (a wrong `remote` or `[baseline] dir`) and
|
|
13
|
+
two histories of one database fail, before a sync finds them.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Recording the first version no longer waits up to 15 minutes, with
|
|
18
|
+
"database could not be opened with the supplied credentials", when
|
|
19
|
+
the cached password does not open the copy (the password was changed,
|
|
20
|
+
or the cache was another database's under the same profile): the
|
|
21
|
+
password is asked for once and replaces the cached one if it opens
|
|
22
|
+
the copy. If the same password is typed again, the wait names the key
|
|
23
|
+
file as the likely cause.
|
|
24
|
+
- `kp-sync history` no longer removes the record of a drive whose mount
|
|
25
|
+
is gone, which the daemon's drive handling may still need.
|
|
26
|
+
|
|
6
27
|
## 0.7.1 (2026-11-29)
|
|
7
28
|
|
|
8
29
|
### Fixed
|
|
@@ -187,8 +187,9 @@ line and wait their turn.
|
|
|
187
187
|
hand. Not yet seen: duplicate names on Drive and the PLAN 15 path
|
|
188
188
|
through `kp-sync setup`.
|
|
189
189
|
|
|
190
|
-
17. **Database identity from the root group UUID.**
|
|
191
|
-
|
|
190
|
+
17. **Database identity from the root group UUID.** Released in 0.7.0
|
|
191
|
+
(0.7.1: syncs while another database's endpoint is left out);
|
|
192
|
+
approved 2026-11-20 (rules in
|
|
192
193
|
"Database identity" in the baseline store, history chapter). The
|
|
193
194
|
history records the root group UUID of its database (nothing is
|
|
194
195
|
written into the database), learned at the first commit verified
|
|
@@ -210,8 +211,9 @@ line and wait their turn.
|
|
|
210
211
|
detection and its retention gap, the commit check, the remembered
|
|
211
212
|
copy and the first-version record. pykeepass-created fixtures share
|
|
212
213
|
one template root UUID; `create_database(..., another_database=True)`
|
|
213
|
-
makes another database.
|
|
214
|
-
reads
|
|
214
|
+
makes another database. `doctor --history` (opt-in, it contacts
|
|
215
|
+
the stores) reads each store read-only and reports its record,
|
|
216
|
+
another database's store and two histories of one database. Root
|
|
215
217
|
group UUID kept (2026-11-21, the cloud file's revisions): one edit
|
|
216
218
|
each from KeePassXC 2.6.6, 2.7.10 and the one phone app that saves
|
|
217
219
|
the database. Live 2026-11-20 with kp-test's
|
|
@@ -205,7 +205,7 @@ source = "runtime"
|
|
|
205
205
|
| `kp-sync service install daemon [--desktop]` | write or refresh selected-profile units and required shared templates; reload systemd without enabling or starting; desktop entries opt-in |
|
|
206
206
|
| `kp-sync setup HOST [--hub PATH \| --runtime-hub] [--key-file PATH] [--remote REMOTE] [--rclone-config PATH] [--drive-dir NAME] [--history-dir NAME] [--drive MOUNT=NAME]... [--alias NAME] [--no-desktop] [--dry-run] [--yes]` | PLAN 3: set up this machine for profile `HOST` by running the steps of "Setting up another machine" (`examples/README.md`) in order, each as the existing command it names, so each behaves and reports as when typed: (1) write `~/.config/kp-sync/HOST.toml` (0600, atomic) from the answers (a persistent hub with `--hub` on an encrypted disk, or the runtime hub; key file, cloud remote, its `rclone_config`, drive and history folder names), or keep an existing one unchanged; (2) `service install daemon` (`--desktop` unless `--no-desktop`) and `service enable daemon --now`; (3) `sync --dry-run`, then `sync`; (4) `drive-setup MOUNT NAME` for each `--drive`; (5) `completion install --alias NAME` with `--alias`, printing the `alias` line for `~/.bashrc`; (6) `doctor`. Missing answers are asked on a terminal (defaults shown) and are an error elsewhere. It prints the whole plan first and asks once before changing anything (`--yes` skips the question, and is required without a terminal); `--dry-run` prints the plan only. It stops at the first failing step, saying which steps remain; running it again repeats the idempotent steps and keeps the profile. It never installs packages, edits `~/.bashrc` or shell files, creates, moves or overwrites a database, retires old scripts or starts an application itself (a main-mode `drive-setup` does, as plugging the drive would) |
|
|
207
207
|
| `kp-sync completion install [--alias NAME]... [--dry-run]` | since 0.5.1: write kp-sync's argcomplete registration (generated in-process, so the `register-python-argcomplete` helper need not be on `PATH`) and, per `--alias`, `examples/bash-completion/kps` with the alias name filled in, into bash-completion's per-user directory (`$BASH_COMPLETION_USER_DIR/completions`, else `$XDG_DATA_HOME/bash-completion/completions`). Files already identical are left alone; others are replaced atomically. Loads no configuration (no `--profile` needed) and contacts nothing; the alias itself stays the user's (`~/.bashrc`) |
|
|
208
|
-
| `kp-sync doctor [--self-test]` | check the installation and report what to fix: units installed and enabled, socket reachable and protocol version, menu entry override still in effect and still calling `kp-sync run` (a KeePassXC update may change the system entry), KeePassXC's reload option, key file readable, rclone remote and probe working (a generated probe lists the remote folder as a sync does, since PLAN 16: a database not yet in an existing remote folder is a warning that the next sync installs it only when that folder's history store is read and holds this database's history or none, a missing remote folder fails with the `rclone mkdir` hint; and that the reach check agrees with a working probe: `reach:NAME` fails, saying to set `reach_check`, when the check fails while rclone reaches the cloud), hub on an encrypted disk when `require_encrypted`, a key written by a client readable by the daemon (keyring possession), swap encrypted or absent (`$XDG_RUNTIME_DIR` is tmpfs, which can be swapped out), that every `kp-sync` call in udevmon's actions and kp-access's `[owner] file-op-cmd` selects an existing profile (no `--profile` only with `config.toml`) and, for this profile, that kp-access's `db-path` is its staged copy, and for sessions `bwrap` (and unprivileged user namespaces), `sftp-server`, `~/.ssh/authorized_keys` editable (regular file, owned, not group/other-writable), no stale `kp-sync-session-*` lines, and the system sshd reachable on localhost. With udevmon 0.9.0+, the `udevmon` checks: the features kp-sync needs are installed; `status --json` shows a running daemon of the installed version (an older one still running: restart udevmon with the key drives unplugged); `check --json` has no errors, and its warnings about kp-sync's entries are shown (by source with udevmon 0.10.0, else by name); each kp-sync action's `program` exists and is this kp-sync (by real path); the last result of each kp-sync action since the daemon started succeeded (otherwise its time, status, `failure` and output lines). The action list for the profile check comes from `actions list --json`. Older udevmon: the check fails with what to upgrade and the udevmon parts of the profile check are skipped. Explicit `--self-test` authorizes a five-minute restricted key and a confined localhost SFTP put/get round trip; removes only its own key and runtime artifacts afterwards, never uses the database/key file, and catches shell startup output that breaks SFTP |
|
|
208
|
+
| `kp-sync doctor [--history] [--self-test]` | check the installation and report what to fix: units installed and enabled, socket reachable and protocol version, menu entry override still in effect and still calling `kp-sync run` (a KeePassXC update may change the system entry), KeePassXC's reload option, key file readable, rclone remote and probe working (a generated probe lists the remote folder as a sync does, since PLAN 16: a database not yet in an existing remote folder is a warning that the next sync installs it only when that folder's history store is read and holds this database's history or none, a missing remote folder fails with the `rclone mkdir` hint; and that the reach check agrees with a working probe: `reach:NAME` fails, saying to set `reach_check`, when the check fails while rclone reaches the cloud), hub on an encrypted disk when `require_encrypted`, a key written by a client readable by the daemon (keyring possession), swap encrypted or absent (`$XDG_RUNTIME_DIR` is tmpfs, which can be swapped out), that every `kp-sync` call in udevmon's actions and kp-access's `[owner] file-op-cmd` selects an existing profile (no `--profile` only with `config.toml`) and, for this profile, that kp-access's `db-path` is its staged copy, and for sessions `bwrap` (and unprivileged user namespaces), `sftp-server`, `~/.ssh/authorized_keys` editable (regular file, owned, not group/other-writable), no stale `kp-sync-session-*` lines, and the system sshd reachable on localhost. With udevmon 0.9.0+, the `udevmon` checks: the features kp-sync needs are installed; `status --json` shows a running daemon of the installed version (an older one still running: restart udevmon with the key drives unplugged); `check --json` has no errors, and its warnings about kp-sync's entries are shown (by source with udevmon 0.10.0, else by name); each kp-sync action's `program` exists and is this kp-sync (by real path); the last result of each kp-sync action since the daemon started succeeded (otherwise its time, status, `failure` and output lines). The action list for the profile check comes from `actions list --json`. Older udevmon: the check fails with what to upgrade and the udevmon parts of the profile check are skipped. Explicit `--history` also reads each history store as `history` does (the cloud and attached drives are contacted; read-only, no password, the persistent history cache unchanged): it names the database's root group UUID, fails a store that holds another database's history and two histories of one database (the load checks of "Database identity"), and warns about a store without a record yet, without history, unavailable, or configured but not attached. Explicit `--self-test` authorizes a five-minute restricted key and a confined localhost SFTP put/get round trip; removes only its own key and runtime artifacts afterwards, never uses the database/key file, and catches shell startup output that breaks SFTP |
|
|
209
209
|
| `kp-sync daemon [--foreground] [--debug]` | run the daemon in the terminal for debugging (the service must be stopped); it never detaches, so `--foreground` changes nothing |
|
|
210
210
|
|
|
211
211
|
### Status presentation (implemented)
|
|
@@ -292,7 +292,15 @@ send a request to the daemon, and in time-limited contexts return at once
|
|
|
292
292
|
A newly entered password is checked against an observed local copy
|
|
293
293
|
before the run relies on it; a rejected one is removed from the keyring
|
|
294
294
|
(`forget`) and asked again, up to three times, then the run fails
|
|
295
|
-
without caching it.
|
|
295
|
+
without caching it. A cached password is used as it is (checking it
|
|
296
|
+
would open a copy on every run); where nothing else can open the copy,
|
|
297
|
+
the first version of a lone copy, a cached password the copy rejects
|
|
298
|
+
(changed since, or another database's under this profile name) is
|
|
299
|
+
asked for once, with a notice. A mismatched key file fails the same
|
|
300
|
+
way, so the cached password is replaced only when the typed one opens
|
|
301
|
+
the copy; retyping the same password names the key file instead, and
|
|
302
|
+
a failure (or a keyring error) leaves the run waiting with the earlier
|
|
303
|
+
password still cached.
|
|
296
304
|
- A copy that opens with neither the cached password nor one learned in the
|
|
297
305
|
run (an old pendrive with a former master key) gets its own key,
|
|
298
306
|
`kp-sync:PROFILE:copy:SLOT`, so its password never replaces the main one.
|
|
@@ -755,7 +755,7 @@ a file completing that alias of
|
|
|
755
755
|
Unchanged files are left alone. Needs no profile and contacts nothing;
|
|
756
756
|
run it again after upgrading argcomplete.
|
|
757
757
|
.TP
|
|
758
|
-
\fBdoctor\fR [\fB\-\-self\-test\fR]
|
|
758
|
+
\fBdoctor\fR [\fB\-\-history\fR] [\fB\-\-self\-test\fR]
|
|
759
759
|
Check the installation and print one
|
|
760
760
|
.BR OK ,
|
|
761
761
|
.B WARNING
|
|
@@ -777,6 +777,12 @@ kp-sync, and their last runs succeeded. Some checks contact
|
|
|
777
777
|
configured endpoints. Exits 1 if any check fails.
|
|
778
778
|
.RS
|
|
779
779
|
.TP
|
|
780
|
+
.B \-\-history
|
|
781
|
+
Also read each history store (the cloud and attached drives; read-only,
|
|
782
|
+
without the password) and check that it records this database: a store
|
|
783
|
+
holding another database's history, or two separate histories of one
|
|
784
|
+
database, fails; a store without a record yet is a warning.
|
|
785
|
+
.TP
|
|
780
786
|
.B \-\-self\-test
|
|
781
787
|
Also authorize a five-minute restricted localhost key and perform a
|
|
782
788
|
confined SFTP upload and download with synthetic data. Only the test's own
|
|
@@ -419,12 +419,18 @@ class BaselineManager:
|
|
|
419
419
|
self.publication_outcomes[store_name] = reason
|
|
420
420
|
|
|
421
421
|
def load(
|
|
422
|
-
self,
|
|
422
|
+
self,
|
|
423
|
+
temporary: Path,
|
|
424
|
+
*,
|
|
425
|
+
read_only: bool = False,
|
|
426
|
+
report_foreign: bool = True,
|
|
423
427
|
) -> HistoryState:
|
|
424
428
|
"""Load and merge cached and available shared state.
|
|
425
429
|
|
|
426
430
|
``temporary`` is the private download directory. Unavailable
|
|
427
|
-
stores are skipped; snapshots support checks.
|
|
431
|
+
stores are skipped; snapshots support checks. Without
|
|
432
|
+
``report_foreign``, another database's store is only recorded in
|
|
433
|
+
``foreign`` (``doctor`` reports it itself).
|
|
428
434
|
"""
|
|
429
435
|
cache = HistoryState.load(self.runtime / "state.json")
|
|
430
436
|
self.cache = cache
|
|
@@ -461,13 +467,15 @@ class BaselineManager:
|
|
|
461
467
|
and state.database is not None
|
|
462
468
|
and state.database.root_uuid != identity.root_uuid
|
|
463
469
|
):
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
if report_foreign:
|
|
471
|
+
error(
|
|
472
|
+
f"{store_location(store)} holds the history of "
|
|
473
|
+
"another database (root group "
|
|
474
|
+
f"{state.database.root_uuid}, not "
|
|
475
|
+
f"{identity.root_uuid}): wrong `remote` or "
|
|
476
|
+
"`[baseline] dir`? It is neither read nor "
|
|
477
|
+
"published to."
|
|
478
|
+
)
|
|
471
479
|
self.foreign[store.name] = state.database.root_uuid
|
|
472
480
|
self.publication_outcomes[store.name] = "another database"
|
|
473
481
|
continue
|
|
@@ -237,6 +237,14 @@ def _build_parser() -> argparse.ArgumentParser:
|
|
|
237
237
|
command_parser.set_defaults(restore_mode="merge")
|
|
238
238
|
command_parser.add_argument("--dry-run", action="store_true")
|
|
239
239
|
elif name == "doctor":
|
|
240
|
+
command_parser.add_argument(
|
|
241
|
+
"--history",
|
|
242
|
+
action="store_true",
|
|
243
|
+
help=(
|
|
244
|
+
"also read each history store (the cloud and attached "
|
|
245
|
+
"drives) and check it records this database"
|
|
246
|
+
),
|
|
247
|
+
)
|
|
240
248
|
command_parser.add_argument(
|
|
241
249
|
"--self-test",
|
|
242
250
|
action="store_true",
|
|
@@ -686,7 +694,9 @@ def _dispatch(parser: argparse.ArgumentParser, args) -> int:
|
|
|
686
694
|
if args.command == "doctor":
|
|
687
695
|
from kp_sync.integration import doctor
|
|
688
696
|
|
|
689
|
-
checks = doctor(
|
|
697
|
+
checks = doctor(
|
|
698
|
+
config, self_test=args.self_test, history=args.history
|
|
699
|
+
)
|
|
690
700
|
for check in checks:
|
|
691
701
|
print(_doctor_line(check))
|
|
692
702
|
return 0 if all(check.ok for check in checks) else 1
|
|
@@ -3034,8 +3034,8 @@ class SyncEngine:
|
|
|
3034
3034
|
if password != previous and not self._opens_an_observed_copy(
|
|
3035
3035
|
password, key_file
|
|
3036
3036
|
):
|
|
3037
|
-
# A mistyped password must not stay cached
|
|
3038
|
-
#
|
|
3037
|
+
# A mistyped password must not stay cached until
|
|
3038
|
+
# the keyring times out. Copies may differ after a
|
|
3039
3039
|
# password change, so any accepting copy suffices.
|
|
3040
3040
|
forget = getattr(self.credentials, "forget", None)
|
|
3041
3041
|
if forget is not None:
|
|
@@ -3051,6 +3051,82 @@ class SyncEngine:
|
|
|
3051
3051
|
raise SyncError(str(exc)) from exc
|
|
3052
3052
|
raise SyncError("the supplied password was rejected three times")
|
|
3053
3053
|
|
|
3054
|
+
def _verify_first_version(
|
|
3055
|
+
self, source: Observation, password: str, key_file: Path
|
|
3056
|
+
):
|
|
3057
|
+
return verify_candidate(
|
|
3058
|
+
source.local_path,
|
|
3059
|
+
password=password,
|
|
3060
|
+
key_file=key_file,
|
|
3061
|
+
require_keepassxc=True,
|
|
3062
|
+
max_entry_drop=self.config.verify["max_entry_drop"],
|
|
3063
|
+
min_entry_drop=self.config.verify["min_entry_drop"],
|
|
3064
|
+
)
|
|
3065
|
+
|
|
3066
|
+
def _retry_first_version_password(
|
|
3067
|
+
self, source: Observation, cached: str, error: Exception
|
|
3068
|
+
):
|
|
3069
|
+
"""Ask once when the cached password does not open the copy.
|
|
3070
|
+
|
|
3071
|
+
A cached password is not checked when it is read: one left from
|
|
3072
|
+
a password change, or another database's under this profile,
|
|
3073
|
+
fails here. The key file fails the same way, so the cached
|
|
3074
|
+
password is kept unless a newly typed one opens the copy.
|
|
3075
|
+
Returns ``(verification, password, key_file)`` or a reason.
|
|
3076
|
+
"""
|
|
3077
|
+
reason = f"the copy cannot become the first version: {error}"
|
|
3078
|
+
try:
|
|
3079
|
+
if (
|
|
3080
|
+
cached in self._transient_passwords
|
|
3081
|
+
or self.credentials.cached_password() != cached
|
|
3082
|
+
):
|
|
3083
|
+
return reason
|
|
3084
|
+
self.ui.notify(
|
|
3085
|
+
"The cached password and the key file do not open the "
|
|
3086
|
+
"database copy."
|
|
3087
|
+
)
|
|
3088
|
+
typed = self.ui.password("KeePass database password")
|
|
3089
|
+
if typed is None:
|
|
3090
|
+
return reason
|
|
3091
|
+
if typed == cached:
|
|
3092
|
+
return (
|
|
3093
|
+
f"{reason}; the password was confirmed, so the key "
|
|
3094
|
+
"file may not be this database's"
|
|
3095
|
+
)
|
|
3096
|
+
key_file = self.credentials.key_file(self.ui)
|
|
3097
|
+
if key_file is None:
|
|
3098
|
+
self._restore_cached_password(cached)
|
|
3099
|
+
return reason
|
|
3100
|
+
try:
|
|
3101
|
+
verification = self._verify_first_version(
|
|
3102
|
+
source, typed, key_file
|
|
3103
|
+
)
|
|
3104
|
+
except VerificationCredentialError as exc:
|
|
3105
|
+
# Neither opens it: keep the earlier password (a daemon
|
|
3106
|
+
# client has already cached the typed one).
|
|
3107
|
+
self._restore_cached_password(cached)
|
|
3108
|
+
self.ui.notify(
|
|
3109
|
+
"The password does not open the database copy either."
|
|
3110
|
+
)
|
|
3111
|
+
return f"the copy cannot become the first version: {exc}"
|
|
3112
|
+
except VerificationError as exc:
|
|
3113
|
+
self.credentials.cache_password(typed)
|
|
3114
|
+
return f"the copy cannot become the first version: {exc}"
|
|
3115
|
+
self.credentials.cache_password(typed)
|
|
3116
|
+
except CredentialError as exc:
|
|
3117
|
+
return f"{reason}; the password cache failed: {exc}"
|
|
3118
|
+
self._known_credentials = [
|
|
3119
|
+
item for item in self._known_credentials if item[0] != cached
|
|
3120
|
+
]
|
|
3121
|
+
if (typed, key_file) not in self._known_credentials:
|
|
3122
|
+
self._known_credentials.append((typed, key_file))
|
|
3123
|
+
return verification, typed, key_file
|
|
3124
|
+
|
|
3125
|
+
def _restore_cached_password(self, password: str) -> None:
|
|
3126
|
+
# Only if replaced: caching it again would renew its timeout.
|
|
3127
|
+
if self.credentials.cached_password() != password:
|
|
3128
|
+
self.credentials.cache_password(password)
|
|
3129
|
+
|
|
3054
3130
|
def _cache_selected_password(self, password: str) -> None:
|
|
3055
3131
|
if password not in self._transient_passwords:
|
|
3056
3132
|
self.credentials.cache_password(password)
|
|
@@ -3499,18 +3575,18 @@ class SyncEngine:
|
|
|
3499
3575
|
password, key_file = self._request_credentials()
|
|
3500
3576
|
if password is None or key_file is None:
|
|
3501
3577
|
return wait(
|
|
3502
|
-
"the first version needs the password and a readable
|
|
3503
|
-
"file; copies were left unchanged"
|
|
3578
|
+
"the first version needs the password and a readable "
|
|
3579
|
+
"key file; copies were left unchanged"
|
|
3504
3580
|
)
|
|
3505
3581
|
try:
|
|
3506
|
-
verification =
|
|
3507
|
-
source
|
|
3508
|
-
password=password,
|
|
3509
|
-
key_file=key_file,
|
|
3510
|
-
require_keepassxc=True,
|
|
3511
|
-
max_entry_drop=self.config.verify["max_entry_drop"],
|
|
3512
|
-
min_entry_drop=self.config.verify["min_entry_drop"],
|
|
3582
|
+
verification = self._verify_first_version(
|
|
3583
|
+
source, password, key_file
|
|
3513
3584
|
)
|
|
3585
|
+
except VerificationCredentialError as exc:
|
|
3586
|
+
retried = self._retry_first_version_password(source, password, exc)
|
|
3587
|
+
if isinstance(retried, str):
|
|
3588
|
+
return wait(retried)
|
|
3589
|
+
verification, password, key_file = retried
|
|
3514
3590
|
except VerificationError as exc:
|
|
3515
3591
|
return wait(f"the copy cannot become the first version: {exc}")
|
|
3516
3592
|
if not verification.verified:
|
|
@@ -5302,11 +5378,14 @@ def endpoints_from_config(
|
|
|
5302
5378
|
run_directory: str | os.PathLike[str],
|
|
5303
5379
|
*,
|
|
5304
5380
|
rclone_daemons: dict | None = None,
|
|
5381
|
+
remove_stale_drives: bool = True,
|
|
5305
5382
|
) -> tuple[Endpoint, ...]:
|
|
5306
5383
|
"""Create endpoint adapters from configuration and attached drives.
|
|
5307
5384
|
|
|
5308
5385
|
Runtime-discovered sessions are added by ``session_endpoints``. This
|
|
5309
|
-
constructs adapters without probing remote endpoints.
|
|
5386
|
+
constructs adapters without probing remote endpoints. Read-only
|
|
5387
|
+
commands pass ``remove_stale_drives=False``: stale drive records
|
|
5388
|
+
are then skipped but left for the daemon's drive handling.
|
|
5310
5389
|
|
|
5311
5390
|
``rclone_daemons`` is the daemon's registry of owned ``rclone rcd``
|
|
5312
5391
|
transports for endpoints with ``rclone_transport = "auto"``, kept
|
|
@@ -5356,7 +5435,7 @@ def endpoints_from_config(
|
|
|
5356
5435
|
|
|
5357
5436
|
endpoints.extend(session_endpoints(config, run_directory))
|
|
5358
5437
|
try:
|
|
5359
|
-
drives = list_drives(run_directory)
|
|
5438
|
+
drives = list_drives(run_directory, remove_stale=remove_stale_drives)
|
|
5360
5439
|
except DriveError as exc:
|
|
5361
5440
|
raise SyncError(f"cannot inspect attached drives: {exc}") from exc
|
|
5362
5441
|
for drive in drives:
|