visync 0.1.0__py3-none-any.whl

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.

Potentially problematic release.


This version of visync might be problematic. Click here for more details.

@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.5
2
+ Name: visync
3
+ Version: 0.1.0
4
+ Summary: Ventoy ISO Synchronization Tool
5
+ Project-URL: Homepage, https://github.com/hxmbl/visync
6
+ Project-URL: Repository, https://github.com/hxmbl/visync
7
+ Project-URL: Issues, https://github.com/hxmbl/visync/issues
8
+ Author: hxmbl
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: checksum,iso,linux,package-manager,usb,ventoy
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: 3.15
25
+ Classifier: Topic :: System :: Archiving :: Backup
26
+ Classifier: Topic :: System :: Filesystems
27
+ Classifier: Topic :: Utilities
28
+ Requires-Python: <3.16,>=3.12
29
+ Requires-Dist: rich>=13.0
30
+ Requires-Dist: typer>=0.12
31
+ Provides-Extra: dev
32
+ Requires-Dist: build>=1.2; extra == 'dev'
33
+ Requires-Dist: pyright>=1.1.380; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
35
+ Requires-Dist: pytest>=8; extra == 'dev'
36
+ Requires-Dist: ruff>=0.16; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Visync
40
+
41
+ Ventoy Package Manager. Install, update, and manage Linux distros on your Ventoy drive.
42
+
43
+ ## Install
44
+
45
+ Requires Python 3.12+ and a mounted Ventoy drive.
46
+
47
+ ```bash
48
+ pip install visync
49
+ ```
50
+
51
+ For a development checkout:
52
+
53
+ ```bash
54
+ pip install -e ".[dev]"
55
+ ```
56
+
57
+ Both layouts work out of the box: `config.toml` ships inside the installed package, so `visync search` finds the distro list from any directory.
58
+
59
+ ## Quick Start
60
+
61
+ ```bash
62
+ # See what's available
63
+ visync search
64
+
65
+ # Auto-detect distros already on the drive
66
+ visync autodetect
67
+
68
+ # Install a distro
69
+ visync install archlinux
70
+ visync install nixos-graphical
71
+
72
+ # Batch install from file
73
+ visync install -i packages.txt
74
+
75
+ # Update all installed distros
76
+ visync update
77
+
78
+ # Update a specific distro
79
+ visync update tails
80
+
81
+ # Check for old versions (dry-run)
82
+ visync sync
83
+
84
+ # Remove old versions
85
+ visync sync --clean
86
+
87
+ # Remove a distro
88
+ visync remove tails
89
+
90
+ # Show distro details
91
+ visync info archlinux
92
+
93
+ # Verify checksums
94
+ visync verify
95
+ ```
96
+
97
+ ## Commands
98
+
99
+ | Command | Description |
100
+ |---|---|
101
+ | `visync search [query]` | List available distros (filter by query) |
102
+ | `visync install <name>` | Download and register a distro |
103
+ | `visync install -i <file>` | Batch install from file (one name per line) |
104
+ | `visync remove <name>` | Delete from drive and unregister |
105
+ | `visync update [name]` [--no-staging] | Update installed distros (all if no name given) |
106
+ | `visync sync` [--no-staging] | Sync installed distros to latest |
107
+ | `visync sync --all` [--no-staging] | Sync all configured distros |
108
+ | `visync sync --clean` [--no-staging] | Remove old versions of same distro |
109
+ | `visync sync --reset-visync` | Allow the watchdog to wipe an over-budget `.visync/` |
110
+ | `visync list` | List ISOs on the drive |
111
+ | `visync autodetect` | Register existing ISOs as installed |
112
+ | `visync verify` | Verify checksums against upstream |
113
+ | `visync info <name>` | Show distro details |
114
+
115
+ ## Batch Install File
116
+
117
+ Create a text file with one distro name per line:
118
+
119
+ ```
120
+ # My Ventoy setup
121
+ archlinux
122
+ nixos-minimal
123
+ tails
124
+ ubuntu-desktop
125
+ ubuntu-server
126
+ ```
127
+
128
+ Then run:
129
+
130
+ ```bash
131
+ visync install -i packages.txt
132
+ ```
133
+
134
+ Blank lines and lines starting with `#` are ignored.
135
+
136
+ ## Configuration
137
+
138
+ Edit `config.toml` to add or remove distros. Each distro entry defines a scraping strategy, mirror URL, and checksum verification method.
139
+
140
+ Config resolution order: explicit `--config` path, then `$VISYNC_CONFIG`, then `~/.config/visync/config.toml`, then the `config.toml` shipped inside the installed package. A `config.toml` in the current directory is only used as a last resort, so planted configs cannot hijack identification.
141
+
142
+ **Release selection:** `version_filter` restricts a scraper to one release family before the newest match is chosen. Ubuntu entries use `\d*[02468]\.04(\.\d+)*` so they track the current LTS (26.04.1) and ignore interim releases (25.10, 26.10). NixOS resolves the newest stable `YY.MM` channel from the release bucket at scrape time, so it advances to the next stable without a config edit; set `channel = "26.05"` to pin deliberately while that channel is current.
143
+
144
+ **Built-in strategies:**
145
+
146
+ | Strategy | Description | Example |
147
+ |---|---|---|
148
+ | `direct_match` | Flat index page | Arch Linux |
149
+ | `fedora_nested` | Version dirs + variant subdirs | Fedora, Fedora KDE |
150
+ | `ubuntu_nested` | Version dirs | Ubuntu, Parrot Security |
151
+ | `nixos_channel` | Stable-channel lookup + channel page parse | NixOS Minimal, NixOS Graphical |
152
+ | `popos_api` | JSON API | Pop!_OS |
153
+ | `tails_api` | JSON API | Tails |
154
+
155
+ **Checksum formats:** `gpg_checksum` (Fedora — inline `SHA256 (file) = hash`), `sha256sums` (Ubuntu, Arch, Parrot, NixOS, Tails), `json` (Tails)
156
+
157
+ Signature checking is configured separately via `signing_key_url` + `signing_key_fingerprint` and works with any signed layout, so Parrot's sectioned hash list gets both a signature check and a digest check.
158
+
159
+ ## How it works
160
+
161
+ 1. **Detect** — finds mounted Ventoy drives on Windows, macOS, or Linux (with udisksctl automount)
162
+ 2. **Scrape** — concurrent mirror scraping with TCP pre-flight checks and watchdog timeouts. A distro whose mirror can't be read is reported with the reason and makes the command exit non-zero; it is never silently counted as up to date
163
+ 3. **Select** — release-family filters keep scrapers on the intended series: Ubuntu tracks the current **LTS** (even-year `.04`, skipping interim releases and beta-only directories), and NixOS resolves the current **stable** channel from the release bucket instead of pinning a version string
164
+ 4. **Compare** — version-aware comparison (semantic or date-based) against local ISOs
165
+ 5. **Download** — streaming downloads with staging buffer (less drive wear), falls back to direct if staging full. Use `--no-staging` / `--no-buffer` to skip the staging buffer and download directly to the Ventoy drive.
166
+ 6. **Verify** — optional checksum verification against published hashes
167
+ 7. **Clean** — `--clean` removes deprecated ISOs of the same distro variant (dry-run by default)
168
+ 8. **State** — tracks installed distros in `.visync/installed.json`
169
+
170
+ ## Safety
171
+
172
+ - `--clean` is dry-run by default, and `--dry-run` never modifies the drive — `sync --clean --dry-run` deletes nothing and does not touch `.visync/`
173
+ - `remove` and `nuke-metadata` show exactly what will be deleted and ask for confirmation (`--yes` skips)
174
+ - Ambiguous distro queries are refused with candidate lists instead of acting on an arbitrary match
175
+ - Distro matching uses whole-token keywords (`pop` does not match `popcorn.iso`)
176
+ - `.visync/` watchdog enforces a 1 GiB ceiling by deep-cleaning orphaned metadata. Wiping `.visync/` entirely is **opt-in** via `sync --reset-visync`, because it destroys `installed.json` and every registration
177
+ - The watchdog never runs on `--dry-run`
178
+ - Guardrails prevent deletion of `.iso` or `.img` files under any circumstance — including inside `.visync/metadata`
179
+ - Downloads use parallel range requests with per-chunk HTTP 206 and byte-count validation; truncated or range-ignoring servers fail loudly instead of producing silent corruption
180
+ - Checksum mismatch deletes the download; an *unreachable* checksum source keeps the file and warns (`UNVERIFIED`)
181
+ - HTTPS is enforced for all mirrors and checksum sources (loopback exempt); https→http redirects are blocked
182
+ - GPG signature verification supports fingerprint pinning via `signing_key_fingerprint`, and applies to any signed checksum file regardless of its digest layout (Fedora's inline `SHA256 (file) = hash`, Parrot's sectioned md5/sha256/sha512 list)
183
+ - When multiple digests for the same file appear in one signed list, the configured `checksum_algo` selects the section — a first-match parser would compare an MD5 against a SHA-256 and delete a good download as corrupt
184
+ - Failed downloads clean up `.part` files automatically
185
+ - Install verifies file exists on drive before marking as installed
186
+ - State and metadata writes are atomic (tmp file + rename)
187
+
188
+ ## Tests
189
+
190
+ ```bash
191
+ python3 -m pytest test/ -v
192
+ ```
193
+
194
+ CI installs from the committed `uv.lock` so a dependency release cannot break the build without a diff. `uv` is used for reproducible CI and builds only — installing visync itself with `pip` is fully supported.
195
+
196
+ ## Debug
197
+
198
+ ```bash
199
+ VISYNC_DEBUG=1 visync sync
200
+ ```
201
+
202
+ ## License
203
+
204
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,14 @@
1
+ visync/__init__.py,sha256=uJ4l7PZ1BWLT1VDZdC1rdIBcr5fqGL1i6r1cegBIg30,71
2
+ visync/download.py,sha256=oAymqtmzrISEU0q9dRbudSin7Yl03IzGac9KZq_ucpY,60543
3
+ visync/finder.py,sha256=h2Kv8Mfcm0FDV7uk6XlbhR9MqsK90mtqWETD98wxPl0,26283
4
+ visync/main.py,sha256=GMmsfS1yqPAnTVThyPCgKNqg150NZNAgKduAFh7937E,41204
5
+ visync/net.py,sha256=bIA6yYxRKJ2EU3Bs1B-3fiZZc-HWvTFCFly97_TS2f0,3362
6
+ visync/output.py,sha256=hlDIKFo8Ce8P616-kmeCj1ND74nlQ_SV0R4gPDGkqNA,3428
7
+ visync/pm.py,sha256=vZEXcYUgc2WHEH4T_Jla74f5KL6-sP6YQ6IxmTE0yjo,4301
8
+ visync/verify.py,sha256=AToIkllaeRW1u4KjKgFvUl5ekZnWdPxDCxU7f8PdqvU,25116
9
+ visync/config.toml,sha256=Q2KfFSppFvB6jzMRHKIk-Msa1WWchaOga7aiZWRbueY,9896
10
+ visync-0.1.0.dist-info/METADATA,sha256=XvE3zgVnG_L9R2y0tLFmoqNq2OkUA6IyEKxxIMtkLCI,8792
11
+ visync-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
12
+ visync-0.1.0.dist-info/entry_points.txt,sha256=Yx-VxnL1d-xrPJOyK3h1qQMSFRB9S5VYgV6NhbfzLfM,43
13
+ visync-0.1.0.dist-info/licenses/LICENSE,sha256=8lV2pYYtelPscUmZMKok8VeKJJz4VxHxsIESnspxywk,1062
14
+ visync-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ visync = visync.main:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hxmbl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.