Skip to content

feat(docker): Docker imajı, yönetim paneli ve HAS okuyucusu / Docker image, admin panel and HAS reader - #66

Open
ramazansancar wants to merge 64 commits into
schematrix:mainfrom
ramazansancar:admin-panel
Open

ramazansancar wants to merge 64 commits into
schematrix:mainfrom
ramazansancar:admin-panel

Conversation

@ramazansancar

@ramazansancar ramazansancar commented Nov 29, 2026 •

Copy link
Copy Markdown

English below.

Türkçe

#7 (issue) ve #42 (issue) madde 23 için. Docker sürümü bu depoda; Pi kurulumuyla aynı dosyaları ve betikleri kullanıyor, ayrı bir fork gibi geride kalmıyor. Commit'ler konu konu ayrı, sırayla incelenebilir.

Öne çıkan farklar

Ne Önce Sonra
Ana sayfa, 1 çekirdek (gzip isteyen istemci) 962 istek/sn 21.036 istek/sn (~22 kat)
has.js, 1 çekirdek 1.725 istek/sn 30.354 istek/sn (~18 kat)
Kiwix kataloğu, 1 çekirdek 2.182 istek/sn 19.945 istek/sn (~9 kat)
Kiwix kataloğu, 4 çekirdek 8.440 istek/sn, en yavaş %1: 21 ms 35.569 istek/sn, en yavaş %1: 7 ms
Yönetim paneli, 0,25 çekirdek Python: 8 istek/sn Go: 437 istek/sn (~55 kat)
Lighthouse ana sayfa, masaüstü (performans / erişilebilirlik) 77 / 80 puan 100 / 100 puan
Lighthouse ana sayfa, telefon (performans / erişilebilirlik) 94 / 80 puan 100 / 100 puan
Boştaki bellek, çok çekirdekli makine 19 MiB 11 MiB
CI, bir koşu 12–13 dk ~8 dk

Ölçümler Windows'ta Docker'da, Pi'de değil. Tablolar ve yöntem aşağıda "Ayrıntılar"da.

Neler var

  • Kurulu servisler: ana sayfa yalnız cihazda olan servisleri "Kurulu" gösteriyor (servis modülleri).
  • Docker imajı: Pi kurulumuyla aynı betikler, beş mimari, root olmayan kullanıcı, salt okunur kök.
  • Yönetim paneli (Go): ilk kurulum kodu, varsayılan şifre yok; içeriği dile göre seçip indirme, doğrulama, şifreyle silme; satırlarda indirme durumu ve bildirim.
  • HAS okuyucusu: Kiwix içeriği HAS çubuğuyla; "Tüm kaynaklar" araması dil seçimiyle (kiwix/libkiwix#1434).
  • Dil ve görünüm: tüm sayfalar Türkçe/İngilizce ve koyu tema; acil sayfası artık İngilizce de (CDC/EPA asıl metin, AFAD çeviri).
  • Boyutlar: "~" ile yazılan tahminler yerine Kiwix kataloğundaki gerçek dosya boyutları (ana sayfa ve panel); internet yoksa son bilinen değerler, kurulu dosyanın boyutu diskten, harita boyutu cihazda ölçülüyor.
  • Belgeler: docs/ altında Türkçe (tr-TR/) ve İngilizce (en-US/): kurulum ve güncelleme rehberi (komutlar ve çıktılarının anlamı), yönetim paneli, API, içerik ekleme, testler, güvenlik, sorun giderme, kararlar.
  • Diğer: erişilebilirlik (WCAG AA), wget yerine curl, Docker'da disk uyarısı, CONTRIBUTING.md.
  • Testler ve CI: imaj testi beş mimaride, tarayıcı testleri yedi kuşakta (Chrome 102'ye kadar), erişilebilirlik denetimi.

Pi kurulumunda değişenler

Docker dışındaki değişiklikler Pi'deki kurulumu da etkiliyor; hepsi eskisiyle uyumlu:

  • Ana sayfa: servisleri services.json'dan okuyor (kurulu olmayan "Henüz yüklenmedi", menüde gizli; dosya yoksa eskisi gibi hepsi var sayılır), kitap bağlantıları ve arama HAS okuyucusunda (www/home/reader.html) açılıyor, Türkçe/İngilizce ve tema seçimi var, boyutlar Kiwix kataloğundan.
  • install-homepage.sh: yeni sayfaları ve has.js'i kopyalıyor, services.sh'yi çalıştırıyor, sizes.json'u ilk kez kopyalıyor; .gz kopyaları yalnız HAS_GZIP=1 ile (Docker).
  • download-content.sh: wget yerine curl (kaldığı yerden, 5 deneme), sonunda kesin boyutları yazıyor, kütüphane komutu KIWIX_LIB_CMD ile seçilebiliyor (varsayılan yine iiab-make-kiwix-lib).
  • download-content.sh, disk-health.sh: disk bağlı mı sorusu mountpoint yerine findmnt --mountpoint ile (bağlama tablosuna bakıyor; Pi'de zaten var).
  • config/content.conf: notlardaki "~" boyutlar kaldırıldı.
  • Yeni: scripts/catalog-sizes.sh, scripts/services.d/, config/sizes.json.

Yönetim paneli Pi'de henüz kurulmuyor (aşağıda "Bu PR'da olmayanlar").

Kullanım

docker compose up -d --build                                      # imajı derler; http://<cihaz-ip>:8080/home/
docker compose logs has                                           # ilk kurulum kodu
docker compose exec has has-admin reset-password <ad>             # şifreyi rastgele bir şifreyle sıfırlar
docker compose exec has has-admin reset-password <ad> --stdin     # istediğin şifre (iki kez sorar, yazılan görünmez)
docker compose exec has /opt/has/scripts/download-content.sh      # ya da panelden: /admin/

Harici disk: HAS_LIBRARY=/mnt/ssd/library, port: HAS_PORT=80. Windows/macOS'ta telefondan erişim için Docker Desktop'a güvenlik duvarında bir kez izin gerekiyor (README'de).

Denediklerim

Ne Sonuç
İmaj testi (docker/test.sh) 187/187 (indirmeyle; indirmesiz 160/160); beş mimaride geçti
Tarayıcı testleri, en güncel tarayıcılar 596 geçti, 4 atlandı (WebKit klavye)
Tarayıcı testleri, Chrome 102 / Firefox 99 / Safari 15.4 596 geçti, 4 atlandı (WebKit klavye; erişilebilirlik testleri dahil)
Olmaması gerekeni denetleyen testler kurulu olmayanın bağlantısız kalması, gizli kalması gerekenler (bildirim, Durdur, dil seçimi), yanlış şifre / farklı şifre / biten oturum, Kiwix'e ulaşılamaması, GET ile 405, 64 KB üstü 413
Erişilebilirlik (axe-core, WCAG 2.2 A/AA) 6 sayfa (acil İngilizce dahil) × açık/koyu tema, ihlal yok
Elle uçtan uca ilk kurulum, indirme, durdurup sürdürme, doğrulama, şifreli silme, yeniden başlatmada kalıcılık, telefondan erişim
ShellCheck, hadolint, actionlint, Go testleri temiz
Pi denemedim

Ölçümler Windows'ta Docker'da, Pi'de değil.

Çakışmalar

main ile temiz. Açık PR'lardan #5 (PR), #19 (PR), #23 (PR), #63 (PR) ve #65 (PR) ile www/home/index.html'de (#19 ve #23'te ayrıca README.md ve scripts/install-homepage.sh'de) çakışıyor; hangisi önce birleşirse öteki güncellenmeli. Çoğu, ana sayfa listesine eklenen yeni satırların komşu satırlarda olmasından.

Bu PR'da olmayanlar

  • Panelin Pi'de systemd servisi olarak kurulması ve derlenmiş dosyanın sürüm + SHA-256 ile indirilmesi (IIAB'nin kendi paneli Pi'de /admin'de; HAS paneli orada HAS_ADMIN_PREFIX ile başka adrese alınabilir).
  • Pi'de /kiwix/ adresinin okuyucuya yönlendirilmesi (IIAB nginx ayarı).
  • #5 (PR) birleşince harita modülü.

İlk yayından sonra GitHub'daki paket özel olur: Packages → has-disk → Package settings → Change visibility → Public.

Ayrıntılar

Neler var (ayrıntılı)

Konu Ne yapıyor Dosyalar
Kurulu servisler Ana sayfa harita, Kolibri, yönetim gibi servisleri cihazda olmasa da "Kurulu" gösteriyordu. Artık her servis küçük bir modül, sonuç services.json'da; olmayan "Henüz yüklenmedi", menü bağlantısı gizli. Dosya yoksa davranış eskisi gibi. scripts/services.sh, scripts/services.d/
Docker imajı Dizin düzeni IIAB ile aynı (/library/zims, /library/www/html); kurulum, indirme, doğrulama betikleri değişmeden çalışıyor. Alpine 3.24.4, Kiwix'in resmî statik kiwix-serve 3.8.2 dosyaları (mimari başına SHA-256), nginx. Root olmayan kullanıcı, salt okunur kök, yetkilerin çoğu düşürülmüş. docker/, compose.yaml
Yönetim paneli Go, yalnız standart kütüphane; Pi ve Docker için ortak, betikleri çağırıyor. İlk kurulumda kayıtlara yazılan kodla hesap (repoda varsayılan şifre yok), komut satırından şifre sıfırlama (has-admin reset-password: rastgele ya da kendi şifren, terminalde gizli sorulur), PBKDF2, POST ile giriş, HttpOnly + SameSite=Strict çerez, hatalı denemede artan bekleme, kalıcı oturum (şifre değişince kapanır). İçerik dile göre ayrı tablolarda; seçip indirme (ilerleme sayfada, kaldığı yerden), seçileni doğrulama, tek tek ya da seçilenleri şifreyle silme (sayfa içi pencere, şifre sunucuda; biri yoksa hiçbiri silinmez); işi başlayanın seçimi kalkar; indirme sürerken satırlarda Sırada / İndiriliyor (yüzdeyle) / İndirilemedi, iş başlayınca ve bitince sayfa içi bildirim; güncel boyut ve "yeni sürüm var" uyarısı. API yolları İngilizce; hatalar error_code + İngilizce message, sayfa seçili dilde gösteriyor. admin/
Panelde güvenlik CSRF koruması kutuya hangi adresle gelindiğine bakmıyor (IP, port, box.lan, yönlendirilmiş port): JSON gövde zorunlu, başka siteden gelen istek (Sec-Fetch-Site: cross-site) reddediliyor, çerez SameSite=Strict. İlk sürümde adres karşılaştırması tarayıcıdan girişi engelliyordu. Yanıtlarda X-Frame-Options: DENY, Content-Security-Policy (frame-ancestors 'none'), Cache-Control: no-store; 5 hatalı denemeden sonra 1 dk'dan 15 dk'ya kadar artan bekleme; şifreler PBKDF2-SHA256 (600.000 tur). admin/handlers.go
Dayanıklılık Panel çökerse yalnız panel 10 sn sonra yeniden başlıyor; ana sayfa ve Kiwix açık kalıyor (önceden tüm konteyner kapanıp açılıyordu). docker/entrypoint.sh
HAS okuyucusu kiwix-serve 3.8 içerik sayfalarında bağlantılar doğrudan açılınca çalışmıyor. Ana sayfadaki kitap bağlantıları ve arama artık okuyucuda açılıyor; üstte HAS çubuğu: ana sayfa, kütüphane, kaynağın başı, kaynaklar arası geçiş, arama, rastgele sayfa. Kiwix kitaplık sayfası da aynı çubukla (/kiwix/ okuyucuya yönleniyor). Eski tarayıcıda Kiwix kitaplığı boş kalırsa kaynakları düz liste gösteriyor. Aramada tüm kurulu kitaplar seçilebiliyor. Kiwix farklı dillerdeki kitaplarda birlikte aramayı reddettiği için (400) "Tüm kaynaklar" araması tek dilde yapılıyor; yanında dil seçimi var (Kiwix'e öneri: kiwix/libkiwix#1434). Kaynak hızlı değişince eski sayfanın yeni seçimi ezmesi düzeldi. www/home/reader.html, www/home/index.html
Dil ve görünüm Ana sayfa, okuyucu ve panel Türkçe/İngilizce; seçim tüm sayfalarda ortak. Koyu tema (Sistem varsayılan/Koyu/Açık). Telefon genişliğinde (320 px'e kadar) okuyucu çubuğu simgelere iniyor, panelde notlar adın altında. Bütün metinler ve tema tek dosyada; yeni dil bir blok. www/home/has.js
Acil sayfası İngilizce Acil sayfası yalnız Türkçeydi, dil düğmesi orada çalışmıyordu. Artık TR/EN. İçme suyu bölümü CDC ve EPA'nın asıl İngilizce metniyle; AFAD ve İstanbul İl Sağlık Müdürlüğü bölümleri Türkçe kaynaklardan çeviri, kaynak satırında yazıyor (AFAD'ın İngilizce sitesi 500 veriyor). Türkçe metin aynı; yalnız içindekilere karbonmonoksit bağlantısı ve su kaynak notu (EPA ve CDC tablolarında litre başına 2 damla doğrudan var). Kaynaklar 29.11.2026'da denetlendi; CDC sayfasının adresi değişmiş (cdc.gov/water-emergency/about/). www/home/acil.html
Erişilebilirlik İçeriğe atla bağlantısı, sayfa bölgeleri, görünür klavye odağı, WCAG AA karşıtlık, ekran okuyucu etiketleri, hata ve iş durumunun duyurulması, ≥24 px dokunma alanı. sayfalar, e2e/tests/a11y.spec.js
Kesin boyutlar Kiwix kataloğundaki gerçek boyutlar (sizes.json): açılışta, 6 saatte bir, indirmeden sonra ve imaj derlenirken; internet yoksa son bilinen değerler (bozuk ya da kesik katalog dosyayı bozmuyor). Harita boyutu cihazda ölçülüyor. content.conf'taki "~" tahminler kaldırıldı. scripts/catalog-sizes.sh, config/sizes.json
Harita algılama Servis modülü IIAB Maps'in yeni yolunu (/library/www/maps) da tanıyor; eski osm-vector-maps de geçerli. scripts/services.d/maps.sh
Disk uyarısı Docker'da ana sayfanın disk uyarısı dosyası hiç yazılmıyordu; artık Pi'deki gibi açılışta ve 6 saatte bir. docker/entrypoint.sh
İndirme wget yerine curl (kaldığı yerden, 5 deneme); wget bağımlılığı kalkıyor (Alpine'deki wget 1.25.0'da düzeltmesi olmayan iki yüksek düzeyli açık var). Kütüphaneyi yenileyen komut KIWIX_LIB_CMD ile seçilebiliyor (varsayılan iiab-make-kiwix-lib, Pi'de değişiklik yok). scripts/download-content.sh
Testler ve CI İmaj testi (docker/test.sh, 160'ı aşkın kontrol), beş mimaride ayrı işler, tarayıcı testleri (Playwright: masaüstü 3 motor + telefon/tablet, yedi tarayıcı kuşağı Chrome 102'ye kadar, axe-core). İmaj yalnız bütün testler geçince ve yalnız main/v* etiketinden yayımlanıyor; her dalda testler koşuyor; her iş adında mimari, işletim sistemi ve Docker sürümü olan bir rapor bırakıyor; haftalık yeniden derleme. Actions sürüm etiketiyle. amd64 imajı bir kez derleniyor; tarayıcı testleri yalnız onu bekliyor ve kuşak başına iki parçada koşuyor (bir koşu ~8 dk, önce 12–13 dk). .github/workflows/, e2e/
Derleme Kiwix dosyalarını indiren ve boyutları üreten aşamalar derleyicinin mimarisinde çalışıyor (QEMU'suz, katalog tek kez). Go testleri imaj derlenirken. Yalnız gereken paketler (util-linux-misc çıkarıldı, imaj 76,5 → 73,8 MB). docker/Dockerfile
Kod biçimi ve belge .editorconfig, Prettier ayarı; CONTRIBUTING.md (içerik ve servis ekleme, kod biçimi, testler); docs/ (iki dilde dokuz belge); docker/README.md (kullanım, panel, güvenlik, test, telefondan erişilemezse), e2e/README.md. kök, docker/, e2e/

Platformlar ve imaj boyutu

Mimari Cihaz örneği İmaj Test
linux/amd64 PC, dizüstü, NAS 74 MB GitHub (indirme + compose dahil)
linux/arm64 Pi 3/4/5 (64 bit) 79 MB GitHub'ın ARM makinesi
linux/arm/v7 32 bit Pi 61 MB QEMU
linux/arm/v6 Pi Zero, Pi 1 66 MB QEMU
linux/386 eski 32 bit PC 59 MB ubuntu-24.04 (ubuntu-latest'teki Docker 29.4.2 32 bit x86'da ağı kapatıyor)

Dil seçimi: Go ve Python (yönetim paneli)

Aynı uç (/api/status, 300 ZIM listesi + disk), 3.000 istek, 50 eşzamanlı:

Ölçüm Go Python Fark
İstek/sn, 1 çekirdek 1.918 istek/sn 49 istek/sn ~39 kat
İstek/sn, 0,25 çekirdek 437 istek/sn 8 istek/sn ~55 kat
En yavaş %1, 1 çekirdek 84 ms 1,38 sn ~16 kat hızlı
En yavaş %1, 0,25 çekirdek 397 ms 11,7 sn ~29 kat hızlı
Bellek 2–10 MB 11–19 MB yaklaşık yarısı
İmaja eklenen boyut 6,6 MB 42,3 MB ~6 kat küçük

Afette kutuya çok kişi bağlanacağı için zayıf donanımdaki fark (0,25 çekirdek) önemli.

Performans: nginx, önce ve sonra

50 eşzamanlı istek (ab -k), istek/sn (parantezde en yavaş %1). ab HTTP/1.0 konuştuğu için nginx bu ölçümlerde sıkıştırma yapmadı; sıkıştırmalı ölçüm aşağıda (gzip_static):

İstek Çekirdek Önce Sonra Fark
Kiwix kataloğu 4 8.440 istek/sn (21 ms) 35.569 istek/sn (7 ms) ~4,2 kat
Kiwix kataloğu 1 2.182 istek/sn (90 ms) 19.945 istek/sn (76 ms) ~9 kat
Kiwix kataloğu 0,5 810 istek/sn (192 ms) 6.635 istek/sn (87 ms) ~8 kat
has.js 4 28.072 istek/sn 51.553 istek/sn ~1,8 kat
Kiwix makalesi 4 5.313 istek/sn (34 ms) 6.820 istek/sn (34 ms) ~1,3 kat
Ana sayfa 4 30.972 istek/sn 31.081 istek/sn aynı
Ana sayfa 1 22.931 istek/sn 15.496 istek/sn daha yavaş

Değişiklikler: nginx çekirdek sayısı kadar, en çok 4 işçiyle çalışıyor (çok çekirdekli makinede boştaki bellek 19 MiB'tan 11 MiB'a indi); Kiwix kataloğu 10 sn önbellekte ve aynı anda gelen istekler tek istekle karşılanıyor (Kiwix "max-age=0" gönderdiği için başlık yok sayılıyor; yoksa her istek 5 sn bekliyordu); has.js tarayıcıda 10 dk, sayfalar ETag ile; gzip. Kiwix'e açık bağlantı tutmak makaleleri yavaşlattığı için kullanılmadı (4 çekirdekte 4.469'a karşı 6.820). Tek çekirdekte sabit sayfalar biraz yavaşladı; Pi 4 çekirdekli.

Sıkıştırma (gzip):

Dosya Önce Sonra
has.js 16,2 KB 5,3 KB
Ana sayfa 26,5 KB 9,7 KB

Önceden sıkıştırılmış sayfalar (gzip_static): nginx sayfaları ve has.js'i her istekte yeniden sıkıştırıyordu. Artık Docker açılışında her sayfanın .gz kopyası yazılıyor, nginx onu gönderiyor (Pi'de değişiklik yok). wrk ile (HTTP/1.1, 50 bağlantı, gzip isteyen istemci), istek/sn:

İstek Çekirdek Önce Sonra Fark
Ana sayfa 1 962 istek/sn 21.036 istek/sn ~22 kat
has.js 1 1.725 istek/sn 30.354 istek/sn ~18 kat
Okuyucu 1 2.003 istek/sn 28.010 istek/sn ~14 kat
Acil sayfası 1 1.791 istek/sn 28.781 istek/sn ~16 kat
Ana sayfa 4 3.806 istek/sn 106.893 istek/sn ~28 kat
has.js 4 6.896 istek/sn 125.608 istek/sn ~18 kat

Tek çekirdekte en yavaş %1 ~100–340 ms'den ~80 ms'ye indi. 4 çekirdekte üst sınırı büyük olasılıkla aynı makinedeki ölçüm aracı belirledi.

kiwix-serve --threads 2, 4 (varsayılan), 8 ve 16 ile denendi: 4 çekirdekte 16 iş parçacığı aramayı ve öneriyi ~%30 hızlandırdı ama makalelerde en yavaş %1'i iki katına çıkardı, tek çekirdekte 8 ve 16 her şeyi yavaşlattı. Varsayılan bırakıldı.

Lighthouse

Lighthouse 13.6.0, Chromium 158; 3 ölçümün ortancası. Puanlar: performans / erişilebilirlik / en iyi uygulamalar / SEO.

Sayfa main (puan) Bu PR (puan)
Ana sayfa, telefon 94 / 80 / 74 / 90 100 / 100 / 78 / 100
Ana sayfa, masaüstü 77 / 80 / 74 / 90 (sayfa yüklenirken kayıyor, CLS 0,75) 100 / 100 / 78 / 100 (CLS 0,01)
Acil sayfası 100 / 88 / 74 / 90 100 / 100 / 78 / 100
Okuyucu — 100 / 100 / 59 / 100
Yönetim paneli (giriş, girişten sonra) — 100 / 100 / 78 / 100

Yapılanlar: ana sayfanın satırları veri beklenmeden çiziliyor, panel veriler gelince açılıyor (ikisi de yüklenirken kayıyordu), favicon.ico 404'ü ve açıklama etiketi. "En iyi uygulamalar"da kalan eksik HTTPS: kutu http://box.lan ile açılıyor. Okuyucudaki 59, ZIM'in içindeki bir betiğin (wombat.js) eskimiş bir tarayıcı özelliğini kullanmasından.

English

For #7 (issue) and #42 (issue) item 23. The Docker edition lives in this repo and uses the same files and scripts as the Pi install. Commits are split by topic.

Highlights

What Before After
Homepage, 1 core (client asking for gzip) 962 req/s 21,036 req/s (~22×)
has.js, 1 core 1,725 req/s 30,354 req/s (~18×)
Kiwix catalog, 1 core 2,182 req/s 19,945 req/s (~9×)
Kiwix catalog, 4 cores 8,440 req/s, slowest 1%: 21 ms 35,569 req/s, slowest 1%: 7 ms
Admin panel, 0.25 core Python: 8 req/s Go: 437 req/s (~55×)
Lighthouse homepage, desktop (performance / accessibility) 77 / 80 points 100 / 100 points
Lighthouse homepage, phone (performance / accessibility) 94 / 80 points 100 / 100 points
Idle memory, many-core machine 19 MiB 11 MiB
CI, one run 12-13 min ~8 min

Measured in Docker on Windows, not on a Pi. Tables and method under "Details" below.

What is included

  • Installed services: the homepage shows only the services on the device as installed (service modules).
  • Docker image: the same scripts as the Pi install, five platforms, non-root, read-only root.
  • Admin panel (Go): first-run setup code, no default password; pick content by language, download, verify, delete with the password; download status on the rows and notices.
  • HAS reader: Kiwix content with the HAS bar; "All sources" search with a language picker (kiwix/libkiwix#1434).
  • Language and look: every page in Turkish/English with a dark theme; the emergency page now in English too (original CDC/EPA wording, AFAD translated).
  • Sizes: the real file sizes from the Kiwix catalog instead of "~" estimates (homepage and panel); last known values offline, the size of an installed file from the disk, the map measured on the device.
  • Documentation: docs/ in Turkish (tr-TR/) and English (en-US/): install and update guide (commands and what their output means), admin panel, API, adding content, testing, security, troubleshooting, decisions.
  • Other: accessibility (WCAG AA), curl instead of wget, the disk warning in Docker, CONTRIBUTING.md.
  • Tests and CI: image test on five platforms, browser tests in seven generations (down to Chrome 102), accessibility checks.

Changes to the Pi install

The changes outside Docker also affect the Pi install; all stay compatible with it:

  • Homepage: reads the services from services.json (missing ones show "not installed yet" and their menu link is hidden; without the file everything is assumed present, as before), book links and search open in the HAS reader (www/home/reader.html), Turkish/English and a theme choice, sizes from the Kiwix catalog.
  • install-homepage.sh: copies the new pages and has.js, runs services.sh, copies sizes.json the first time; .gz copies only with HAS_GZIP=1 (Docker).
  • download-content.sh: curl instead of wget (resume, 5 retries), writes the exact sizes at the end, the library command can be set with KIWIX_LIB_CMD (still iiab-make-kiwix-lib by default).
  • download-content.sh, disk-health.sh: "is the disk mounted" is asked with findmnt --mountpoint instead of mountpoint (reads the mount table; already on the Pi).
  • config/content.conf: the "~" sizes in the notes are gone.
  • New: scripts/catalog-sizes.sh, scripts/services.d/, config/sizes.json.

The admin panel is not installed on the Pi yet (see "Not in this PR").

Usage

docker compose up -d --build                                      # builds the image; http://<device-ip>:8080/home/
docker compose logs has                                           # first-run setup code
docker compose exec has has-admin reset-password <name>           # resets the password to a random one
docker compose exec has has-admin reset-password <name> --stdin   # a password of your choice (asked twice, hidden)
docker compose exec has /opt/has/scripts/download-content.sh      # or from the panel: /admin/

External disk: HAS_LIBRARY=/mnt/ssd/library, port: HAS_PORT=80. On Windows/macOS, phones need a one-time firewall permission for Docker Desktop (see the README).

Tested

What Result
Image test 187/187 with a download (160/160 without); passes on all five platforms
Browser tests, latest browsers 596 passed, 4 skipped
Browser tests, Chrome 102 / Firefox 99 / Safari 15.4 596 passed, 4 skipped (WebKit keyboard; accessibility tests included)
Tests for what must not happen items not installed stay unlinked, things that must stay hidden (notice, Stop, language picker), wrong / mismatched password and an ended session, Kiwix unreachable, 405 for GET, 413 over 64 KB
Accessibility (axe-core, WCAG 2.2 A/AA) 6 pages (English emergency page included) × light/dark, no violations
ShellCheck, hadolint, actionlint, Go tests clean
Raspberry Pi not tested

Measured in Docker on Windows, not on a Pi. Not in this PR: Pi packaging of the panel, the /kiwix/ redirect on the Pi, maps after #5.

Conflicts

Clean against main. Among the open PRs it conflicts with #5 (PR), #19 (PR), #23 (PR), #63 (PR) and #65 (PR) in www/home/index.html (#19 and #23 also in README.md and scripts/install-homepage.sh); whichever is merged first, the other needs an update. Mostly new rows added next to each other in the homepage list.

Details

What is included (in detail)

Topic What it does Files
Installed services Services come from the server (services.d modules → services.json); missing ones show as not installed, their menu link is hidden. scripts/services.sh, scripts/services.d/
Docker image Same layout as IIAB; the install, download and verify scripts run unchanged. Alpine 3.24.4, official static kiwix-serve 3.8.2 pinned by SHA-256, nginx. Non-root, read-only root, most capabilities dropped. docker/, compose.yaml
Admin panel Go, standard library only, shared by Pi and Docker. First-run setup code (no default password), CLI password reset (random, or your own asked on the terminal with hidden typing), PBKDF2, POST login, HttpOnly/SameSite=Strict cookie, growing wait after failures, persistent sessions (ended on password change). Content grouped by language, download with live progress and resume, verify the selection, delete one or the selected files with the password checked on the server (nothing is deleted if one is missing); ticks clear once a job starts; while downloading the rows show Queued / Downloading (with percent) / Failed, and a notice appears when a job starts and ends; exact size and "new version available". English API paths; errors as error_code + English message, localized by the page. admin/
Panel security CSRF protection does not depend on the address the box is reached by (IP, port, box.lan, forwarded port): JSON body required, cross-site requests refused, SameSite=Strict cookie. The first version compared addresses and blocked browser logins. Responses carry X-Frame-Options: DENY, a Content-Security-Policy (frame-ancestors 'none') and Cache-Control: no-store; after 5 failed attempts a wait growing from 1 to 15 min; passwords hashed with PBKDF2-SHA256 (600,000 rounds). admin/handlers.go
Resilience If the panel crashes only the panel restarts after 10 s; the homepage and Kiwix stay up. docker/entrypoint.sh
HAS reader Book links and search on the homepage open in a reader with the HAS bar (home, library, start of the book, source switch, search, random); Kiwix's library page uses the same bar (/kiwix/ redirects to it); lists the sources itself when the library stays empty in older browsers; every installed book selectable in search. Kiwix refuses to search books in different languages together (400), so "All sources" searches one language at a time with a language picker next to it (suggested upstream: kiwix/libkiwix#1434). A quick source switch no longer gets undone by the previous page. www/home/reader.html, www/home/index.html
Language and look Turkish/English on the homepage, reader and panel, one shared choice; dark theme (System default/Dark/Light); phone layout down to 320 px; all texts and the theme in one file. www/home/has.js
Emergency page in English The emergency page was Turkish only and the language buttons did not work there. Now TR/EN. The drinking-water part uses the original English wording from CDC and EPA; the AFAD and Istanbul Provincial Health Directorate parts are translated from the Turkish sources, and the source line says so (AFAD's English site returns 500). The Turkish text is unchanged except a carbon monoxide link in the contents and the water source note (the EPA and CDC tables give 2 drops per litre directly). Sources checked on 2026-11-29; the CDC page moved (cdc.gov/water-emergency/about/). www/home/acil.html
Accessibility Skip link, landmarks, visible focus, WCAG AA contrast, screen reader labels, announced errors and job status, ≥24 px targets. pages, e2e/tests/a11y.spec.js
Exact sizes Real sizes from the Kiwix catalog at start, every 6 h, after downloads and at build time; last known values offline (a bad or cut catalog cannot spoil the file); the map is measured on the device; the "~" estimates are gone from content.conf. scripts/catalog-sizes.sh, config/sizes.json
Map detection The service module also detects the newer IIAB Maps path (/library/www/maps). scripts/services.d/maps.sh
Disk warning Docker never wrote the homepage's disk warning file; now at start and every 6 h, like on the Pi. docker/entrypoint.sh
Downloads curl instead of wget (resume, retries); drops the wget dependency. The library rebuild command can be set with KIWIX_LIB_CMD (no change on the Pi). scripts/download-content.sh
Tests and CI Image test (over 160 checks), a job per platform, Playwright browser tests (desktop engines + phones/tablets, seven browser generations down to Chrome 102, axe-core); published only after every test passes and only from main/v* tags; tests on every branch; a report per job named after platform, OS and Docker version; weekly rebuild; actions by version tag. The amd64 image is built once; the browser tests wait only for it and run in two shards per generation (a run takes ~8 min, 12-13 min before). .github/workflows/, e2e/
Build The stages that download kiwix-tools and build the sizes run on the build machine's arch (no QEMU, catalog fetched once); Go tests run during the build. Only the packages needed (util-linux-misc dropped, image 76.5 → 73.8 MB). docker/Dockerfile
Code style and docs .editorconfig, Prettier settings; CONTRIBUTING.md (adding content and services, code style, tests); docs/ (nine documents in two languages); docker/README.md (usage, panel, security, tests, phone access), e2e/README.md. root, docker/, e2e/

Platforms and image size

Platform Example device Image
linux/amd64 PC, laptop, NAS 74 MB
linux/arm64 Pi 3/4/5 (64-bit) 79 MB
linux/arm/v7 32-bit Pi 61 MB
linux/arm/v6 Pi Zero, Pi 1 66 MB
linux/386 old 32-bit PC 59 MB

Go vs Python (admin panel)

Measure Go Python Difference
Req/s, 1 core 1,918 req/s 49 req/s ~39×
Req/s, 0.25 core 437 req/s 8 req/s ~55×
p99, 1 core 84 ms 1.38 s ~16× faster
p99, 0.25 core 397 ms 11.7 s ~29× faster
Memory 2–10 MB 11–19 MB about half
Added image size 6.6 MB 42.3 MB ~6× smaller

Performance: nginx before and after

Request Cores Before After Difference
Kiwix catalog 4 8,440 req/s (21 ms) 35,569 req/s (7 ms) ~4.2×
Kiwix catalog 1 2,182 req/s (90 ms) 19,945 req/s (76 ms) ~9×
has.js 4 28,072 req/s 51,553 req/s ~1.8×
Kiwix article 4 5,313 req/s 6,820 req/s ~1.3×
Homepage 4 30,972 req/s 31,081 req/s same
Homepage 1 22,931 req/s 15,496 req/s slower

Measured with ab -k, which speaks HTTP/1.0, so nginx did not compress these responses; the compressed numbers are below.

nginx runs one worker per core, at most 4 (on a many-core machine idle memory went from 19 MiB to 11 MiB); the catalog is cached for 10 s with one upstream request per burst (Kiwix's "max-age=0" is ignored, otherwise every request waited 5 s); has.js is cached 10 min in the browser, pages revalidate with ETag; gzip (has.js 16.2 → 5.3 KB). Keep-alive to Kiwix slowed articles down and is not used. Static pages are slightly slower on a single core; a Pi has four.

Precompressed pages (gzip_static): nginx compressed the pages and has.js again on every request. The Docker start now writes a .gz copy of each page and nginx sends it (no change on the Pi). With wrk (HTTP/1.1, 50 connections, gzip), requests/s:

Request Cores Before After Difference
Homepage 1 962 req/s 21,036 req/s ~22×
has.js 1 1,725 req/s 30,354 req/s ~18×
Reader 1 2,003 req/s 28,010 req/s ~14×
Emergency page 1 1,791 req/s 28,781 req/s ~16×
Homepage 4 3,806 req/s 106,893 req/s ~28×
has.js 4 6,896 req/s 125,608 req/s ~18×

On one core the slowest 1% went from ~100–340 ms to ~80 ms. On four cores the ceiling is most likely the benchmark tool on the same machine.

kiwix-serve --threads was tried with 2, 4 (default), 8 and 16: on four cores 16 threads made search and suggestions ~30% faster but doubled the slowest 1% for articles; on one core 8 and 16 slowed everything down. The default stays.

Lighthouse

Lighthouse 13.6.0, Chromium 158; median of 3 runs. Scores: performance / accessibility / best practices / SEO.

Page main (points) This PR (points)
Homepage, phone 94 / 80 / 74 / 90 100 / 100 / 78 / 100
Homepage, desktop 77 / 80 / 74 / 90 (layout shift while loading, CLS 0.75) 100 / 100 / 78 / 100 (CLS 0.01)
Emergency page 100 / 88 / 74 / 90 100 / 100 / 78 / 100
Reader — 100 / 100 / 59 / 100
Admin panel (login, logged in) — 100 / 100 / 78 / 100

The homepage rows are drawn before the data arrives and the panel shows once its data is in (both jumped while loading); no favicon.ico 404; a meta description. The remaining best-practices item is HTTPS: the box is opened over http://box.lan. The reader's 59 comes from a script inside the ZIM (wombat.js) using a deprecated browser feature.

The World Map, Kolibri and the Library/Maps/Admin links in the top menu always
showed as "Installed", even when the device did not have them.

- scripts/services.sh runs the scripts/services.d/<name>.sh modules and writes
  /library/www/html/home/services.json: for each service whether it is installed,
  its URL and its Turkish/English label. A new service is a new module file.
- Modules: kiwix, maps (IIAB osm-vector-maps), kolibri, iiab-admin.
- install-homepage.sh calls it at the end.
- Homepage: a missing item shows "Not installed yet"; a top menu link goes to the
  first installed service and is hidden when there is none. Without the file (older
  installs) nothing changes.

Dünya Haritası, Kolibri ve üst menüdeki Kütüphane/Haritalar/Yönetim, cihazda
olmasa da hep "Kurulu" görünüyordu.

- scripts/services.sh, scripts/services.d/<ad>.sh modüllerini çalıştırıp
  /library/www/html/home/services.json yazar: her servis için kurulu mu, adresi,
  Türkçe/İngilizce adı. Yeni servis = yeni modül dosyası.
- Modüller: kiwix, maps (IIAB osm-vector-maps), kolibri, iiab-admin.
- install-homepage.sh sonunda çağırır.
- Ana sayfa: kurulu olmayan öğe "Henüz yüklenmedi"; üst menü bağlantısı ilk kurulu
  servise gider, hiçbiri yoksa gizlenir. Dosya yoksa (eski kurulum) davranış aynı.
One container for people without a Pi. Same layout as the Pi/IIAB install
(/library/zims, /library/www/html), so install-homepage.sh, download-content.sh and
verify-content.sh run unchanged.

- Alpine 3.24.4, official static kiwix-tools 3.8.2 binaries (pinned version + SHA-256)
- kiwix-serve and nginx run as a non-root user, read-only root filesystem
- download-content.sh: the library rebuild command can be set with KIWIX_LIB_CMD
  (default iiab-make-kiwix-lib, same behaviour)
- GitHub Actions: amd64 smoke test, then amd64/arm64/arm-v7/arm-v6/386 images to
  ghcr.io; weekly rebuild

Pi'si olmayanlar için tek konteyner. Dizin düzeni Pi/IIAB kurulumuyla aynı
(/library/zims, /library/www/html); install-homepage.sh, download-content.sh ve
verify-content.sh değişmeden çalışır.

- Alpine 3.24.4, kiwix-tools 3.8.2 resmî statik ikilileri (sürüm + SHA-256)
- kiwix-serve ve nginx root olmayan kullanıcıyla, salt okunur kök dosya sistemi
- download-content.sh: kütüphaneyi yenileyen komut KIWIX_LIB_CMD ile seçilebilir
  (varsayılan iiab-make-kiwix-lib, davranış aynı)
- GitHub Actions: amd64 duman testi, ardından amd64/arm64/arm-v7/arm-v6/386
  imajı ghcr.io'ya; haftalık yeniden derleme
…ownloads

A single static Go binary under admin/ (has-admin), standard library only. Shared by
the Pi and Docker installs; it runs the scripts in the repo.

- First run: the admin account is created with a setup code written to the logs; no
  default password in the repo
- has-admin reset-password <name>: reset a password from the command line
- PBKDF2-SHA256 (600,000 iterations), login with a POST body, HttpOnly + SameSite=Strict
  session cookie, growing wait after 5 failed attempts, JSON + same-origin check (CSRF)
- Status (disk, ZIMs), pick and download from content.conf, verify, delete; one job at a
  time, output shown on the page
- Errors as error_code + English message; the page is Turkish/English
- Docker: cross-compile stage (tests run during the build), nginx /admin, CI smoke test

admin/ altında tek statik Go dosyası (has-admin), yalnız standart kütüphane.
Pi ve Docker için ortak; repodaki betikleri çağırır.

- İlk kurulum: kayıtlara yazılan kurulum koduyla yönetici hesabı; repoda varsayılan şifre yok
- has-admin reset-password <ad>: komut satırından şifre sıfırlama
- PBKDF2-SHA256 (600.000 yineleme), giriş POST gövdesiyle, oturum çerezi HttpOnly + SameSite=Strict,
  5 hatalı denemeden sonra artan bekleme, JSON + aynı kaynak kontrolü (CSRF)
- Durum (disk, ZIM), content.conf'tan seçip indirme, doğrulama, silme; tek iş, çıktı sayfada
- Hatalar error_code + İngilizce message; sayfa Türkçe/İngilizce
- Docker: çapraz derleme aşaması (testler derlemede), nginx /admin, CI duman testi
The script already uses curl for the catalog and SHA-256; the large download now
uses curl -C - too (resume, 5 retries). A complete partial file is not
re-downloaded. Drops the wget dependency.

Betik katalog ve SHA-256 için zaten curl kullanıyor; büyük dosya indirmesi de
curl -C - ile (kaldığı yerden devam, 5 yeniden deneme). Yarım dosya zaten tamsa
indirme atlanır. wget bağımlılığı kalkar (Alpine'de wget 1.25.0'da düzeltmesi
olmayan iki yüksek düzeyli CVE var; Docker imajı için de gerekli değil).
curl redraws its progress bar with carriage returns. The job reader now replaces the
last line on a \r instead of adding a new one, so the panel shows one live progress
line; only full lines go to last-job.log. Test added. wget is no longer installed in
the image, since download-content.sh uses curl only.

curl ilerleme çubuğunu satır başı (\r) ile yeniliyor. İş okuyucusu artık \r gelince
son satırı değiştiriyor, yeni satır eklemiyor; panelde tek, canlı bir ilerleme satırı
görünüyor, last-job.log'a yalnız tam satırlar yazılıyor. Test eklendi. download-content.sh
yalnız curl kullandığı için imaja wget kurulmuyor.
The Origin vs Host comparison rejected browser logins because nginx passed Host
without the port. Protection is now address-independent: JSON body (cross-site
JSON needs a CORS preflight the panel never grants), Sec-Fetch-Site "cross-site"
refused, SameSite=Strict cookie. Tests cover other addresses, ports and old browsers.

Origin ile Host karşılaştırması, nginx Host'u portsuz geçirdiği için tarayıcıdan
yapılan girişi "cross_origin" diye reddediyordu (127.0.0.1:18081). Afette kutuya
hangi adresle (IP, port, box.lan, captive portal) ulaşılacağı belli değil; adres
karşılaştırması meşru isteği reddedebilir.

Koruma artık adresten bağımsız: JSON gövde zorunlu (başka site CORS ön isteği
olmadan JSON gönderemez, panel CORS izni vermez), Sec-Fetch-Site yalnız
"cross-site" ise ret, oturum çerezi SameSite=Strict. nginx Host'u portuyla geçirir.
Farklı adres/port/eski tarayıcı/başka site durumları için test eklendi.
Delete now asks in an in-page dialog for the logged-in user's password; it is
checked on the server and wrong attempts count towards the login limit.

Silme, tarayıcının confirm() kutusu yerine sayfa içi bir pencereyle soruluyor ve
oturumdaki kullanıcının şifresini istiyor. Şifre sunucuda doğrulanıyor, yanlış
denemeler giriş ile aynı sınıra takılıyor; şifre alanı her açılışta ve işten sonra
temizleniyor. Test: şifresiz ve yanlış şifreyle dosya silinmiyor.
Sessions are stored in sessions.json (hashed tokens) and survive restarts; a
password change, also from the CLI while the panel runs, ends older sessions.

Oturumlar sessions.json'da (0600) tutuluyor; dosyada çerezdeki anahtar değil
SHA-256 özeti var. Kutu ya da konteyner yeniden başlayınca oturum kapanmıyor.
Şifre değişince (panel ya da has-admin reset-password) o kullanıcının eski
oturumları geçersiz; çalışan panel users.json'u her seferinde yeniden okuduğu
için CLI ile sıfırlama yeniden başlatmadan geçerli. reset-password --stdin ile
şifre girdiden verilebiliyor. Test: yeniden başlatmada oturum kalıyor, başka
süreçten şifre değişince kapanıyor.
kiwix-serve 3.x serves /content/ for its own viewer (sandbox CSP); linking there
directly left article links dead and no search bar. Book links and search now use
the viewer.

kiwix-serve 3.x /content/ sayfalarını yalnız kendi görüntüleyicisinin içinde
açılmak üzere sunuyor (sandbox CSP). Ana sayfa doğrudan /content/'e bağlandığı
için makalelerdeki bağlantılar tıklanmıyor, üstte arama çubuğu olmuyordu.
Ana sayfadaki kitap bağlantıları /kiwix/viewer#<kitap>, arama
/kiwix/viewer#search?... oldu. Pi'de de aynı sorun vardı.
HAS reader page around Kiwix content (home, library, source picker, search,
random), dark theme on all pages, every installed source selectable in search.

- www/home/oku.html: Kiwix içeriğini çerçevede gösterir; üstte ana sayfa,
  Kiwix kütüphanesi, açık kaynağın başı, kaynaklar arası açılır liste, arama
  (seçili kaynakta ya da tümünde), rastgele makale; Türkçe/İngilizce. Ana sayfa
  kitap bağlantıları ve arama buraya gider.
- Ana sayfa, acil sayfası, okuyucu ve yönetim paneli cihazın karanlık tema
  ayarına uyar (dengeli kontrast).
- Ana sayfa aramasında listede olmayan kurulu kaynaklar da seçilebilir.
- install-homepage.sh www/home altındaki tüm sayfaları kopyalar.
Reader bar collapses to SVG icons on narrow screens and fits two rows; panel gets
larger touch targets and wraps long names. Checked at 320/390/768/1280 px, light and dark.

- Okuyucu çubuğu dar ekranda simgelere iner (SVG, yazı tipine bağlı değil; tam
  ad title/aria-label'da) ve iki satıra sığar: üstte ana sayfa, kütüphane,
  kaynağın başı, kaynak listesi; altta arama, rastgele, dil.
- Panel: dar ekranda kenar boşluğu, büyük dokunma hedefleri, uzun adlar satır
  kırıyor, Sil düğmesi bölünmüyor.
320, 390, 768, 1280 px genişlikte, açık ve karanlık temada ekran görüntüsüyle denendi.
Reader #library shows Kiwix's library page under the HAS bar (books open in the
reader, dark theme applied); Docker redirects a direct /kiwix/ there.

- Okuyucuda #library: Kiwix'in kitaplık sayfası HAS çubuğunun altında; bir
  kitaba tıklanınca okuyucuda açılır. Karanlık temada kitaplık sayfası da
  koyulaşır (Kiwix'in kendi karanlık teması yok).
- Ana sayfa ve okuyucudaki Kütüphane bağlantısı buraya gider (services.d/kiwix).
- Docker: /kiwix/ doğrudan açılırsa okuyucunun kitaplığına yönlenir; çerçeve
  ?has=1 ile döngüye girmez.
Theme selector (system default, dark, light) on all HAS pages, shared and stored
in the browser, applied before first paint.

Ana sayfa, acil sayfası, okuyucu ve yönetim panelinde tema seçimi. Seçim
tarayıcıda saklanıyor ve tüm HAS sayfalarında ortak; "sistem" cihaz ayarını
izliyor ve ayar değişince anında uyuyor. Tema sayfa çizilmeden önce
uygulandığı için açılışta yanıp sönme yok. Okuyucudaki Kiwix kitaplığı da
seçime uyuyor. Dar ekranda okuyucudaki seçim simgeye iniyor.
docker/test.sh starts the image with the hardening from compose.yaml and checks the
homepage and relative redirects, services.json, Kiwix, first-run setup, login, CSRF
(including a browser using another host name/port), bad input, sessions and users across
a restart, CLI password reset, non-root processes, only port 8080 exposed, read-only root
and the wait after failed attempts. --download fetches a small ZIM via the panel,
verifies and deletes it.

Workflow: hadolint + docker compose config; each of the five platforms is built in its
own job and tested with test.sh (arm64 on an ARM runner, arm/v7 and arm/v6 under QEMU);
amd64 also runs the download and a compose start. The publish job depends on the tests
and reuses their cache. HEALTHCHECK in JSON form (hadolint 2.15 DL3025).

docker/test.sh imajı compose.yaml'daki güvenlik ayarlarıyla açıp dener: ana sayfa ve
göreli yönlendirmeler, services.json, Kiwix, ilk kurulum, giriş, CSRF (başka ad/portla
gelen tarayıcı dahil), hatalı girdiler, yeniden başlatmada oturum ve kullanıcı, CLI ile
şifre sıfırlama, root olmayan süreçler, yalnız 8080'in dışa açık olması, salt okunur kök,
hatalı denemede bekleme. --download panelden küçük bir ZIM indirir, doğrular, siler.

Workflow: hadolint + docker compose config; beş mimari ayrı işte derlenip test.sh ile
deneniyor (arm64 ARM makinede, arm/v7 ve arm/v6 QEMU ile); amd64'te ayrıca indirme ve
compose ile açılış. Yayın işi testlere bağlı ve onların önbelleğini kullanıyor.
HEALTHCHECK JSON biçiminde (hadolint 2.15 DL3025).
… tags

The push trigger used to cover only main, so pushing a side branch or a fork did not
run the workflow at all. Tests now run on every push (with the paths filter); the
publish job is limited to main, v* tags and the weekly build.

Önceden push tetikleyicisi yalnız main'deydi; fork'ta ya da yan dalda push edilince
workflow hiç çalışmıyordu. Testler artık her push'ta (paths süzgeciyle) çalışıyor;
yayın işi main, v* etiketi ve haftalık derlemeyle sınırlı.
The maintainer's has-disk-setup branch uses IIAB Maps (maps_install, /library/www/maps);
the module only looked for the older osm-vector-maps folder, so an installed map would
show as not installed. Both paths are accepted now.

Bakımcının has-disk-setup dalı IIAB Maps'i (maps_install, /library/www/maps) kullanıyor;
modül yalnız eski osm-vector-maps klasörüne bakıyordu, harita kurulu olsa da 'Henüz
yüklenmedi' görünecekti. İki yol da kabul ediliyor.
Before, the container stopped when the panel (has-admin) exited, so with restart:
unless-stopped a crashing panel took the homepage and Kiwix down with it (seen on 386
in CI). The panel now runs in its own loop and restarts after 10 s; the container
stops only when kiwix-serve or nginx stops.

Önceden panel (has-admin) çıkınca wait -n bütün konteyneri kapatıyordu; restart:
unless-stopped ile sürekli çöken bir panel ana sayfayı ve Kiwix'i de kapatıp açardı
(CI'da 386'da görüldü). Panel artık kendi döngüsünde 10 sn arayla yeniden başlıyor;
konteyner yalnız kiwix-serve ya da nginx durunca duruyor.
ubuntu-latest (26.04) ships Docker 29.4.2, whose seccomp profile blocks socketcall
(moby/profiles#21, reverted in 29.4.3; actions/runner-images#14790), so Go and kiwix-serve
have no network on 32-bit x86. The 386 job moves to ubuntu-24.04 (Docker 28.0.4); on that
version + 386 test.sh states the cause and stops instead of weakening the hardening.
README note added.

test.sh: the reset-password check uses the exit code (pipefail + grep -q gave a false
failure on arm/v6); new checks that the homepage and Kiwix stay up while the panel is
stopped and that the panel comes back.

ubuntu-latest (26.04) Docker 29.4.2 ile geliyor; o sürümün seccomp profili socketcall'u
kapatıyor (moby/profiles#21, 29.4.3'te geri alındı; actions/runner-images#14790) ve 32 bit
x86'da Go ile kiwix-serve ağa çıkamıyor. 386 işi Docker 28.0.4'lü ubuntu-24.04'e alındı;
test.sh bu sürüm + 386'da güvenliği gevşetmeden nedeni yazıp duruyor. README'ye not.

test.sh: reset-password kontrolü çıkış koduna bakıyor (pipefail + grep -q yüzünden
arm/v6'da yanlış hata veriyordu); panel kapatılınca ana sayfa ve Kiwix açık kalıyor mu,
panel geri geliyor mu kontrolü eklendi.
The output is captured first and then searched for 'password changed'; piping straight
into 'grep -q' with pipefail could hit SIGPIPE and fail falsely on slow machines.

Çıktı önce değişkene alınıyor, sonra 'password changed' aranıyor; doğrudan '| grep -q'
pipefail ile SIGPIPE'a takılıp yavaş makinede yanlış hata veriyordu.
The healthcheck only covers nginx, so on arm/v7 (QEMU) the check ran before the panel
had logged the setup code; it now waits up to the timeout. '| grep -q' chains can fail
falsely with SIGPIPE under pipefail, so outputs are captured first and the process and
port checks use a single awk step. Under QEMU ps shows {nginx} in the second column, so
the pattern is not anchored.

Sağlık kontrolü yalnız nginx'e baktığı için arm/v7'de (QEMU) panel kurulum kodunu
yazmadan kontrol yapılıyordu; artık zaman aşımına kadar bekleniyor. '| grep -q'
zincirleri pipefail altında SIGPIPE ile yanlış hata verebildiği için çıktılar önce
değişkene alınıyor, süreç ve port kontrolleri tek adımda awk ile. QEMU'da ps ikinci
sütunu {nginx} gösterdiği için desen başa sabitlenmiyor.
The image test grows from 54 to 134 checks (156 with --download):
- image metadata: HEALTHCHECK, port 8080, /library volume, tini entrypoint
- start-up: kiwix-serve version matches the Dockerfile, data dir 700, setup code file 600
- web: missing pages 404, ZIMs and panel data not served, no ../ traversal, Referrer-Policy,
  hidden nginx version, panel X-Frame-Options / Cache-Control / CSP, no outside resources on
  any page (offline), theme choice on every page, reader bar elements, TR + EN text for
  every API error code
- panel: every endpoint needs login, invalid user name, broken JSON, cookie path and 12 h
  lifetime, setup code file removed, status fields, password and cookie never stored in
  plain text, form bodies rejected, no CORS, no GET login, forged cookie, mixed valid and
  unknown download entries, empty delete password
- download: second job rejected while busy, stop and resume, SHA-256 matches, book opens,
  search and random work, content survives a restart, library.xml rebuilt from the ZIMs,
  delete also removes .sha256 and the catalog entry
- CLI: --stdin does not echo the password, short password and unknown command rejected,
  random password works, the old cookie is invalid on the server after logout
- security: no capabilities for the has user, no-new-privileges; memory use and a clean
  stop under 15 s are reported

No '| grep -q' is left in the script: under pipefail it can fail falsely with SIGPIPE.

İmaj testi 54'ten 134 kontrole çıktı (--download ile 156):
- imaj bilgisi: HEALTHCHECK, 8080 portu, /library volume, tini giriş noktası
- açılış: kiwix-serve sürümü Dockerfile'daki ile aynı, veri klasörü 700, kurulum kodu dosyası 600
- web: olmayan sayfa 404, ZIM'ler ve panel verisi dışarıdan okunamıyor, ../ ile yol aşımı yok,
  Referrer-Policy, nginx sürümü gizli, panelde X-Frame-Options / Cache-Control / CSP, hiçbir
  sayfa dışarıdan kaynak yüklemiyor (çevrimdışı), her sayfada tema seçimi, okuyucu çubuğunun
  öğeleri, API'nin her hata kodu için TR + EN metin
- panel: her uç giriş istiyor, geçersiz kullanıcı adı, bozuk JSON, çerez yolu ve 12 saatlik
  ömrü, kurulum kodu dosyasının silinmesi, durum alanları, şifre ve çerez düz metin
  saklanmıyor, form gövdesi reddediliyor, CORS yok, GET ile giriş yok, uydurma çerez, geçerli
  ve bilinmeyen öğe karışık indirme, silmede boş şifre
- indirme: iş sürerken ikinci iş reddediliyor, durdurup kaldığı yerden sürdürme, SHA-256
  eşleşiyor, kitap açılıyor, arama ve rastgele sayfa çalışıyor, içerik yeniden başlatmada
  kalıyor, library.xml ZIM'lerden yeniden kuruluyor, silme .sha256'yı ve katalog kaydını da
  kaldırıyor
- komut satırı: --stdin şifreyi ekrana yazmıyor, kısa şifre ve bilinmeyen komut reddediliyor,
  rastgele şifre çalışıyor, çıkıştan sonra eski çerez sunucuda da geçersiz
- güvenlik: has kullanıcısında yetki yok, no-new-privileges; bellek kullanımı ve 15 sn'den
  kısa düzgün kapanış raporlanıyor

Betikte '| grep -q' kalmadı: pipefail altında SIGPIPE ile yanlış hata verebiliyor.
Every test job now uploads a report, also when it passes, named like
has-disk-armv7-ubuntu26.04-docker29.4.2. It holds environment.txt (runner OS, kernel,
runner image, Docker and containerd, buildx, Go build image, commit, run link, and the
Alpine, Kiwix, nginx and musl versions inside the image), packages.txt (apk list),
test.txt (test output) and container.log; the amd64 job adds compose.log. The opaque
.dockerbuild build records are no longer uploaded; the build summary stays. The compose
step no longer pipes curl into grep -q.

Her test işi artık geçse de bir rapor yüklüyor; adı has-disk-armv7-ubuntu26.04-docker29.4.2
gibi. İçinde environment.txt (makinenin işletim sistemi, çekirdek, runner imajı, Docker ve
containerd, buildx, Go derleme imajı, commit, koşu bağlantısı ve imajdaki Alpine, Kiwix,
nginx, musl sürümleri), packages.txt (apk listesi), test.txt (test çıktısı) ve
container.log var; amd64 işi compose.log da ekliyor. Adı okunmayan .dockerbuild derleme
kayıtları artık yüklenmiyor, derleme özeti kalıyor. compose adımında curl çıktısı artık
grep -q'ya boruyla verilmiyor.
The content list is now one table per language (Turkish, English, multilingual,
then other codes), taken from the second part of the ZIM name (wikipedia_tr_all_maxi
→ tr). Each group header has a select-all checkbox and an "x/y on device" count;
items can be selected across groups at the same time and the selection survives a
refresh. "Verify selected" checks only the selected items that are on the device,
next to "Download selected" and "Verify all". Group tables share column widths, and
long ZIM names wrap after _ and . on narrow screens.

API: /api/status gives each content item a "lang" field; /api/verify accepts
{"files": [...]} to check only those files. Names must match the ZIM name rule and
exist (invalid_file, file_not_found, choose_content for an empty list); each file is
verified in turn and the job fails if any of them is bad. Go tests and test.sh cover
the language field and the selective verify.

İçerik listesi artık dile göre ayrı tablolar (Türkçe, İngilizce, çok dilli, sonra
diğer kodlar); dil ZIM adının ikinci parçasından alınıyor (wikipedia_tr_all_maxi → tr).
Her grup başlığında hepsini seçen bir kutu ve "x/y cihazda" sayısı var; gruplar arası
birlikte seçilebiliyor, seçim yenilemede korunuyor. "Seçilenleri doğrula" yalnız
seçilenlerden cihazda olanları doğruluyor; "Seçilenleri indir" ve "Hepsini doğrula"
yanında. Grup tabloları aynı sütun genişliğinde, uzun ZIM adları dar ekranda _ ve .
sonrasında satır kırıyor.

API: /api/status her içeriğe "lang" alanı ekliyor; /api/verify {"files": [...]} ile
yalnız o dosyaları doğruluyor. Adlar ZIM adı kuralına uymalı ve klasörde olmalı
(invalid_file, file_not_found, boş listede choose_content); dosyalar tek tek
doğrulanıyor, biri bozuksa iş hata koduyla bitiyor. Go testleri ve test.sh dil alanını
ve seçili doğrulamayı deniyor.
The homepage gets TR/EN buttons in the menu, like the admin panel and the reader. The
choice is stored in the browser under has-lang and shared by every HAS page, so a
language picked on the homepage also applies to the reader and the panel. Section
titles, item names and descriptions, table headers, status words, the search box, the
system information line and the footer are translated; sizes use a decimal point in
English and the server time follows the language. Switching language redraws the table
and keeps the source selected for search.

Not translated yet: the disk warnings, which come in Turkish from disk-health.sh, and
the emergency page, whose life-safety text needs a translation checked against its
sources.

Ana sayfaya, panel ve okuyucudaki gibi menüde TR/EN düğmeleri eklendi. Seçim tarayıcıda
has-lang olarak saklanıyor ve tüm HAS sayfalarında ortak; ana sayfada seçilen dil okuyucuda
ve panelde de geçerli. Bölüm başlıkları, içerik adları ve açıklamaları, tablo başlıkları,
durum metinleri, arama kutusu, sistem bilgisi ve alt bilgi çevrildi; İngilizcede boyutlar
ondalık noktayla, sunucu saati seçili dile göre. Dil değişince tablo yeniden çiziliyor,
aramada seçili kaynak korunuyor.

Henüz çevrilmeyenler: disk-health.sh'den Türkçe gelen disk uyarıları ve hayati bilgi
içeren acil sayfası (çevirisi kaynaklarla karşılaştırılarak yapılmalı).
The homepage reads /home/disk.json for its disk and power warning. On the Pi
has-disk-health.timer writes it; in Docker nothing did, so the page got a 404 and never
showed that the disk is full, read-only or has filesystem errors. The entrypoint now
runs scripts/disk-health.sh at start and every six hours, like the timer. The browser
tests found it. test.sh checks disk.json and the homepage TR/EN choice.

Ana sayfa disk ve güç uyarısını /home/disk.json'dan okuyor. Pi'de has-disk-health.timer
yazıyor; Docker'da yazan yoktu, sayfa 404 alıyor ve diskin dolduğunu, salt okunur
olduğunu ya da dosya sistemi hatası olduğunu hiç göstermiyordu. Entrypoint artık
scripts/disk-health.sh'yi zamanlayıcı gibi açılışta ve 6 saatte bir çalıştırıyor.
Tarayıcı testleri buldu. test.sh disk.json'u ve ana sayfadaki TR/EN seçimini deniyor.
Kiwix 3.8's library page draws its book list with script that older browsers do not run
(seen with Chrome 102, Firefox 99 and Safari 15.4 in the browser tests): the page stays
empty. If no book link shows up within eight seconds, the reader now shows the sources
on the device as a plain list of links. Old phones connect to the box in a disaster too.

Kiwix 3.8'in kitaplık sayfası kitap listesini eski tarayıcıların çalıştırmadığı bir
betikle çiziyor (tarayıcı testlerinde Chrome 102, Firefox 99 ve Safari 15.4'te görüldü):
sayfa boş kalıyor. Sekiz saniye içinde kitap bağlantısı çıkmazsa okuyucu artık cihazdaki
kaynakları düz bir bağlantı listesi olarak gösteriyor. Afette kutuya eski telefonlar da
bağlanır.
…nerations

e2e/ starts the Docker image (prepare.sh: its own Docker network, the compose.yaml
hardening, an admin account and two small ZIMs, one English and one Turkish) and runs
Playwright in the official Playwright image (run.sh), so no browser is installed on the
machine.

Devices: Chromium, Firefox and WebKit on desktop; Pixel 7, Galaxy S9+ and Galaxy Tab S4;
iPhone SE (320 px), a large iPhone and iPad Mini; Firefox at phone width. The 28 tests
cover the homepage (menu from services.json, search, book links, language, theme, no
horizontal overflow, no script errors), the emergency page, the reader (book in the
frame, links inside the content, switching sources, search, random page, language,
theme, the library page and opening a book from it or from the fallback list) and the
admin panel (login and logout through the page, localized error text, content grouped
by language, group and cross-group selection, selection kept on refresh, verify
selected, the delete dialog, theme).

.github/workflows/e2e.yml runs them with seven Playwright versions, each with its own
browsers: the latest, and 1.54.2 down to 1.22.2 (Chrome 102, Firefox 99, Safari 15.4,
the last Safari on the iPhone 6s and 7). The older versions are locked in the same
package.json under npm aliases; run.sh mounts the chosen one over @playwright/test.
Tests run one at a time against the shared server, and a wrong password is never sent
to it (the login limit is shared), the error text is checked with a mocked answer. Each
job uploads a report named after the browser generation and Playwright version.

e2e/ Docker imajını açıyor (prepare.sh: kendi Docker ağı, compose.yaml'daki güvenlik
ayarları, yönetici hesabı ve biri İngilizce biri Türkçe iki küçük ZIM) ve Playwright'ı
resmî Playwright imajında çalıştırıyor (run.sh); makineye tarayıcı kurulmuyor.

Cihazlar: masaüstünde Chromium, Firefox, WebKit; Pixel 7, Galaxy S9+, Galaxy Tab S4;
iPhone SE (320 px), büyük iPhone, iPad Mini; telefon genişliğinde Firefox. 28 test ana
sayfayı (services.json'a göre menü, arama, kitap bağlantıları, dil, tema, yatay taşma
yok, betik hatası yok), acil sayfasını, okuyucuyu (kitap çerçevede, içerikteki
bağlantılar, kaynaklar arası geçiş, arama, rastgele sayfa, dil, tema, kitaplık sayfası
ve oradan ya da yedek listeden kitap açma) ve yönetim panelini (arayüzden giriş/çıkış,
seçili dilde hata metni, dile göre gruplu içerik, grup ve gruplar arası seçim, seçimin
yenilemede kalması, seçili doğrulama, silme penceresi, tema) kapsıyor.

.github/workflows/e2e.yml bunları her biri kendi tarayıcılarıyla gelen yedi Playwright
sürümüyle çalıştırıyor: en günceli ve 1.54.2'den 1.22.2'ye kadar (Chrome 102, Firefox 99,
iPhone 6s ve 7'nin son Safari'si 15.4). Eski sürümler aynı package.json'da npm takma
adıyla kilitli; run.sh seçileni @playwright/test'in üstüne bağlıyor. Testler ortak
sunucuya sırayla gidiyor, yanlış şifre gerçek sunucuya gönderilmiyor (giriş sınırı ortak),
hata metni taklit edilmiş cevapla deneniyor. Her iş tarayıcı kuşağı ve Playwright
sürümüyle adlandırılmış bir rapor yüklüyor.
The Docker workflow now refers to actions by their exact release tag (checkout v7.0.1,
setup-qemu v4.4.0, setup-buildx v4.4.1, build-push v7.4.0, metadata v6.2.0, login
v4.8.0, upload-artifact v7.0.2), all the latest releases, so versions are readable and
easy to bump. The new E2E workflow uses the same tags.

Docker iş akışı eylemlere artık tam sürüm etiketiyle bağlanıyor (checkout v7.0.1,
setup-qemu v4.4.0, setup-buildx v4.4.1, build-push v7.4.0, metadata v6.2.0, login v4.8.0,
upload-artifact v7.0.2); hepsi son sürüm, sürümler okunur ve kolay güncellenir. Yeni E2E
iş akışı da aynı etiketleri kullanıyor.
On Linux nothing is needed, Docker adds the port to the firewall itself. On Windows and
macOS the OS firewall asks once to allow Docker Desktop; the permission is per app, not
per port. The README now says where to give it if the prompt was missed or denied, and
mentions client isolation on Wi-Fi extenders and guest networks.

Linux'ta bir şey gerekmiyor, Docker portu güvenlik duvarına kendisi ekliyor. Windows ve
macOS'ta işletim sisteminin güvenlik duvarı Docker Desktop için bir kez izin soruyor;
izin uygulama başına, port başına değil. README artık soru kaçırıldıysa ya da
reddedildiyse iznin nereden verileceğini anlatıyor ve kablosuz genişletici ile misafir
ağlarındaki istemci yalıtımına değiniyor.
On narrow screens the Note column is hidden, so on a phone the content list showed only
ZIM file names, which do not say what an item is. The note (size and description from
content.conf) now appears under the item name when the column is hidden.

Dar ekranda Not sütunu gizli olduğu için telefonda içerik listesinde yalnız ZIM dosya
adları görünüyordu; bunlar içeriğin ne olduğunu söylemiyor. Sütun gizliyken not
(content.conf'taki boyut ve açıklama) artık içerik adının altında görünüyor.
…atively

A new "sizes" stage runs scripts/catalog-sizes.sh on the build machine's architecture
and puts the current Kiwix catalog sizes into the image instead of the repo's starter
list; it does not depend on the target, so the 4.4 MB catalog is fetched once for all
five platforms and cached, and the weekly build keeps it fresh. The kiwix stage only
downloads and unpacks the archive for the target, so it now also runs natively instead
of under QEMU.

catalog-sizes.sh no longer spoils the file when the catalog is bad: unreachable or not
a catalog leaves it untouched (as before), and items missing from a cut catalog keep
their previous values. Tested with a cut catalog, an HTML error page and an unreachable
host; an arm64 build picks the aarch64 kiwix-serve and carries fresh sizes.

Yeni "sizes" aşaması scripts/catalog-sizes.sh'yi derleyen makinenin mimarisinde çalıştırıp
repodaki başlangıç listesi yerine güncel Kiwix katalog boyutlarını imaja koyuyor; hedeften
bağımsız olduğu için 4,4 MB katalog beş mimari için bir kez inip önbellekte kalıyor, haftalık
derleme tazeliyor. kiwix aşaması hedef için arşivi yalnız indirip açtığından artık o da
QEMU yerine yerel çalışıyor.

catalog-sizes.sh katalog bozuksa artık dosyayı bozmuyor: erişilemez ya da katalog değilse
dokunmuyor (önceki gibi), kesik katalogda bulunamayan içerikler eski değerini koruyor. Kesik
katalog, HTML hata sayfası ve erişilemeyen adresle denendi; arm64 derlemesi aarch64
kiwix-serve'ü seçiyor ve güncel boyutları taşıyor.
…n the browser

Measured with ab -k -c 50 in Docker (4 cores, not a Pi), before → after:
Kiwix catalog 8,440 → 35,569 req/s (p99 21 → 7 ms), has.js 28,072 → 51,553,
Kiwix article 5,313 → 6,820.

- worker_processes auto (was 1), worker_connections 1024 (was 512).
- /kiwix/catalog/ is cached for 10 s with proxy_cache_lock, so a burst of clients
  costs Kiwix one catalog build. Kiwix sends "max-age=0, must-revalidate", which has
  to be ignored (proxy_ignore_headers); without it every request waited 5 s on the
  lock (catalog fell to 544 req/s in the first try).
- has.js stays 10 minutes in the browser; pages and json files are sent with
  Cache-Control: no-cache, so they are revalidated with ETag (304 without a body).
- The panel upstream keeps connections open. For Kiwix it is left off: kiwix-serve
  runs with few threads and idle kept-open connections made articles slower
  (4,469 req/s with, 6,820 without).
- On one core static pages got slightly slower (several workers competing).

test.sh: the "deleted file gone" check now looks at the ZIM list only, since the new
"latest" field can carry the same file name from the catalog.

Docker'da ab -k -c 50 ile ölçüldü (4 çekirdek, Pi değil), önce → sonra: Kiwix kataloğu
8.440 → 35.569 istek/sn (p99 21 → 7 ms), has.js 28.072 → 51.553, Kiwix makalesi
5.313 → 6.820.

- worker_processes auto (önce 1), worker_connections 1024 (önce 512).
- /kiwix/catalog/ 10 sn proxy_cache_lock ile önbellekte; aynı anda gelen çok istemci
  Kiwix'e tek katalog üretimine mal oluyor. Kiwix "max-age=0, must-revalidate"
  gönderiyor, yok sayılması gerekiyor (proxy_ignore_headers); yoksa her istek kilitte
  5 sn bekliyordu (ilk denemede katalog 544 istek/sn'ye düştü).
- has.js tarayıcıda 10 dk kalıyor; sayfalar ve json dosyaları Cache-Control: no-cache
  ile gidiyor, ETag ile denetleniyor (değişmediyse gövdesiz 304).
- Panel upstream'inde bağlantılar açık tutuluyor. Kiwix'te kapalı: kiwix-serve az iş
  parçacığıyla çalışıyor, açık tutulan boştaki bağlantılar makaleleri yavaşlattı (açıkken
  4.469, kapalıyken 6.820 istek/sn).
- Tek çekirdekte sabit sayfalar biraz yavaşladı (birden çok işçi yarışıyor).

test.sh: "silinen dosya listede yok" kontrolü artık yalnız ZIM listesine bakıyor; yeni
"latest" alanı katalogdaki aynı dosya adını taşıyabiliyor.
The Docker and E2E workflows each built the amd64 image. The E2E jobs now live in the
Docker workflow: the amd64 test job saves its image as a short-lived artifact
(has-disk-image-amd64, one day) and the seven E2E jobs load it instead of building
again. Publishing waits for lint, the image tests and the browser tests. e2e/** is
added to the workflow paths; the separate e2e.yml is removed.

Docker ve E2E iş akışları amd64 imajını ayrı ayrı derliyordu. E2E işleri artık Docker iş
akışında: amd64 test işi imajını kısa ömürlü bir artifact olarak saklıyor
(has-disk-image-amd64, bir gün), yedi E2E işi yeniden derlemek yerine onu yüklüyor. Yayın
lint, imaj testleri ve tarayıcı testlerini bekliyor. e2e/** iş akışı yollarına eklendi; ayrı
e2e.yml kaldırıldı.
nginx compressed the pages and has.js again on every request. install-homepage.sh now
writes a .gz copy next to each page when HAS_GZIP=1 (set by the Docker entrypoint) and
nginx sends it with gzip_static on. The copies are rewritten on every install, so no
stale copy is left; json files and Kiwix are still compressed on the fly. On the Pi
(IIAB nginx) nothing changes: without HAS_GZIP the script only removes old copies.

Measured with wrk (HTTP/1.1, 50 connections, Accept-Encoding: gzip) in Docker, not on
a Pi, before → after, requests/s:
- 1 core: homepage ~960 → ~21,000, has.js ~1,720 → ~30,350, reader ~2,000 → ~28,000,
  emergency page ~1,790 → ~28,800.
- 4 cores: homepage ~3,800 → ~107,000, has.js ~6,900 → ~125,600.
gzip -9 copies are slightly smaller than nginx level 5 (homepage 10,151 → 10,127 bytes).

The earlier ab numbers were uncompressed: ab speaks HTTP/1.0 and nginx only compresses
HTTP/1.1 by default (gzip_http_version), so wrk is used for this one.

test.sh: index.html.gz exists, every page unpacks to the same bytes as the plain page,
Vary: Accept-Encoding is sent. 152/152 locally; ETag and 304 work with the .gz copy.

nginx sayfaları ve has.js'i her istekte yeniden sıkıştırıyordu. install-homepage.sh artık
HAS_GZIP=1 olduğunda (Docker başlangıcı verir) her sayfanın yanına .gz kopyası yazıyor,
nginx gzip_static ile onu gönderiyor. Kopyalar her kurulumda yeniden yazılır, eski kopya
kalmaz; json dosyaları ve Kiwix yine anında sıkıştırılır. Pi'de (IIAB nginx) değişiklik
yok: HAS_GZIP olmadan betik yalnız eski kopyaları siler.

Docker'da wrk ile ölçüldü (HTTP/1.1, 50 bağlantı, Accept-Encoding: gzip), Pi değil,
önce → sonra, istek/sn:
- 1 çekirdek: ana sayfa ~960 → ~21.000, has.js ~1.720 → ~30.350, okuyucu ~2.000 → ~28.000,
  acil sayfası ~1.790 → ~28.800.
- 4 çekirdek: ana sayfa ~3.800 → ~107.000, has.js ~6.900 → ~125.600.
gzip -9 kopyaları nginx'in 5. düzeyinden biraz küçük (ana sayfa 10.151 → 10.127 bayt).

Önceki ab ölçümleri sıkıştırmasızdı: ab HTTP/1.0 konuşuyor, nginx varsayılan olarak yalnız
HTTP/1.1'i sıkıştırıyor (gzip_http_version); bu ölçümde wrk kullanıldı.

test.sh: index.html.gz var, her sayfa açılınca düz sayfayla aynı, Vary: Accept-Encoding
gönderiliyor. Yerelde 152/152; ETag ve 304 .gz kopyasıyla çalışıyor.
…tests

.editorconfig already pointed to CONTRIBUTING.md, which did not exist. It covers:
- adding a ZIM: the content.conf line, the homepage CATS item (zim is matched as a
  prefix), regenerating config/sizes.json with catalog-sizes.sh, the texts in has.js;
- adding a service module in scripts/services.d (check, size, typical, data-service);
- code style: EditorConfig, Prettier 3.10.0 for JS/JSON/YAML, HTML by hand with no
  outside resources and support down to Chrome 102 / Firefox 99 / Safari 15.4,
  ShellCheck 0.10.0, no "| grep -q" under pipefail, Go standard library with vet/test,
  comments in Turkish and English, commit messages;
- running docker/test.sh and the browser tests.
README's repo layout lists it.

.editorconfig CONTRIBUTING.md'yi gösteriyordu ama dosya yoktu. İçerik:
- ZIM ekleme: content.conf satırı, ana sayfadaki CATS öğesi (zim ön ek olarak eşlenir),
  catalog-sizes.sh ile config/sizes.json'u yeniden üretme, has.js'teki metinler;
- scripts/services.d'ye servis modülü ekleme (check, size, typical, data-service);
- kod biçimi: EditorConfig, JS/JSON/YAML için Prettier 3.10.0, HTML elle, dışarıdan kaynak
  yok, Chrome 102 / Firefox 99 / Safari 15.4'e kadar destek, ShellCheck 0.10.0, pipefail
  altında "| grep -q" yok, Go'da standart kitaplık + vet/test, yorumlar Türkçe ve
  İngilizce, commit mesajları;
- docker/test.sh ve tarayıcı testlerini çalıştırma.
README'deki repo yapısında yer alıyor.
…tier

CONTRIBUTING says `npx prettier@3.10.0 --check .` passes; it did not for these two files.
Only quotes and the overrides line change (single → double quotes in docker.yml).
actionlint is clean.

CONTRIBUTING `npx prettier@3.10.0 --check .` geçer diyor; bu iki dosyada geçmiyordu.
Yalnız tırnaklar ve overrides satırı değişti (docker.yml'de tek → çift tırnak).
actionlint temiz.
The search box used to offer only the items marked search:true. It now lists every
installed book, so the flag was no longer read anywhere; it only confused new entries.
docker/test.sh --download 177/177, browser tests (desktop Chromium) 40/40.

Arama kutusu eskiden yalnız search:true işaretli öğeleri gösteriyordu. Artık kurulu
bütün kitapları listelediği için işaret hiçbir yerde okunmuyordu; yeni girdilerde yalnız
kafa karıştırıyordu. docker/test.sh --download 177/177, tarayıcı testleri (masaüstü
Chromium) 40/40.
…r a job starts

- "Delete selected" deletes the selected items that are on the device. /api/delete
  now takes "files" next to "file"; the password is asked once in the same dialog
  (the files listed one per line) and wrong attempts count towards the login limit.
  If any name is invalid or missing, nothing is deleted; the Kiwix library is
  rebuilt once at the end. The response is {"removed": [...]}.
- After a download starts or a delete finishes, those items are unselected (the group
  box follows), so nothing is downloaded again by accident.

Tests: Go (one password deletes all; wrong password, missing file, invalid name and
empty selection delete nothing), docker/test.sh --download 179/179 (a missing file in
the selection keeps the file, the real delete goes through "files"), browser tests
416 passed / 4 skipped on the latest browsers and on Chrome 102 / Firefox 99 /
Safari 15.4 (delete-selected dialog, warning without a selection, ticks cleared after
a download with a mocked server answer).

- "Seçilenleri sil" seçilenlerden cihazda olanları siler. /api/delete artık "file"ın
  yanında "files" da alıyor; şifre aynı pencerede bir kez sorulur (dosyalar alt alta),
  yanlış denemeler giriş sınırına sayılır. Bir ad bile geçersiz ya da yoksa hiçbir şey
  silinmez; Kiwix kütüphanesi sonunda bir kez yenilenir. Cevap {"removed": [...]}.
- İndirme başlayınca ya da silme bitince o öğelerin seçimi kalkar (grup kutusu da),
  yanlışlıkla yeniden indirilmez.

Testler: Go (tek şifreyle hepsi silinir; yanlış şifre, olmayan dosya, geçersiz ad ve
boş seçimde hiçbir şey silinmez), docker/test.sh --download 179/179 (seçimde olmayan
dosya varsa dosya kalır, gerçek silme "files" ile), tarayıcı testleri en güncel
tarayıcılarda ve Chrome 102 / Firefox 99 / Safari 15.4'te 416 geçti / 4 atlandı
(seçilenleri sil penceresi, seçim yokken uyarı, taklit sunucu cevabıyla indirmeden
sonra seçimin kalkması).
"has-admin reset-password <user> --stdin" read one line silently: on a terminal there
was no prompt and the password was echoed. On a terminal it now asks twice with the
typing hidden (stty -echo, restored on Ctrl+C too) and fails without changes if the two
do not match. From a pipe it reads one line as before. A random reset now also prints
how to choose your own password. Standard library only; without stty it warns that
the typing will be visible.

Checked in a pty (script): matching passwords change it, different ones fail, the
pipe still works; go vet/test clean.

"has-admin reset-password <kullanıcı> --stdin" sessizce bir satır okuyordu: terminalde
soru yoktu, şifre ekranda görünüyordu. Artık terminalde iki kez soruyor, yazılan
görünmüyor (stty -echo, Ctrl+C'de de geri açılıyor); ikisi aynı değilse hiçbir şey
değiştirmeden hata veriyor. Borudan eskisi gibi bir satır okuyor. Rastgele sıfırlama
kendi şifreni nasıl belirleyeceğini de yazıyor. Yalnız standart kitaplık; stty yoksa
yazılanın görüneceği uyarısı çıkıyor.

pty'de (script) denendi: aynı şifreler değiştiriyor, farklılar hata veriyor, boru
çalışıyor; go vet/test temiz.
… descriptions

Lighthouse 13.6.0 (Chromium 158, median of 3 runs) found:
- The homepage jumped while loading (CLS 0.22 on a phone, 0.75 on a desktop): the
  table was empty until the catalog and service data arrived. The rows are now drawn
  at once with the status "…" and updated in place.
- The admin panel jumped after login (CLS 0.63 on a phone): it is now shown once its
  first data is in.
- Every page logged a 404 for /favicon.ico. The pages declare an empty icon (data:);
  the panel, whose CSP blocks data:, and Kiwix content pages get a 204 from nginx.
- No meta description on the four pages.

Scores (performance / accessibility / best practices / SEO), main → this branch:
- Homepage, phone: 94/80/74/90 → 100/100/78/100
- Homepage, desktop: 77/80/74/90 → 100/100/78/100 (CLS 0.75 → 0.01)
- Emergency page: 100/88/74/90 → 100/100/78/100
- Reader 100/100/59/100, admin panel (login and logged in) 100/100/78/100.
The remaining best-practices item is HTTPS (the box runs on http://box.lan); the
reader's 59 comes from a deprecated API used by wombat.js inside the ZIM.

test.sh: /favicon.ico answers 204. Browser tests: the Firefox runs that caught the CSP
message on the panel pass after dropping the data: icon there; docker/test.sh 152/152
before this check was added.

Lighthouse 13.6.0 (Chromium 158, 3 ölçümün ortancası) şunları buldu:
- Ana sayfa yüklenirken kayıyordu (telefonda CLS 0,22, masaüstünde 0,75): tablo katalog
  ve servis verisi gelene kadar boştu. Satırlar artık hemen "…" durumuyla çiziliyor ve
  yerinde güncelleniyor.
- Yönetim paneli girişten sonra kayıyordu (telefonda CLS 0,63): artık ilk veriler
  gelince açılıyor.
- Her sayfa /favicon.ico için 404 yazıyordu. Sayfalar boş simge (data:) bildiriyor; CSP'si
  data:'ya izin vermeyen panel ve Kiwix içerik sayfaları nginx'ten 204 alıyor.
- Dört sayfada meta description yoktu.

Puanlar (performans / erişilebilirlik / en iyi uygulamalar / SEO), main → bu dal:
- Ana sayfa, telefon: 94/80/74/90 → 100/100/78/100
- Ana sayfa, masaüstü: 77/80/74/90 → 100/100/78/100 (CLS 0,75 → 0,01)
- Acil sayfası: 100/88/74/90 → 100/100/78/100
- Okuyucu 100/100/59/100, yönetim paneli (giriş ve girişten sonra) 100/100/78/100.
En iyi uygulamalarda kalan HTTPS (kutu http://box.lan üzerinde); okuyucudaki 59, ZIM
içindeki wombat.js'in kullandığı eskimiş bir API'den.

test.sh: /favicon.ico 204 dönüyor. Tarayıcı testleri: paneldeki CSP mesajını yakalayan
Firefox koşuları, oradaki data: simgesi kaldırılınca geçiyor; docker/test.sh bu kontrol
eklenmeden önce 152/152.
The emergency page was Turkish only and the language buttons did not work on it. It now
has TR / EN like the other pages; both languages are on the page and the selected one
shows (Turkish without JavaScript; printing prints the selected language).

- Drinking water: the CDC ("How to Make Water Safe in an Emergency") and EPA
  ("Emergency Disinfection of Drinking Water") parts use the original English wording.
- Earthquake, trapped under debris, after the earthquake, communication, emergency bag
  (AFAD) and carbon monoxide (Istanbul Provincial Health Directorate) are translated
  from the Turkish sources; each source line says so. AFAD's English site returned 500,
  no official English version was found.
- Turkish text unchanged, except the missing carbon monoxide link in the contents and
  the water source note: the EPA and CDC tables give 2 drops per litre directly.
- The frame texts (title, skip link, breadcrumb, theme, footer) are in has.js
  ("emergency").

Sources checked 2026-11-29: CDC page moved to cdc.gov/water-emergency/about/
(2024-09-19): 1 minute, 3 minutes above 6,500 feet, 2 drops of 5-9% bleach per litre;
EPA (2026-02-24): 2 drops of 6% bleach per litre, 8 per gallon.

Tests: language switch (same number of source lines in both languages, no overflow, no
console errors) and an axe check of the English page; browser tests 446 passed /
4 skipped on the latest browsers and on Chrome 102 / Firefox 99 / Safari 15.4;
docker/test.sh 153/153.

Acil sayfası yalnız Türkçeydi, dil düğmeleri bu sayfada çalışmıyordu. Artık öteki
sayfalardaki gibi TR / EN var; iki dil de sayfada, seçili olan görünüyor (JavaScript
yoksa Türkçe; yazdırınca seçili dil basılır).

- İçme suyu: CDC ve EPA bölümleri asıl İngilizce metinle.
- Deprem, enkaz, deprem sonrası, haberleşme, afet çantası (AFAD) ve karbonmonoksit
  (İstanbul İl Sağlık Müdürlüğü) Türkçe kaynaklardan çeviri; kaynak satırında yazıyor.
  AFAD'ın İngilizce sitesi 500 verdi, resmî İngilizce karşılık bulunamadı.
- Türkçe metin aynı; yalnız içindekilere eksik karbonmonoksit bağlantısı ve su bölümünün
  kaynak notu (EPA ve CDC tablolarında litre başına 2 damla doğrudan var).
- Çerçeve metinleri (başlık, içeriğe geç, yol, tema, alt bilgi) has.js'de ("emergency").

Kaynaklar 2026-11-29'da denetlendi: CDC sayfası cdc.gov/water-emergency/about/ adresine
taşınmış (19.09.2024): 1 dakika, 6.500 feet üstünde 3 dakika, %5-9 çamaşır suyundan
litre başına 2 damla; EPA (24.02.2026): %6'dan litre başına 2, galon başına 8 damla.

Testler: dil geçişi (iki dilde aynı sayıda kaynak satırı, taşma yok, konsol hatası yok)
ve İngilizce sayfanın axe denetimi; tarayıcı testleri en güncel tarayıcılarda ve
Chrome 102 / Firefox 99 / Safari 15.4'te 446 geçti / 4 atlandı; docker/test.sh 153/153.
When the source was changed while the previous page was still loading, that page's
late "load" event could take over again: the reader went back to the old book and the
address bar followed it. Seen once on the iPhone project in CI (reader "switching
between sources", flaky). The reader now remembers the page it asked for; a load from
another source is ignored and the requested page is opened again (at most twice, so
it cannot loop). The random button clears it.

New test "the last choice wins when switching sources quickly" (three changes in a
row). With the old code 7 of 200 runs failed (10 repeats on every device); with the
fix 200 of 200 pass.

Önceki sayfa yüklenirken kaynak değiştirilince o sayfanın geç gelen "load" olayı yeniden
devreye girebiliyordu: okuyucu eski kitaba dönüyor, adres çubuğu da onu izliyordu. CI'da
iPhone'da bir kez görüldü ("kaynaklar arası geçiş", flaky). Okuyucu artık istediği sayfayı
hatırlıyor; başka kaynaktan gelen yükleme yok sayılıp istenen sayfa yeniden açılıyor (en
çok iki kez, döngü olmaz). Rastgele düğmesi bunu temizliyor.

Yeni test "hızlı kaynak değişiminde son seçim kalır" (art arda üç değişiklik). Eski kodla
200 koşunun 7'si düştü (her cihazda 10 tekrar); düzeltmeyle 200/200 geçiyor.
…b starts or ends

- A notice at the bottom of the page when a download starts ("Download started: N
  items") and when a download or verification ends (finished / ended with an error and
  the exit code). It is a status region, so screen readers announce it; errors stay
  longer. The box serves plain HTTP, so browser notifications (secure context only)
  are not used.
- While a download runs, the content rows say Queued, Downloading (with the percent
  from curl), Downloaded or Failed. The server now records which prefixes a download
  covers (job.items); the status comes from the job's output lines.

Tests: the download test expects the start notice; a new test mocks the job state
(one item downloading at 42.5%, one queued, then the job ends) and checks the rows and
the end notice. Browser tests 466 passed / 4 skipped on the latest browsers; on
Chrome 102 / Firefox 99 / Safari 15.4 in two shards 234 + 232 passed / 4 skipped.
go vet/test clean.

- İndirme başlayınca ("İndirme başladı: N içerik") ve indirme ya da doğrulama bitince
  (bitti / hata ile bitti ve çıkış kodu) sayfanın altında bildirim. Durum bölgesi olduğu
  için ekran okuyucu duyuruyor; hata bildirimi daha uzun kalıyor. Kutu düz HTTP sunduğu
  için tarayıcı bildirimleri (yalnız güvenli bağlamda) kullanılmadı.
- İndirme sürerken içerik satırlarında Sırada, İndiriliyor (curl'den yüzdeyle), İndirildi
  ya da İndirilemedi yazıyor. Sunucu indirmenin hangi ön ekleri kapsadığını kaydediyor
  (job.items); durum işin çıktı satırlarından.

Testler: indirme testi başlangıç bildirimini bekliyor; yeni test iş durumunu taklit
ediyor (biri %42,5 indiriliyor, biri sırada, sonra iş bitiyor), satırlara ve bitiş
bildirimine bakıyor. Tarayıcı testleri en güncel tarayıcılarda 466 geçti / 4 atlandı;
Chrome 102 / Firefox 99 / Safari 15.4'te iki parçada 234 + 232 geçti / 4 atlandı.
go vet/test temiz.
- util-linux-misc (2.3 MB) was only there for `mountpoint`. disk-health.sh and
  download-content.sh now ask `findmnt --mountpoint`, which reads the mount table
  (mountpoint only compares device numbers) and is already in the image and on the Pi.
- nginx started one worker per core: 17 in Docker Desktop's VM. The entrypoint now
  starts as many as there are cores, at most 4 (4 on a Pi); NGINX_WORKERS overrides it.

Measured, before → after: image 76.5 MB → 73.8 MB; idle container memory 19.3 MiB →
11.3 MiB on a 16-core Docker VM (no change on a 4-core Pi). docker/test.sh --download
180/180; browser tests as in the previous commit.

- util-linux-misc (2,3 MB) yalnız `mountpoint` için vardı. disk-health.sh ve
  download-content.sh artık `findmnt --mountpoint` soruyor; bağlama tablosuna bakıyor
  (mountpoint yalnız aygıt numarasını karşılaştırır), imajda ve Pi'de zaten var.
- nginx her çekirdeğe bir işçi açıyordu: Docker Desktop sanal makinesinde 17. Başlangıç
  betiği artık çekirdek sayısı kadar, en çok 4 açıyor (Pi'de 4); NGINX_WORKERS ile
  değiştirilebilir.

Ölçüm, önce → sonra: imaj 76,5 MB → 73,8 MB; boştaki konteyner belleği 16 çekirdekli
Docker sanal makinesinde 19,3 MiB → 11,3 MiB (4 çekirdekli Pi'de değişmez).
docker/test.sh --download 180/180; tarayıcı testleri önceki commit'teki gibi.
…n two

After merging the Docker and E2E workflows the browser tests waited for all five
platform tests (~2.7 min), so a run took 12-13 min instead of ~11 (job time went down,
~67 → 53-60 min, since the E2E jobs no longer built the image). Each browser job spent
12 s on setup and 6.5-10 min running Playwright with one worker.

- A first job builds the amd64 image and uploads it; the amd64 image test and the
  browser tests load it, so it is built exactly once.
- The browser tests wait only for that image, not for the other platforms.
- Every browser generation is split in two with `playwright --shard` (14 jobs, each
  with its own HAS container). 1 lint + 5 platforms + 14 parts = 20, GitHub Free's
  limit for concurrent jobs. Coverage stays the same: every test on every device in
  every generation. Locally the oldest generation took 9 min in one job and 5 + 5 min
  in two (235 tests each).
- The paths filter now has scripts/** (the whole scripts/ folder goes into the image;
  catalog-sizes.sh and disk-health.sh were missing).

actionlint 1.7.7 clean.

Docker ve E2E iş akışları birleşince tarayıcı testleri beş mimarinin testini (~2,7 dk)
bekliyordu; koşu ~11 yerine 12-13 dk sürdü (toplam iş süresi ~67'den 53-60 dk'ya indi,
çünkü E2E işleri imajı derlemiyordu). Her tarayıcı işi 12 sn hazırlık, 6,5-10 dk tek
işçili Playwright koşusu harcıyordu.

- İlk iş amd64 imajını derleyip yüklüyor; amd64 imaj testi ve tarayıcı testleri onu
  yüklüyor, imaj tam bir kez derleniyor.
- Tarayıcı testleri yalnız bu imajı bekliyor, diğer mimarileri beklemiyor.
- Her tarayıcı kuşağı `playwright --shard` ile ikiye bölünüyor (14 iş, her biri kendi HAS
  konteyneriyle). 1 lint + 5 mimari + 14 parça = 20, GitHub Free'nin eşzamanlı iş sınırı.
  Kapsam aynı: her test, her kuşakta, her cihazda. Yerelde en eski kuşak tek işte 9 dk,
  iki parçada 5 + 5 dk (her biri 235 test).
- paths filtresine scripts/** (imaja scripts/ klasörünün tamamı giriyor; catalog-sizes.sh
  ve disk-health.sh eksikti).

actionlint 1.7.7 temiz.
`.toast{display:flex}` overrode the hidden attribute, so an empty green box sat at the
bottom of the panel all the time. `.toast[hidden]{display:none}` restores it. The tests
only checked that the notice appears; they now also check that it is hidden when the
panel opens and after the close button.

`.toast{display:flex}` hidden özniteliğini eziyordu; panelin altında boş yeşil bir kutu
hep duruyordu. `.toast[hidden]{display:none}` düzeltiyor. Testler yalnız bildirimin
göründüğüne bakıyordu; artık panel açılınca ve kapat düğmesinden sonra gizli olduğuna
da bakıyor.
…ge picker

kiwix-serve refuses a search across books in different languages (400 "Two or more
books in different languages would participate in search", by design since
libkiwix#838), so "All sources" failed on any box with Turkish and English books. When
the books are in several languages, the reader now adds `books.filter.lang`: the page
language if there are books in it, else the language with the most books. A selector
next to "All sources" lists the languages with their book counts (hidden when a source
is selected or there is one language), remembers the choice and re-runs an open search;
the search box says which language it searches. The homepage search goes through the
reader, so it is fixed too.

Tests: an all-sources search with books in two languages gets no 4xx and no "Invalid
request"; the selector is hidden with a source selected, shown with "All sources", and
every language in it searches without error. Browser tests 486 passed / 4 skipped on
the latest browsers and on Chrome 102 / Firefox 99 / Safari 15.4; docker/test.sh 153/153.

kiwix-serve farklı dillerdeki kitaplarda birlikte aramayı reddediyor (400 "Two or more
books in different languages…", libkiwix#838'den beri bilerek); Türkçe ve İngilizce kitabı
olan her kutuda "Tüm kaynaklar" araması hata veriyordu. Kitaplar birden çok dildeyse
okuyucu artık `books.filter.lang` ekliyor: o dilde kitap varsa sayfanın dili, yoksa en çok
kitabı olan dil. "Tüm kaynaklar"ın yanında dilleri kitap sayısıyla gösteren bir seçim var
(bir kaynak seçiliyken ya da tek dil varken gizli); seçim hatırlanıyor, açık arama yeni
dilde yeniden yapılıyor; arama kutusu hangi dilde aradığını yazıyor. Ana sayfa araması
okuyucudan geçtiği için o da düzeldi.

Testler: iki dilde kitapla tüm kaynaklarda arama 4xx ve "Invalid request" almıyor; seçim
bir kaynak seçiliyken gizli, "Tüm kaynaklar"da görünür, içindeki her dil hatasız arıyor.
Tarayıcı testleri en güncel tarayıcılarda ve Chrome 102 / Firefox 99 / Safari 15.4'te
486 geçti / 4 atlandı; docker/test.sh 153/153.
@ramazansancar ramazansancar changed the title Docker imajı, yönetim paneli ve HAS okuyucusu (tüm mimariler) / Docker image, admin panel and HAS reader (all platforms) feat(docker): Docker imajı, yönetim paneli ve HAS okuyucusu / Docker image, admin panel and HAS reader Nov 29, 2026
The other pages and the code use English names ("reader" in has.js, the tests and the
docs); only the Turkish file name stood out. Links from the homepage, the /kiwix/
redirect in nginx, the Kiwix service module, test.sh and the browser tests now point
to /home/reader.html. The page has not been released, so no old address is kept.

Okuyucu sayfasının adı oku.html'den reader.html'e. Öteki sayfalar ve kod İngilizce adlar
kullanıyor (has.js, testler ve belgelerde "reader"); yalnız Türkçe dosya adı ayrı
duruyordu. Ana sayfadaki bağlantılar, nginx'teki /kiwix/ yönlendirmesi, Kiwix servis
modülü, test.sh ve tarayıcı testleri artık /home/reader.html'i gösteriyor. Sayfa henüz
yayımlanmadığı için eski adres tutulmadı.
The CI run 46308746698 failed once more on the iPhone ("switching between sources",
flaky). The trace showed that no request for the new book was ever made: the source
picker had set the new address, but before its hashchange event ran, the old page
finished loading and its load handler wrote the old address back with replaceState.
When hashchange then fired it read the old address, so the choice was lost. The
previous fix (58061da) only covered a late load arriving after the new page started.

The reader now remembers the address it last opened. If the address bar holds a
different one when a page finishes loading (a change not handled yet), that address
is opened instead of being overwritten. Links that lead from one book to another
still update the address as before.

Reader tests repeated 5 times on every device: 700 passed. Full browser tests 486
passed / 4 skipped on the latest browsers and on Chrome 102 / Firefox 99 / Safari 15.4;
docker/test.sh 153/153.

CI koşusu 46308746698'de iPhone'da bir kez daha düştü ("kaynaklar arası geçiş", flaky).
İz dosyası yeni kitap için hiç istek yapılmadığını gösterdi: kaynak seçimi yeni adresi
yazmış, ama hashchange olayı çalışmadan eski sayfanın yüklemesi bitmiş ve onun load
işleyicisi eski adresi replaceState ile geri yazmıştı. hashchange sonra çalışınca eski
adresi okudu, seçim kayboldu. Önceki düzeltme (58061da) yalnız yeni sayfa başladıktan
sonra gelen geç yüklemeyi kapsıyordu.

Okuyucu artık son açtığı adresi hatırlıyor. Bir sayfa yüklendiğinde adres çubuğunda
başka bir adres varsa (henüz işlenmemiş bir değişiklik), üstüne yazılmak yerine o adres
açılıyor. Bir kitaptan başka kitaba giden bağlantılar adresi eskisi gibi güncelliyor.

Okuyucu testleri her cihazda 5 tekrar: 700 geçti. Tarayıcı testlerinin tamamı en güncel
tarayıcılarda ve Chrome 102 / Firefox 99 / Safari 15.4'te 486 geçti / 4 atlandı;
docker/test.sh 153/153.
docs/README.md lists every document with its Turkish and English title. Each document
exists in docs/tr-TR/ and docs/en-US/ with the same file name:

- guide.md: installing on a Pi and with Docker, downloading content, updating, backups
  and removal, with what every script's output lines and exit codes mean
  (setup-ssd.sh, install.sh, download-content.sh, status.sh, disk-health.sh,
  verify-content.sh) and references (Internet-in-a-Box, Kiwix, Docker Compose).
- admin-panel.md: first setup, login, password reset, the content table, jobs and notices.
- api.md: every endpoint with request and response examples, the error codes with their
  HTTP status, the CSRF and login-limit rules, has-admin commands and variables.
- adding-content.md: a ZIM or a service, the license rule, sizes.json, texts.
- testing.md: docker/test.sh, the browser tests, code checks and the CI layout.
- security.md: what the box protects against, what runs as which user, what is not
  recorded, when it connects out, the supply chain.
- troubleshooting.md: Docker, panel, homepage/reader and Pi problems.
- decisions.md: why things are the way they are, with the measurements.

All relative links were checked. README's repo layout lists docs/.

docs/README.md her belgeyi Türkçe ve İngilizce başlığıyla listeliyor. Her belge
docs/tr-TR/ ve docs/en-US/ içinde aynı dosya adıyla var:

- guide.md: Pi'de ve Docker'da kurulum, içerik indirme, güncelleme, yedekleme ve
  kaldırma; her betiğin çıktı satırlarının ve çıkış kodlarının anlamı (setup-ssd.sh,
  install.sh, download-content.sh, status.sh, disk-health.sh, verify-content.sh) ve
  kaynaklar (Internet-in-a-Box, Kiwix, Docker Compose).
- admin-panel.md: ilk kurulum, giriş, şifre sıfırlama, içerik tablosu, işler ve bildirimler.
- api.md: her uç için istek ve cevap örnekleri, HTTP durumlarıyla hata kodları, CSRF ve
  giriş sınırı kuralları, has-admin komutları ve değişkenleri.
- adding-content.md: ZIM ya da servis ekleme, lisans kuralı, sizes.json, metinler.
- testing.md: docker/test.sh, tarayıcı testleri, kod denetimleri ve CI düzeni.
- security.md: kutunun neye karşı korunduğu, ne hangi kullanıcıyla çalışıyor, neyin
  kaydedilmediği, ne zaman dışarı bağlandığı, tedarik zinciri.
- troubleshooting.md: Docker, panel, ana sayfa/okuyucu ve Pi sorunları.
- decisions.md: işlerin neden böyle olduğu, ölçümleriyle.

Bütün göreli bağlantılar denetlendi. README'deki repo yapısında docs/ var.
…undone

Two more races between the frame's load event and the user, found by CI and the new
browser tests:

- CI run 46316703485 (Android, three jobs, flaky): after picking "All sources", a late
  load of the book in the frame set the source back to that book and the language
  picker disappeared again. The choice is now remembered until a book or a search is
  opened.
- A full local run on WebKit: the home button stayed on the reader. The frame's load
  handler wrote the address with replaceState while the page was leaving, and WebKit
  cancelled the navigation. Nothing is written once the page is leaving
  (beforeunload); pageshow resets it for the back button.

Reader tests on WebKit, iPhone, iPad and Android, 3 repeats: 255 passed.

Çerçevenin load olayıyla kullanıcı arasında iki yarış daha; CI ve yeni tarayıcı testleri
buldu:

- CI koşusu 46316703485 (Android, üç iş, flaky): "Tüm kaynaklar" seçildikten sonra
  çerçevedeki kitabın geç gelen yüklemesi kaynağı o kitaba geri çeviriyor, dil seçimi
  yeniden kayboluyordu. Seçim artık bir kitap ya da arama açılana kadar hatırlanıyor.
- WebKit'te yerel tam koşu: ana sayfa düğmesi okuyucuda kalıyordu. Çerçevenin load
  işleyicisi sayfa kapanırken adresi replaceState ile yazıyor, WebKit gezinmeyi iptal
  ediyordu. Sayfadan çıkılırken (beforeunload) artık bir şey yazılmıyor; geri düğmesi
  için pageshow sıfırlıyor.

Okuyucu testleri WebKit, iPhone, iPad ve Android'de 3 tekrar: 255 geçti.
When a session ended while the panel was open (12 hours passed, the password was
changed, logout elsewhere), the next request got 401 login_required and the panel only
showed "Log in first." above the empty tables. Any 401 login_required now stops the job
polling and shows the login form again. Found by a new browser test.

Panel açıkken oturum bittiğinde (12 saat doldu, şifre değişti, başka yerden çıkış) bir
sonraki istek 401 login_required alıyor, panel boş tabloların üstünde yalnız "Giriş
yapın." gösteriyordu. Artık her 401 login_required iş sorgulamasını durdurup giriş
ekranını yeniden açıyor. Yeni bir tarayıcı testi buldu.
Most tests checked that something appears or works; few checked that it stays away
when it should (the always-visible job notice slipped through that way). New checks:

- Homepage: a service and a book that are not installed have no link and say "not
  installed yet"; the disk warning shows only when disk.json has a warning (mocked);
  an empty search goes nowhere.
- Emergency page: printing hides the language buttons, the theme and the contents,
  and still prints the content and its sources.
- Reader: no Kiwix catalog shows a message and no frame; no books shows a message and
  no language picker; books in one language show no picker and search without a
  language filter.
- Panel: with no job running, Stop and the row status are hidden; a wrong password on
  delete (mocked 403) keeps the dialog open, shows the error and clears the field;
  mismatched passwords in the setup form send nothing; an ended session goes back to
  the login form.
- docker/test.sh: job/stop without a session is 401; GET on the data-changing
  endpoints is 405; an unknown endpoint is 404; a body over 64 KB is 413 (the body is
  read from a file, since the Windows command line is limited to 32 KB).

New browser tests 110/110 on the latest browsers; docker/test.sh 160/160.

Testlerin çoğu bir şeyin göründüğüne ya da çalıştığına bakıyordu; gerektiğinde ortada
olmadığına bakan az test vardı (hep görünen iş bildirimi böyle kaçtı). Yeni denetimler:

- Ana sayfa: kurulu olmayan servis ve kitap bağlantısız, "Henüz yüklenmedi" yazıyor;
  disk uyarısı yalnız disk.json'da uyarı varken çıkıyor (taklit); boş arama bir yere
  gitmiyor.
- Acil sayfası: yazdırırken dil düğmeleri, tema ve içindekiler gizleniyor; içerik ve
  kaynakları yine basılıyor.
- Okuyucu: Kiwix kataloğu yoksa mesaj, çerçeve yok; kitap yoksa mesaj, dil seçimi yok;
  tek dilde kitap varsa dil seçimi yok, arama dil filtresiz.
- Panel: iş çalışmıyorken Durdur ve satır durumları gizli; silmede yanlış şifre
  (taklit 403) pencereyi açık tutuyor, hatayı gösteriyor, alanı boşaltıyor; kurulum
  formunda şifreler farklıysa hiçbir şey gönderilmiyor; biten oturum giriş ekranına
  dönüyor.
- docker/test.sh: oturumsuz job/stop 401; veri değiştiren uçlara GET 405; bilinmeyen uç
  404; 64 KB'tan büyük gövde 413 (gövde dosyadan; Windows'ta komut satırı 32 KB ile
  sınırlı).

Yeni tarayıcı testleri en güncel tarayıcılarda 110/110; docker/test.sh 160/160.
@ramazansancar
ramazansancar marked this pull request as ready for review November 29, 2026 23:23
Copilot AI balanced review requested due to automatic review settings November 29, 2026 23:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@volthdl

volthdl commented Nov 30, 2026

Copy link
Copy Markdown

Emeğine sağlık @ramazansancar, kapsamlı bir iş olmuş. Kodu okudum (imajı derlemedim, testleri çalıştırmadım).

İyi olanlar: varsayılan şifre yok, PBKDF2 + sabit süreli karşılaştırma (olmayan kullanıcıda da aynı süre), oturumlar dosyada özet olarak, şifre değişince eski oturumlar kapanıyor; panel betiklere kullanıcı metni göndermiyor (yalnız content.conf satırları), dosya adları kuralla denetleniyor. Dockerfile'daki amd64 kiwix-tools SHA-256'sını resmî arşivle karşılaştırdım, tutuyor. CI izinleri dar, imaj yalnız main'den yayımlanıyor.

Notlar (önem sırasıyla):

  1. Kapsam ve Pi: 73 dosya / 8.217 satır; Docker'ın yanında ana sayfa, okuyucu, acil sayfası, install-homepage.sh ve download-content.sh Pi'yi de değiştiriyor ama Pi'de denenmemiş. Ya Pi'yi etkileyen kısım (ana sayfa/okuyucu/has.js/acil) ayrı PR olsun, ya da birleşmeden önce Pi'si olan biri (ör. @schematrix) bir kurulum denesin.
  2. ZIM içeriği ve panel aynı kökende: kiwix-serve içerik sayfalarına sandbox allow-scripts allow-same-origin ... ve default-src 'self' gönderiyor (libkiwix internalServer.cpp, CONTENT_CSP_HEADER). Yani bir ZIM'deki JavaScript (ör. zimit arşivleri) girişli yöneticinin çereziyle /admin/api/download, verify, job/stop çağırabilir; Sec-Fetch-Site burada same-origin olur. Silme şifre istediği için korunuyor. Olasılığı düşük, ama paneli Docker'da ayrı porttan sunmak (farklı köken; JSON isteği CORS ön kontrolüne takılır) bunu tamamen kapatır.
  3. Giriş ve işlemci: her deneme 600.000 tur PBKDF2; sınır yalnız biten hatalı denemeleri saydığı için aynı anda gelen çok sayıda istek birlikte hesaplanıyor. arm/v6'da tek deneme tahminen saniyeler sürer. Aynı anda tek şifre hesabı (semaphore) ve Onaylı otomatik güncelleme ve USB'den güncelleme / Approval-based auto-update and USB updates (#2) #14'teki gibi genel bir üst sınır (10 dk'da 20 hata) önerim.
  4. Docker Desktop'ta tek IP: Windows/macOS'ta istemciler Docker'ın ağ geçidi adresinden geliyor; IP başına sınır herkese uygulanır, birinin 5 yanlış denemesi herkesi 15 dk'ya kadar kilitler. Belgede not ya da kullanıcı adına göre sınır.
  5. /admin çakışması: IIAB'nin yönetim konsolu Pi'de http://box.lan/admin; services.d/has-admin.sh de /admin/ sabit. Bağlantılar yayılmadan varsayılanı /has-admin yapmak Pi kurulumunu kolaylaştırır.
  6. Çakışmalar: saydıklarına ek olarak Optional mesh chat for Meschy / Meshtastic / Meschy ile isteğe bağlı mesh sohbet #9 da README.md ve index.html'de çakışıyor. feat(docker): Docker imajı, yönetim paneli ve HAS okuyucusu / Docker image, admin panel and HAS reader #66 önce birleşirse Arapça tıp ve Kürtçe Vikipedi, Calibre-Web bağlantısı / Arabic medicine and Kurdish Wikipedia, Calibre-Web link #65'i ben güncellerim (Calibre-Web için bir services.d modülüyle).
  7. Küçükler: content.conf başında hâlâ "Boyutlar yaklaşıktır" yazıyor; 8504c92 Actions'ı SHA'dan etikete çevirmiş, üçüncü taraf docker/* eylemleri için SHA daha güvenli; 📰 Yapılabilecekler ve fikirler / Ideas and things to work on #42'deki özette "süreçler root değil" yazıyor ama has-admin root çalışıyor (docs/security.md'de doğru yazılmış), özeti de buna göre düzeltmek iyi olur.

EN: Nice work. I read the code (did not build the image or run the tests). Good: no default password, PBKDF2 with constant-time compare and equal time for unknown users, hashed session tokens, sessions dropped on password change, no user text reaches the scripts, file names validated; the amd64 kiwix-tools SHA-256 matches the official archive; CI permissions are tight and only main publishes.

Notes, most important first: (1) 73 files / 8,217 lines, and the homepage, reader, emergency page, install-homepage.sh and download-content.sh changes also affect the Pi but weren't tested there: split them out, or have someone with a Pi (e.g. @schematrix) try an install before merging. (2) kiwix-serve sends sandbox allow-scripts allow-same-origin ... with default-src 'self' on content (libkiwix CONTENT_CSP_HEADER), so JavaScript inside a ZIM runs on the panel's origin and can call /admin/api/download, verify and job/stop with a logged-in admin's cookie (Sec-Fetch-Site is same-origin); delete is safe thanks to the password. Low likelihood, but serving the panel on its own port in Docker (a different origin; JSON requests fail the CORS preflight) closes it. (3) Each login runs 600k PBKDF2 rounds and the limiter only counts finished failures, so parallel requests are all hashed; likely seconds per attempt on arm/v6. Suggest one hash at a time plus a global cap like #14 (20 failures per 10 min). (4) On Docker Desktop all clients share the gateway IP, so one person's 5 wrong tries lock everyone out for up to 15 min. (5) IIAB's Admin Console is at /admin on the Pi and services.d/has-admin.sh hard-codes /admin/; defaulting to /has-admin now avoids that. (6) #9 also conflicts (README.md, index.html); if #66 lands first I'll update #65 with a Calibre-Web services.d module. (7) Nits: content.conf still says sizes are approximate; 8504c92 moved Actions from SHAs to tags, and SHAs are safer for third-party docker/* actions; the #42 summary says no process runs as root, but has-admin does (correctly stated in docs/security.md).

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