Skip to content

Offline vector map without the admin-console download (works in Turkey) / Çevrimdışı vektör harita: yönetim paneli indirmesi gerekmez (Türkiye'de çalışır) - #5

Open
turer73 wants to merge 2 commits into
schematrix:mainfrom
turer73:feat/offline-vector-map
Open

turer73 wants to merge 2 commits into
schematrix:mainfrom
turer73:feat/offline-vector-map

Conversation

@turer73

@turer73 turer73 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

English · Türkçe

English

The README says IIAB's map download (contabostorage.com) is blocked in some countries such as Turkey and suggests Cloudflare WARP. This adds a second way that needs neither WARP nor the admin console.

scripts/download-map.sh (new)

  • Cuts a region from the Protomaps planet build with the pmtiles CLI (v1.31.2, tarball sha256 pinned for x86_64 and arm64). Default is Turkey, about 1.7 GB, zoom ≤ 15; MAP_NAME, MAP_BBOX (west,south,east,north) and MAP_MAXZOOM change it.
  • Installs a small MapLibre page plus fonts and sprites under /library/www/html/harita/. The four JS/CSS libraries are fetched from jsDelivr at pinned versions and verified against pinned sha256 values, so no minified JS is added to the repo (only the three BSD-3 licence texts).
  • Needs no nginx change: IIAB's nginx serves static files under /library/www/html with Range support, which is all PMTiles needs. Result: http://box.lan/harita/.
  • Only talks to build.protomaps.com, github.com and cdn.jsdelivr.net.
  • --update re-cuts only when a newer planet build exists; --force always re-cuts; a failed or unverifiable extract leaves no partial file; a corrupted library file is re-fetched on the next run.
  • Same style as the other scripts: sudo check, bilingual messages, flock, free-space check with RESERVE_GB.

Homepage: one row under "Haritalar ve Navigasyon". It sits next to the IIAB map, it does not replace it. README: step 6 alternative, repo-layout row, troubleshooting pointer, both languages.

Evidence (Debian x86_64 box, a fake IIAB web root served by a plain nginx:alpine, small extract so the run is quick)

Not tested, please check: a real IIAB install (its nginx config could differ from plain nginx), a Raspberry Pi 5 / arm64 run (the arm64 tarball hash was taken from the release file but the binary was not executed there), and an actual /library SSD mount.

Türkçe

README, IIAB'ın harita indirmesinin (contabostorage.com) Türkiye gibi bazı ülkelerde engelli olduğunu söylüyor ve Cloudflare WARP öneriyor. Bu PR WARP'a da yönetim paneline de ihtiyaç duymayan ikinci bir yol ekliyor.

scripts/download-map.sh (yeni)

  • Protomaps planet build'inden pmtiles CLI ile bölge keser (v1.31.2, x86_64 ve arm64 tarball sha256 değerleri sabit). Varsayılan Türkiye, yaklaşık 1,7 GB, zoom ≤ 15; MAP_NAME, MAP_BBOX (batı,güney,doğu,kuzey) ve MAP_MAXZOOM ile değişir.
  • /library/www/html/harita/ altına küçük bir MapLibre sayfası, yazı tipleri ve sprite'lar kurar. Dört JS/CSS kütüphanesi jsDelivr'den sabit sürümle indirilir ve sabit sha256 ile doğrulanır; depoya minify JS eklenmez (yalnız üç BSD-3 lisans metni).
  • nginx ayarı gerekmez: IIAB'ın nginx'i /library/www/html altındaki statik dosyaları Range desteğiyle sunar, PMTiles'ın tek ihtiyacı budur. Sonuç: http://box.lan/harita/.
  • Yalnızca build.protomaps.com, github.com ve cdn.jsdelivr.net adreslerine gider.
  • --update yalnız daha yeni build varsa yeniden keser; --force her zaman keser; başarısız ya da doğrulanamayan kesit yarım dosya bırakmaz; bozuk kütüphane dosyası sonraki koşuda yeniden indirilir.
  • Diğer betiklerle aynı üslup: sudo denetimi, iki dilli mesajlar, flock, RESERVE_GB ile yer kontrolü.

Ana sayfa: "Haritalar ve Navigasyon" altında bir satır; IIAB haritasının yanında durur, yerine geçmez. README: adım 6 alternatifi, repo yapısı satırı, sorun giderme yönlendirmesi, iki dilde.

Kanıt (Debian x86_64 makine, sahte IIAB web kökü, düz nginx:alpine ile sunuldu, koşu hızlı olsun diye küçük kesit)

Denenmedi, lütfen kontrol edin: gerçek bir IIAB kurulumu (nginx ayarı düz nginx'ten farklı olabilir), Raspberry Pi 5 / arm64 koşusu (arm64 tarball hash'i yayın dosyasından alındı ama ikili orada çalıştırılmadı) ve gerçek /library SSD bağlaması.

@schematrix

Copy link
Copy Markdown
Owner

Türkiye'deki harita derdini WARP'sız çözmüşsün, eline sağlık! Bir ricam var: font ve sprite paketi şu an main branch'ten iniyor. Betik root olarak çalıştığı için onu da bir commit'e ve SHA-256'ya sabitleyebilir misin? Sonra Pi'de gerçek IIAB kurulumunda deneyip sorun yoksa merge ederim.

You solved the map issue in Turkey without WARP, great job! One request: the fonts and sprites archive is downloaded from the main branch right now. Since the script runs as root, could you pin that to a commit and SHA-256 too? Then I'll test it on the Pi with a real IIAB install and merge if all good.

@Proxy34

Proxy34 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@turer73 #5'i gerçek IIAB kurulu sanal makinede (Debian 13), diğer açık PR'larla birlikte kurup denedim. Küçük bir bölge kesildi (Kahramanmaraş merkez, z14), harita sayfası açıldı, yazı tipleri ve sprite'lar indi.

Bir önerim var: builds.json alınamadığında betik "build listesi alınamadı" deyip duruyor, ama harita dosyaları build.protomaps.com'dan yine de iniyor. Liste alınamazsa son birkaç günün dosyasını doğrudan denemek bunu çözüyor. Sanal makinede denedim, çalışıyor:

if [ -z "$MAP_BUILD" ]; then
  for i in $(seq 0 10); do
    d=$(date -u -d "-$i day" +%Y%m%d)
    curl -fsI -m 20 "$BUILD_BASE/$d.pmtiles" >/dev/null && { MAP_BUILD=$d; break; }
  done
fi

#14'teki güncelleme kontrolüne de aynı yedek yolu ekledim.

Firewall (Proxy34)

@schematrix

Copy link
Copy Markdown
Owner

Merhaba turer73, #3'ü bugün merge ettim, böylece #5'in önü açıldı. #14 ve #9 da #5'i bekliyor, yani bu PR şu an zincirin tam ortasında. Müsait olduğunda font ve sprite paketini bir commit'e ve SHA-256'ya sabitleyebilirsen kutuda deneyip ilerleyebiliriz. Proxy34'ın builds.json alınamadığında son günlerin dosyasını doğrudan deneme önerisini de eklersen çok iyi olur.


Hi turer73, I merged #3 today, so the way is clear for #5. #14 and #9 are waiting on #5 too, so this PR is right in the middle of the chain now. Whenever you have time, if you can pin the fonts and sprites archive to a commit and SHA-256, I'll test it on the box and we can move forward. It would also be great to add Proxy34's suggestion of probing recent daily files when builds.json can't be fetched.

turer73 and others added 2 commits November 24, 2026 23:21
…e map download needed

IIAB'ın harita indirmesi (contabostorage) Türkiye'de engelli; README bunun için WARP öneriyor.
scripts/download-map.sh Protomaps planet build'inden bölge kesiti (PMTiles) alır, küçük bir
MapLibre sayfasını /library/www/html/harita/ altına kurar; nginx dosyaları olduğu gibi sunar
(Range desteği hazır), ek ayar yok. Türkiye kesiti ~1,7 GB, z15, Türkçe etiketli.

The IIAB map download (contabostorage) is blocked in Turkey and the README suggests WARP for it.
scripts/download-map.sh cuts a region (PMTiles) from the Protomaps planet build and installs a
small MapLibre page under /library/www/html/harita/; nginx serves the files as-is (Range works
out of the box), no extra config. Turkey extract ~1.7 GB, zoom 15, Turkish labels.
…robing recent builds when builds.json is unreachable

Maintainer review on PR schematrix#5: the basemaps-assets archive came from the main branch while the script
runs as root. It is now pinned to commit 028c18f (tarball sha256 verified; mismatch installs nothing
and the run ends with failed=1). A .commit stamp refreshes older, unpinned installs once.

builds.json okunamazsa son 10 günün build dosyası doğrudan denenir (Proxy34'ın önerisi).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@turer73
turer73 force-pushed the feat/offline-vector-map branch from 4ae060a to 4cd0b90 Compare November 24, 2026 20:27
@turer73

turer73 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks both, and sorry for the long silence. Both requests are in the new commit (4cd0b90), and the branch is rebased on the current main (it was 24 commits behind).

English

  • Fonts and sprites are pinned. The archive now comes from protomaps/basemaps-assets at commit 028c18f713baecad011301ff7a69acc39bcc2ae7 (2025-10-31), not from the main branch. The script checks the tarball's SHA-256 (57e40e8c…92d0) before extracting anything; on a mismatch nothing is installed and the run ends with failed=1. I downloaded the tarball three times (twice from github.com, once from codeload) and the hash was identical every time. A .commit stamp makes an install that came from the old unpinned script re-fetch the pack once. To update the pin later, change ASSETS_COMMIT, ASSETS_SHA256 and the URL together (noted in the script).
  • builds.json fallback. If it cannot be read, the script now probes the last 10 daily files on build.protomaps.com directly, as @Proxy34 suggested (credited in a comment). If no build is found at all it stops with a clear message.

Tested on a Debian x86_64 box against a fake IIAB web root: shellcheck -S warning clean; fresh install (768 font files); stale install re-fetched once, then not again; a wrong hash is refused (failed=1, nothing installed); an unreachable builds.json falls back to the newest build; no build at all exits with an error; the page renders with the pinned fonts and Turkish labels, no failed requests.

Still not tested by me: a real IIAB install and a Pi 5 (arm64). Thanks @Proxy34 for trying it on a real IIAB VM. Note that #1 already conflicts with main (README and install-homepage.sh), independent of this PR.

Türkçe

  • Font ve sprite paketi sabitlendi. Arşiv artık main dalından değil, protomaps/basemaps-assets deposunun 028c18f713baecad011301ff7a69acc39bcc2ae7 commit'inden (2025-10-31) iniyor. Betik, bir şey çıkarmadan önce tarball'ın SHA-256'sını (57e40e8c…92d0) doğruluyor; uyuşmazsa hiçbir şey kurulmuyor ve koşu failed=1 ile bitiyor. Tarball'ı üç kez indirdim (iki kez github.com, bir kez codeload), hash her seferinde aynı çıktı. .commit damgası, eski sabitlenmemiş betikle kurulmuş bir kurulumun paketi bir kez yeniden indirmesini sağlıyor. Sabitlemeyi sonradan güncellemek için ASSETS_COMMIT, ASSETS_SHA256 ve URL birlikte değiştirilmeli (betikte yazıyor).
  • builds.json yedek yolu. Okunamazsa betik build.protomaps.com'daki son 10 günün dosyasını doğrudan deniyor; öneri @Proxy34'ten (yorumda atıf var). Hiç build bulunamazsa net bir mesajla duruyor.

Debian x86_64 makinede sahte bir IIAB web köküne karşı denendi: shellcheck -S warning temiz; sıfırdan kurulum (768 font dosyası); eski kurulum bir kez yenileniyor, sonra yenilenmiyor; yanlış hash reddediliyor (failed=1, hiçbir şey kurulmuyor); erişilemeyen builds.json en yeni build'e düşüyor; hiç build yoksa hatayla çıkıyor; sayfa sabitlenmiş yazı tipleriyle Türkçe etiketli çiziliyor, başarısız istek yok.

Benim denemediğim: gerçek bir IIAB kurulumu ve Pi 5 (arm64). Gerçek bir IIAB sanal makinesinde denediği için @Proxy34'e teşekkürler. Not: #1 bu PR'dan bağımsız olarak zaten main ile çakışıyor (README ve install-homepage.sh).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants