Repository navigation
Onaylı otomatik güncelleme ve USB'den güncelleme / Approval-based auto-update and USB updates (#2) - #14
Onaylı otomatik güncelleme ve USB'den güncelleme / Approval-based auto-update and USB updates (#2)#14Proxy34 wants to merge 13 commits into
Conversation
…e map download needed IIAB'ın harita indirmesi (contabostorage) Türkiye'de engelli; README bunun için WARP öneriyor. scripts/download-map.sh Protomaps planet build'inden bölge kesiti (PMTiles) alır, küçük bir MapLibre sayfasını /library/www/html/harita/ altına kurar; nginx dosyaları olduğu gibi sunar (Range desteği hazır), ek ayar yok. Türkiye kesiti ~1,7 GB, z15, Türkçe etiketli. The IIAB map download (contabostorage) is blocked in Turkey and the README suggests WARP for it. scripts/download-map.sh cuts a region (PMTiles) from the Protomaps planet build and installs a small MapLibre page under /library/www/html/harita/; nginx serves the files as-is (Range works out of the box), no extra config. Turkey extract ~1.7 GB, zoom 15, Turkish labels.
…hematrix#2) When the Pi gets internet it checks the Kiwix catalog and the Protomaps build for newer versions; it never downloads on its own. The homepage lists the updates with sizes, warns on metered (phone hotspot) connections, disables items that do not fit on the disk, and anyone on the network can start the download with one button. - scripts/auto-update.sh: --check (rate-limited) and --apply - download-content.sh: CHECK_ONLY mode, reused for the check - update/: unprivileged button endpoint, systemd units, NetworkManager hook, nginx config; scripts/install-auto-update.sh installs them - Builds on schematrix#3 and schematrix#5.
… seç Varsayılan seçim boş alan ve payla sınırlı; seçim sığmazsa buton kapanır. Yüklü olmayan içerik için 'eski sürüm' uyarısı gösterilmez.
…leme USB disk takılınca salt okunur bağlanır; kutuda olmayan ya da daha yeni ZIM'ler ana sayfadaki güncelleme listesine '(USB'den)' etiketiyle eklenir. Kopya, ZIM içindeki MD5 ile doğrulanır. fstab'daki ya da zaten bağlı diskler (USB'li SSD) atlanır; liste /run altında tutulur. install-auto-update.sh artık API'yi yeniden başlatıyor.
|
Onaysız hiçbir şey indirmemesi ve USB'den güncelleme çok iyi düşünülmüş, teşekkürler. Bu PR #3 ve #5'e bağlı, önce onları bitirmek istiyorum. Bir de güvenlik tarafında bir ricam var: şu an Wi-Fi'a bağlanan herkes güncellemeyi başlatabiliyor. Pi telefon hotspot'una bağlıysa biri büyük bir indirme başlatıp bütün mobil veriyi bitirebilir. Buton sadece admin girişiyle çalışabilir mi? Not downloading anything without approval and the USB updates are really well thought out, thanks. This PR depends on #3 and #5, so I'd like to finish those first. One security request too: right now anyone on the Wi-Fi can start an update. If the Pi is on a phone hotspot, someone could kick off a big download and burn through all the mobile data. Could the button work only after an admin login? |
…i şifresi ister Kurulumda bir kez sorulur, tuzlu PBKDF2 özeti /etc/has-update/admin'e yazılır ve servise LoadCredential ile verilir; --sifre ile değiştirilir. Yanlış şifre denemeleri sınırlı. Asked once at install; a salted PBKDF2 hash is stored in /etc/has-update/admin and passed to the service with LoadCredential; change it with --sifre. Wrong passwords are rate limited.
|
Tamam, #3 ve #5'i bekliyorum. Bu arada butonu yönetici şifresine bağladım:
IIAB'nin Sanal makinede boş/yanlış/doğru şifre, deneme sınırı, şifre değiştirme ve tarayıcıdan gerçek indirme denendi. Firewall (Proxy34) |
|
Şifre konusunu düşündüm. Root yetkisi konusundaki gerekçen çok mantıklı, butona root yetkisi vermek istemem. Ama kullanıcı açısından iki ayrı şifre kafa karıştırır, afet anında kimse hangi şifrenin nerede kullanıldığını hatırlamaz. O yüzden şu aşamada olabildiğince tek şifreyle ilerleyelim. Örneğin kurulum sırasında I've thought about the password. Your reasoning about root access makes a lot of sense, I don't want to give the button root privileges either. But from a user's point of view, two separate passwords are confusing, and in a disaster nobody will remember which password goes where. So at this stage let's stick to a single password as much as possible. For example, would it be possible to use the password entered for |
…dmin şifresini kullanır Ayrı şifre yerine kurulumda belirlenen iiab-admin şifresi. Servis yetkisiz kalır: başlarken root bir adım yalnızca iiab-admin'in /etc/shadow özetini /run/has-update/admin'e koyar, şifre değişince has-update-admin.path yeniler. yescrypt'i sistemin libcrypt'i doğrular. One password instead of two. The service stays unprivileged: a root start step copies only iiab-admin's hash from /etc/shadow, has-update-admin.path refreshes it on change.
|
Haklısın, tek şifreye geçtim. Buton artık Root yetkisi gerekmiyor:
Sanal makinede denendi: doğru/yanlış/boş şifre, deneme sınırı, Firewall (Proxy34) |
…açılmazsa da harita güncellemesi bulunur
…erikler güncelleme listesinde kapalı durur
|
Merhaba @Proxy34, eline sağlık. #2'de incelemeye söz vermiştim; son hâli (fdd057f) okudum ve şifre kontrolünü ayrıca denedim (donanımda çalıştırmadım). Tek şifreye geçiş güzel olmuş. Buton servisinin yetkisiz kalması, root adımın yalnızca İki öneri:
Birleştirme sırası: README ve ana sayfada #9 (mesh sohbet) ile çakışıyor; ikisi de yeni bölüm eklediği için çözmesi kolay. #14 önce birleşirse #9'u ben güncellerim. EN: Reviewed fdd057f and tested the password check (not run on hardware). Switching to the single iiab-admin password is clean: the service stays unprivileged, a root step copies only iiab-admin's hash, and libcrypt verifies it. With yescrypt and sha512 hashes the right password passes and wrong, empty and locked ( |
… yanlış şifre sınırı; USB'den yalnızca content.conf içerikleri
|
@volthdl incelemen ve testlerin için teşekkürler, iki öneriyi de ekledim (3009020).
Bunları sanal makinede sahte bir USB klasörüyle denedim: listedeki ZIM kopyalanıp kuruldu, listede olmayan çıkmadı. #9 için de teşekkürler, #14 önce birleşirse çakışmayı senin çözmen çok iyi olur. Firewall (Proxy34) |
|
Teşekkürler @Proxy34, 3009020'ı kontrol ettim: toplam sınır mantığı doğru, USB filtresini de örnek dosya adlarıyla denedim. Listedeki içerikler kabul ediliyor; listeden çıkarılmış, yorum satırında duran ya da hiç listede olmayanlar reddediliyor. Değiştirilmiş bir kopyanın çevrimdışı ayırt edilememesi için arayüzdeki uyarı ve README notu da yerinde. Benim tarafımdan başka bir şey yok. #14 önce birleşirse #9'u güncellerim. EN: Checked 3009020: the global cap logic is right, and the USB filter accepts listed items and rejects retired, commented-out and unlisted ones in my test. The UI warning and README note cover what can't be verified offline. Nothing more from me; I'll update #9 if #14 lands first. |
|
@Proxy34 Conflict var müsait olduğunda çözebilir misin? |
# Conflicts: # README.md # install.sh # www/home/index.html
…fre kutusu: telefonda tam genişlik, yakınlaştırma yok
|
@ramazansancar güncel main'i birleştirip çakışmaları çözdüm. Telefonda şifre kutusuna dokununca iPhone'un sayfayı yakınlaştırmaması için kutuyu telefonda tam genişlik ve 16 px yaptım. Sanal makinede kurup kontrol ettim: disk uyarısı ve güncelleme listesi ana sayfada birlikte çalışıyor. #14 hâlâ #5'in birleşmesini bekliyor. Firewall (Proxy34) |
Closes #2
Onaylı otomatik güncelleme ve internetsiz USB'den güncelleme. Issue #2'de önerildiği gibi #3 ve #5'in üstüne kurulu; o ikisi birleşince bu PR'da yalnızca kendi commit'leri kalır.
download-content.sh'ı (SHA-256) ve Offline vector map without the admin-console download (works in Turkey) / Çevrimdışı vektör harita: yönetim paneli indirmesi gerekmez (Türkiye'de çalışır) #5'indownload-map.sh --update'i ile yapılır. İlerleme ana sayfada çubukla görünür. Harita sürüm listesi (builds.json) alınamazsa son günlerin harita dosyası doğrudan bulunur..zimdosyaları aynı listede "(USB'den)" etiketiyle çıkar. Kopya, ZIM dosyasının içindeki MD5 özetiyle doğrulanır; bozuk kopya kurulmaz./librarySSD'si USB ile bağlı olsa bile içerik diski sayılmaz.iiab-adminşifresiyle (kurulumda belirlenen,/admingirişindeki şifre) çalışır; ayrı bir şifre yok. Servis root olmadan çalışır: başlarken root bir adım yalnızcaiiab-admin'in özetini/run/has-update/admin'e koyar, şifre değişince kendiliğinden yenilenir. Yanlış şifre 10 dakikada 5 denemeyle sınırlı. Liste herkese görünür.Test: Debian 13 + Internet-in-a-Box sanal makinesinde: gerçek Kiwix kataloğundan kontrol, nginx üzerinden buton, gerçek indirme ve SHA-256, internet gelince otomatik kontrol, taklit USB bellekle (dummy_hcd + g_mass_storage) sağlam/bozuk/eski dosya senaryoları, çıkarma ve yeniden başlatma,
iiab-adminşifresi (boş/yanlış/doğru, deneme sınırı, şifre değişimi, yeniden başlatma). Gerçek bir Pi 5'te denenmedi.Approval-based automatic updates and updates from a USB drive without internet. Built on #3 and #5 as suggested in #2; once those are merged only this PR's own commits remain.
download-content.sh(SHA-256) and Offline vector map without the admin-console download (works in Turkey) / Çevrimdışı vektör harita: yönetim paneli indirmesi gerekmez (Türkiye'de çalışır) #5'sdownload-map.sh --update, with a progress bar on the homepage. If the map build list (builds.json) can't be fetched, recent daily map files are probed directly..zimfiles show up in the same list marked "(USB'den)". Each copy is verified against the MD5 stored inside the ZIM file. The/librarySSD is never treated as a content drive, even over USB.iiab-adminpassword (set at install, also used for/admin); no second password. The service stays unprivileged: a root start step copies onlyiiab-admin's hash to/run/has-update/admin, refreshed automatically when the password changes. 5 wrong tries per 10 minutes. The list stays visible to everyone.Tested in a Debian 13 + IIAB VM, including an emulated USB stick (dummy_hcd + g_mass_storage) with good, corrupt and older files, unplugging, reboots and the
iiab-adminpassword (empty/wrong/right, rate limit, password change, reboot). Not tested on a real Pi 5.Firewall (Proxy34)