4.0.1: serve the chat through nginx on GL.iNet, https://<name>/ support

- GL.iNet: nginx terminates https with the web admin's certificate and
  serves static files (conf.d/zz-cabinchat.conf, after gl.conf so the
  admin stays nginx's default server); /cgi-bin/ goes to uhttpd on
  127.0.0.1 (fcgiwrap is shared with the admin and runs only 4 scripts)
- --name <host>: also serve https://<host>/ on port 443 plus an http
  redirect, add the name to dnsmasq; guessed from dnsmasq entries that
  contain "chat" and match the certificate; server_name as regex since
  GL's server_names_hash_bucket_size is too small
- config checked with nginx -t, falls back to uhttpd; kept on firmware
  updates via /etc/sysupgrade.conf
- fix: TLS detection failed when /usr/lib/libustream-ssl.so is missing
- fix: previous version read from the wrong place ("upgrading 1.x")
- fix: photos of expired messages and deleted accounts were never
  removed (file name check rejected ".jpg")

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal Suter
2026-11-16 17:49:56 +01:00
co-authored by Claude Opus 5.5
parent 8928ae7077
commit 907a54eb57
5 changed files with 454 additions and 71 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ needs_prune() {
del_photos() {
[ -f "$DATA/.del" ] || return 0
while IFS= read -r f; do
case $f in .*|*[!0-9a-f.-]*) ;; *.jpg) rm -f "$IMG/$f" ;; esac
case $f in .*|*[!0-9a-z.-]*) ;; *.jpg) rm -f "$IMG/$f" ;; esac
done < "$DATA/.del"
rm -f "$DATA/.del"
}