Files
dawnline/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline
T
Aemeath 2b98abdba4 Dawnline 0.5.2
- Fixed: a new server with the Maximum disguise could not be created ("jmin=10
  (64-1024)"): the 3.1 preset's small junk packets failed Dawnline's own check
- Fixed: guesses from a shared address (every visitor behind Cloudflare) could
  lock people with valid links out of the portal for 15 minutes; a valid link
  always opens now, only wrong guesses are counted
- Fixed: a disabled Dawnline still loaded every device into the tunnels when
  netifd brought them up, with nothing enforcing end dates or limits afterwards
- Fixed: an MTU of 1380 chosen by hand was deleted on every apply (the one-time
  switch to automatic MTU now runs once)
- Locations (city lookups) are off by default on new installs: they send
  people's addresses to a third party. Routers that had them on keep them on
- "Don't warn" before an end date is honoured, and the warning window is the
  one chosen for the person on the Overview, People, the person page and the
  portal alike (People and Overview used to warn 3 days before whatever was set)
- "Ends today" and "ends tomorrow" instead of "ends in 1 day"
- Renaming a person keeps the dialog open when the router refuses the name
- Settings → Portal no longer saves a listening port its own help line marks
  as taken
- "Remove Dawnline" is live only once "remove" is typed
- Downloaded .conf files are named after the device first, and two devices
  whose names only differ past the 15th character no longer get the same file
  (and tunnel name in the app)
2026-10-18 14:42:01 +03:00

63 lines
2.5 KiB
Bash
Executable File

#!/bin/sh
# Dawnline first-run / upgrade housekeeping.
# Locations are off by default since 0.5.2 (lookups send addresses to a third
# party); a router that had them on by the old default keeps them on.
if [ -f /etc/config/dawnline ] && [ -z "$(uci -q get dawnline.settings.geo_enabled)" ]; then
uci -q set dawnline.settings.geo_enabled=1
uci -q commit dawnline
fi
[ -f /etc/config/dawnline ] || cat > /etc/config/dawnline <<'CFG'
config settings 'settings'
option portal_enabled '0'
option portal_port '8443'
option default_device_limit '3'
option hostnames '1'
CFG
chmod 600 /etc/config/dawnline
mkdir -p /etc/dawnline && chmod 700 /etc/dawnline
# Webhook alerts were removed.
uci -q delete dawnline.settings.webhook_url
uci -q delete dawnline.settings.alert
uci -q commit dawnline
rm -f /etc/dawnline/alerts.json
# Backups moved into Settings.
rm -f /www/luci-static/resources/view/dawnline/backups.js
# "Pause everyone" is gone: turning a server off does the same, so a
# router left paused keeps its servers off instead of letting everyone in.
if [ "$(uci -q get dawnline.settings.paused_all)" = 1 ]; then
for s in $(uci -q show dawnline | sed -n 's/^dawnline\.\([^.=]*\)=server$/\1/p'); do uci -q set "dawnline.$s.enabled=0"; done
fi
uci -q delete dawnline.settings.paused_all
uci -q commit dawnline
# Portal assets moved out of the web root (served only with a valid code).
rm -rf /usr/share/dawnline/portal/www/assets
# "Find home devices" (0.3.0) is gone: its option and dnsmasq records too.
for s in $(uci -q show dawnline | sed -n 's/^dawnline\.\([^.]*\)\.bonjour=.*/\1/p'); do uci -q delete "dawnline.$s.bonjour"; done
uci -q commit dawnline
if ls /tmp/dnsmasq*.d/dawnline-bonjour.conf >/dev/null 2>&1; then
rm -f /tmp/dnsmasq*.d/dawnline-bonjour.conf /var/run/dawnline/bonjour.json
/etc/init.d/dnsmasq restart 2>/dev/null
fi
# LuCI caches: menu index, and module URLs (?v= follows the opkg status time).
rm -f /tmp/luci-indexcache* /tmp/luci-modulecache/* 2>/dev/null
touch /usr/lib/opkg/status 2>/dev/null
# Cron restarts the agent when it stops ticking (Health → Watchdog).
mkdir -p /etc/crontabs
grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root || {
echo '*/5 * * * * /usr/libexec/dawnline/heartbeat' >> /etc/crontabs/root
/etc/init.d/cron restart 2>/dev/null
}
/etc/init.d/rpcd reload
# A reload keeps LuCI logins but sometimes misses the plugin; restart only then.
sleep 2
ubus list luci.dawnline >/dev/null 2>&1 || { /etc/init.d/rpcd restart; sleep 2; }
/etc/init.d/dawnline enable
/etc/init.d/dawnline restart
exit 0