Dawnline 0.1.0: AmneziaWG access server for OpenWrt
Build packages / Version (push) Waiting to run

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:
Aemeath committed 2026-10-15 03:29:30 +03:00
commit a3910f8b97
105 files changed
+22278

No files matched your search

+65
View File
@@ -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
}