- Access rules fail closed: when the table cannot load, no device is loaded into the tunnels (the firewall alone would let every loaded device reach everything); an older table that survived a failed rebuild keeps its rules and a revoked device still leaves. The agent re-syncs within a minute when the table is gone - A change the router saved but could not put into effect (access rules that did not load, a server that refused its devices) is said in the admin UI instead of a plain "Saved" - The guard judges every packet, not only a connection's first: a change of access, a pause or a limit now cuts open connections too - Each server's home networks are its own: with several servers, "all home" on one no longer reaches the other's networks where firewall zones overlap - People limited to some home networks reach the router only on the addresses in those networks (LuCI and SSH on the main LAN stay closed) - Internet-only people can open their personal portal with the VPN on - Tunnel DNS reaches the resolver and the LAN's DNS from servers that do not forward to those zones on their own (Home-only names on servers without "like a home device", LAN DNS on servers with no home network) - A new personal link offers to remove the devices added through the old one, so a leaked link is really contained - Import and restore refuse an inconsistent file (devices with addresses outside their server, shared addresses, malformed keys, broken references); Health reports one, and the sync leaves such a device out instead of failing its server. A config write that did not reach flash is an error, not a silent success - Backups are kept per kind (nightly ones no longer push out manual or pre-delete ones), nightly and pre-change backups hold the config only, archives are written whole or not at all, and a failed nightly backup is logged. A restore no longer has its history overwritten by the agent's in-memory counters - Settings defaults and ranges come from one place (dawnline.schema) - Portal: anything not shaped like a personal link is answered by a shell before ucode starts (a scan on the root costs nothing); 4 portal processes at once instead of 16; a link may make 40 changes a quarter hour; over plain HTTP the page shows but configurations, new devices and new keys are refused with the HTTPS twin of the link; the connect sheet polls only while the first connection is awaited, with backoff, and stops once the link stopped working - Updates: after Dawnline's own package changes, a shell checks that LuCI reaches it and the agent runs, and puts the kept previous version back when they do not (automatic runs always keep it); the AmneziaWG module reload verifies rmmod and modprobe; installs check free space; on apk a reinstall that changed nothing is an error; uninstall.sh hands the update lock to the removal it calls; an upgrade restarts the service only where it was enabled; the release workflow pins the SDK images by digest and the actions by commit - AmneziaWG: features count only when both the tools and the kernel module have them; a server whose disguise this build cannot run (a 3.1 preset after a rollback to 2.0) is kept down and reported; Components tells 1.0 builds from 2.0 ones; `awg show dump` is parsed by shape; Maximum's DNS-shaped signature packets are made for each server and its keep-alive is a 25-35 s range - CI compiles every ucode file and runs the new tests/ucode unit tests (54 tests on the real libuci) in OpenWrt 24.10 and 25.12 rootfs containers; scripts/compile-ucode.sh does the same wherever ucode runs and scripts/ucode-container.sh locally with docker; lint-ucode checks POSIX regexes and module layering; a tag builds only after CI passes
173 lines
6.4 KiB
YAML
173 lines
6.4 KiB
YAML
name: CI
|
|
|
|
# Every push to main and every pull request; also called by build.yml, so a
|
|
# tag never publishes a release without these checks passing on it.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
web:
|
|
name: Web (format, types, tests, bundles)
|
|
runs-on: ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: '22'
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check formatting
|
|
id: format
|
|
run: |
|
|
if ! npm run --silent format:check; then
|
|
echo "::error::Code is not formatted. Run 'npm run format' in web/."
|
|
exit 1
|
|
fi
|
|
|
|
# Sources and the test files (tsconfig.test.json).
|
|
- name: Type check
|
|
id: types
|
|
run: npm run --silent typecheck
|
|
|
|
- name: Tests
|
|
id: tests
|
|
run: npm test
|
|
|
|
# The bundles under package/ are committed: a build must change nothing
|
|
# and leave no new file behind (an output nobody added to git would be
|
|
# missing from the package).
|
|
- name: Build bundles and check they are committed
|
|
id: build
|
|
run: |
|
|
npm run --silent build
|
|
changed="$(git status --porcelain --untracked-files=all -- ../package)"
|
|
if [ -n "$changed" ]; then
|
|
echo "$changed"
|
|
echo "::error::The committed bundles are out of date or the build left new files. Run 'npm run build' in web/ and commit the result."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Summary
|
|
if: always()
|
|
run: |
|
|
{
|
|
echo "## Web"
|
|
echo ""
|
|
echo "| Check | Result |"
|
|
echo "|---|---|"
|
|
echo "| Formatting | ${{ steps.format.outcome }} |"
|
|
echo "| Types | ${{ steps.types.outcome }} |"
|
|
echo "| Tests | ${{ steps.tests.outcome }} |"
|
|
echo "| Bundles | ${{ steps.build.outcome }} |"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
shell:
|
|
name: ShellCheck
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# Every shell script by its shebang (the init script's is "/bin/sh
|
|
# /etc/rc.common"), so a new hotplug or libexec script is covered the
|
|
# day it appears. Files without a shebang (keep.d lists) are not shell.
|
|
- name: ShellCheck
|
|
run: |
|
|
shellcheck --version
|
|
files="$(grep -rlIE '^#!(/usr)?/bin/(sh|bash|env (sh|bash))( |$)' \
|
|
install.sh uninstall.sh package/luci-app-dawnline/root scripts tests | sort)"
|
|
echo "$files"
|
|
for f in package/luci-app-dawnline/root/etc/init.d/dawnline \
|
|
package/luci-app-dawnline/root/etc/hotplug.d/iface/95-dawnline \
|
|
package/luci-app-dawnline/root/usr/libexec/dawnline/resolver \
|
|
package/luci-app-dawnline/root/usr/libexec/dawnline/heartbeat \
|
|
package/luci-app-dawnline/root/usr/libexec/dawnline/postupdate \
|
|
package/luci-app-dawnline/root/usr/share/dawnline/portal/www/cgi-bin/portal; do
|
|
echo "$files" | grep -qx "$f" || { echo "::error file=$f::not found by the shebang scan"; exit 1; }
|
|
done
|
|
# shellcheck disable=SC2086
|
|
shellcheck -S warning $files
|
|
|
|
ucode:
|
|
name: ucode static checks
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Lint (use before definition, exports, POSIX regexes, rpcd methods)
|
|
run: python3 scripts/lint-ucode.py
|
|
|
|
- name: Executables keep their mode
|
|
run: |
|
|
for f in usr/bin/dawnline usr/libexec/dawnline/agent usr/libexec/dawnline/updater usr/libexec/dawnline/resolver usr/libexec/dawnline/heartbeat usr/libexec/dawnline/postupdate \
|
|
etc/init.d/dawnline etc/uci-defaults/90_dawnline usr/share/dawnline/portal/www/cgi-bin/portal usr/share/dawnline/portal/cgi.uc; do
|
|
[ -x "package/luci-app-dawnline/root/$f" ] || { echo "::error file=package/luci-app-dawnline/root/$f::not executable (git update-index --chmod=+x $f)"; exit 1; }
|
|
done
|
|
for f in scripts/check-ucode.sh scripts/compile-ucode.sh scripts/ucode-container.sh tests/ucode/run.sh tests/ucode/fixtures/bin/awg; do
|
|
[ -x "$f" ] || { echo "::error file=$f::not executable (git update-index --chmod=+x $f)"; exit 1; }
|
|
done
|
|
|
|
- name: Versions agree
|
|
run: |
|
|
v="$(sed -n 's/^PKG_VERSION:=//p' package/luci-app-dawnline/Makefile)"
|
|
grep -q "^export const VERSION = '$v';" package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc ||
|
|
{ echo "::error::util.uc VERSION differs from the Makefile ($v)"; exit 1; }
|
|
grep -q "\"version\": \"$v\"" web/package.json ||
|
|
{ echo "::error::web/package.json version differs from the Makefile ($v)"; exit 1; }
|
|
python3 - "$v" <<'PY'
|
|
import json, sys
|
|
v = sys.argv[1]
|
|
lock = json.load(open('web/package-lock.json'))
|
|
got = (lock.get('version'), lock.get('packages', {}).get('', {}).get('version'))
|
|
if got != (v, v):
|
|
print(f"::error::web/package-lock.json says {got}, the Makefile {v}: run 'npm install' in web/")
|
|
sys.exit(1)
|
|
PY
|
|
echo "Version $v"
|
|
|
|
ucode-compile:
|
|
# scripts/compile-ucode.sh and tests/ucode on the release's own ucode and
|
|
# libuci, in the OpenWrt rootfs containers scripts/ucode-container.sh pins
|
|
# by digest (24.10 = opkg, 25.12 = apk: the two the packages are built for).
|
|
name: ucode compiles and tests pass (OpenWrt ${{ matrix.release }})
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
release: ['24.10', '25.12']
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Compile every ucode file and run tests/ucode
|
|
run: scripts/ucode-container.sh ${{ matrix.release }}
|