Dawnline 0.4.0
Build packages / Version (push) Waiting to run

- Components tab replaces Updates: Dawnline, the AmneziaWG build for this
  firmware (Slava-Shchipunov 2.0 or 2Grey 3.1, Russian translation) and
  the system packages Dawnline adds, each checked, installed, reinstalled
  or rolled back in place, with What's new, versions and an activity log
- Automatic updates: daily check, install at a set time or right away,
  per component; AmneziaWG is left out by default and an automatic run
  never switches its build or generation
- Downloads verified against GitHub's sha256; mirrors are used only when
  GitHub is unreachable and the hash is known
- New installer: checks firmware, clock, space and DNS, lets you pick a
  release, shows the plan and asks first; --dry-run
- New uninstaller removes everything Dawnline added (cron, nft, firewall,
  routing, interfaces, packages it installed); --dry-run
- Works without AmneziaWG on the router: Overview, the setup wizard,
  Health and Components say what is missing and offer to install it
- Overview shows failed health checks as notices with their fix
- People list no longer reads the config from the browser: private keys
  stay on the router; personal links are fetched on demand
- Config changes are serialized under one lock, the nft table loads
  atomically and fails closed, and Dawnline never touches network
  sections it did not create
- The portal never opens system ports, keeps disabled devices disabled,
  rate-limits per address and counts days by the router's clock
- Settings and Diagnostics load their heavy parts in the background
- Release notes are written from the commits since the previous release
- Backend and admin UI split into small single-purpose modules
This commit is contained in:
Aemeath committed 2026-10-16 02:14:15 +03:00
1 parent 70a932b8ea
commit 34293fb8e5
158 files changed
+17418 -10022

No files matched your search

@@ -0,0 +1,64 @@
// Dawnline — one-time steps for routers set up by older versions. Each one
// checks first and writes nothing when there is nothing to do; dawnline.apply
// runs them before it takes its own lock (changes to /etc/config/dawnline go
// through dawnline.store and its config lock).
import { cursor } from 'uci';
import { stat, unlink } from 'fs';
import { q, slog } from 'dawnline.util';
import * as core from 'dawnline.core';
import * as store from 'dawnline.store';
const LAN_CGI = '/www/cgi-bin/dawnline-portal';
const LAN_CGI_URL = '/cgi-bin/dawnline-portal';
/** Every personal code is a word code; older random ones are replaced (their links stop working). */
function word_codes() {
let old = (s) => s.code != null && !match(s.code, core.WORD_CODE);
let c = cursor();
c.load('dawnline');
let any = false;
c.foreach('dawnline', 'person', (s) => {
if (old(s))
any = true;
});
if (!any)
return;
store.transact((w, m) => {
w.foreach('dawnline', 'person', (s) => {
if (old(s)) {
w.set('dawnline', s['.name'], 'code', core.new_code());
w.delete('dawnline', s['.name'], 'words');
}
});
});
slog('dawnline', 'info', 'moved to word codes', null, 'Personal links');
}
/*
* Older versions answered on 443 at home through LuCI's web server (its error
* page ran the portal CGI). The portal now keeps its own port: remove that.
*/
export function uhttpd() {
let c = cursor();
c.load('uhttpd');
if (c.get('uhttpd', 'main', 'error_page') == LAN_CGI_URL) {
c.delete('uhttpd', 'main', 'error_page');
c.commit('uhttpd');
system('/etc/init.d/uhttpd reload >/dev/null 2>&1');
system(`logger -t dawnline ${q('portal removed from the LuCI web server')}`);
}
if (stat(LAN_CGI))
unlink(LAN_CGI);
// The old setting itself.
let d = cursor();
d.load('dawnline');
if (d.get('dawnline', 'settings', 'portal_443') != null)
store.transact((w, m) => w.delete('dawnline', 'settings', 'portal_443'));
};
/** All of them, in order. */
export function run() {
word_codes();
uhttpd();
};