Add web GUI, docs, scripts, and 5G router config

- Web app (Flask): status, config, firewall, logs, users, restart
- Docs: AT commands, deploy, DNS, quickstart, web GUI
- Scripts: connect, deploy, diag, healthcheck, modem-status, speedtest, status, troubleshoot
- Init and iptables: 5g-router, 5g-webgui, rules.v4
- CHANGELOG, TODO, REVISION; config and README updates
This commit is contained in:
nearxos
2026-02-02 09:38:23 +02:00
parent 1136a332b5
commit 160ad641ce
46 changed files with 4320 additions and 40 deletions

21
scripts/rotate-5g-log.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
# Rotate /var/log/5g-router.log (keep last 5 copies, max 1MB each)
# Run from cron daily: 0 3 * * * /usr/local/bin/rotate-5g-log.sh
# Alpine does not ship logrotate by default; this is a minimal alternative.
# Rev: 1 (see REVISION in repo root)
LOG="/var/log/5g-router.log"
MAXSIZE=$((1024 * 1024)) # 1MB
KEEP=5
[ ! -f "$LOG" ] && exit 0
size=$(stat -c %s "$LOG" 2>/dev/null) || size=$(wc -c < "$LOG" 2>/dev/null) || exit 0
[ "$size" -lt "$MAXSIZE" ] && exit 0
for i in $(seq $((KEEP - 1)) -1 1); do
[ -f "${LOG}.$i" ] && mv "${LOG}.$i" "${LOG}.$((i+1))"
done
[ -f "${LOG}.1" ] && mv "${LOG}.1" "${LOG}.2"
mv "$LOG" "${LOG}.1"
touch "$LOG"
chmod 644 "$LOG" 2>/dev/null || true