LuCI admin (people, devices, limits, disguise, health, updates, backups) and a personal self-service portal, built as ipk (OpenWrt 24.10) and apk (OpenWrt 25.12) with the OpenWrt SDK. Successor of openwrt-liminal. - install.sh: checks the router, installs AmneziaWG for its firmware, then the release package verified against sha256sums.txt - CI: Prettier, types, tests, committed bundles, ShellCheck, ucode checks; tagged releases build both packages and publish them - Web bundles minified with esbuild (JS and CSS) - README with framed screenshots
This commit is contained in:
commit
a3910f8b97
105 files changed
+22278
No files matched your search
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Load devices into a Dawnline tunnel whenever netifd (re)creates it.
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
[ -n "$(uci -q get "network.$INTERFACE._dawnline")" ] || exit 0
|
||||
/usr/bin/dawnline sync >/dev/null 2>&1 &
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# shellcheck shell=dash disable=SC2034 # START/STOP/USE_PROCD are read by /etc/rc.common
|
||||
# Dawnline: AmneziaWG access server — agent and personal portal.
|
||||
|
||||
START=95
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
|
||||
PORTAL_ROOT=/usr/share/dawnline/portal/www
|
||||
|
||||
start_portal() {
|
||||
local enabled port certs cert key hport http
|
||||
config_get_bool enabled settings portal_enabled 0
|
||||
[ "$enabled" = 1 ] || return 0
|
||||
config_get port settings portal_port 8443
|
||||
certs="$(/usr/bin/dawnline portal-cert 2>/dev/null)"
|
||||
cert="${certs% *}"
|
||||
key="${certs#* }"
|
||||
[ -f "$cert" ] && [ -f "$key" ] || return 0
|
||||
# IP addresses in links get plain HTTP on the next port (names stay HTTPS-only).
|
||||
hport="$(/usr/bin/dawnline portal-http-port 2>/dev/null)"
|
||||
[ -n "$hport" ] && http="-p 0.0.0.0:$hport -p [::]:$hport"
|
||||
|
||||
procd_open_instance portal
|
||||
procd_set_param command /usr/sbin/uhttpd -f -h "$PORTAL_ROOT" -x /cgi-bin -E /cgi-bin/portal \
|
||||
-D -n 16 -N 64 -t 20 -T 30 -k 10 -A 1 \
|
||||
-s "0.0.0.0:$port" -s "[::]:$port" -C "$cert" -K "$key" $http
|
||||
procd_set_param file "$cert"
|
||||
procd_set_param respawn 3600 5 0
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
# Plain DNS for Home-only tunnel devices (config written by `dawnline apply`).
|
||||
start_resolver() {
|
||||
[ -f /var/etc/dawnline-dns.conf ] || return 0
|
||||
procd_open_instance dns
|
||||
procd_set_param command /usr/libexec/dawnline/resolver
|
||||
procd_set_param file /var/etc/dawnline-dns.conf
|
||||
procd_set_param respawn 3600 5 0
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load dawnline
|
||||
mkdir -p /var/run/dawnline
|
||||
/usr/bin/dawnline apply >/dev/null 2>&1
|
||||
|
||||
procd_open_instance agent
|
||||
procd_set_param command /usr/libexec/dawnline/agent
|
||||
procd_set_param respawn 3600 5 0
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
|
||||
start_portal
|
||||
start_resolver
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
/usr/bin/dawnline apply >/dev/null 2>&1
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger dawnline
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# Dawnline first-run / upgrade housekeeping.
|
||||
|
||||
[ -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
|
||||
# Portal assets moved out of the web root (served only with a valid code).
|
||||
rm -rf /usr/share/dawnline/portal/www/assets
|
||||
|
||||
# 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
|
||||
|
||||
/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
|
||||
Reference in new issue
Block a user