pmtiles-swarm 0.44.0 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,34 @@
7
7
  ### 🐞 Bug fixes
8
8
  - _...Add new stuff here..._
9
9
 
10
+ ## 0.45.1
11
+ ### ✨ Features and improvements
12
+
13
+ ### 🐞 Bug fixes
14
+ - **The virtualenv route for libtorrent now says it can hand you an older version.** pip installs the
15
+ newest wheel the *Python* can take, not the newest libtorrent, and the wheels for Python 3.8 stop
16
+ at 2.0.9 — so on Ubuntu 20.04 the recipe as written produced a downgrade from the distribution's
17
+ own package, silently. The section now says how to read the `cp` tag in the filename, to compare
18
+ both interpreters before committing, and that a newer libtorrent on an older release needs a newer
19
+ Python first.
20
+
21
+ ## 0.45.0
22
+ ### ✨ Features and improvements
23
+ - **Requires pmtiles-torrent 0.9.1**, which stops the sidecar rewriting resume data that has not
24
+ changed. A hybrid torrent carries a merkle tree of 32 bytes per 16 KiB block in its resume data —
25
+ a few hundred megabytes for a 128 GiB archive — and it was being restaged, fsynced and renamed
26
+ every five minutes for every archive at once, to record that nothing had moved. It also gives each
27
+ torrent its own share of the save budget instead of five seconds for the whole library, which is
28
+ why a node with four archives persisted two of them and a different two next time.
29
+ - **Running as a service documents a newer libtorrent than the distribution ships.** `apt` gives you
30
+ whatever your release froze on, `pip install` into the system Python is refused under PEP 668, and
31
+ `--break-system-packages` is not the way round it. A virtualenv plus the existing
32
+ `libtorrent.python` key is, reversibly and without touching apt. The upgrade section now also says
33
+ that libtorrent is a third thing an update never moves, and how to check which one the service
34
+ actually imports.
35
+
36
+ ### 🐞 Bug fixes
37
+
10
38
  ## 0.44.0
11
39
  ### ✨ Features and improvements
12
40
  - **Web seeds are added where they are listed.** The **HTTP sources** tab now has a field and an Add
@@ -553,6 +553,52 @@ rather than exiting. Name the interpreter explicitly when the service user's
553
553
  { "libtorrent": { "python": "/usr/bin/python3" } }
554
554
  ```
555
555
 
556
+ ### A newer libtorrent than the distribution ships
557
+
558
+ `apt` gives you whatever your release froze on, which on Ubuntu 24.04 is
559
+ libtorrent 2.0.x. `pip install libtorrent` into the system Python is refused —
560
+ `externally-managed-environment`, because apt owns that Python — and
561
+ `--break-system-packages` is not the way round it.
562
+
563
+ Give the service account a virtualenv instead and point the sidecar at it. The
564
+ same `python` key does the work, so nothing else changes:
565
+
566
+ ```sh
567
+ sudo -u pmtiles-swarm python3 -m venv /var/lib/pmtiles-swarm/venv
568
+ sudo -u pmtiles-swarm /var/lib/pmtiles-swarm/venv/bin/pip install libtorrent
569
+ sudo -u pmtiles-swarm /var/lib/pmtiles-swarm/venv/bin/python -c "import libtorrent; print(libtorrent.__version__)"
570
+ ```
571
+
572
+ ```json
573
+ { "libtorrent": { "python": "/var/lib/pmtiles-swarm/venv/bin/python" } }
574
+ ```
575
+
576
+ **Check what you got before pointing anything at it.** pip installs the newest
577
+ wheel _your Python_ can take, which is not the newest libtorrent. The filename
578
+ says which: `libtorrent-2.1.1-cp312-…` is Python 3.12, `libtorrent-2.0.9-cp38-…`
579
+ is Python 3.8 — and 2.0.9 is where the wheels for 3.8 stop. On Ubuntu 20.04,
580
+ whose `python3` is 3.8, this route hands you something **older** than the
581
+ distribution's own package. Compare the two before you commit to it:
582
+
583
+ ```sh
584
+ sudo -u pmtiles-swarm python3 -c "import libtorrent; print(libtorrent.__version__)"
585
+ sudo -u pmtiles-swarm /var/lib/pmtiles-swarm/venv/bin/python -c "import libtorrent; print(libtorrent.__version__)"
586
+ ```
587
+
588
+ If the venv is not newer, delete it and keep the distribution package. Getting a
589
+ newer libtorrent on an older release means a newer Python first — deadsnakes, or
590
+ the release upgrade — and building the venv from that interpreter.
591
+
592
+ Reversible in one line: delete the key and the node is back on the distribution
593
+ package, with no uninstall and nothing done to apt. `ReadWritePaths` already
594
+ covers `/var/lib/pmtiles-swarm`, so the venv needs no unit change — put it
595
+ anywhere else and it does.
596
+
597
+ Worth doing for a node seeding very large hybrid archives, where v2 support has
598
+ had the most work since 2.0. Change one thing at a time, though: take a version
599
+ of the node first, confirm what it did, then move libtorrent, so a difference in
600
+ behaviour has one candidate rather than two.
601
+
556
602
  ## Ports
557
603
 
558
604
  Five listeners, and only the peer ports want a firewall rule. See
@@ -615,6 +661,22 @@ sudo -u pmtiles-swarm -H npm ls --prefix /var/lib/pmtiles-swarm --depth 1 \
615
661
  pmtiles-swarm pmtiles-torrent
616
662
  ```
617
663
 
664
+ **libtorrent itself is a third thing, and an update never touches it.** The
665
+ sidecar is Python that ships with the package; libtorrent is the binding it
666
+ imports, which came from `apt` or from a virtualenv you made. Neither moves when
667
+ the node does:
668
+
669
+ ```sh
670
+ sudo -u pmtiles-swarm python3 -c "import libtorrent; print(libtorrent.__version__)"
671
+ ```
672
+
673
+ Run that against whatever `libtorrent.python` names, not your login shell's
674
+ Python — they are frequently different interpreters, and the one that matters is
675
+ the one the service uses. See
676
+ [a newer libtorrent than the distribution ships](#a-newer-libtorrent-than-the-distribution-ships)
677
+ for moving it, and move it on its own: a node upgrade and a libtorrent upgrade in
678
+ one restart leaves two candidates for whatever happens next.
679
+
618
680
  An install runs the dependency install scripts again, so check WebRTC survived
619
681
  it — see [the allowScripts warning](#the-allowscripts-warning):
620
682
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmtiles-swarm",
3
- "version": "0.44.0",
3
+ "version": "0.45.1",
4
4
  "description": "BitTorrent distribution for PMTiles map archives: create torrents, watch folders, publish and subscribe to RSS feeds, and seed through qBittorrent or an embedded client",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -46,7 +46,7 @@
46
46
  "maplibre-gl": "^6.2.0",
47
47
  "parse-torrent": "^11.0.24",
48
48
  "pmtiles": "^4.4.1",
49
- "pmtiles-torrent": "^0.9.0",
49
+ "pmtiles-torrent": "^0.9.1",
50
50
  "webtorrent": "^3.0.21"
51
51
  },
52
52
  "engines": {