pmtiles-swarm 0.24.3 → 0.24.4
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 +20 -0
- package/package.json +1 -1
- package/src/feed.js +21 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@
|
|
|
7
7
|
### 🐞 Bug fixes
|
|
8
8
|
- _...Add new stuff here..._
|
|
9
9
|
|
|
10
|
+
## 0.24.4
|
|
11
|
+
### 🐞 Bug fixes
|
|
12
|
+
- **The feed advertised a .torrent nobody could fetch.** Every item named
|
|
13
|
+
`/api/torrents/<infohash>/file`, and that address is unreachable to exactly the audience a feed
|
|
14
|
+
is written for: the API is not on the public listener, so it answers 404 there, and on the
|
|
15
|
+
console listener it answers 401. Our own subscriptions got one or the other, and so did any
|
|
16
|
+
ordinary torrent client pointed at the same URL.
|
|
17
|
+
|
|
18
|
+
It failed quietly, which is why it lasted. `subscriptions.js` falls back to the magnet and logs a
|
|
19
|
+
line about it, so a mirror still joined and still downloaded. What the fallback costs is not
|
|
20
|
+
visible from there: BEP 9 carries only the info dict, and a v2 torrent's piece layers live
|
|
21
|
+
outside it, so an archive joined by magnet can never obtain them. On a hybrid torrent the mirror
|
|
22
|
+
then holds metadata it cannot verify pieces against and republishes a .torrent that claims v2
|
|
23
|
+
while omitting the hashes — 413 KB against the origin's 1,074 KB, the difference being precisely
|
|
24
|
+
20,636 pieces x 32 bytes. Anything mirroring from that mirror inherits it.
|
|
25
|
+
|
|
26
|
+
Items now name `/archives/<infohash>/archive.torrent`, which is public, unauthenticated, and the
|
|
27
|
+
same URL the TileJSON has always given for the same archive. Those two disagreeing was the bug;
|
|
28
|
+
a test now pins that they agree and that what they name answers 200 on the public surface.
|
|
29
|
+
|
|
10
30
|
## 0.24.3
|
|
11
31
|
### 🐞 Bug fixes
|
|
12
32
|
- **Takes pmtiles-torrent 0.4.6.** Two things a node reading pieces on demand wanted. The sidecar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmtiles-swarm",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.4",
|
|
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",
|
package/src/feed.js
CHANGED
|
@@ -84,7 +84,27 @@ ${items}
|
|
|
84
84
|
* @returns {string} - The item XML.
|
|
85
85
|
*/
|
|
86
86
|
function renderItem(entry, baseUrl) {
|
|
87
|
-
|
|
87
|
+
// The public route, which is the only one a subscriber can use.
|
|
88
|
+
//
|
|
89
|
+
// This named /api/torrents/<hash>/file, and that address is unreachable to
|
|
90
|
+
// everyone the feed is written for: the API is not on the public listener at
|
|
91
|
+
// all, so it answers 404 there, and on the console listener it answers 401.
|
|
92
|
+
// A feed is a public document whose whole purpose is to be followed by
|
|
93
|
+
// somebody else, and every consumer of it -- our own subscriptions, and any
|
|
94
|
+
// ordinary torrent client pointed at the same URL -- got one of those two.
|
|
95
|
+
//
|
|
96
|
+
// Nothing broke loudly, because subscriptions.js falls back to the magnet and
|
|
97
|
+
// logs a line about it. What that fallback costs is invisible from here and
|
|
98
|
+
// considerable: BEP 9 carries only the info dict, and a v2 torrent's piece
|
|
99
|
+
// layers live outside it, so an archive joined by magnet can never obtain
|
|
100
|
+
// them. On a hybrid torrent the mirror then holds metadata it cannot verify
|
|
101
|
+
// pieces against, and republishes a .torrent that claims v2 and omits the
|
|
102
|
+
// hashes -- measured at 413 KB against the origin's 1,074 KB, the difference
|
|
103
|
+
// being exactly 20,636 pieces x 32 bytes.
|
|
104
|
+
//
|
|
105
|
+
// Kept identical to what the TileJSON advertises for the same archive, in
|
|
106
|
+
// api.js. Those two disagreeing is what this was.
|
|
107
|
+
const torrentUrl = `${baseUrl}/archives/${entry.infoHash}/archive.torrent`;
|
|
88
108
|
const map = entry.pmtiles;
|
|
89
109
|
|
|
90
110
|
const mapFields = map
|