debkit 0.1.0__tar.gz → 0.1.1__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.
- {debkit-0.1.0 → debkit-0.1.1}/CONFIG.md +2 -2
- {debkit-0.1.0 → debkit-0.1.1}/CRYPTO.md +4 -4
- {debkit-0.1.0 → debkit-0.1.1}/EXCEPTIONS.md +1 -1
- {debkit-0.1.0 → debkit-0.1.1}/PKG-INFO +11 -11
- {debkit-0.1.0 → debkit-0.1.1}/README.md +9 -9
- {debkit-0.1.0 → debkit-0.1.1}/ROADMAP.md +7 -11
- {debkit-0.1.0 → debkit-0.1.1}/SETUP.md +14 -4
- {debkit-0.1.0 → debkit-0.1.1}/STORAGE.md +1 -2
- {debkit-0.1.0 → debkit-0.1.1}/STRUCTURE.md +1 -1
- {debkit-0.1.0 → debkit-0.1.1}/STYLE.md +1 -1
- {debkit-0.1.0 → debkit-0.1.1}/VALIDATION.md +18 -7
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/README.md +1 -1
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/action_pkg_insert.md +21 -4
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/action_pkg_remove.md +2 -2
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/action_sync.md +22 -6
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-insert-activity.puml +10 -2
- debkit-0.1.1/docs/development/diagrams/action-pkg-insert-activity.svg +2 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-insert-sequence.puml +9 -2
- debkit-0.1.1/docs/development/diagrams/action-pkg-insert-sequence.svg +2 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/repo-sync-indices-sequence.puml +9 -2
- debkit-0.1.1/docs/development/diagrams/repo-sync-indices-sequence.svg +2 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/repo_sync_indices.md +15 -7
- {debkit-0.1.0 → debkit-0.1.1}/docs/guides/examples.md +2 -2
- {debkit-0.1.0 → debkit-0.1.1}/pyproject.toml +2 -2
- {debkit-0.1.0 → debkit-0.1.1}/scripts/check_docs.py +1 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/action/action_pkg.py +21 -14
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/__init__.py +43 -14
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/compress.py +7 -26
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/debfile.py +25 -5
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/hashes.py +62 -5
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/packages.py +16 -18
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/release.py +4 -16
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/repo_rw.py +24 -19
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/repo_sync.py +12 -3
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/shared_root.py +2 -2
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/factories.py +30 -8
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_action_pkg.py +97 -1
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_action_sync.py +51 -8
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_check_docs.py +3 -2
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_cli_main.py +3 -1
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_compress.py +18 -38
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_debfile.py +27 -3
- debkit-0.1.1/tests/test_hashes.py +149 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_packages.py +25 -9
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_release.py +10 -23
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_repo.py +109 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_repo_rw.py +65 -16
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_repo_sync.py +38 -5
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_sources.py +2 -0
- {debkit-0.1.0 → debkit-0.1.1}/uv.lock +6 -5
- debkit-0.1.0/docs/development/diagrams/action-pkg-insert-activity.svg +0 -2
- debkit-0.1.0/docs/development/diagrams/action-pkg-insert-sequence.svg +0 -2
- debkit-0.1.0/docs/development/diagrams/repo-sync-indices-sequence.svg +0 -2
- debkit-0.1.0/tests/test_hashes.py +0 -75
- {debkit-0.1.0 → debkit-0.1.1}/.gitignore +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/AGENTS.md +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/CLAUDE.md +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/LICENSE +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/TESTING.md +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-remove-activity.puml +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-remove-activity.svg +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-remove-sequence.puml +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-pkg-remove-sequence.svg +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-sync-activity.puml +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-sync-activity.svg +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-sync-sequence.puml +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/action-sync-sequence.svg +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/repo-sync-indices-activity.puml +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/development/diagrams/repo-sync-indices-activity.svg +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/docs/guides/README.md +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/scripts/render_diagrams.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/__init__.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/__main__.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/_env.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/_escape.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/_logging.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/_options.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/action/__init__.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/action/action_history.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/action/action_sync.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/argparser.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/argtypes.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/cli.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/changes.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/component.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/gnupg.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/index_selection.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/package.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/params.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/repo_diff.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/sources.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/src/debkit/repo/stanza.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/conftest.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/__init__.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/binaries.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/gpg.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/storage.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/helpers/trees.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_action.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_action_history.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_argparser.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_argtypes.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_changes.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_component.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_env.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_gnupg.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_gnupg_real.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_index_selection.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_logging.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_package.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_params.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_render_diagrams.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_repo_diff.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_repo_package.py +0 -0
- {debkit-0.1.0 → debkit-0.1.1}/tests/test_stanza.py +0 -0
|
@@ -151,10 +151,10 @@ Uses `--target-url`, whose dist and component fields are optional and ignored; a
|
|
|
151
151
|
secret, but is never logged next to the secret.
|
|
152
152
|
- Userinfo and query of a repository or storage URL are secrets: debkit logs and raises a URL only
|
|
153
153
|
through txstore's `redact_url` →
|
|
154
|
-
[txstore CONFIG.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
154
|
+
[txstore CONFIG.md](https://github.com/vinklat/txstore/blob/v0.1.3/CONFIG.md#secrets).
|
|
155
155
|
- A credentialed URL goes in its variable (`DEBKIT_TARGET_URL`, `DEBKIT_SOURCE_URL`,
|
|
156
156
|
`DEBKIT_INCOMING_URL`) or, for `http(s)://`, in `~/.netrc` →
|
|
157
|
-
[txstore CONFIG.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
157
|
+
[txstore CONFIG.md](https://github.com/vinklat/txstore/blob/v0.1.3/CONFIG.md#secrets); the
|
|
158
158
|
`--*-url` flags take the same value but expose it on the command line like any flag.
|
|
159
159
|
|
|
160
160
|
## Maintenance
|
|
@@ -51,14 +51,14 @@ Implemented by `GnuPG`, `cleartext_body`, and `canonical_text` in `repo/gnupg.py
|
|
|
51
51
|
## Checksums
|
|
52
52
|
|
|
53
53
|
Digest helpers and the algorithm-name lists are txstore's →
|
|
54
|
-
[txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
54
|
+
[txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#digests); the Debian
|
|
55
55
|
hash-block layer over them is `repo/hashes.py`.
|
|
56
56
|
|
|
57
57
|
| Item | Rule |
|
|
58
58
|
| -- | -- |
|
|
59
59
|
| Algorithms | `MD5Sum`, `SHA1`, `SHA256`, `SHA512`; `MD5Sum` exists for Debian compatibility and new behavior never relies on it alone. |
|
|
60
|
-
| `SHA1` | A `SHA1`-only record verifies: debkit filters nothing from txstore's comparison list; how algorithms combine → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
61
|
-
| `ChecksumOpen`, `calc_digests`, `compare_digests`, `normalize_digests` | txstore; comparison semantics, including that MD5 alone never makes a match → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
60
|
+
| `SHA1` | A `SHA1`-only record verifies: debkit filters nothing from txstore's comparison list; how algorithms combine → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#digests); requiring `SHA256` or `SHA512` → [ROADMAP.md](ROADMAP.md#ideas). |
|
|
61
|
+
| `ChecksumOpen`, `calc_digests`, `compare_digests`, `normalize_digests` | txstore; comparison semantics, including that MD5 alone never makes a match → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#digests). |
|
|
62
62
|
| Non-overlapping, unknown, or mismatched digests | `verify_checksum` returns `False`; what each path raises or logs → [Verification failures](#verification-failures). |
|
|
63
63
|
| Hash blocks | `parse_hash_block()` in `repo/hashes.py` splits a `Release` hash field, a `Checksums-<algorithm>` field, or a `Sources` `Files` field into `(digest, size, filename)` triples; a trailing partial run is dropped. |
|
|
64
64
|
| Index skip during sync | The target `Release` digest block is compared before the stored object metadata; which entries that settles → [VALIDATION.md](VALIDATION.md#index-selection). |
|
|
@@ -105,7 +105,7 @@ what an older Release no longer lists.
|
|
|
105
105
|
| Source `Date` missing while the loaded target has a `Date` | → `ReleaseFreshnessException` (Distrustful) |
|
|
106
106
|
| Source `Date` or `Valid-Until` malformed → [VALIDATION.md](VALIDATION.md#release-dates) | → `ReleaseFreshnessException` (Distrustful) |
|
|
107
107
|
| Target trust | The operator owns the target, so its Release sets the floor unverified: whoever can write the target can roll it back directly, and `--allow-release-rollback` recovers from a bad floor. |
|
|
108
|
-
| Target compared | The target as read under txstore's `history_lock` → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
108
|
+
| Target compared | The target as read under txstore's `history_lock` → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#locking), so a peer commit that lands before the lock is granted is the floor; `--verify-existing` checks that same read |
|
|
109
109
|
| Target reset as corrupt | Its indices are ignored → [Verification failures](#verification-failures), but the `Date` its Release carried before the reset stays the floor |
|
|
110
110
|
| Later pass | The source is compared with the staged target and with the target as the run found it, so a staged target cannot lower the floor |
|
|
111
111
|
| Target loaded from `InRelease` | Its `Date` is read from the signed body → [GPG](#gpg), even though the target is not verified |
|
|
@@ -35,6 +35,7 @@ statuses. Routing → [AGENTS.md](AGENTS.md#canonical-sources).
|
|
|
35
35
|
| `ChecksumException` | `repo/hashes.py` | Digest mismatch or distrustful object |
|
|
36
36
|
| `StorageException` | `txstore` | Backend failure; its remapping at construction → [STORAGE.md](STORAGE.md#construction) |
|
|
37
37
|
| `StorageNotFoundException` | `txstore` | Object missing on `get` / `get_stream`; subclass of `StorageException` |
|
|
38
|
+
| `StorageNotSupportedException` | `txstore` | Operation a read-only, write-only, or non-transactional backend lacks; subclass of `StorageException` and `NotImplementedError` |
|
|
38
39
|
|
|
39
40
|
## CLI exit groups
|
|
40
41
|
|
|
@@ -55,7 +56,6 @@ Exits outside the groups:
|
|
|
55
56
|
| -- | -- |
|
|
56
57
|
| Argparse usage error, including `ArgumentTypeError` from a type converter, an invalid `DEBKIT_*` value, or a missing required option | Usage text, status 2 (group Usage) |
|
|
57
58
|
| `check` finds an inconsistent repository | `Repository is not consistent.`, status 1 |
|
|
58
|
-
| `NotImplementedError` from a capability stub | Uncaught → [ROADMAP.md](ROADMAP.md#known-deviations) |
|
|
59
59
|
| A builtin `ValueError` or other programming error | Uncaught: a traceback, never an input-error message |
|
|
60
60
|
|
|
61
61
|
## Orchestration vs repo semantics
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: debkit
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Build, mirror, and verify Debian package repositories on filesystem, S3, and HTTP storage.
|
|
5
5
|
Project-URL: Homepage, https://github.com/vinklat/debkit
|
|
6
6
|
Project-URL: Source, https://github.com/vinklat/debkit
|
|
@@ -26,7 +26,7 @@ Requires-Python: >=3.13
|
|
|
26
26
|
Requires-Dist: humanize<5,>=4.14.0
|
|
27
27
|
Requires-Dist: python-debian<2,>=1.0.1
|
|
28
28
|
Requires-Dist: python-gnupg<0.6,>=0.5.5
|
|
29
|
-
Requires-Dist: txstore<0.2,>=0.1.
|
|
29
|
+
Requires-Dist: txstore<0.2,>=0.1.3
|
|
30
30
|
Requires-Dist: urllib3<3,>=2.7.0
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ Command-line tool for building, inspecting, and mirroring Debian package reposit
|
|
|
36
36
|
filesystem, S3-compatible object storage, or HTTP(S) servers, with GPG-signed Release files,
|
|
37
37
|
streamed checksum verification, and transactional writes you can revert.
|
|
38
38
|
|
|
39
|
-
Current version: **0.1.
|
|
39
|
+
Current version: **0.1.1**. Planned work → [ROADMAP.md](https://github.com/vinklat/debkit/blob/v0.1.1/ROADMAP.md).
|
|
40
40
|
|
|
41
41
|
## Capabilities
|
|
42
42
|
|
|
@@ -58,8 +58,8 @@ Current version: **0.1.0**. Planned work → [ROADMAP.md](https://github.com/vin
|
|
|
58
58
|
### Installation
|
|
59
59
|
|
|
60
60
|
Released versions are published to [PyPI](https://pypi.org/project/debkit/). Prerequisites →
|
|
61
|
-
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
62
|
-
[Quick how-to](https://github.com/vinklat/debkit/blob/v0.1.
|
|
61
|
+
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.1/SETUP.md#prerequisites-and-install). Other examples →
|
|
62
|
+
[Quick how-to](https://github.com/vinklat/debkit/blob/v0.1.1/docs/guides/examples.md).
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
pip install debkit
|
|
@@ -122,17 +122,17 @@ debkit --target-url /srv/repo log
|
|
|
122
122
|
| Location | Audience | Authority |
|
|
123
123
|
| -- | -- | -- |
|
|
124
124
|
| `/` root contract documents | Developers and AI agents | Canonical |
|
|
125
|
-
| [docs/guides/](https://github.com/vinklat/debkit/blob/v0.1.
|
|
126
|
-
| [docs/development/](https://github.com/vinklat/debkit/blob/v0.1.
|
|
125
|
+
| [docs/guides/](https://github.com/vinklat/debkit/blob/v0.1.1/docs/guides/README.md) | Anyone operating the CLI | Non-canonical how-tos and examples |
|
|
126
|
+
| [docs/development/](https://github.com/vinklat/debkit/blob/v0.1.1/docs/development/README.md) | Developers and contributors | Non-canonical diagrams, code maps, explanations |
|
|
127
127
|
|
|
128
|
-
Domain owners and agent navigation → [AGENTS.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
128
|
+
Domain owners and agent navigation → [AGENTS.md](https://github.com/vinklat/debkit/blob/v0.1.1/AGENTS.md#canonical-sources).
|
|
129
129
|
|
|
130
130
|
## Technology
|
|
131
131
|
|
|
132
132
|
Python and [txstore](https://github.com/vinklat/txstore); runtime dependencies →
|
|
133
|
-
[STRUCTURE.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
134
|
-
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
133
|
+
[STRUCTURE.md](https://github.com/vinklat/debkit/blob/v0.1.1/STRUCTURE.md#dependencies). Tests and gates use pytest, Ruff, and mypy →
|
|
134
|
+
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.1/SETUP.md#quality-gates).
|
|
135
135
|
|
|
136
136
|
## License
|
|
137
137
|
|
|
138
|
-
MIT → [LICENSE](https://github.com/vinklat/debkit/blob/v0.1.
|
|
138
|
+
MIT → [LICENSE](https://github.com/vinklat/debkit/blob/v0.1.1/LICENSE).
|
|
@@ -4,7 +4,7 @@ Command-line tool for building, inspecting, and mirroring Debian package reposit
|
|
|
4
4
|
filesystem, S3-compatible object storage, or HTTP(S) servers, with GPG-signed Release files,
|
|
5
5
|
streamed checksum verification, and transactional writes you can revert.
|
|
6
6
|
|
|
7
|
-
Current version: **0.1.
|
|
7
|
+
Current version: **0.1.1**. Planned work → [ROADMAP.md](https://github.com/vinklat/debkit/blob/v0.1.1/ROADMAP.md).
|
|
8
8
|
|
|
9
9
|
## Capabilities
|
|
10
10
|
|
|
@@ -26,8 +26,8 @@ Current version: **0.1.0**. Planned work → [ROADMAP.md](https://github.com/vin
|
|
|
26
26
|
### Installation
|
|
27
27
|
|
|
28
28
|
Released versions are published to [PyPI](https://pypi.org/project/debkit/). Prerequisites →
|
|
29
|
-
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
30
|
-
[Quick how-to](https://github.com/vinklat/debkit/blob/v0.1.
|
|
29
|
+
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.1/SETUP.md#prerequisites-and-install). Other examples →
|
|
30
|
+
[Quick how-to](https://github.com/vinklat/debkit/blob/v0.1.1/docs/guides/examples.md).
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
pip install debkit
|
|
@@ -90,17 +90,17 @@ debkit --target-url /srv/repo log
|
|
|
90
90
|
| Location | Audience | Authority |
|
|
91
91
|
| -- | -- | -- |
|
|
92
92
|
| `/` root contract documents | Developers and AI agents | Canonical |
|
|
93
|
-
| [docs/guides/](https://github.com/vinklat/debkit/blob/v0.1.
|
|
94
|
-
| [docs/development/](https://github.com/vinklat/debkit/blob/v0.1.
|
|
93
|
+
| [docs/guides/](https://github.com/vinklat/debkit/blob/v0.1.1/docs/guides/README.md) | Anyone operating the CLI | Non-canonical how-tos and examples |
|
|
94
|
+
| [docs/development/](https://github.com/vinklat/debkit/blob/v0.1.1/docs/development/README.md) | Developers and contributors | Non-canonical diagrams, code maps, explanations |
|
|
95
95
|
|
|
96
|
-
Domain owners and agent navigation → [AGENTS.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
96
|
+
Domain owners and agent navigation → [AGENTS.md](https://github.com/vinklat/debkit/blob/v0.1.1/AGENTS.md#canonical-sources).
|
|
97
97
|
|
|
98
98
|
## Technology
|
|
99
99
|
|
|
100
100
|
Python and [txstore](https://github.com/vinklat/txstore); runtime dependencies →
|
|
101
|
-
[STRUCTURE.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
102
|
-
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.
|
|
101
|
+
[STRUCTURE.md](https://github.com/vinklat/debkit/blob/v0.1.1/STRUCTURE.md#dependencies). Tests and gates use pytest, Ruff, and mypy →
|
|
102
|
+
[SETUP.md](https://github.com/vinklat/debkit/blob/v0.1.1/SETUP.md#quality-gates).
|
|
103
103
|
|
|
104
104
|
## License
|
|
105
105
|
|
|
106
|
-
MIT → [LICENSE](https://github.com/vinklat/debkit/blob/v0.1.
|
|
106
|
+
MIT → [LICENSE](https://github.com/vinklat/debkit/blob/v0.1.1/LICENSE).
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
| Phase | Status | Feature | Notes |
|
|
6
6
|
| -- | -- | -- | -- |
|
|
7
|
-
| 0.1.0 | ✅ | Initial public release | Insert, remove, inspect, sync, and check Debian repositories on fs, S3, and HTTP via txstore; transactional writes with history
|
|
8
|
-
| 0.
|
|
9
|
-
| 0.
|
|
7
|
+
| 0.1.0 | ✅ | Initial public release | Insert, remove, inspect, sync, and check Debian repositories on fs, S3, and HTTP via txstore; transactional writes with history |
|
|
8
|
+
| 0.1.1 | ✅ | Storage size and error limits | Recorded-`Size` caps and mapped storage stream errors |
|
|
9
|
+
| 0.2.0 | ⏳ | Debian package `debkit` | Waits for txstore 0.2.0, its Debian package → [SETUP.md](SETUP.md#dependency-policy); the `debian-testing` CI job then installs txstore from apt → [known deviations](#known-deviations) |
|
|
10
10
|
|
|
11
11
|
## Ideas
|
|
12
12
|
|
|
@@ -17,14 +17,14 @@ or the work is planned; drop it when it no longer applies.
|
|
|
17
17
|
| -- | -- | -- |
|
|
18
18
|
| Typed settings object passed to actions instead of the argparse `Namespace`; it also carries the parsed `--architectures` and `--indices-exclude` selection `_selection()` returns as a tuple | An action is called from Python rather than the CLI | [STRUCTURE.md](STRUCTURE.md#dependencies) |
|
|
19
19
|
| Immutable `RepoParams` holding location only, with the run's `VerifyPolicy` passed to `Repo*` beside it instead of the `verify_gpg` and `verify_digests` fields | The typed settings idea starts, or a second caller builds `RepoParams` | [CRYPTO.md](CRYPTO.md#verification-switches) |
|
|
20
|
-
|
|
|
20
|
+
| `insert` and `remove` of source packages; `insert` refuses them and `remove` keeps their payloads today | A user publishes source packages, or the `IndexKind` work starts | [VALIDATION.md](VALIDATION.md#sources-stanzas) |
|
|
21
21
|
| One deb822 stanza reader and writer for `Release`, `.changes`, and `Sources`, which still read through the email parser, with the repeated-field and blank-line rules as its parameters; the email parser also matches field names case-sensitively, so a lowercase `sha256:` Release block is ignored, where Debian Policy 5.1 makes names case-insensitive | A fourth stanza rule diverges between the email parser and `debian.deb822` | [VALIDATION.md](VALIDATION.md#release-fields) |
|
|
22
22
|
| Mirror `by-hash/` indices | A mirror's clients rely on `Acquire-By-Hash` | [VALIDATION.md](VALIDATION.md#repository-index-paths) |
|
|
23
23
|
| `ReleaseKey`/`StoragePath` NewTypes and a coordinate-aware `Packages` owning its component, arch, and codec; a `Repo.slots()` iterator over it would then replace the hand-written component and arch walks in `repo/__init__.py`, `repo/shared_root.py`, and `ActionPkg`, resolve the component and arch selection once, and rename `Packages.packages` | A fifth raw `component.packages` walk outside `Component`, or `IndexKind` or `Layout` starts | [STRUCTURE.md](STRUCTURE.md#layout) |
|
|
24
24
|
| Split `ActionPkg` into its read-only views, `ActionInsert`, and `ActionRemove`, and `ActionHistory` per subcommand, as `ActionSync` and `ActionCheck` are, so no action reads its subcommand's flags as optional | The typed settings idea starts, or the `ActionPkg.insert` placement moves into `RepoRW` | [STRUCTURE.md](STRUCTURE.md#layout) |
|
|
25
25
|
| `SyncPlanner(source, target, listing)` returning the `SyncPlan`, so `RepoSync` keeps only the transfer, with an optional listing replacing the `existing_files`/`can_list` pair | The `ActionSync` sync policy moves into a repo-level use case, or `RepoSync` gains a second caller | [STRUCTURE.md](STRUCTURE.md#layout) |
|
|
26
26
|
| `ComponentRelease` split out of `Release`, so `load_component` and `setup_component` cannot be called on a `RootRelease` | A third Release role, or a caller of either method on the root | [STRUCTURE.md](STRUCTURE.md#layout) |
|
|
27
|
-
| `IndexKind` value object owning the arch directory, index name, container class, and writability, replacing the `SOURCE_ARCH` comparisons | A second index kind is written, or
|
|
27
|
+
| `IndexKind` value object owning the arch directory, index name, container class, and writability, replacing the `SOURCE_ARCH` comparisons | A second index kind is written, or `insert` of source packages starts | [STRUCTURE.md](STRUCTURE.md#dependencies) |
|
|
28
28
|
| Decode a `.zst` `control.tar` in process with `compression.zstd`, capped by `ZstdDecompressor.decompress(max_length=…)`, replacing the `zstd` subprocess and the `zstd` binary prerequisite | `requires-python` rises to 3.14, once Debian testing no longer ships Python 3.13 | [VALIDATION.md](VALIDATION.md#object-sizes) |
|
|
29
29
|
| Require `SHA256` or `SHA512` for payload, index, and shared-root replace decisions, so a `SHA1`-only record no longer verifies | A mirrored source publishes `SHA1`-only records, or a publisher is not trusted with its own payloads | [CRYPTO.md](CRYPTO.md#checksums) |
|
|
30
30
|
| `insert` reads each `.deb` control from the stored copy after its `.changes` digest check, so the index stanza and the verified payload come from one read | The pool key no longer needs the control before the transfer | [CRYPTO.md](CRYPTO.md#verification-failures) |
|
|
@@ -40,14 +40,10 @@ TODOs; remove a row when the code meets the rule.
|
|
|
40
40
|
| Contract | Deviation | Source |
|
|
41
41
|
| -- | -- | -- |
|
|
42
42
|
| [VALIDATION.md](VALIDATION.md#sources-stanzas) | Read-only-ness on the insert path is inferred per call site: `RepoRW.binary_archs` filters on the source architecture, and the `.changes` and control-field checks refuse it before the transfer. `remove` and `save` already rely on `Sources` returning the base contract's "nothing changed"; a read-only base shared by `Packages` and `Sources` would own insert too. | `repo/repo_rw.py` `RepoRW.binary_archs`, `action/action_pkg.py` `_target_archs` |
|
|
43
|
-
| [STYLE.md](STYLE.md#layers) | `ActionPkg.insert` places each `.deb` in the pool, checks it against its `.changes` digest, and refuses other bytes under a held pool key through `RepoRW.held_digests`, repo logic an action does not own; it moves into `RepoRW` with the `IndexKind` [idea](#ideas). | `action/action_pkg.py` `insert` |
|
|
43
|
+
| [STYLE.md](STYLE.md#layers) | `ActionPkg.insert` places each `.deb` in the pool, caps its reads at its `.changes` `Size`, checks it against its `.changes` digest, and refuses other bytes under a held pool key through `RepoRW.held_digests`, repo logic an action does not own; it moves into `RepoRW` with the `IndexKind` [idea](#ideas). | `action/action_pkg.py` `insert` |
|
|
44
44
|
| [CRYPTO.md](CRYPTO.md#verification-failures) | `insert` builds the index stanza from a first read of each `.deb` and checks its `.changes` digest on the transfer, a second read, so an incoming-storage writer racing the two could pair other control fields with the verified payload. | `action/action_pkg.py` `insert` |
|
|
45
45
|
| [STYLE.md](STYLE.md#layers) | `ActionSync` decides the sync policy itself: the target reset after a checksum failure, the freshness floors of each pass, and the verify-before-sync order; it moves into a repo-level use case with the typed settings [idea](#ideas), when an action is called from Python. | `action/action_sync.py` `sync`, `_load_target`, `_sync_until_settled` |
|
|
46
46
|
| [VALIDATION.md](VALIDATION.md#index-selection) | A component nested below a selected one, as `main/debug` below `--components main`, keeps its indices, since selection splits a key at the longest selected component, while its payloads are never loaded, so the mirror lists packages it lacks. | `repo/index_selection.py` `_split_component` |
|
|
47
|
-
| [EXCEPTIONS.md](EXCEPTIONS.md#cli-exit-groups) | `NotImplementedError` from a read-only, write-only, or non-transactional txstore backend is in no exit group and surfaces as a traceback. | `cli.py` |
|
|
48
47
|
| [VALIDATION.md](VALIDATION.md#repository-index-paths) | `by-hash/` objects are not mirrored because the root `Release` does not list them; an apt client of a mirror whose `Release` advertises `Acquire-By-Hash: yes` falls back to the canonical index path after a 404. | `repo/__init__.py` `Repo._get_indices` |
|
|
49
|
-
| [
|
|
50
|
-
| [VALIDATION.md](VALIDATION.md#object-sizes) | A sync or insert transfer streams the whole source object before its digests and `Size` are checked, so a hostile source can fill the target with an endless body; txstore's `transfer` takes no limit to stop at the recorded `Size`. | `repo/repo_rw.py` `RepoRW.transfer_from` |
|
|
51
|
-
| [VALIDATION.md](VALIDATION.md#object-sizes) | `read_capped()` reads through txstore's `get_stream`, so a backend error raised while an S3 or HTTP stream is read, such as botocore's `ResponseStreamingError` or urllib3's `ProtocolError`, escapes unwrapped instead of as `StorageException`; txstore's capped `get` would map it as its `get` does. | `repo/compress.py` `read_capped` |
|
|
52
|
-
| [VALIDATION.md](VALIDATION.md#object-sizes) | An upload on a backend that cannot stream is read whole with `storage.get` before the control caps apply, so its size is bounded only by the backend. | `repo/debfile.py` `DebFile._read_control` |
|
|
48
|
+
| [VALIDATION.md](VALIDATION.md#object-sizes) | An upload inserted with `--deb-filename`, without digest verification, or listed in its `.changes` with no usable `Size`, on a backend that cannot seek, is read whole with `storage.get` before the control caps apply, since no checked `Size` bounds it and python-debian's `ArFile` seeks; only the backend bounds its size. | `repo/debfile.py` `DebFile._read_control` |
|
|
53
49
|
| [SETUP.md](SETUP.md#dependency-policy) | The `debian-testing` CI job installs txstore from PyPI, since Debian does not package it yet; every other dependency comes from apt. | `.github/debian-test.sh` |
|
|
@@ -130,15 +130,25 @@ A floor raise names the Debian testing version that satisfies it in the change d
|
|
|
130
130
|
|
|
131
131
|
## Upgrade notes
|
|
132
132
|
|
|
133
|
+
### 0.1.1
|
|
134
|
+
|
|
135
|
+
Size-capped storage reads on txstore 0.1.3.
|
|
136
|
+
|
|
137
|
+
| Change | Migration |
|
|
138
|
+
| -- | -- |
|
|
139
|
+
| txstore | Requires txstore 0.1.3 or later → [Dependency policy](#dependency-policy). |
|
|
140
|
+
| Unsupported operation | An operation the backend lacks is now a `StorageNotSupportedException` instead of a bare `NotImplementedError`, handled like any storage failure → [EXCEPTIONS.md](EXCEPTIONS.md#domain-exceptions). |
|
|
141
|
+
| Oversized objects | A checked copy longer than its recorded `Size` stops → `ChecksumException` (Distrustful); when a cap applies → [VALIDATION.md](VALIDATION.md#object-sizes). |
|
|
142
|
+
| Stream read failures | A backend error while an S3 or HTTP body is read is now a `StorageException` instead of escaping unwrapped → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#storage-abi). |
|
|
143
|
+
| Stream read failures in a sync copy | A failed copy is retried, then → `RepoSyncException` (Sync) → [EXCEPTIONS.md](EXCEPTIONS.md#cli-exit-groups). |
|
|
144
|
+
| Read metrics | A read refused at its cap counts one read error and no read bytes in the `-o json` metrics → [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#storage-abi). |
|
|
145
|
+
|
|
133
146
|
### 0.1.0
|
|
134
147
|
|
|
135
|
-
Initial public release
|
|
136
|
-
txstore storage package; repositories, footmarks, and `.transactions.json` histories written by
|
|
137
|
-
either tool are read by the other.
|
|
148
|
+
Initial public release, on the public txstore storage package.
|
|
138
149
|
|
|
139
150
|
| Change | Migration |
|
|
140
151
|
| -- | -- |
|
|
141
|
-
| Command and package | `repo-deb-factory` → `debkit`; `python -m repo_deb_factory` → `python -m debkit`. |
|
|
142
152
|
| Variables | Every variable gains the `DEBKIT_` prefix: `TARGET_URL` → `DEBKIT_TARGET_URL`, `S3_SECRET` → `DEBKIT_S3_SECRET`, and so on → [CONFIG.md](CONFIG.md). |
|
|
143
153
|
| Switches | `--skip-verify 1` → `--skip-verify`; `--skip-verify-gpg false` → omit it or pass `--no-skip-verify-gpg`. The same holds for `--skip-verify-ssl` and `--allow-release-rollback`. |
|
|
144
154
|
| Logging | `-l` gains `DEBKIT_LOG_LEVEL` and drops `TRACING`; `--log-format json` is new. |
|
|
@@ -6,7 +6,7 @@ commands. Routing → [AGENTS.md](AGENTS.md#canonical-sources).
|
|
|
6
6
|
Storage is the [txstore](https://github.com/vinklat/txstore) package; its contracts own the
|
|
7
7
|
`Storage` interface, backends, transactions, footmarks, history files, retention rules, locking, S3
|
|
8
8
|
ACL handling, and digests →
|
|
9
|
-
[txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
9
|
+
[txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md). This file states
|
|
10
10
|
only what debkit chooses.
|
|
11
11
|
|
|
12
12
|
## Construction
|
|
@@ -26,7 +26,6 @@ storage → [STYLE.md](STYLE.md#layers).
|
|
|
26
26
|
| Rejected URL | → [VALIDATION.md](VALIDATION.md#storage-urls) |
|
|
27
27
|
| Construction failure | `make_storage` raising `StorageException` (empty URL, no host, unresolved S3 key, uncreatable path): `--target-url` or `--source-url` → `RepoReadException` (Read). |
|
|
28
28
|
| Construction failure, plain URL | The same on `--incoming-url` or a `log`, `revert`, or `prune` target → `StorageException` (Generic). |
|
|
29
|
-
| Digest sink | A storage built outside `open_storage()` → [ROADMAP.md](ROADMAP.md#known-deviations). |
|
|
30
29
|
|
|
31
30
|
## Storage errors
|
|
32
31
|
|
|
@@ -36,7 +36,7 @@ Owns: directories, module ownership, internal import directions, and the txstore
|
|
|
36
36
|
| `src/debkit/repo/debfile.py` | `.deb` introspection. |
|
|
37
37
|
| `src/debkit/repo/compress.py` | Index codecs that stop at a size limit → [VALIDATION.md](VALIDATION.md#index-decoding); `codec_for()` picks one by suffix → [VALIDATION.md](VALIDATION.md#repository-index-paths); `read_capped()` and `zstd_decompress()` cap a read or decode → [VALIDATION.md](VALIDATION.md#object-sizes). |
|
|
38
38
|
| `src/debkit/repo/gnupg.py` | GPG sign/verify wrapper → [CRYPTO.md](CRYPTO.md#gpg). |
|
|
39
|
-
| `src/debkit/repo/hashes.py` | Debian hash blocks: `parse_hash_block()`, `parse_size()`, `has_sha()`, `HexDigests`, `ChecksumException`; the algorithm-name lists are imported from txstore directly → [CRYPTO.md](CRYPTO.md#checksums). |
|
|
39
|
+
| `src/debkit/repo/hashes.py` | Debian hash blocks: `parse_hash_block()`, `parse_size()`, `largest_recorded_size()`, `has_sha()`, `HexDigests`, `ChecksumException`, `refuse_past_recorded_size()`; the algorithm-name lists are imported from txstore directly → [CRYPTO.md](CRYPTO.md#checksums). |
|
|
40
40
|
| `tests/` | Test suite → [TESTING.md](TESTING.md#file-layout). |
|
|
41
41
|
| `scripts/check_docs.py` | Contract-doc gate → [SETUP.md](SETUP.md#quality-gates). |
|
|
42
42
|
| `scripts/render_diagrams.py` | PlantUML renderer and freshness checker → [SETUP.md](SETUP.md#diagrams). |
|
|
@@ -50,7 +50,7 @@ Import directions → [STRUCTURE.md](STRUCTURE.md#dependencies).
|
|
|
50
50
|
|
|
51
51
|
| Concern | Rule |
|
|
52
52
|
| -- | -- |
|
|
53
|
-
| Large objects | Stream with `get_stream`, `put_stream`, and `transfer`; never load a package just to digest it. |
|
|
53
|
+
| Large objects | Stream with `get_stream`, `put_stream`, and `transfer`, and digest with `get_digests`; never load a package just to digest it. |
|
|
54
54
|
| Digests | Reuse txstore's `ChecksumOpen` for in-flight calculation → [CRYPTO.md](CRYPTO.md#checksums). |
|
|
55
55
|
| Lookups | Avoid repeated full scans when a stable key lookup is available. |
|
|
56
56
|
|
|
@@ -17,7 +17,7 @@ skips, or recopies. Routing → [AGENTS.md](AGENTS.md#canonical-sources).
|
|
|
17
17
|
|
|
18
18
|
Implemented by `storage_url()` in `action/__init__.py` for `--target-url`, `--source-url`, and
|
|
19
19
|
`--incoming-url`; txstore validates what it receives →
|
|
20
|
-
[txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
20
|
+
[txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.3/VALIDATION.md#storage-urls),
|
|
21
21
|
including HTTP joins and the S3 path split.
|
|
22
22
|
|
|
23
23
|
| Rule | Constraint | Failure |
|
|
@@ -132,17 +132,28 @@ per entry by its transfer; the source is never probed.
|
|
|
132
132
|
## Object sizes
|
|
133
133
|
|
|
134
134
|
Release files, stored indices, and `.changes` files are read by `read_capped()` in
|
|
135
|
-
`repo/compress.py
|
|
136
|
-
|
|
135
|
+
`repo/compress.py` through txstore's capped `get` →
|
|
136
|
+
[txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#storage-abi), so each
|
|
137
|
+
is refused before it is verified or buffered in full. Sync and insert transfers stop the same way
|
|
138
|
+
and leave no target object. Upload control data is capped by `_control_of()` in `repo/debfile.py`,
|
|
137
139
|
which decodes the `control.tar` member under a limit and walks it as a stream. "Checked" means
|
|
138
|
-
digest verification is on.
|
|
140
|
+
digest verification is on. A recorded `Size` is only as trustworthy as the metadata that lists it:
|
|
141
|
+
without GPG verification the source sets both a body and its `Size` →
|
|
142
|
+
[CRYPTO.md](CRYPTO.md#verification-switches).
|
|
139
143
|
|
|
140
144
|
| Rule | Constraint | Failure |
|
|
141
145
|
| -- | -- | -- |
|
|
146
|
+
| Recorded `Size` | A run of at most `MAX_SIZE_DIGITS` (20) ASCII digits, read by `parse_size()` in `repo/hashes.py`. | Any other value → no `Size` recorded |
|
|
142
147
|
| Root Release files | `Release`, `InRelease`, and `Release.gpg` are at most `MAX_RELEASE_BYTES` (16 MiB): no signed file records their size. | → `ReleaseReadException` (Read) |
|
|
143
148
|
| Per-arch Release | At most the `Size` the checked root Release records, and never past `MAX_RELEASE_BYTES`. | Larger than recorded → `ChecksumException` (Distrustful); past the cap → `ReleaseReadException` (Read) |
|
|
144
149
|
| Stored index | At most the largest `Size` a checked root or per-arch Release records, and never past `MAX_INDICES_BYTES` (256 MiB), the decoded cap → [Index decoding](#index-decoding). | Larger than recorded → `ChecksumException` (Distrustful); past the cap → `PackagesException` (Read) |
|
|
150
|
+
| Stored index without a `Size` | A Release listing the index with no usable `Size` leaves only `MAX_INDICES_BYTES`. | Past the cap → `PackagesException` (Read) |
|
|
145
151
|
| `.changes` file | At most `MAX_CHANGES_BYTES` (4 MiB), read by `read_capped()` before `--changes-sha256` is checked. | → `ChangesException` (Read) |
|
|
152
|
+
| Sync transfer | At most the largest `Size` of the records `Repo.verify_checksum` checks the object against → [CRYPTO.md](CRYPTO.md#verification-order). | Larger than recorded → `ChecksumException` (Distrustful), not retried |
|
|
153
|
+
| Sync transfer without a `Size` | Unchecked, no record listing the object, or one listing it with no usable `Size` → no cap. | — |
|
|
154
|
+
| Insert payload | Each `.deb` a checked `.changes` lists is at most the `Size` it records, on its transfer and on a whole-file read by a backend that cannot seek. | Larger than recorded → `ChecksumException` (Distrustful) |
|
|
155
|
+
| Insert payload without a `Size` | `--deb-filename`, unchecked, or a `.changes` listing the `.deb` with no usable `Size` → no cap. | — |
|
|
156
|
+
| Held object digests | Digest reads of objects the target already holds (`held_digests`, `check`) stream through txstore's `get_digests` with no cap: the target is the operator's storage, and a stream buffers nothing. | — |
|
|
146
157
|
| Upload control data | The compressed `control.tar` member and its `control` file are each at most `MAX_CONTROL_BYTES` (4 MiB). | → `DebFileException` (Read) |
|
|
147
158
|
| Upload control tar | The `control.tar` decodes to at most `MAX_CONTROL_TAR_BYTES` (64 MiB), which also bounds its member count; it is uncompressed, `.gz`, `.xz`, `.bz2`, `.lzma`, or `.zst`, the last decoded by the `zstd` binary. | Past the limit, another compression, or a stream that does not decode → `DebFileException` (Read) |
|
|
148
159
|
|
|
@@ -223,7 +234,7 @@ checks below constrain both; unsafe names fail before any storage mutation.
|
|
|
223
234
|
|
|
224
235
|
| Rule | Constraint | Failure |
|
|
225
236
|
| -- | -- | -- |
|
|
226
|
-
| Unsafe key | txstore's `is_unsafe_path()`, shared by every caller below → [txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
237
|
+
| Unsafe key | txstore's `is_unsafe_path()`, shared by every caller below → [txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.3/VALIDATION.md#filename-safety). | — |
|
|
227
238
|
| `Packages.remove()` | Matched package filename passes the unsafe-key rule. | → `PackagesException` (Read) |
|
|
228
239
|
| `RepoSync` index set | Release-listed index key and path pass the unsafe-key rule. | Entry dropped from the index set and logged |
|
|
229
240
|
| `Packages` index parse | Stanza `Filename`, POSIX-normalized, passes `is_safe_name()`: not empty, not `.`, and the unsafe-key rule. | Stanza dropped from the container and logged |
|
|
@@ -236,7 +247,7 @@ checks below constrain both; unsafe names fail before any storage mutation.
|
|
|
236
247
|
| Insert pool object | A pool key the target already holds is replaced only by identical bytes: every dist of the root and every arch index may list it, and their records name the bytes it holds. An identical upload passes. | Different bytes → `ActionException` (Generic), the staged transfer discarded |
|
|
237
248
|
| Insert pool prefix | `lib` and the next letter for a source name longer than 3 starting with `lib`, else its first letter. | — |
|
|
238
249
|
| `.changes` file list | Every `Checksums-Sha256` entry is a bare file name: no `/` segment, and it passes the unsafe-key rule. | → `ChangesException` (Read) |
|
|
239
|
-
| Storage paths | Confinement, reserved names, and footmark reclaim → [txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
250
|
+
| Storage paths | Confinement, reserved names, and footmark reclaim → [txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.3/VALIDATION.md#filename-safety). | → `StorageException` (Generic) |
|
|
240
251
|
|
|
241
252
|
## Control file encoding
|
|
242
253
|
|
|
@@ -356,7 +367,7 @@ path.
|
|
|
356
367
|
|
|
357
368
|
Implemented by `object_acl_type()` and `bucket_acl_type()` in `argtypes.py` over txstore's
|
|
358
369
|
`parse_object_acl()` and `parse_bucket_acl()`; values →
|
|
359
|
-
[txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
370
|
+
[txstore VALIDATION.md](https://github.com/vinklat/txstore/blob/v0.1.3/VALIDATION.md#s3-canned-acls).
|
|
360
371
|
|
|
361
372
|
| Rule | Constraint | Failure |
|
|
362
373
|
| -- | -- | -- |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Non-canonical explanations for contributors: behavior diagrams of the actions and the reasoning
|
|
4
4
|
behind the rules. Storage internals are explained in txstore's
|
|
5
|
-
[developer guidance](https://github.com/vinklat/txstore/blob/v0.1.
|
|
5
|
+
[developer guidance](https://github.com/vinklat/txstore/blob/v0.1.3/docs/development/README.md).
|
|
6
6
|
Root contract documents remain authoritative; when a page here conflicts with a root contract,
|
|
7
7
|
update or remove the page. The reader-facing guides are in [docs/guides/](../guides/README.md).
|
|
8
8
|
|
|
@@ -8,10 +8,20 @@ together. Rules are owned by [STYLE.md](../../STYLE.md#layers) (action layer),
|
|
|
8
8
|
[VALIDATION.md](../../VALIDATION.md#debian-source-strings) (deb source and file rules),
|
|
9
9
|
[VALIDATION.md](../../VALIDATION.md#filename-safety) (upload names),
|
|
10
10
|
[CRYPTO.md](../../CRYPTO.md#verification-failures) (`.changes` and payload digests),
|
|
11
|
+
[VALIDATION.md](../../VALIDATION.md#object-sizes) (payload size caps),
|
|
11
12
|
[EXCEPTIONS.md](../../EXCEPTIONS.md#cli-exit-groups) (exit groups), and
|
|
12
13
|
[STORAGE.md](../../STORAGE.md#transactions) (transaction behavior). The user-facing walkthrough is
|
|
13
14
|
in [examples.md](../guides/examples.md#add-packages-from-a-changes-upload).
|
|
14
15
|
|
|
16
|
+
## Code map
|
|
17
|
+
|
|
18
|
+
| Concern | Module | Notes |
|
|
19
|
+
| -- | -- | -- |
|
|
20
|
+
| Orchestration | `action/action_pkg.py` | `ActionPkg.insert` takes each `.deb`'s `max_size` from the pinned `.changes` (`recorded_size()`) and checks the transferred digests |
|
|
21
|
+
| Payload cap | `repo/hashes.py` | `refuse_past_recorded_size()` names a capped read or transfer as `ChecksumException` → [VALIDATION.md](../../VALIDATION.md#object-sizes) |
|
|
22
|
+
| Control read | `repo/debfile.py` | `DebFile._read_control()` reads a backend that cannot seek whole, capped at `max_size` |
|
|
23
|
+
| Pool transfer | `repo/repo_rw.py` | `RepoRW.held_digests()` checks the pool key; `RepoRW.transfer_from()` passes `max_size` to the copy |
|
|
24
|
+
|
|
15
25
|
## Activity diagram
|
|
16
26
|
|
|
17
27
|

|
|
@@ -27,7 +37,7 @@ in [examples.md](../guides/examples.md#add-packages-from-a-changes-upload).
|
|
|
27
37
|
[EXCEPTIONS.md](../../EXCEPTIONS.md#orchestration-vs-repo-semantics).
|
|
28
38
|
- `maybe_transaction` holds `history_lock` for the whole body, bulk transfers included, so a
|
|
29
39
|
concurrent writer on the same root waits and — on S3 — fails after txstore's lock acquire timeout
|
|
30
|
-
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
40
|
+
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#locking). A
|
|
31
41
|
malformed `.transactions.json` aborts the run before `transaction_begin` →
|
|
32
42
|
[STORAGE.md](../../STORAGE.md#transactions).
|
|
33
43
|
- The target is loaded and copied for the diff only after `history_lock` is granted, so a peer that
|
|
@@ -36,7 +46,9 @@ in [examples.md](../guides/examples.md#add-packages-from-a-changes-upload).
|
|
|
36
46
|
- An unsafe `.changes` entry, `Package` or `Source` name, `Version`, or pool path is refused before
|
|
37
47
|
any transfer → [VALIDATION.md](../../VALIDATION.md#filename-safety). A `.deb` whose transferred
|
|
38
48
|
digests differ from its `.changes` entry is refused after it →
|
|
39
|
-
[CRYPTO.md](../../CRYPTO.md#verification-failures)
|
|
49
|
+
[CRYPTO.md](../../CRYPTO.md#verification-failures); with digests checked, one longer than the
|
|
50
|
+
`Size` that entry lists is refused during it, or during the whole-file read of a backend that
|
|
51
|
+
cannot seek; when a cap applies → [VALIDATION.md](../../VALIDATION.md#object-sizes).
|
|
40
52
|
- The pool key holds no dist and no arch beyond the upload file name, so other dists and arch
|
|
41
53
|
indices may list it; a pool key already holding different bytes is refused after the transfer and
|
|
42
54
|
the `.changes` digest check, read through once before it, and an identical upload passes →
|
|
@@ -59,7 +71,11 @@ wiring (begin/commit on success, discard on failure, no-op on a non-transactiona
|
|
|
59
71
|
`tests/test_repo_rw.py` covers the index mutations; `tests/test_debfile.py` and
|
|
60
72
|
`tests/test_changes.py` cover the upload-name refusals; `tests/test_action_pkg.py` refuses other
|
|
61
73
|
bytes under a held pool key on a real `StorageFS` and keeps a peer's insert committed while the run
|
|
62
|
-
waited for the lock
|
|
74
|
+
waited for the lock; `tests/test_action_pkg.py` also refuses a `.deb` past the `Size` its checked
|
|
75
|
+
`.changes` lists, takes one at that size, and leaves an unchecked `.changes` or a bare `.deb`
|
|
76
|
+
uncapped; `tests/test_debfile.py` covers the capped whole-file read of a backend that cannot seek;
|
|
77
|
+
`tests/test_repo_rw.py` covers `transfer_from` forwarding the cap →
|
|
78
|
+
[TESTING.md](../../TESTING.md#required-coverage).
|
|
63
79
|
|
|
64
80
|
## Related contracts
|
|
65
81
|
|
|
@@ -67,7 +83,8 @@ waited for the lock → [TESTING.md](../../TESTING.md#required-coverage).
|
|
|
67
83
|
[VALIDATION.md](../../VALIDATION.md#debian-source-strings),
|
|
68
84
|
[VALIDATION.md](../../VALIDATION.md#filename-safety),
|
|
69
85
|
[CRYPTO.md](../../CRYPTO.md#verification-failures),
|
|
86
|
+
[VALIDATION.md](../../VALIDATION.md#object-sizes),
|
|
70
87
|
[EXCEPTIONS.md](../../EXCEPTIONS.md#cli-exit-groups), [STORAGE.md](../../STORAGE.md#transactions).
|
|
71
88
|
- Sibling pages: [action_pkg_remove.md](action_pkg_remove.md), [action_sync.md](action_sync.md),
|
|
72
89
|
[repo_sync_indices.md](repo_sync_indices.md),
|
|
73
|
-
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.
|
|
90
|
+
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.3/docs/development/class.md).
|
|
@@ -22,7 +22,7 @@ in [examples.md](../guides/examples.md#remove-packages).
|
|
|
22
22
|
|
|
23
23
|
- `maybe_transaction` holds `history_lock` for the whole body, bulk transfers included, so a
|
|
24
24
|
concurrent writer on the same root waits and — on S3 — fails after txstore's lock acquire timeout
|
|
25
|
-
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
25
|
+
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#locking). A
|
|
26
26
|
malformed `.transactions.json` aborts the run before `transaction_begin` →
|
|
27
27
|
[STORAGE.md](../../STORAGE.md#transactions).
|
|
28
28
|
- The target is loaded and copied for the diff only after `history_lock` is granted, so a peer that
|
|
@@ -60,4 +60,4 @@ keeps a payload another dist lists → [TESTING.md](../../TESTING.md#required-co
|
|
|
60
60
|
[STORAGE.md](../../STORAGE.md#transactions).
|
|
61
61
|
- Sibling pages: [action_pkg_insert.md](action_pkg_insert.md), [action_sync.md](action_sync.md),
|
|
62
62
|
[repo_sync_indices.md](repo_sync_indices.md),
|
|
63
|
-
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.
|
|
63
|
+
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.3/docs/development/class.md).
|
|
@@ -6,10 +6,20 @@ target commits every change or discards them all. Rules are owned by
|
|
|
6
6
|
[STYLE.md](../../STYLE.md#layers) (action layer), [CONFIG.md](../../CONFIG.md#sync) (flags),
|
|
7
7
|
[CRYPTO.md](../../CRYPTO.md#release-freshness) (source Release freshness),
|
|
8
8
|
[CRYPTO.md](../../CRYPTO.md#verification-failures) (checksum abort),
|
|
9
|
+
[VALIDATION.md](../../VALIDATION.md#object-sizes) (transfer size caps),
|
|
9
10
|
[EXCEPTIONS.md](../../EXCEPTIONS.md#cli-exit-groups) (exit groups), and
|
|
10
11
|
[STORAGE.md](../../STORAGE.md#transactions) (transaction behavior). The user-facing walkthrough is
|
|
11
12
|
in [examples.md](../guides/examples.md#mirror-a-repository).
|
|
12
13
|
|
|
14
|
+
## Code map
|
|
15
|
+
|
|
16
|
+
| Concern | Module | Notes |
|
|
17
|
+
| -- | -- | -- |
|
|
18
|
+
| Retry loop | `action/action_sync.py` | `ActionSync.sync` runs `_sync_until_settled` inside `maybe_transaction`, at most `MAX_UPDATED_REPO_RETRIES` passes |
|
|
19
|
+
| Plan and copy | `repo/repo_sync.py` | `RepoSync.build_sync_lists()` plans; `RepoSync.sync()` copies each object through `_transfer_file()` |
|
|
20
|
+
| Transfer cap | `repo/__init__.py`, `repo/hashes.py`, `repo/repo_sync.py` | `Repo.max_recorded_size()` sets `max_size`; `RepoSync._transfer_file` refuses past it via `refuse_past_recorded_size()` → [VALIDATION.md](../../VALIDATION.md#object-sizes) |
|
|
21
|
+
| Target writes | `repo/repo_rw.py` | `RepoRW.transfer_from()` passes `max_size` to the copy; `RepoRW.delete()` drops an object whose digests mismatch |
|
|
22
|
+
|
|
13
23
|
## Activity diagram
|
|
14
24
|
|
|
15
25
|

|
|
@@ -22,7 +32,7 @@ in [examples.md](../guides/examples.md#mirror-a-repository).
|
|
|
22
32
|
|
|
23
33
|
- `maybe_transaction` holds `history_lock` for the whole body, bulk transfers included, so a
|
|
24
34
|
concurrent writer on the same root waits and — on S3 — fails after txstore's lock acquire timeout
|
|
25
|
-
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.
|
|
35
|
+
→ [txstore STORAGE.md](https://github.com/vinklat/txstore/blob/v0.1.3/STORAGE.md#locking). A
|
|
26
36
|
malformed `.transactions.json` aborts the run before `transaction_begin` →
|
|
27
37
|
[STORAGE.md](../../STORAGE.md#transactions).
|
|
28
38
|
- The target is loaded inside that body, so a peer that commits while this run waits for the lock is
|
|
@@ -41,9 +51,11 @@ in [examples.md](../guides/examples.md#mirror-a-repository).
|
|
|
41
51
|
as the run found it; a failure there discards what earlier passes staged.
|
|
42
52
|
`--allow-release-rollback` skips the check and warns once →
|
|
43
53
|
[CRYPTO.md](../../CRYPTO.md#release-freshness).
|
|
44
|
-
- A `ChecksumException` from `RepoSync.sync` aborts the whole retry loop
|
|
45
|
-
|
|
46
|
-
[CRYPTO.md](../../CRYPTO.md#verification-failures)
|
|
54
|
+
- A `ChecksumException` from `RepoSync.sync` aborts the whole retry loop and every staged footmark
|
|
55
|
+
is discarded, so no partial commit is produced. A digest mismatch also deletes the mismatching
|
|
56
|
+
target object → [CRYPTO.md](../../CRYPTO.md#verification-failures); with digests checked, a
|
|
57
|
+
transfer past its recorded `Size` stops without leaving one, and is not retried; when a cap
|
|
58
|
+
applies → [VALIDATION.md](../../VALIDATION.md#object-sizes).
|
|
47
59
|
- Corrupted target indices reset the target, and the sync proceeds →
|
|
48
60
|
[CRYPTO.md](../../CRYPTO.md#verification-failures).
|
|
49
61
|
- A target with neither `Release` nor `InRelease` is synced as empty; any other read failure stops
|
|
@@ -62,7 +74,10 @@ in [examples.md](../guides/examples.md#mirror-a-repository).
|
|
|
62
74
|
|
|
63
75
|
`tests/test_action_sync.py` covers the retry loop, checksum abort, the per-pass freshness check and
|
|
64
76
|
its skips, transaction wiring, and `--verify-existing`; `tests/test_release.py` covers each
|
|
65
|
-
freshness rule; `tests/test_repo_sync.py` covers list building and transfer
|
|
77
|
+
freshness rule; `tests/test_repo_sync.py` covers list building and transfer, including the
|
|
78
|
+
recorded-`Size` cap and its refusal without retry; `tests/test_action_sync.py` refuses a payload and
|
|
79
|
+
an index past their recorded `Size` on a real tree; `tests/test_repo.py` covers
|
|
80
|
+
`max_recorded_size` →
|
|
66
81
|
[TESTING.md](../../TESTING.md#required-coverage).
|
|
67
82
|
|
|
68
83
|
## Related contracts
|
|
@@ -70,7 +85,8 @@ freshness rule; `tests/test_repo_sync.py` covers list building and transfer →
|
|
|
70
85
|
- [STYLE.md](../../STYLE.md#layers), [CONFIG.md](../../CONFIG.md#sync),
|
|
71
86
|
[CRYPTO.md](../../CRYPTO.md#release-freshness),
|
|
72
87
|
[CRYPTO.md](../../CRYPTO.md#verification-failures),
|
|
88
|
+
[VALIDATION.md](../../VALIDATION.md#object-sizes),
|
|
73
89
|
[EXCEPTIONS.md](../../EXCEPTIONS.md#cli-exit-groups), [STORAGE.md](../../STORAGE.md#transactions).
|
|
74
90
|
- Sibling pages: [repo_sync_indices.md](repo_sync_indices.md),
|
|
75
91
|
[action_pkg_insert.md](action_pkg_insert.md), [action_pkg_remove.md](action_pkg_remove.md),
|
|
76
|
-
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.
|
|
92
|
+
[txstore class map](https://github.com/vinklat/txstore/blob/v0.1.3/docs/development/class.md).
|
|
@@ -37,9 +37,12 @@ partition "with maybe_transaction(target.storage)" {
|
|
|
37
37
|
:binary_archs = target.binary_archs();
|
|
38
38
|
note right: get_archs() minus "source":\nthe mirrored Sources index is read-only
|
|
39
39
|
while (more filenames?) is (yes)
|
|
40
|
-
:
|
|
40
|
+
:max_size = the Size a checked .changes lists, else None;
|
|
41
|
+
:debfile = DebFile(incoming_storage, filename, comp, max_size);
|
|
41
42
|
:package = debfile.get_package();
|
|
42
43
|
note right
|
|
44
|
+
ChecksumException (Distrustful) when a backend
|
|
45
|
+
that cannot seek reads past max_size;
|
|
43
46
|
DebFileException (Read) before any transfer:
|
|
44
47
|
malformed .deb (read in DebFile()),
|
|
45
48
|
Package or Source not a policy name,
|
|
@@ -74,7 +77,12 @@ partition "with maybe_transaction(target.storage)" {
|
|
|
74
77
|
:held = target.held_digests(pool_key);
|
|
75
78
|
:digests = target.transfer_from(
|
|
76
79
|
incoming_storage, filename,
|
|
77
|
-
path_dst=pool_key);
|
|
80
|
+
path_dst=pool_key, max_size);
|
|
81
|
+
if (transfer passes max_size?) then (yes)
|
|
82
|
+
:raise ChecksumException;
|
|
83
|
+
note right: the copy stops at the cap;\nthe transaction discards the staged transfer
|
|
84
|
+
stop
|
|
85
|
+
endif
|
|
78
86
|
if (.changes upload, digest verification on,\n and digests differ from its entry?) then (yes)
|
|
79
87
|
:raise ChecksumException;
|
|
80
88
|
note right: the transaction discards the staged transfer;\noff under --skip-verify
|