Dawnline 0.18.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
- Add V2RayTun to a device's set-up on Android: its awg:// link as a code and to copy, in the portal and in the admin (phones, tablets and other devices), with the server's IP, which its Android app needs; not with the Maximum disguise. Its Windows app is ready but stays off until it gives the tunnel the server's DNS. - Portal: show V2RayTun's Telegram channel beside Google Play. - Make WireGuard part of AmneziaWG's choice when the disguise is off: the same file and code, both apps named in the steps, WireGuard's store a tap away; a router still picks its package. - Portal: Reconnect asks again what the device is and about LAN Bypass, and LAN Bypass switches from a device's ⋯ menu, in a group of its own between the copy actions and Rename, Reconnect, Remove (the keys stay; the device takes its updated configuration). - Turn LAN Bypass on by default for new devices, in the portal and the admin. - Portal: an app's name too long for the picker fades at its edge and glides to its end on hover or tap; two store buttons stack where they do not fit side by side; the month chart's "Today" stays inside its axis. - Write to the router's system log by level (Settings → Logs & history → System log: errors, warnings, normal, verbose): the service starting and stopping, every apply with its time, network, firewall, nftables and peer changes, changed settings and portal errors, in English whatever the admin's language, with keys masked. - Activity: say what a device's change on the portal was (LAN Bypass on or off, its type). - Demo: build again after a force-pushed main instead of failing on the commit that is gone.
This commit is contained in:
1 parent
18e3013047
commit
f8130e39a8
65 files changed
+2066
-338
No files matched your search
@@ -17,7 +17,7 @@
|
||||
import * as uloop from 'uloop';
|
||||
import { open, readfile, writefile, stat, unlink } from 'fs';
|
||||
import {
|
||||
read_json, write_json, ensure_dir, sh_out, q, uniq, slog, slog_trim, slog_restore, date_end, DATA_DIR, RUN_DIR, VERSION
|
||||
read_json, write_json, ensure_dir, sh_out, q, uniq, slog, syslog, slog_trim, slog_restore, date_end, DATA_DIR, RUN_DIR, VERSION
|
||||
} from 'dawnline.util';
|
||||
import * as core from 'dawnline.core';
|
||||
import * as live from 'dawnline.live';
|
||||
@@ -641,8 +641,9 @@ function nightly_backup() {
|
||||
let st = read_json(`${DATA_DIR}/backup-state.json`, {});
|
||||
if (sum && sum != st.auto) {
|
||||
try {
|
||||
backup.backup_create('auto');
|
||||
let b = backup.backup_create('auto');
|
||||
write_json(`${DATA_DIR}/backup-state.json`, { auto: sum }, 0o600);
|
||||
syslog('info', 'backup', `nightly backup saved${b ? ': ' + b : ''}`);
|
||||
}
|
||||
catch (e) {
|
||||
// Tried again tomorrow; meanwhile the admin should know (a full flash, mostly).
|
||||
@@ -794,9 +795,11 @@ function step(i, s, fn) {
|
||||
delete step_err[i];
|
||||
}
|
||||
catch (e) {
|
||||
system(`logger -t dawnline-agent ${q(`${s.who}: ${e.message}`)}`);
|
||||
// A new error goes to the service log (and from there to syslog); a repeat, or a quiet step's, to syslog alone.
|
||||
if (!s.quiet && step_err[i] != e.message)
|
||||
slog('dawnline', 'error', sprintf(L_('failed: %s'), e.message), e.stacktrace?.[0]?.context, s.who);
|
||||
else
|
||||
syslog('error', 'agent', `${s.who}: ${e.message}`);
|
||||
step_err[i] = e.message;
|
||||
}
|
||||
}
|
||||
@@ -835,7 +838,14 @@ function tick() {
|
||||
});
|
||||
}
|
||||
|
||||
// Once: a signal ends the loop and calls it, and so does the line after uloop.run().
|
||||
let stopping = false;
|
||||
|
||||
function shutdown() {
|
||||
if (stopping)
|
||||
return;
|
||||
stopping = true;
|
||||
syslog('info', 'agent', 'stopping · saving the counters and the logs');
|
||||
live.save_usage(usage, true);
|
||||
live.persist_events();
|
||||
geo.flush();
|
||||
@@ -876,6 +886,7 @@ else if (live.uptime() < 600)
|
||||
slog('dawnline', 'info', sprintf(L_('started with the router · version %s'), VERSION), null, 'Dawnline');
|
||||
else
|
||||
slog('dawnline', 'info', sprintf(L_('started · version %s'), VERSION), null, 'Dawnline');
|
||||
syslog('debug', 'agent', sprintf('watching connections every %d ms, checking the rest every %d ms', WATCH, TICK));
|
||||
// A module Dawnline did not install has no record of its kernel: without one
|
||||
// Health cannot tell a firmware upgrade from a missing module.
|
||||
builds.adopt();
|
||||
|
||||
@@ -29,4 +29,4 @@ else detail="It never completed a check."; fi
|
||||
msg="stopped responding — restarted"
|
||||
mkdir -p /var/run/dawnline
|
||||
printf '{"ts":%s,"src":"dawnline","level":"repair","who":"Dawnline","msg":"%s","detail":"%s"}\n' "$now" "$msg" "$detail" >> /var/run/dawnline/service.log
|
||||
logger -t dawnline "Dawnline $msg"
|
||||
logger -t dawnline -p daemon.warning "[warn] [agent] Dawnline $msg - $detail"
|
||||
@@ -31,13 +31,13 @@ while [ "$i" -lt 12 ]; do
|
||||
up && exit 0
|
||||
done
|
||||
|
||||
logger -t dawnline "update to $to failed its check: luci.dawnline or the agent is not up"
|
||||
logger -t dawnline -p daemon.err "[error] [update] update to $to failed its check: luci.dawnline or the agent is not up"
|
||||
set --
|
||||
for f in "$KEEP"/*.ipk "$KEEP"/*.apk; do
|
||||
[ -f "$f" ] && set -- "$@" "$f"
|
||||
done
|
||||
if [ "$#" -eq 0 ]; then
|
||||
logger -t dawnline "no previous version is kept: nothing to roll back to"
|
||||
logger -t dawnline -p daemon.err "[error] [update] no previous version is kept: nothing to roll back to"
|
||||
exit 1
|
||||
fi
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
@@ -50,5 +50,5 @@ fi
|
||||
mkdir -p "$RUN"
|
||||
# The restored agent reports it in the service log on its start.
|
||||
echo "$to" > "$RUN/update-rolled-back"
|
||||
logger -t dawnline "rolled back from $to to the kept version"
|
||||
logger -t dawnline -p daemon.warning "[warn] [update] rolled back from $to to the kept version"
|
||||
exit 0
|
||||
Reference in new issue
Block a user