Web app, uhttpd shell CGI backend, installer, build script and dev server. README merged with the repository's project description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.2 KiB
cabinchat
A lightweight, web-based chat application for a small group of people to communicate with each other (e.g. aboard a commercial flight), hosted on OpenWrt devices such as the GL.iNet Beryl 7.
Browser-based group chat for a GL.iNet travel router (or any OpenWrt box).
Nothing to install on the phones, no extra packages on the router: it runs on
the built-in uhttpd web server with one small shell CGI script.
Install on the router
scp -O dist/install-cabinchat.sh root@192.168.8.1:/tmp/
ssh root@192.168.8.1 sh /tmp/install-cabinchat.sh
Running a newer installer over an existing install upgrades it and keeps
messages, photos and the port. Other commands: -p <port>, wipe, uninstall.
Open http://192.168.8.1:8088 (or http://chat.lan:8088) on the router's WiFi.
Project layout
www/index.html the whole web app (HTML/CSS/JS, no external files)
www/cgi-bin/chat backend (POSIX sh + busybox); the API is described at its top
www/VERSION version string, bump it for a new release
data/, www/img/ chat data while developing (created on first use)
installer.sh.in installer template
build.sh bundles www/ into dist/install-cabinchat.sh
devserver.py dev server that behaves like uhttpd (stdlib Python)
Develop on a notebook or in Termux
python3 devserver.py # Termux: pkg install python
# open http://localhost:8088, or the LAN URL it prints from a phone
Edit www/, reload the browser. Chat data lives in data/ and photos in
www/img/ (delete both to start over). Open the page in two browsers (or a
normal and a private window) to test private chats and typing notices. When you're happy: bump www/VERSION, run sh build.sh, copy
dist/install-cabinchat.sh to the router.
Storage
On the router's flash: /www-chat/data/messages (one line per message) and
seq, outside the web root; photos in /www-chat/htdocs/img/ with random file
names. Messages older than 24 h are dropped on the fly. Photos are refused once
they pass 50 MB. Presence, typing notices and the long-poll event token live in
RAM under /tmp/cabinchat/. Limits are at the top of www/cgi-bin/chat.