diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad4b86e..031eae9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,8 @@ name: Build packages # A tag vX.Y.Z builds luci-app-dawnline and its translation packages # (luci-i18n-dawnline-) as .ipk (OpenWrt 24.10, opkg) and .apk (OpenWrt # 25.12, apk) with the OpenWrt SDK and publishes a GitHub release with the -# packages and sha256sums.txt, the files install.sh and the in-app updater -# download. The release notes list what changed since the previous tag, from the +# packages, the Go backend's binary for each architecture (dawnlined--) and sha256sums.txt, +# the files install.sh and the in-app updater download. The release notes list what changed since the previous tag, from the # commits (scripts/release-notes.sh). Run it by hand to get the packages as # workflow artifacts only. on: @@ -41,8 +41,8 @@ jobs: id: version 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; } + [ "$(cat package/luci-app-dawnline/root/usr/share/dawnline/version)" = "$v" ] || + { echo "::error::usr/share/dawnline/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; } if [ "${GITHUB_REF_TYPE}" = tag ] && [ "${GITHUB_REF_NAME}" != "v$v" ]; then @@ -95,10 +95,41 @@ jobs: if-no-files-found: error retention-days: 7 + # The Go backend (dawnlined), one static binary an architecture: the package is `all`-architecture, so the + # binary travels beside it as its own release file, with its sha256 in sha256sums.txt like the packages. + backend: + name: Backend ${{ matrix.goarch }} + runs-on: ubuntu-24.04 + needs: [version, ci] + strategy: + fail-fast: true + matrix: + goarch: [arm64, arm, mips, mipsle, amd64] + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Build dawnlined for ${{ matrix.goarch }} + env: + GO_IMAGE: golang:1.27-alpine@sha256:eb61c3873c97416fff0116553fff65d67a3549f72e11d9758849a689cdd8b523 + run: | + bin="$(scripts/build-backend.sh ${{ matrix.goarch }} | tail -n1)" + cp "$bin" "dist/dawnlined-${{ needs.version.outputs.version }}-${{ matrix.goarch }}" + + - name: Upload + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: backend-${{ matrix.goarch }} + path: dist/dawnlined-${{ needs.version.outputs.version }}-${{ matrix.goarch }} + if-no-files-found: error + retention-days: 7 + release: name: Release runs-on: ubuntu-24.04 - needs: [version, build] + needs: [version, build, backend] if: github.ref_type == 'tag' permissions: contents: write @@ -122,10 +153,17 @@ jobs: path: release merge-multiple: true + - name: Download the backend's binaries + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + pattern: backend-* + path: release + merge-multiple: true + - name: Checksums working-directory: release run: | - sha256sum luci-* > sha256sums.txt + sha256sum luci-* dawnlined-* > sha256sums.txt cat sha256sums.txt - name: Publish the release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb83c3d..66bb0b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,21 +125,20 @@ jobs: 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)" + install.sh uninstall.sh package/luci-app-dawnline/root scripts | 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 + package/luci-app-dawnline/root/usr/libexec/dawnline/fetch-backend; 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 + backend: + name: "Backend (Go: vet, tests, a real ubusd and uhttpd)" runs-on: ubuntu-24.04 steps: - name: Checkout @@ -147,24 +146,37 @@ jobs: with: persist-credentials: false - - name: Lint (use before definition, exports, POSIX regexes, rpcd methods) - run: python3 scripts/lint-ucode.py + # The goldens in backend/*/testdata are the ucode backend's own answers, taken before it was removed + # (0.18.0): they are fixed now, and hold the Go backend to what that one did. + # gofmt, go vet and the unit tests in the Go toolchain image, then the object, the calls, the stream + # and a page's whole path against the ubusd, rpcd and uhttpd of OpenWrt 24.10 and 25.12. + - name: Format, vet, unit tests, and the tests in the OpenWrt containers + run: scripts/backend-container.sh + + package: + name: Package files + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - 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 + for f in usr/bin/dawnline usr/libexec/dawnline/updater usr/libexec/dawnline/fetch-backend usr/libexec/dawnline/resolver usr/libexec/dawnline/postupdate \ + etc/init.d/dawnline etc/uci-defaults/90_dawnline etc/hotplug.d/iface/95-dawnline; 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 + for f in scripts/backend-container.sh scripts/build-backend.sh scripts/build-packages.sh scripts/build-release.sh scripts/deploy.sh; 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; } + [ "$(cat package/luci-app-dawnline/root/usr/share/dawnline/version)" = "$v" ] || + { echo "::error::usr/share/dawnline/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' @@ -177,22 +189,3 @@ jobs: 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Compile every ucode file and run tests/ucode - run: scripts/ucode-container.sh ${{ matrix.release }} diff --git a/AGENTS.md b/AGENTS.md index 6a14dd6..7883c7d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,40 +2,45 @@ Guidance for coding agents working in this repository (`tickcount/luci-app-dawnline`): an AmneziaWG access server for OpenWrt with a LuCI admin UI and a personal portal. `CLAUDE.md` points here. +## Important + +Always build code cleanly, modularly, and with proper architecture and separation of concerns. Never simply bolt on a feature because I asked for it. If you can’t find an easy way to build it naturally, and you'd recommend a refactor to make the whole thing cleanly, stop your work ahead of time and say so. + ## Rules - `rules/code-standards.md` — how all code is written: decomposition, one locked writer, fail closed, validation at the boundary, comments and commits. -- `rules/backend.md` — ucode on the router: module layers, conventions, what things cost there (CGI portal, rpcd, the agent's watcher). -- `rules/frontend.md` — TypeScript admin UI and portal: layout of `web/src`, pollers and the live revision. +- `rules/backend-go.md` — the backend (`backend/`, Go: the program `dawnlined`): packages, the stream's rules, what things cost on the router, checks. `docs/backend.md` — how it came to be, the stream's protocol, what each part is held to. +- `rules/frontend.md` — TypeScript admin UI and portal: layout of `web/src`, the admin's four LuCI modules and their size budget, pollers and the live revision. - `rules/shell.md` — install, uninstall, init and CI scripts. -- `rules/ui-design.md` — how the admin UI and the portal look: modern product quality, mock first from the real CSS and components, verified in the browser. -- `DESIGN.md` — the personal portal's design system: tokens, components, layout and motion, measured on the live page. Read it before any work on the portal (`web/src/portal`, and what it uses from `web/src/shared`); a change to how the portal looks or moves updates it in the same change. +- `rules/ui-design.md` — how the admin UI and the portal look: one design system inside LuCI, modern product quality, mock first from the real code and CSS, verified in the browser. +- `DESIGN.md` — the design system of the personal portal and the admin: tokens, components, layout and motion, measured on the live page. Read it before any work on the portal (`web/src/portal`, and what it uses from `web/src/shared`) or the admin's pages (`web/src/admin`); a change to how they look or move updates it in the same change. - `rules/i18n.md` — translations: every visible string and backend message wrapped, the catalogs, the Russian style guide and glossary. Anything added to the admin UI or the portal is localized in the same change; anything removed takes its catalog entries with it. +- `rules/release-notes.md` — how a release's points and any list of «what changed» are collected: from the code against production, key changes only, a rework told whole, in English. This repo usually sits inside the router-admin workspace (`../AGENTS.md`). Its rules apply to anything that touches the router: read-only first, backup before mutating, router shell as a literal stdin heredoc over SSH (`../rules/`). ## Layout -- `package/luci-app-dawnline/root/` — what lands on the router: ucode modules in `usr/share/ucode/dawnline/` (`rpc/` for the LuCI backend), the agent and updater in `usr/libexec/dawnline/`, the portal in `usr/share/dawnline/portal/`, the init script, rpcd ACL. -- `web/` — TypeScript sources of the admin UI (`src/admin`) and the portal (`src/portal`), shared code in `src/shared`; `npm run build` writes the bundles under `package/` (git-ignored: CI builds them before packaging). `web/i18n/` — the string catalogs' tools (`extract.ts`, `po.ts`, `lmo.ts`). +- `package/luci-app-dawnline/root/` — what lands on the router beside the backend's binary: the init script, the shell around the backend in `usr/bin/dawnline` and `usr/libexec/dawnline/` (`updater`, `fetch-backend`, `postupdate`, `resolver`), the portal's assets in `usr/share/dawnline/portal/`, the version in `usr/share/dawnline/version`, the rpcd ACL and the LuCI menu. There is no ucode: the backend is Go. +- `backend/` — the backend (`dawnlined`), one static binary: the stream and the pages' methods (`ubus`, `hub`, `api`, `methods`), the watcher and the minute's work (`watch`, `chores`, `watchdog`, `geo`), putting the settings into effect (`apply`, `nft`, `store`, `uci`, `model`), the portal (`portal`), the updater and the command line (`updater`, `pkgmgr`, `cli`), `daemon` and `cmd/dawnlined`. A release publishes it for each architecture as `dawnlined--`; `fetch-backend` puts the right one on a router (`docs/backend.md`). +- `web/` — TypeScript sources of the admin UI (`src/admin`: the LuCI modules `dawnline.app`, `dawnline.style`, `dawnline.map` and `dawnline.qr`) and the portal (`src/portal`), shared code in `src/shared`; `npm run build` writes the bundles under `package/` (git-ignored: CI builds them before packaging); `npm run build:demo` writes the two demos into `web/dist/` (the portal's, which is the public preview, and the admin's, which the README's pictures are taken from). `web/i18n/` — the string catalogs' tools (`extract.ts`, `po.ts`, `lmo.ts`). - `package/luci-app-dawnline/po/` — the admin's catalog (`templates/dawnline.pot`, `ru/dawnline.po`): luci.mk builds the `luci-i18n-dawnline-ru` package from it. The portal's catalog is `web/src/portal/i18n/ru.po`, bundled into the portal. - `install.sh`, `uninstall.sh` — the standalone installer and uninstaller (both have `--dry-run`). -- `scripts/` — `lint-ucode.py`, `compile-ucode.sh` (compiles every ucode file of a tree wherever ucode runs), `check-ucode.sh` (the same on the router, without installing), `ucode-container.sh` (compile and unit tests in the OpenWrt rootfs containers CI uses), `deploy.sh` (dev deploy over SSH), `build-packages.sh`, `build-release.sh`, `release-notes.sh`. -- `tests/ucode/` — unit tests of the ucode modules (`run.uc` runs every `*.test.uc`; fixtures for `/etc/config` and a stand-in `awg`), run in a container by `run.sh`. +- `scripts/` — `backend-container.sh` (the backend's checks, needs docker), `build-backend.sh` (the binary for one architecture), `deploy.sh` (dev deploy over SSH), `build-packages.sh`, `build-release.sh`, `release-notes.sh`, and the screenshot tools. ## Checks before a commit or deploy -- `python3 scripts/lint-ucode.py` (use before definition, exports, POSIX regexes, rpcd methods; layering notes are informational). -- `scripts/ucode-container.sh` (needs docker): compiles every ucode file and runs `tests/ucode` on OpenWrt 24.10 and 25.12, exactly what CI does. `scripts/check-ucode.sh` compiles on the router instead when there is no docker. New ucode entry points are added to the compile list in `scripts/compile-ucode.sh`, to `lint-ucode.py`, and to the executables list in `.github/workflows/ci.yml`; a pure function gets a case in `tests/ucode/.test.uc`. +- `scripts/backend-container.sh` (needs docker) after any change under `backend/` or to the rpcd ACL: gofmt, vet, unit tests, and the tests against a real ubusd, rpcd and uhttpd on OpenWrt 24.10 and 25.12. The goldens in `backend/*/testdata` are the removed ucode backend's own answers (0.18.0), fixed: a deliberate change of behaviour changes its golden by hand, in the same change, and says why. - In `web/`: `npm run format:check`, `npm run typecheck` (sources and tests), `npm run lint` (oxlint), `npm run knip` (unused exports and dependencies), `npm run i18n:check` (after changing visible text: `npm run i18n`, translate the new entries in each `ru.po`), `npm test`, `npm run build` — and commit the catalogs (the bundles stay out of git; CI fails when the build leaves a file under `package/` that `.gitignore` does not cover). - `shellcheck -S warning` for the shell scripts (CI finds them by shebang). - A tag builds only after CI passes on it (`build.yml` calls `ci.yml`). ## Releases -- A release is one commit on `main` titled `Dawnline X.Y.Z`; its body is `- ` points, which become the GitHub release notes and the Components "What's new". Work from a branch is squashed into that one commit. -- Bump the version in `package/luci-app-dawnline/Makefile` (`PKG_VERSION`), `util.uc` (`VERSION`), `web/package.json` and `web/package-lock.json` (CI checks they agree). +- A release is one commit on `main` titled `Dawnline X.Y.Z`; its body is `- ` points, which become the GitHub release notes and "What's new" in Settings › Updates. Work from a branch is squashed into that one commit. +- The points are collected as `rules/release-notes.md` says: from the difference with the last release, not from the commit messages alone. +- Bump the version in `package/luci-app-dawnline/Makefile` (`PKG_VERSION`), `package/luci-app-dawnline/root/usr/share/dawnline/version`, `web/package.json` and `web/package-lock.json` (CI checks they agree). - No `Co-Authored-By` or other agent attribution in commits. - Push `main`, then an annotated tag `vX.Y.Z` ("Dawnline X.Y.Z"); the "Build packages" workflow publishes the `.ipk`, `.apk` (the app and `luci-i18n-dawnline-ru`) and `sha256sums.txt`. - Re-cutting a release (fixes before anyone installs) rewrites `main`: force-push, `gh release delete vX.Y.Z --cleanup-tag`, cancel a running build of the old tag, tag again. Only with the user's go-ahead. -- On the router, install a release the way Components does: `/usr/libexec/dawnline/updater install app@vX.Y.Z` (verified against the release's sha256). +- On the router, install a release the way Settings → Updates does: `/usr/libexec/dawnline/updater install app@vX.Y.Z` (verified against the release's sha256). diff --git a/DESIGN.md b/DESIGN.md index f37726d..eaf251b 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -432,7 +432,7 @@ components: # DESIGN.md — the Dawnline personal portal -This file describes how the **personal portal** (`web/src/portal`, plus the parts of `web/src/shared` it uses) looks and moves: its tokens, its components and, in its own part, its motion. The admin pages inside LuCI follow `rules/ui-design.md` and the LuCI theme and are not covered here. +This file describes how the **personal portal** (`web/src/portal`, plus the parts of `web/src/shared` it uses) looks and moves: its tokens, its components and, in its own part, its motion. It is also the design system of the admin (`web/src/admin`, the LuCI modules `dawnline.app`, `dawnline.style`, `dawnline.map` and `dawnline.qr`): every admin page is built from these tokens, components and springs inside LuCI, in a Shadow DOM, with the few admin-only parts and approved deviations listed in `rules/ui-design.md`. A change here reaches both. The front matter follows the [DESIGN.md](https://github.com/google-labs-code/design.md) draft format (alpha). The prose sections come in that format's order. **Motion Design**, **Content & Voice** and **Accessibility** are extra sections after them. @@ -462,7 +462,7 @@ The portal is one person's page on a router. 4. **One place per fact.** The count sits beside "Your devices", the usage sits on its card, and the access sits in its rows. Nothing is repeated. 5. **Nothing blinks.** A change happens where it is: text morphs letter by letter, cards glide to their new places, a sheet glides to its new height. A repaint never flashes. 6. **Physical, interruptible motion.** Springs are given as stiffness and damping, and each animation starts from where the element stands right now. -7. **The keyboard never animates.** Escape closes a sheet or a menu instantly. Reduced motion keeps fades and drops all travel. +7. **The keyboard does not start motion.** Escape closes a menu instantly; a sheet goes by the way its × sends it (the one thing a key sets moving: a sheet gone in one frame read as a fault). Reduced motion keeps fades and drops all travel. 8. **Honest states.** Each state is said once, where it matters, in the state's colour. 9. **Cheap to draw on a phone.** Nothing watches the page (no observers): what changes says so. Nothing blurs the page behind a sheet (the scrim only dims); on a touch screen the top fade doesn't blur either. A large block (a fold, an accordion's body, a sheet) fades without a blur, on any screen; letters, icons and small things keep theirs. The page keeps its scale, as an app: no pinch or double-tap zoom. @@ -503,7 +503,7 @@ The measured luminance steps are tiny. In dark, raised vs bg is 1.07:1, field vs | `--accent-ink` | `#ffffff` | `#ffffff` | Text on a filled accent button, the knob of a switch that is on | | `--accent-soft` | `blue @ 13%` | `blue @ 12%` | Tinted "Connect", the Demo chip, a primary badge's icon tile | | `--ok` / `--ok-soft` | `#30d158` / 14% | *same* / 12% | Connected, included, the way filling green, the arrival ring | -| `--warn` | `#ff8d28` | *same* | Not set up yet, settings changed, outside hours, Reconnect, ends soon, a link that fails (the card's line; the way's can't finish and no data) | +| `--warn` | `#ff8d28` | *same* | Not set up yet, settings changed, Reconnect, ends soon, a link that fails (the card's line; the way's can't finish and no data) | | `--bad` / `--bad-soft` | `#ff383c` / 13% | *same* / 10% | Out of data, access ended, Remove, errors | | `--sel-bg` / `--sel-fg` | `rgba(131,209,255,.25)` / `#64c6ff` | `rgba(78,175,255,.22)` / `#0a76cf` | `::selection` | | `--bar` | `text @ 13%` | `text @ 11%` | Chart bars, meter and ring tracks | @@ -593,7 +593,7 @@ Frosted pane: dark `--gi-a .58 / --gi-b .14` white with a `.5` rim and no edge s | Pill label | 13 | 600 | — | Update pill, Demo chip | | Small label | 12 / 16 | 500 | — | Kind labels, badge top line, reach tile sub, "Copy…" labels | | Divider | 12 | 500 | +0.06em | "OR" (the only positive tracking) | -| Axis | 11 (10 for hours) | 500 | — | Month and hours axes | +| Axis | 11 | 500 | — | Month axis | | Calendar head | 9 / 10 | 600 | — | Weekday initials | | Mono link | 13 | 400 | 0 | Link rows, name chips | | Mono code | 12 / 18 | 400 | 0 | `.conf` view; the file card icon is mono 10 / 600 | @@ -695,7 +695,8 @@ Only the person moves the page: on a phone nothing the page does pulls it up or - picked kind: 1.5 px accent; - this device: 1 px, accent at 32%; - notice tone: 1 px, tone at 22%; - - the arrival flash: 1.5 px `--ok`, fading. + - the arrival flash: 1.5 px `--ok`, fading; + - the item a page was opened from, back on its list (admin): 1.5 px accent, fading over 1.8 s. - **Inset context.** Inside the sheet, accordion rows use `--field` (`.acc.inset`), one step above the sheet's `--raised`. Segmented controls, badges, the file card and a row nested in one step up again (`knob 65% + field`; a badge's and a nested row's hover go to `knob`). - **Glass icons** are the only "material" effect: a frosted pane over a 1.5 px Gaussian-blurred copy of the tinted back shape, with a rim stroke. Keep it to icons. @@ -713,13 +714,13 @@ Only the person moves the page: on a phone nothing the page does pulls it up or | 22 | Dense QR | | 20 | Accordion row (open, and the shared ends of closed rows), usage block, ⋯ menu, the way | | 18 | Badge, QR in a row, file card | -| 16 | Field, segmented track, reach tile, option row, "until" and "hours" blocks | +| 16 | Field, segmented track, reach tile, option row, the "until" block | | 14 | Kind tile, link row, menu item and highlight, `.conf` block | | 12 | Go button, segmented pill | | 11 | Ends of the way | | 10 | Name chip, badge icon tile, link row knobs | | 9 | File card icon | -| 2.5–4 | Chart bars (2.5 month, 3 spark, 3 calendar cells), meter and hours bar, a field's and the page's selection wash (4) | +| 2.5–4 | Chart bars (2.5 month, 3 spark, 3 calendar cells), meter and time strips (the link timeline, Places), a field's and the page's selection wash (4) | | 1 | A field's caret and selection handles, the page's selection handles | | 999 / 50% | Buttons, pills, chips, toasts, tooltips, the switch / knobs, step numbers, reach marks, the switch's knob, the handles' knobs | @@ -804,7 +805,7 @@ The ⋯ menu, the pick pills' popups and the page code card are one kind of thin ### Notice · `page/notices.ts` - **Layout:** radius 24, padding `14 18 14 14`, gap 14, a 36 px glass icon, a 15/22 500 title and a 14/20 `text-2` line that adds to the title and never repeats it. -- **Tones:** `warn` (orange) for attention (outside hours, ends soon). `bad` (red) for an end (out of data, access ended). +- **Tones:** `warn` (orange) for attention (ends soon). `bad` (red) for an end (out of data, access ended). - **Placement:** one per page, above the columns, 22 px above them. - **On a repaint** a notice that comes blurs in, one that goes fades where it stood and one that changes morphs in place, while its slot glides to the new height. The page under it moves instead of jumping. @@ -818,7 +819,7 @@ The ⋯ menu, the pick pills' popups and the page code card are one kind of thin **Anatomy:** - Card: `raised`, radius 28, padding 8, gap 8. -- Top row (padding `8 6 6 10`, gap 12): a 32 px glass icon (blue on "this device", else grey), the name (16/22 500, one line), the status (13/18, one line, full wording in `title`), and the ⋯ knob. +- Top row (padding `8 6 6 10`, gap 12): a 32 px glass icon (blue on "this device", else grey), the name (16/22 500, one line), the status (13/18, one line; cut short, it says itself whole in the tooltip, with why or when it last connected), a knob for what a router asked of the admin (see *A router's networks*), and the ⋯ knob. - Bottom, one of three: - **Usage** (`field`, radius 20, padding `12 14 12 16`, min-height 66): "Last 7 days" 13/18 `text-2` over the total 17/24 500 tabular. Spark of 7 bars at the right: 6 px wide, gap 4, ≤ 34 px high, min 3, radius 3, `--bar`, today in accent. A day under the pointer, tapped (it stays until a tap elsewhere) or picked with ← → once the bars have focus (*Reading the bars* below) puts its name and bytes in place of the label and total instantly, with no morph; a day with nothing adds "· not used". - **Reconnect** (instead of the week): a `tint` block button with the refresh icon. @@ -833,7 +834,7 @@ The grid keeps cards in place across repaints and glides them (FLIP). |---|---| | This device | accent; the card gets the accent ring and the icon turns blue | | Connected | ok | -| Attention (settings changed, outside hours, no data left, a link that fails, not set up yet) | warn, with Reconnect or Connect in the bottom where one applies | +| Attention (settings changed, no data left, a link that fails, not set up yet) | warn, with Reconnect or Connect in the bottom where one applies | | At rest ("Last connected 3 h ago", the exact time in `title`) | text-2 | | Disabled | text-2, the card at 50% opacity | @@ -856,6 +857,17 @@ A longer reason sits in `title` and, for a screen reader, in hidden text right a - one balanced 14/20 line (max 34ch); - an accent block button, max 320. +### A router's networks · `flows/behind.ts`, `ui/net-chips.ts` (`styles/behind.css`) + +A router of a person's own may bring its network along (site to site). By the server's rule a person only asks: the admin takes a router, and each network behind it, or turns it down. The page says where each stands and never makes the admin's choice look like its own. + +- **Adding a router** (`flows/add.ts`). Picking «Router» among the kinds folds a block in between LAN Bypass and the name (`ui/fold.ts`: height, opacity and a 4 px blur on SMOOTH, the fields under it travelling with its edge; it folds away with another kind): the option row's shape on `field`, radius 16, the router's glass 28, «Networks behind it», one line of what that means, and the chips. The line under the title morphs in place from the free slots to «A router is confirmed by the admin», and the go button says «Ask the admin». With the internet alone nothing at home reaches the person's devices, so the block is not shown. Sent, the form does not open a set-up: what it held fades (160 ms EASE_IN), the sheet glides to its new height and the title's words morph to «Asked the admin» over the request's own state: the router's glass in orange, one line, «Done». Where routers are added at once the form is the usual one, with the block. +- **Chips** (`ui/net-chips.ts`; the admin's share the base, `.nb-chip`). In a sheet the chips stand on the sheet's ground: 32 high, radius 10, mono 13/18, each with its own × (28 × 28). One that works is plain; one that waits for the admin is in the pending tone with a clock before it and «waits» after it; one the admin turned down is in the bad tone with «turned down». The last chip adds another, typed where it stands (`ui/inline-edit.ts`); why a typed one is refused is a red line under the chips, the sheet gliding open for it (how to finish is not said: a sheet is narrow). Eight at the most. They move as the admin's do (`ui/chips-motion.ts`). +- **The networks' sheet**, from a router's ⋯ («Networks behind it», with a line of what there is: the networks, «Waiting for the admin», «Turned down») and from the knob beside it. The title «Networks behind », one line of what they are for, the chips, the admin's reason once under them when something was turned down (the alert, bad tone), and one accent button. Nothing is made by a press: what is typed or taken away is a draft the device keeps until the button sends it, «Ask the admin» when something new is asked for and «Save» when networks were only taken away or put away; at rest while there is nothing to send. The router's refusal is said in red over the button and the draft stays. +- **On the card** (`page/devices.ts`). Something of a router waits for the admin: a knob beside its ⋯ with a clock in the pending tone; a network was turned down: the same knob with the alert in the bad tone. Its words are a tooltip (and its accessible name), a press opens the sheet. The status line keeps saying what it always does. A router that itself waits reads «Waiting for approval» in the pending tone, its «Connect» stands at rest, and its ⋯ holds «Rename» and «Take the request back»; one turned down reads «Turned down» in the bad tone with the reason on hover, and ⋯ holds «Rename» and «Remove». +- **Tooltip** (`ui/tip.ts`, shared with the admin). A name or a status cut short by «…» says itself whole in the tooltip; one that fits shows none beyond what its hover always said (when it last connected, why a link fails). Here it may take a second line (radius 12) instead of cutting a sentence. +- «Your access» no longer lists the devices' names at home: a device's own address is copied from its ⋯ menu. + ### Accordion · `ui/accordion.ts` - **Row:** `raised`, padding `0 8`. Head 52 high, gap 10, with a 22 px glass icon, a 15/22 500 title (ellipsis), an optional chip, an optional value at the end (14 px `text-2`) and a 16 px chevron (pointing down, rotated 90°, and up when open). @@ -869,9 +881,9 @@ A longer reason sits in `title` and, for a screen reader, in hidden text right a | Row | Head | Body | |---|---|---| -| **What it reaches** (shield, home or globe glass) | Title only | Two **reach tiles** (radius 16, `field`, padding `12 12 12 14`, glass 28, title 14/20 500, sub 12/16; a 20 px round mark at the top right: ok-soft check or knob minus, the tile dimmed when off). Then a sentence with the hostname pattern in mono, and **name chips** (32 high, radius 10, mono 13, the domain part in `text-3`, a copy icon 14). | +| **What it reaches** (`both`, home or globe glass, by what the access reaches) | Title only | Two **reach tiles** (radius 16, `field`, padding `12 12 12 14`, glass 28, title 14/20 500, sub 12/16; a 20 px round mark at the top right: ok-soft check or knob minus, the tile dimmed when off). Then a sentence with the hostname pattern in mono, and **name chips** (32 high, radius 10, mono 13, the domain part in `text-3`, a copy icon 14). | | **Data this month** (chart glass) | A 16 px **ring** (track `--bar`, arc accent, warn ≥ 90%, bad ≥ 100%) and "38.6 GB / 100 GB"; hidden while open | The **month**: one bar per day (flex, gap 3, 64 high, radius 2.5, min 3; days to come at 45% bar; today accent), an axis 11 px `text-3` with "Today" in accent under its bar, kept inside the axis (each of the month's ends hides where "Today" comes within 6 px of it, measured: the words' widths follow the language), the total line (`bad` when out), a 6 px **meter** (same tone thresholds), and a `.desc`. A picked day (*Reading the bars*) puts its down and up in place of the total and "21 Oct · +62%" (its date and how it compares with the month's other days; today "so far") in place of what is left, instantly. With a limit not reached, a line under the meter (12/16 `text-2`, warn when it fills within a week): the pace lately (the devices' last 7 days) and when the limit fills at it, or what a monthly one reaches by the reset (`shared/pace.ts`). | -| **Access until** (calendar glass) | "30 Nov" plus "42 days" in ok, warn when soon, or "ended" in bad | The **until block** (`field`, radius 16, padding `14 16`): the days left as a 36/40 600 number (warn when soon), "days left", the end date in `text-3`, and a **calendar** of the weeks to the end. 7 columns of 10 px cells with gap 5 and radius 3: past at text 5%, left at text 16%, today in accent, the last day ringed 1.5 px accent; warn colours when soon. Under it the **hours bar**: 8 px track, the allowed window in ok 70%, a 2 × 16 "now" marker (`text`, warn when outside, with a 2 px field ring), and axis 00/06/12/18/24 at 10 px, then how long the window still runs ("3h 20m left") or, outside it in warn, when it opens (12/16 `text-2`). With nothing to open, the row is still. | +| **Access until** (calendar glass) | "30 Nov" plus "42 days" in ok, warn when soon, or "ended" in bad | The **until block** (`field`, radius 16, padding `14 16`): the days left as a 36/40 600 number (warn when soon), "days left", the end date in `text-3`, and a **calendar** of the weeks to the end. 7 columns of 10 px cells with gap 5 and radius 3: past at text 5%, left at text 16%, today in accent, the last day ringed 1.5 px accent; warn colours when soon. With nothing to open, the row is still. | A repaint keeps the rows on the page and changes what they hold in place, the same row open (see *Motion → Repaint choreography*). @@ -893,7 +905,7 @@ A repaint keeps the rows on the page and changes what they hold in place, the sa - **×:** a knob pinned at top 22 / right 22. - **Pinned keys:** a view's own buttons, pinned at top 22 / right 58. - **View:** padding `0 24 24`. -- **View head** (`.vhead`): 76 high. Title 20/28 500, centred with a Back knob inside a flow. The head is the drag handle, with `touch-action: none` and a grab cursor. +- **View head** (`.vhead`): 76 high. Title 20/28 500, centred with a Back knob inside a flow. The head is the drag handle, with `touch-action: none` and a grab cursor. A view with no head whose top is a picture and a title (the admin's job stage) names that top the handle instead (`.vgrab`). - **Sub line:** 14/20 `text-2`, pulled up 16 px under the head. - **Scrolling:** what is taller than the screen scrolls inside the sheet with no scrollbar (a bar would cut into its round corners); so does the configuration in it. @@ -928,6 +940,15 @@ Apple's iOS 26 menu (Figma kit, "Menu – iPhone"), made compact: smaller type a **Separators** between groups: 13 px high, their 1 px line 16 px in from the edge. +**Order** (the admin's menus too): groups run from calm to grave, so the tone only deepens downward and the thing that cannot be taken back is always the last row. + +1. what only shows or opens something (Open, Show set-up, What's new, a link out); +2. what changes the thing itself and is safe (Rename, a note, a translation, a check); +3. what redoes or moves something of it (Reset traffic, New keys, Move to another server); +4. what stops it: off or Pause in `warn`, then Remove in `bad`, in one group, last. A component's menu ends the same way with what replaces the version in use (Reinstall, Roll back, `warn`). + +A neutral row never stands under a `warn` or `bad` one, and nothing follows Remove. + **Highlight:** the dropdowns' (see *Dropdowns*), radius 18 on a row. The row under it grows its icon to 1.08 on the same spring; a press takes the row to 0.97. **Motion and shutting:** as every dropdown's, growing from the knob's side. @@ -1021,7 +1042,117 @@ One choice with a switch (Add a device's **LAN Bypass**). A line that unfolds un ### Glass icon catalogue · `ui/glass.ts` -`phone, mobile, tablet, computer, router, other, plus, globe, home, shield, chart, calendar, clock, pause, server, link, key, lock, check, trash, refresh, app (AmneziaVPN mark), file, lan (three devices joined)`. +`phone, mobile, tablet, computer, router, other, plus, globe, home, both (the internet with the home behind it: an access that reaches both), shield, chart, calendar, clock, pause, server (a terminal's prompt and the mark of the core it runs on, AmneziaWG's today), link, key, lock, check, trash, refresh, browser (a page in a browser window), file, lan (three devices joined: a network)`. + +On the portal each stands for one thing: `link` a link (the row that opens yours on the device, the card of a link that no longer works), `key` the connection's key, `browser` the page or a browser (the page that could not load, «open this page in Safari or Chrome»), `server` the server (it is off, there is none yet), `home`, `globe` and `both` what an access reaches, `chart` data, `calendar` the term, `pause` a pause, `lan` LAN Bypass, `lock` the secure view, `file` the configuration, `trash` a removal. The line icons the same: the server's end of the way while a device connects is `terminal`, the server in a line. + +A pane may carry a filled mark instead of strokes, or beside them (`m`, its size on the pane `ms`, its centre `mc` where strokes share the pane; `markShape(name)` is a product's mark on the square pane, each at the size it reads alike at: the set-up sheet's «Add the connection» row wears the mark of the app picked, AmneziaVPN's at .385, AmneziaWG's and WireGuard's at .46, V2RayTun's at .42, and changes with the pick; the admin's at about half the box, `dawnline`, Dawnline's sun over the horizon from `shared/mark.ts`, and `amneziawg`, AmneziaWG's, which comes with the stylesheet's module so it is there when the page stands). In Settings › Updates a component's row wears its own mark, in the tone of where it stands (the owner, 2026-11-12: «если версия последняя то синяя, если новая то другим цветом»): blue on its latest version (or a build newer than the release), orange when a newer one is out, grey before it was ever checked, and red for AmneziaWG when it is not installed. The section's head says nothing after its title when everything is on its latest version: the marks say it (it still names a job under way, AmneziaWG missing, what is available, package updates). + +**What a picture stands for** (the owner, 2026-11-12: «для Network иконки должен быть не домик а буквально иконка сети», and «это пример сути, а не конкретно эдж кейс»). An icon draws the thing its row, section or tab names, never something near it; one picture has one meaning across the admin; a named product wears its own mark. Before an icon is chosen, the object is named, and that is what is drawn. + +**The admin's shapes** (`admin/ui/glass-shapes.ts`, and those with a mark in `admin/ui/glass.ts`), each with its one meaning: + +| Shape | Stands for | Where | +|---|---|---| +| `server` (the portal's: a terminal's prompt and the mark of its core, AmneziaWG's today) | a Dawnline server | the server's page head and its card on Overview, «General» on its rail, the «Server» section and its switch, Health's group, the notices and questions about a server, the first run's step | +| `core` (a chip) | a tunnel core in general, whichever it is | «Core» on the server's rail; the core's own row wears its product's mark | +| `amneziawg`, `wireguard`, `openwrt`, `github`, `dawnline` (marks) | the product itself | Updates' rows (Dawnline, AmneziaWG, the system packages as OpenWrt's) and their questions, the builds of AmneziaWG, «GitHub mirrors», the first run's card and its AmneziaWG step, a router's own WireGuard or AmneziaWG interface among the home networks, what Dawnline did itself in the log | +| `settings` (two sliders) | settings as a whole | the Settings page's head | +| `lan` (three nodes joined, the portal's) | a network | «Network» on the server's rail, «Auto-detect LAN», «Device hostnames», an Ethernet interface | +| `portal` (the portal's `browser`: a page in a browser window) | the personal portal | its rail item, section, switch (Settings and the new server's sheet), Health's group, the first run's step | +| `newperson` (a person with a plus) | a person to come | «New people» | +| `storage` (a store of records) | what is kept on flash | «History and storage» | +| `entry` (an arrow through a door), `out` (the arrow out) | the way in: the address and port devices connect to; leaving a page | the «Way in» / «Address» section; «Leave without applying?» | +| `tunnel` (a tunnel's mouth) | a tunnel | the «Tunnel» section; a router's VPN interface of another protocol | +| `key`, `lock`, `link` (the portal's) | a key; encryption; a link | «Interface and key», new keys; HTTPS; a new link, an invitation, the portal's address by a name | +| `cert` (a sheet with its seal) | a certificate | ACME: its packages, its notice, its question | +| `pin` | a place on the map | «Where people connect from», the location cache, the map's empty state | +| `wifi` | a Wi-Fi interface | the home networks | +| `service` (a machine in a rack) | a service at home | the home services' rows | +| `mask` | the disguise | its section | +| `route` | a path | «Check a path» | +| `update` | an update | Updates' rail item, section and «is out» notice; the stage of a check of every component | +| `backup` (an archive box) | a kept copy | Backups, «Keep the previous version», the stage of a restore or an import | +| `chart` (the portal's) | traffic | the questions that reset it | +| `refresh` (the portal's) | devices fetch their configuration again; a repair | the rollout's notices and questions, the watchdog, a job under way | +| `pulse` | a problem | notices, checks that did not pass | +| `person`, `people`, `log` | a person, people or a circle, the log | their heads, rows and empty states | + +The line icons follow the same rule (`admin/ui/line-icons.ts` beside `shared/icons.ts`): a server in a menu or a filter is the shared `terminal` (a line that small cannot hold a mark), a core `chip`, people `people` and one person `person` (never `admin`, a person with a shield), settings `sliders`, a server's Overview `dashboard`, the portal `window`, a connection `plug`, a filter `filter`, the people's views `cards` and `map`, what Dawnline did itself `sunrise`. A rail item's glass and its line in the jump menu are the same picture. + +The admin's shapes and line icons, and the marks a page draws as soon as it stands, come with the stylesheet's module (`admin/style-module.ts`, added in `shell/style.ts`): the pages' module is close to its size budget. + +### Admin kit · `admin/ui`, `admin/widgets` (`styles/shadow/kit.css`, `widgets.css`) + +The admin's own parts, on this file's tokens (no colour, radius or curve of their own). Where they stand and how the pages use them: `rules/ui-design.md`, `rules/frontend.md`. + +- **Filter bar** (`ui/filter-bar.ts`). The search field (48, `/` reaches it, Escape empties it); under it chips, pills 32 high: offered on `knob` with a plus, its name in `text-2` and its count in `text-3`; active on `accent-soft` in the accent with × (30 × 32 target); «Reset» in `text-2` while anything narrows the list; the count «12 of 24» Meta at the row's end. A press scales the chip to .96. A phone: one row that scrolls sideways, its end fading 18 px. +- **A list and the page of one thing in it** (`ui/subpage.ts`). Opening a person or a device gives its page the whole column; the list waits under it with the page's head, bar, scroll and filters. A page: the way back «‹ People» (or «‹ Dima» from a device) and × (36; gone under 480), the head a size down (24/30), blocks 28 px apart, each a section head over a raised card. It comes in as a page does, and so does the list on the way back (*Motion › 16*); Escape brings the list back at once. The item opened from wears a 1.5 px accent ring inside, fading over 1800 ms (ease-out), and is scrolled to the middle when it is out of sight. Escape goes back at once. +- **A server's page** (`pages/server`, `server.css`). Everything of one server behind one door. Under the admin's row: the way back («‹ All servers»; «‹ Overview» with one server), the page head (the server's glass: blue while it runs, red when it should and does not, grey when off; its name; its state in the state's tone, the address devices connect to as a mono key that copies it, its core), then ONE track across the page's whole width (the labelled track with icons, 20 under the head, 20 over the part): Overview · People with their count · Places · Settings, a 14 px alert in warn or bad after «Settings» while a part of it is not fine; on a phone the icons alone, the picked one with its word. Overview, People and Places take the page's whole width; inside Settings the Section rail names its three parts (General · Core with the core's name under it · Network; no group name) and a part's sections stand beside it, the first with no space over it. The server's own Overview is the page Overview's blocks of this server, a section's distance (28) apart: «now», the rollout strip while devices fetch, who waits for a decision, Health (what did not pass, each row ending in a pill «Settings › Network» that leads to the part it is fixed in; else one green row), the path check. Core opens with the core's own card: one component row (the card's 24 − 8 = 16 radius inside padding 8) and a note under it, 14 in. People inside the frame loses its own row, its title and its Cards · Map track (the server's track is People · Places). +- **A device as a dialog** (`pages/server/device-dialog.ts`, `server.css` `.dv`). A device opens over its person's page, never in its place. Up to 1000 wide from 760 px of the window (the sheet glides between widths, `ui/sheet-width.ts`), the portal's drawer at the window's height on a phone. The head stays while the blocks scroll under it (12 px fades at both ends): the glass 36, the name as the Sheet title 20/28 (changed where it stands, as the portal's device card: `ui/rename-title.ts`), its facts 13/18, and its actions on ×'s line as keys of ×'s size (32, 8 apart): «Show set-up» (its icon alone on a phone), ⋯, ×. «Connection» opens the dialog across both columns, a field tile with no title over it (its state names it; the heading stays for a screen reader): online or not and since when (17/24 500 in the state's tone), under it what broke when something did as a line of its own (13/18 500 in warn, or bad with a bad state: the diagnosis' first break, «Needs a new configuration»), then the period's sums, the period's track at the state's end (over it on a phone) and the strip. The connection's way, the diagnosis' steps and a fix button are not drawn in the dialog (the owner, 2026-11-11: «сделай это заместо панели выше с подключением», «убери текст связь»); where it connects from is Places'. Under it two columns (1.12fr : 1fr, 24 apart; one on a phone), both beginning with a block head on one line: on the left what the device does (Traffic; Places), on the right what it is set up with (its own MTU and keep-alive under a head that says when its configuration was given out, its addresses) and its latest events. On the sheet's `raised` surface every block is ONE tone, `field` (radius 20 for a tile, 16 for a row), with no card around tiles; block heads are Card titles (16/22) centred in a head 34 high (its tallest control's height) that stands 6 over its tile: the words are 12 over their own tile and 26 under the tile above, so a head reads as its block's, never halfway between two. One fact, one place: the state is «Connection»'s alone (not in the head's facts), and the configuration is «Show set-up»'s alone (no file card in the blocks). «Map and replay» and «Show set-up» are steps of the same dialog with the way back in their head; a question asked from it is a step too, whose Cancel leads back. +- **Usage and its limit month** (`widgets/limit-meter.ts`; the router: `core.limit_month`). The block is «Usage», not «Limit». A month here is never the calendar's. *The limit month* is the person's own: it begins with their first traffic and ends a month later, to the minute (31 Jan → 28 Feb); the next one begins only when they connect again, so time away uses up none of it. *Charts and sums* that used to say a month show the last 30 days, today last («30 days», never a month's name; no empty days to come). The block, top to bottom: the 30 days' bars with their down and up; «50.3 GB of 50 GB» with the limit edited in place; the 6 px bar; under it one Meta line as a usage page says it, when it starts again at the left («Resets in 12 d · 20 Nov»; «The month begins when they next connect» while none runs; «For the whole term: it does not reset») and the share used at the right («93%», warn from 90, bad at the limit); the pace; then the actions as chips: «+10 GB until the reset» (from 80 %; extra data lasts until the limit month ends, and a button that gives it names that day: «+20 GB until 20 Nov») and «Reset usage» (asked first: the count is let go and a new month begins with their next traffic; their traffic history stays). The portal says the same of its own month: «Resets on 20 Nov, in 12 d. Your month began with your first connection.» +- **A person's page** (`pages/people/person`, `panel.css`), the portal's columns (*Layout › Columns and order*) by the page's own width: the head across; under it, from 760 px of the column, the main column (fluid) and the access column (`clamp(320px, 38%, 384px)`, 28 apart; ~347 beside a 537 main column in LuCI at 1440). Main: «Devices 3 of − 4 +» with the cards two across from 480 px of the column (one under it, 8 apart under 420; a card keeps its week at every width), the card that adds one a 60 px row when it stands alone in its row, a single card alone the whole row; Traffic, the device page's card with their devices summed (the week's bars, This month · Total · Now in one row from 440 px of the column, Now only while online: the person's speed lives here, not in the head); Places (rows with strips); Latest (the short feed). Access: one stack under a section head «Access» as high as the devices' head beside it, so the first cards line up: Term, Usage (see *Usage and its limit month* below), What they reach, each a raised card 10 apart with its head inside (16/22 500, the aside Meta in `text-2`, its controls at the end, 36 high), nothing folded. Without an end date the term is its head («Term · No end date») over the moves. The column sticks 16 px under the scroller's top (`--md-top`) and, taller than the window, scrolls on its own (`max-height: 100dvh − 92`, a thin scrollbar). Narrower than 760: one column, the access stack first. +- **Person card** (People, `pages/people/card.ts`; its parts are `people/card.ts`). The device card itself (`.dev`: raised, radius 28, padding 8, gap 8). Head: the face 32 (blue ring while online; red or orange only in «Needs a decision»), the name 16/22 500, up to three device tiles and «+N» at the end of the name's row (26 round on `field`, the kind 16 in `text-3`, `text` with a 7 px `ok` dot while online, warn for a fault or a configuration to fetch, 50 % when off; the tooltip names the device), ⋯. Under the name the one state line 13/18 in its tone with «· N more» in `text-2` (a decision and a long absence wrap to two balanced lines). Then, by state: presence (`field`, radius 20: «Online for 2 d» in `ok` or «Offline for 3 h · Krasnodar» 17/24 over the week's hours Meta, both a duration in ONE short unit (5 min, 3 h, 2 d) so the line never wraps beside the speed; since when exactly is the line's title; the speed 15/22 500 over a 22 px live line, 100 wide, while online), traffic (the week and the month as Label over Value beside the week's bars; the limit's 6 px bar from half of it, «of 100 GB» after the month below that), the action as the card's block button (tint; soft for resume and a link). A grid of 264 px or wider, 10 apart (one column under 560); rows stand by their tops, except «Needs a decision», whose cards stretch to one height with the button at the foot. Groups from seven people: Needs a decision · Online («7 · 3 more above») · Everyone else · Paused (50 %). Over the list a notice per thing that stops many (a server turned off with «Turn on», a rollout with «Who waits»); on a phone two or more fold into one warn line (56 high, radius 24, two lines at most) that unfolds on a tap. + + | State | Line (tone) | Presence · traffic | Action | Group | + |---|---|---|---|---| + | No server | «No server» (bad), no tiles | — | Choose a server | Needs a decision | + | Access ended / limit reached | «Access ended 3 Nov», «Limit reached · 50.3 of 50 GB» (bad) | — | Extend to … / +20 GB until … | Needs a decision | + | A device fails | «ThinkPad does not connect» (warn) | — | Advice / Set-up · device | Needs a decision | + | End near (its last three days), limit nearly | «Access until 10 Nov · 3 days» (warn) | — | Extend / +10 GB | Needs a decision | + | Online | — | both, with the speed | — | Online | + | Offline up to 7 days | — | both | — | Everyone else | + | Long away | «Not connected for 12 days · Krasnodar» (where they were last, when known) | traffic only: the week and the 30 days as everyone's (the owner, 2026-11-12: «офлайн устройство должно показывать last 7 days 30 days как в онлайн устройствах»); no presence, the line says it | — | Everyone else | + | Never connected / no devices | «Not connected yet» / «No devices yet» | — | Link (soft) / Invite | Everyone else | + | Server turned off | «Server Dacha is turned off» (`text-2`) | — | — (the notice) | Everyone else | + | Paused | «Paused since 3 Nov», the card at 50 % | — | Resume (soft) | Paused | + + A configuration to fetch is a rollout, not a decision: its tile in warn, «Show set-up» in ⋯, the notice over the list. Read-only: no action, no ⋯. Picking several: the face gives way to the round mark (24, ringed 1.5 px; accent when picked), a picked card tints accent 8 %, a held one deepens linearly over 450 ms. +- **Tooltip** (`ui/tip.ts`). A pill in the toast's colours (12/16 500, padding 5 10, the glass edge and the pop shadow), one line, above what it names, or under it where a heading stands over the thing; on the other side when the window has no room; it comes up as the connection keys' tooltip does (`in, y∓3, s.96, b3 → 0`, 220 EASE_OUT) and fades where it stands (120 ease-out); from one thing to the next it glides over from where it stands (SMOOTH) as its words morph and its width glides; while said it keeps to its thing as the page moves, and fades where it stands when a repaint takes the thing away (see *16. Admin*). A mouse shows it on hover, the keyboard on focus; a finger's first tap shows it, the second follows the link. On a control that acts a finger presses at once with no tooltip, and a press puts it away. It never covers a heading. +- **Term** (`widgets/term.ts`). With no end date there is no block: the part's head says «No end date» and the moves are the card. With one, the portal's «Access until» block (`field`, radius 20): days as Display in warn in its last three days, bad when over, the calendar of weeks with today in the accent and the last day ringed; past ten weeks the same cells one a week under the word «weeks» (to 28 weeks; further, the number alone), so an extension never leaves the block half empty; an extension brings its cells in one by one (360 / 7·i). Under it the moves, two rows that keep their places whatever the term is (6 apart, a row's chips sharing it evenly, one alone taking it whole; `knob`, radius 14): the extensions «+1 month» and «+3 months», 48 high, each with where it leads («until 10 Dec», 12/16 `text-2`) as its second line, then «Date» and «No end date», 40 high. No tooltip on them (under a chip it would land on the chip below), and no chip ever crosses another on a change. Nothing else: when the date comes access stops, as a pause does, until the date is moved, and the last three days flag the person for everyone alike (no choice of what happens, no days of warning to set). +- **Limit meter** (`widgets/limit-meter.ts`). `field`, radius 20: the month as the portal's bars (64 high), «used of limit» in Value 17/24, the limit a value with a 16 px pencil edited where it stands (a 30 px field in the value's type, Return and Escape, a refusal in bad 12/16 with the shake), a 6 px meter (accent, warn from 90 %, bad at the limit), the pace 12/16 under it, then all they used since they came (Meta, `text-2`). The head: Month / Whole term as segments. Under 500 px of its column the month stands over the numbers. +- **What they reach** (`widgets/reach.ts`). Two switch rows (the portal's `.swrow`: a 28 px glass, grey at 55 % while off, the name 15/22 500, what it means now as Meta `text-2`, the switch): «Internet» (through your router / their own connection) and «Home network» (N networks / no access); 8 apart, radius `--r-row`. The last one on will not turn off: it goes back, shakes, and a line in bad says why. While home is on, what of it sits in home's own field block under its row after a 1 px `line` hairline (14 in from the sides): rows of chips that are switches (32, radius 10, mono for names, a check in `ok`, on the nested fill), the label beside them (over them for a segmented track under 440, for all under 300). Where the server uses circles, «Circle» is a row of the same shape under the block (glass people, blue in a circle), its pill with the circle's colour at the end. No diagram: the way devices → server is the same for everyone and said nothing. +- **A device's set-up block** (`widgets/config-card.ts`, in the device's dialog). Its head: «Set-up», when the configuration was given out as its aside, the one ⟳N of its values at its end. Under it the device's own values written into its configuration (MTU, keep-alive) as edit rows, then its addresses as name chips that copy. No file stands here: the configuration is «Show set-up» in the dialog's head (one way to one thing). No LAN Bypass either: it is chosen where a configuration is made (adding a device, new keys, the portal). +- **Place rows** (`widgets/place-rows.ts`). A row of the stack with a 6 px strip of when the device was there over the period (`--live` while it is there now, `--past` otherwise). +- **Map stage** (`ui/split.ts`, People › Map in `pages/people/map-view.ts`). One card (padding 8): the map and a 360 px inspector side by side from 840 px of the column, as high as the window leaves under the page's head (440–860), so the page stops there and the map alone takes the wheel; narrower, a 320 px map over the inspector, which goes on with the page. The inspector's head: «N places» (15/20 500) with «N devices online» (Meta), the scope's chip (a person or a device, × lets go) at the end, the period track across (Now · 24h · 7 days · 30 days). Its body scrolls inside, its edges fading 28 px only where rows are hidden past them. Level one: a row a city, the place rows' recipe (title, «N now» or how long ago at the end; 24 px faces overlapping 4 px, live ones ringed in `--live`, «+N» past four, then «N devices · networks»; one 6 px strip of when anyone was there). A row under the pointer or focus brings its city's markers forward and fades the rest with their arcs. A row or a marker opens level two in its place: «‹ All places», the city 17/22 500, «country · networks · now», its strip, then its devices as place rows, each the way to the device's page; the camera eases to the city on SMOOTH and holds there. Back: everyone framed again, the list where it was left with the city's row in sight and focused. +- **Empty state** (`ui/empty.ts`). A grey glass 44, the title 18/24 500, one balanced line 14/20 `text-2` up to 34 characters wide, one button (accent to make the first, soft to take filters off). +- **List of choices** (`ui/list-drop.ts`). The dropdown glass with the ⋯ menu's rows (a second line in `text-2`), the picked one with a check in the accent; 248–320 wide, it grows to 420 (a page's sections: 640) and then scrolls inside the glass; the arrows walk it. Chips that pick from several (a person, a device, a server in the Log), a value picked from a few, Settings' sections on a phone. +- **Section rail** (`ui/rail.ts`). 196 wide beside the sections from 840 px of the column (36 apart), sticky. A group: its name Meta 13/18 500 in `text-2`, then links 44 high (52 with a second line), radius 14: a 22 px glass at 60 % (full when current or not fine), the title 15/22 500, the state Meta under it, a 14 px alert in warn or bad at the end. One highlight on `raised` stands on the current link and glides to the next (GLIDE; `ui/rail.ts`: it stays in the page while the links are drawn again, or it could not). A rail of one group gives it no name (Settings and a server's Settings: the page's head or the track over it says «Settings»; the owner, 2026-11-12, of «Router and Dawnline» over the first link: «первая вкладка ниже уровня заголовка»), so the first link stands at the top of the column, and the first section's head stands level with it, their middles on one line (the head 6 px down). A pick swaps the section on screen; nothing follows the scroll. Narrower: a sticky pill «the current section ⚠ 2 ▾» (40, `knob`, press .96) that opens the list of choices with every section. +- **Section** (`ui/section.ts`). 40 above it; the head: a 22 px glass in the state's tone, the title 20/28 500 −0.025em, then quiet Meta 13/18 (a ⟳N mark, «2 checks passed» with a 14 px check in `ok`, what did not pass in warn or bad), one action at the end. Its parts are raised cards 10 apart (radius 24, padding 8, blocks inside 10 apart on `field`, radius 16); a caption 14/20 500 over a part with its buttons at the end (min 40 high), a note Meta 13/18 `text-2` under it. Nothing in a section folds. A check that did not pass stands first in the section's first card: a note on `field` tinted 9 % warn (bad for an error), a 28 px glass, its words, and its fix as a 36 px button (tint for an error, soft for a warning). +- **Option tiles** (`ui/option-tiles.ts`). A choice of two or three whose options are drawn, not described. A tile: `field`, radius 16 (the Settings card's 24 − 8), padding 14/16; a picture of what the option does, its name 15/22 500, one sentence at most (Meta 13/18), facts as pills (24 high, radius 12, 12/16 500, on `knob` 65 % over `field`; on the picked tile `knob` + text 7 %). The one in use: its fill a step up (`knob`), its picture in colour, a 20 px accent mark with a check in its corner; the others an empty 1.5 px ring and a grey picture. Waiting to be applied: the mark in warn, the one still running a dot in an accent ring, and the page's line under the tiles says «Not applied yet. Now: …». No ring around a tile and no word «now». A tile the router cannot run: 55 %. Hover `knob` 50 %, press .98; arrows move between them. Two pictures so far: **a way** (the portal's: 34 px boxes with a line icon, 1.4 px dots every 9 between them, a word 11/14 under each; the stop an option adds on `accent-soft`), for how internet traffic leaves; **a level** (an icon of what is measured, three 12 × 5 pips, what the level means in words), two a tile, for the disguise (how hidden, how fast), with the apps that take it as pills (`widgets/disguise-levels.ts`). +- **A value on a scale** (`ui/range.ts`). A 6 px track on `knob` + text 6 %, the accent to the knob, a 20 px white knob that follows the pointer 1:1 (a handle: one of the things that move), steps of its own and a hold onto a mark within 8 px; the values worth knowing as dots on the track, named under it (the number 12/16 500, a word 11/14 `text-3`). Automatic is the scale's own state: the knob hollow where automatic stands, a smaller ghost where it differs for phones, the fill `text-3`. Arrows step, Page keys five steps, Home and End the ends. +- **A server's link values** (`widgets/link-values.ts`, Settings › Devices). MTU: a `field` block (radius 20) with its name, ⟳N and an «Auto» key at the head's end (lit on `accent-soft` while the router picks), the number as its own field in Display 28/34 600 (no frame until pointed at), what it applies to beside it, the scale 1280–1500 with «mobile networks · auto · WireGuard · Ethernet», one line of what MTU is. Keep-alive: a track «Off · 15 s · 25 s · 60 s · Own» (a small field under «Own»), one line of what the picked one means. Both wait for «Apply». +- **A server's way in** (`widgets/entry.ts`, Settings › Address). A `field` block: «Address» and «UDP port» as two named cells of one address in mono 17/24 500 with a `:` between, each edited where it stands, ⟳N and the copy knob at the block's right; under a hairline the router's verdicts as rows (a 20 px mark: check on `ok-soft`, alert on warn or bad, a quiet dot for a plain fact; the fact 14/20 500; its proof at the row's end in `text-2`): where the address points, whether anyone reached it from the internet and when, what the port means. The first row follows what is typed. On a phone the address takes a line of its own. No state dot. +- **A network with its switch** (`widgets/net-switches.ts`, Settings › Home network). Rows touching on one `field` list with shared round ends: the interface's glass (blue while home access leads there, orange with no firewall zone), its name, its subnet in mono and its zone as the line under it, the portal's switch. The LAN found by itself is on and locked, «Auto» beside its switch. Not tiles: a tile says «one of», a switch «this one too». The interfaces that cannot be home networks fold under the list behind a pill «N interfaces are not offered» (its chevron turns), **by reason** (the owner, 2026-11-12, of the old run-on list: «сейчас сломано»): rows touching on one `field` list (radius 16, 2 apart, padding `11 14 11 16`), the reason once as the row's name (14/20 500), the interfaces it holds for in mono `text-2` at the row's end, wrapping under it where they do not fit; six ports of one bridge are one row. +- **Who sees whom** (`widgets/visibility.ts`). The rule on a track (Nobody · Everyone · In circles), its meaning in one line, and under it the rule drawn with the server's own people: every group whose devices reach each other a tile with their faces (a circle: its colour dot, its name, the count, a pencil; the last tile makes a new one); people in no circle and people with internet only as quiet lines. +- **A list of people to tick** (`flows/circle.ts`). Rows 44 high on one `field` box (radius 16) that scrolls inside from seven: the face, the name 15/20 500, a second line only when it matters (another circle with its dot, «moves from …» once ticked), the option tiles' round mark at the end; a search over it from nine people; the head counts the ticked; who the choice does nothing for stand last under one line that says why. +- **Measure with its limit** (`ui/measure.ts`). `field`, radius 16, padding 12/14/12/16: the label Meta, «used of limit unit» in Value 17/24 500 (the small words Meta in `text-2`), a 6 px bar (accent; warn from 90 %, bad at the limit; its width on SMOOTH), a line 12/16 under it. The limit is changed where it stands: a value with a 16 px pencil that opens the list of choices, or an inline edit. Two measures stand side by side from 560. +- **Inline edit** (`ui/inline-edit.ts`). A value pressed becomes its own field in the value's type and place, as wide as what is typed; Return takes it (a refusal: the reason in bad where the part says things, the shake), Escape, a press elsewhere or the focus gone put it back. On a touch screen the field is 16 px (no zoom). +- **A week of traffic** (`widgets/week-use.ts`). «Last 7 days» over what was downloaded and uploaded in them (`↓ … ↑ …`), beside the days as the portal's bars. A day under the pointer, picked by a tap or with ← → on the bars, puts its own name («Today», «3 days ago») and numbers in the sum's place, at once (a hover readout never morphs). One part wherever a week is shown: a device's card on its person's page, the Traffic card of a device and of a person (the owner, 2026-11-12: «в девайсе трафик last 7 days должен работать по такому же принципу как в карточке устройства в персоне, и при наведении на бары»). +- **Row of a thing** (`ui/comp-row.ts`). The Updates block's component row for other lists (home services, circles, the portal's addresses, backups): a 28 px glass (or a circle's colour dot), the name 15/22 500, a state line Meta (mono for an address or a file), its actions in sight at the end (a button, 36 px knobs). Rows touch on `field` and share round ends. +- **Dock** (`.kt-dock`). The glass at the window's foot, in the layer: up to 520 wide (Settings' changes: 560), 60 high, radius 30, 20 from the edge plus the safe area; it rises from under the edge on a transform alone (SMOOTH) and leaves on EASE_IN (180). People's selection, and a server's changes that wait: «3 changes» 15/20 500 over «39 devices will fetch the configuration» Meta, Cancel (soft on the glass) and Apply (accent); the counts morph. +- **A chip that toggles** (`.chipb[aria-pressed]`: a choice row's chips, the ports found at home). On: a fill one step up (`knob` + text 10 %), the words in `text`, a 14 px check in the accent before them; off: `knob`, `text-2`. The option tiles' language. No ring (the owner, 2026-11-11: «вот такие пиллы надо заредизайнить», then «исправь» for an accent fill): a ring on a pill reads as a focus outline, an accent fill as a button. +- **What the log records** (Settings › History). Three independent yes / no, so three switch tiles in a row (one column under 640): the kind's name, how many events of it the log holds now, the portal's switch. Not chips. +- **Automatic updates** (Settings › Updates, `router/updates-policy.ts policyPanel`; a panel of its own under the components, the owner, 2026-11-12: «заредизайни это и отдели в отдельную панель»). A caption, then the choices as lines touching on one list (`field`, radius 16, 2 apart, padding `14 14 14 16`): a name 15/22 500 with a Meta note under it, and the control that makes the choice at the line's end, standing open (no row that folds): how often it checks and whether it installs as pills that open a list (`valuePick`; tracks of five intervals did not fit beside the name in Russian and squeezed it to a word a line: the owner, «лучше сделать а-ля дроп-даун»), the words never getting less than half the line; the time of a scheduled run in mono inside its own sentence, edited where it stands (how to finish, or why not, on a line under it); what it installs as chips that toggle on a line of their own, the note turning warn once AmneziaWG is among them. Then «Keep the previous version» and «GitHub mirrors» as switch rows. +- **Latest updates** (Settings › Updates, `router/updates-policy.ts`; a panel of its own, last in the section). A caption with the way to the Log as a pill at its end, then rows touching on one `field` list (radius 16, 52 high): a 20 px mark in its tone (check, a download for what a check found, × in bad), what it was about as the row's name 14/20 500 (a component with its versions in mono, the one it left in `text-2`; what was found), how it came about under it in Meta (by you or by itself, how long, in bad why it failed), how long ago at the row's end in `text-3`. Not sentences. +- **A device's set-up in the admin** (`flows/setup.ts`). Two tracks of one width under the lead: the app (AmneziaWG · AmneziaVPN), then the form it is handed over in (QR · .conf · Text; AmneziaVPN's key has no file: QR · Key), the code first for a phone or a tablet, the file for a computer or a router. Under them the form itself (the QR card, the file card, the configuration's text in the portal's `.conf` block: sections in the accent, key names in `text`, scrolling inside from 15 rem; a key wraps) and Copy and Download (.conf only). «Show set-up» shows this and nothing else (the owner, 2026-11-11): the wait for a first connection belongs to Add and New keys, where the portal's way stands under the head. Showing it marks nothing: a configuration counts as given out when it is made (a new device, new keys) or fetched on the portal, never because the admin looked at it; the lead says only whose device it is. +- **Release notes** (`flows/whats-new.ts`). Under the head one row: the date (a pre-release as a warn pill), then two quiet 36 px keys on `field` at its end (copy, the page on GitHub; their names are tooltips, so the row never wraps). The notes: a point a row with its own 4 px dot in `text-3`, 8 between points; code on `field`. Notes that could not be read: why on a `field` block (radius 16, Meta in `text-2`) with «Try again» (soft, 40) at its end, in the notes' place. The same view is a version's page among Dawnline's other versions: a step with the way back, the version as its title, and one block button 20 under the notes. +- **A job's stage** (`flows/job-stage.ts`; an updater job in `flows/operation.ts`: Dawnline itself, AmneziaWG, the system packages, a check, a translation, installing what a feature misses; a restore or an import in `flows/restore.ts`). One view from the job's start to its end, in the question's own anatomy (*Sheet › Question view*), so the question, the work and what came of it are one shape and nothing is laid over anything (the owner, 2026-11-12: «переработать модалку с обновлением… там сейчас наслоплено»: the old one was a head, a line, a track, a lone clock and a text fold, with the end put into its middle under a second title). **The top:** the picture of what the job is about, 64 px (a component's own mark; `update` for a check of all of them, `backup` for a restore) in the tone of where the job stands (blue under way, green done, red failed, orange when a check found something newer or the router stopped answering), the title 20/28 500 (the job in words, then what came of it, wrapping freely), one line 15/21 `text-2` under it (that it may be closed; then why it failed or what happens next; none when the title says it all). No view head: × stands at the sheet's corner and the top is the drag handle (`.vgrab`). **The steps**, 18 under the top: one `field` block (radius 16, padding `14 14 14 12`), a step a row 10 apart: a 20 px round mark and its words 14/20. Done: an `ok-soft` check, the words in `text-2`. Under way: a 6 px accent dot that breathes on `accent-soft` (1.8 s, still with less motion), the words in `text` 500, and the job's time at the row's end (Meta, tabular): it is where the job is, not a warning, so not orange. Where it failed: × on `bad-soft`, the words in `bad` 500. Not reached yet (a restore's steps are known ahead): a `text-3` dot on `knob`. **The log**, 8 under them: the portal's inset accordion row («Operation log», the `log` glass), its Copy key beside the chevron while it is open, the lines in mono 12/17 on `knob 65% + field` (radius 12, at most 240 high, scrolling inside), as the set-up's `.conf` (*Accordion › Inset variant*). **The actions**, 20 under, at the foot and only once there is something to decide: «Done» (accent) after what went well, «Close» (soft) after what did not, «Close» and «Update» after a check of one component that found a newer one. **The end** changes the same parts in place: after an install the steps go (the title says it: «AmneziaWG 1.0.20251101 is installed»; the packages' names as the line); after a failure or a silence they stay, so the step it stopped at is in sight, and the line says why and that nothing else was changed; after a check they give way to what it found. **What a check found:** the components as rows of one list (`.checks`), each as its row in Settings › Updates: its mark in the same tone (blue: nothing newer, orange: a newer one is out, red: its check failed, grey: not installed), its name, and under it its version or its move in mono («0.18.0 → 0.18.1»), the count of package updates, or the router's reason; a 20 px round mark at the row's end (check on `ok-soft`, an arrow pointing up on warn 14 %, an alert on `bad-soft`). The title says the whole once («Everything is up to date», «There are updates», «Not everything was checked», «The check failed»); one component whose check failed has its reason as the line and no list. **Dawnline's own job** runs here as every other (it was a notice of its own with its own progress, failure and log sheet). Installed, it has no button: the line says the router is restarting its services and the page reads itself again once the router answers with the new version (the owner, 2026-11-12: «предлагаю сделать автоматический релоад страницы»); «Reload now» comes only when 45 s passed without that answer. A translation's job ends the same way, the page reloading by itself after 4 s. Closing the sheet leaves the job running: its row in Updates says «Updating…» and opens the stage again, titled by the job (`updater/jobs.ts jobTitle`). The «is out» notice over the components only announces a version that waits (What's new, Update now) and steps aside while any job runs. +- **Dawnline's versions** (`flows/versions.ts`). A lead (which one is installed), then the releases as rows of one list (`.checks`, each row a button 52 high): the version in mono 13 with its marks beside it (pills 11/16 500: «Installed» on `accent-soft`, «Pre-release» on warn 14 %), its date under it in Meta, a 16 px chevron in `text-2` at the end. A row opens the version's own page in the same sheet (*Release notes*) with «Install 0.18.1» at its foot: accent for a newer one, `warn` for an older one, which then asks about the backup first; none for the one installed, while another job runs (the lead says so) and for a read-only login. No button in the rows and no pager (there were a notes knob and «Install» in each of five rows under «Newer · Page 1 · Older»): «Show older» (soft, 40, centred, 8 under the list) adds the next five. A list that could not be read: the notes' block of why with «Try again». Last, 20 under: «A version by its tag», the name 13/18 500 over the portal's field, whose go button is at rest until something is typed. +- **Packages and versions** (`flows/packages.ts`). A block a feature on `field` (radius 16, 8 apart): its head as a row of a thing (a 28 px glass, the name, what it is for), then a row a package under the head's words: the name in mono 12 on the left, its version in mono `text-2` at the right end, in warn with its move when the feeds have a newer one («6.11.0-r1 → 6.11.0-r2»), «not installed» in words. A version that does not fit beside its name goes under it, still at the right. +- **Paddings, checked** (the whole admin; the owner, 2026-11-11: «каждый элемент интерфейса должен корректно следовать правилам»). A surface is anything with its own fill and round corners (a card, a tile, a row). Its content stands at least 8 px from every edge; words 12 from the left; words that begin or end a card 14 from that edge (the card's 8 and 6 of their own); a single row's content in the middle of its height; a surface nested in another's corner has the outer radius less the gap between them (a Settings card is 24 round with 8 of padding: its tiles are 16; a portal card is 28: its tiles 20); a line of words never touches a tile (4 px at the least, 6 by the rule below). The concept's `tools/ia3-pads.mjs` measures every surface of every page and sheet at 1440 and 390 against these and must print «0 findings» before a change of the admin's look ships. **Controls are measured too** (its second pass; the owner, 2026-11-12, of a track whose pill sat low: «линтер паддингов, отступов, закруглений и прочего нужен»): nothing in a control is taller than its inside (a 32 px tab in a track 28 high inside is a finding: a lower track sets its tabs' height with it); a track's pill is as far from the top as from the foot, by the track's own padding, and concentric with it (the track's radius less that padding); the picked words stand in the pill's middle, and a one-line control's words in its own (1.5 px of slack); a filled part in a control's corner is concentric with it. The stand-in must draw the pages for any of this to count: it answers the backend's stream from its fixtures (`src/ia3/stream-stub.ts`), and a run over pages that did not open measures nothing. +- **A name, a value, a note** (the whole admin; the owner, 2026-11-11: «подписи у айтема визуально накладываются вместе с остальными ноутами… нет чёткого разделения или отношения одного к другому»). Three voices that never share a look, and nearness that says what belongs to what. **A name** (a field's label in a sheet, a caption in a card) is the text's colour with a weight: 13/18 500 over a field, 14/20 500 over a card's block. **A note** (what explains the thing over it) is `text-2`, regular, 13/18. **A lead** (what a step or a sheet is for) is `text-2` 14/20, once, under the head. A note stands 6 px under what it explains and at least 16 px (20 in a sheet) before the next name, and starts on the left edge of the words it explains (in a card: 14 in from the tile's edge, where a row's name starts; a caption starts 8 in). One note a thing: a second sentence joins the first, goes to the lead, or is dropped when the router's own verdict says it. A verdict is not a note: it carries a mark or a tone. A note that belongs to a tile lives inside the tile. +- **A sheet's rhythm** (the admin's sheets, `styles/shadow/sheets.css` › «The sheet's rhythm»). One set of gaps for every view, whatever flow builds it: the lead tucked under the head, 18 to the first group; a name 6 over its control and a note 6 under it (one group), groups 20 apart; a footnote 12 under the actions; 20 over the actions and 8 between them; 24 at the foot. A flow does not set these itself; a new kind of block at a view's top level is named in that rule set. The concept's `tools/ia3-sheets.mjs` opens every sheet and prints the gaps between its blocks (under 6 and over 26 are flagged). +- **⟳N** (`ui/edit-rows.ts reMark`: how many devices fetch their configuration again after a change). A 22 px pill on warn 14 %. It stands at the right end of what it belongs to (the owner, 2026-11-11: «не нравится что 37 находится не по правой стороне»): before a row's value or its switch, with the copy knob at an address row's end, at the end of a section's head, of a card's caption, of a measure's label line, of a block's head. Never between a name and its value. +- **A field that picks as it is typed in** (`ui/combo.ts`). The portal's field (48, radius 16) with its name inside in `text-2` 13/18, the picked thing's icon in a 28 px box on `knob`, the words 15/22 500 and a 40 px chevron key at the end. Under it the list of choices' glass and rows, as wide as the field (248–420), narrowed to what is typed (a row's second line counts: a device is found by its person); the keyboard stays in the field: arrows walk the rows, Return takes the one they stand on (a still `glass-hl` highlight), Escape shuts the list; what is typed and is no row is taken as it is (an address, mono). The picked one says more than its row where the row alone is ambiguous («iPad · Vika»). Never a browser datalist. Used by Settings › Check a path (from a device, to a home service). +- **The portal's port and unknown links** (Settings › Personal portal). The port is a part of the link: a tile draws the main link in mono with the port in its place on a nested fill, edited there, and one line of what the port means (or why a typed one is refused). What an unknown link opens is a choice of two on a track («Not found» · «Another address») with the address row under the second and one line of what the picked one does. The certificate's card stands under them (it follows from the address and the port). +- **A value that waits to be applied** (Settings, a person's page: nothing that changes how a server works or what a person may do is made by one press; «Apply» in the dock makes it, asking once first only when devices fetch their configuration again). On a person's page the part's head carries «not applied» (the ⟳N pill's shape, 12 px) and the part is drawn as it would be. In Settings its field shows the new value in warn, with «Not applied yet. Now: …» under it (Meta, warn); a tile picked next wears the warn mark; an address row's chip says «not applied». Nothing else on the page changes until Apply. +- **Rollout strip** (`widgets/rollout.ts`). A raised card (radius 24, padding 8): a 32 px round ⟳ mark on warn 14 %, the count 15/22 500 with the change and when under it (Meta), the way to People at the end (no «Remind everyone»: a person is reminded with their own link); one cell a device (radius 3, 16 high, 2 apart; done in `ok` 70 %, waiting in warn; a 6 px meter past 60 devices); then who has not fetched yet, two columns of rows (a glass, «device · person», when it was last seen, a 36 px knob that copies the person's portal link). It comes in softly when devices start waiting (opacity, 6 px, a 4 px blur; 280, EASE_OUT). +- **Feed with a time column** (the Log, `pages/log`). The feed's rows with the time first (46 wide, Meta, tabular), day heads that stay under the top edge while their rows pass (the ground's own colour, fading 12 px), the server a quiet word at a row's end (gone under 700; under 560 the time is at the end again). +- **A server's card on Overview** (`pages/overview/servers.ts`). The door to the server's page, raised, `--r-row`. Its row: a 28 px glass, the name (15/22 500), and under it the server as its page's head names it, on one line: its state in the state's tone, « · », the address devices connect to in mono 12 `text-2` (it ends in «…», the state never). Then its figures as NAMED cells, 96 wide, 20 apart, the name Meta 13/18 `text-2` over the value 15/22 500: People · Waiting for a decision (warn; the column stands on every card while anyone on any server waits) · Now (↓ speed to the devices) · Today; a figure there is none of is «—» in `text-3`. The cells stand in the same columns on every card, so two servers are compared down a column: «Turn on» of a server that is off stands between the name and the figures, never after them. A number with no name beside a grey address in the middle of the row is not a figure (the owner, 2026-11-11). Narrower than 800 px of the page the figures go under the name in as many columns as fit one whole (two by two on a phone). +- **Health as a list** (Overview, `pages/overview/health.ts`). The most pressing check that did not pass is the page's one notice; the other failing ones are rows under it; what passed stays in sight grouped by what it is about, a component row each (`overview/model.ts checkGroups`): the router, each server under its own name, the portal. A row: the subject's glass in the tone of its worst check (green, orange, red; grey for a server turned off), its name, under it the checks that passed in ONE quiet line (Meta, joined by « · », each with its detail as its title, a skipped one in `text-3`), and at the row's end its count («6 of 6» in `text-2` with a 14 px check in `ok`; in warn or bad with an alert when not all did; «off» for a server that does not run, whose row then has no line). A check is named by what it checks, never with the core's or the server's name in it: inside a server's row the « (name)» the router adds is dropped, and a failing check is not named again in its group (the notice and the rows above have it). Never a cloud of ticked phrases (the owner, 2026-11-11: two dozen marks that repeated «AmneziaWG … (Ames Gateway)» told nothing apart). A two-line row keeps 11 px over and under its words. A check a Settings section is about is a link as a whole («Fix in Settings ›» at its end, in `text-2`); only a check no section is about keeps its fix button. The foot: the watchdog in one line with its switch, «Check again». +- **A track of tabs that does not fit** (`ui/tabs.ts`, `tabs.css`). It scrolls, wherever it stands: on a page, in a sheet, in a dialog (a sheet lives outside the page's container, so a rule tied to the page's width never reached it, and on a phone the devices of «Where they have been» were cut off at the sheet's edge). Every tab stays in the track and in the keyboard's order; a finger swipes it; no scrollbar. Each end that has more beyond it fades over 28 px (a mask on the track, driven by the track's own scroll position; where scroll-driven animations are missing the ends are marked by an observer and the fade eases in 200 ms). A pick brings the picked tab whole into view, past the fade, with only the track scrolling (smoothly, unless less motion is asked for), and a track is opened with its picked tab in view. +- **Networks behind routers** (`widgets/net-values.ts`, `flows/behind-ask.ts`, `styles/shadow/behind.css`; classes `nb-*`). A router that is someone's device may bring its own network along (site to site). *Where they are set:* a server's Settings › Network, the card «Networks behind people's routers»: a row a router (the router's glass: blue with networks, grey without, orange while its list waits; its name with its person as a link to the device's dialog, a chevron after the words), and under the name its networks as chips. *A chip* is the name chip's shape a step up (32 high, radius 10, `knob`, mono 13/18) in two parts, as a filter's chip: the address, pressed to change it where it stands (`ui/inline-edit.ts`, the field in the chip's own shape), and its own × (28 × 28). The last chip adds another (dashed outline, «+ Network»). What waits for «Apply» is in the pending tone (warn 14 % with warn text), one taken away is struck until then and a press brings it back; under the list one line says what the router has now («Not applied yet. Now: …»). Why a typed network is refused is a red line under the chips, the row gliding open for it; how to finish stands beside the chips, on their line, so nothing under them moves. A change is one staged change whatever the number of routers, and ⟳N counts only the devices whose configuration names the changed routers' networks. *What a router's owner asked for on their own page* is the admin's to answer, at once, never through the dock: a network asked for is a chip in the accent's tint with its two answers in sight (✓ and ×, 28 × 28; 40 × 40 and 6 px apart under a finger) and one accent line under the chips saying who asks; a router asked for is the whole row's question, its networks read-only chips, «Accept» (tint) and «Decline» (soft) at the row's end on a wide page and under its words on a narrow one, with what the admin should know before taking it as warn lines (a person with Internet access brings the whole place's internet into the tunnel; devices kept apart will not reach it). «Decline» opens a menu at its button: three reasons and «Without a reason»; the owner reads the one picked. Each answer is said in a toast with Undo, which puts the question back. A refusal of the router's (a network that shares addresses with one something has) is said in red where the row says things, and the question stays. *In the device's dialog* the same question is the first block of Set-up (`.nb-ask`: the accent line, the chips, the warnings, ⟳N with its words, the two buttons side by side, each half the block), and a router's networks stand under its addresses as copy chips with a pill link to the Network section; a router that waits has no «Show set-up» in the head and only Rename and Remove in ⋯, and its state reads «Waits for your answer» in the pending tone. *Elsewhere* a card never holds the question: a device's card on its person's page shows «Answer the request» (tint, the clock) where «Show set-up» would stand, and the People list has the line «Asks for the router …» with «Answer»; both open the dialog. A router asked for and turned down leaves the admin's lists. *Adding a router as the admin:* the form's block «Networks behind it» (the option row's shape: the router's glass, the name, what it means, the chips under the words) folds in with the kind «Router» and away with another (`ui/fold.ts`); nothing is asked, the networks are saved with the device. *The rules of people's pages* are the next card, «Routers on people's pages»: two pick rows (pill value picks: Off / On request / At once; On request / At once), the second gone while the first is Off, one line under them for what the pair means, in the pending tone where something is made with no answer of the admin's; both wait for «Apply». *Motion* (`ui/chips-motion.ts`): the page stands still and a press draws the row again, so each chip goes on from where its own stood: one that stays glides to its place (FLIP on SMOOTH), one whose look changed crosses in place through the blur (out 160 ms EASE_IN, in 280 ms EASE_OUT after 60 ms), a typed one takes the field's place, any other new one comes in from nine tenths on SOFT, one that left fades where it stood (160 ms EASE_IN) while the rest close up, and the row glides to its new height; a line that comes or goes under a list unfolds or folds so the cards below travel with it; a request answered folds away where it stood. The device grid of a person's page moves as the portal's: a card removed fades where it stood (180 ms EASE_IN, 4 px blur), the others glide to their places, the grid to its height. ### Demo-only pieces · `demo/` (not in the router build) @@ -1076,7 +1207,7 @@ Six rules hold everywhere: 2. **Exits are quick, entrances are soft.** Exits use an ease-in curve and run 120–220 ms. Entrances use ease-out or a spring and run 280–572 ms. In a cross-fade the incoming part waits 60–110 ms so the two overlap in the blur. 3. **Blur is the transition medium.** Things appear and disappear through `filter: blur(2–6px)` with opacity and a small scale (`.86–.96`) or a few px of travel. Large travel is reserved for the drawer (`translateY(100% + 40px)`) and the FLIP of cards. 4. **Interruptible from the present.** Every new animation starts from the computed current state (`getComputedStyle`, a morph's live width, the pill's current edges, a live rect) and cancels the old one only after the new one is in place. Turned back half-way (a double click, a quick second pick), nothing starts over from fixed keyframes, and a fade runs only what is left of its way. -5. **The keyboard never animates.** Escape closes menus and sheets instantly. +5. **The keyboard does not start motion,** but for a sheet's way out. Escape closes a menu instantly and sends a sheet out as its × does (the owner, 2026-11-12: «ESC резко закрывает модалку не как кнопка закрыть»; asked whether the portal should do the same: «Да»). 6. **Reduced motion keeps fades, drops travel.** See *Reduced motion*. ### The engine · `motion.ts` @@ -1087,7 +1218,7 @@ spring(k, c, m = 1) // closed-form damped harmonic oscillator; under-, critica // what is left of the way then is spread over the curve (mostly near its end), so it lands on 1 // exactly: a 500 px travel ends without a last-frame step // easing = CSS linear() with 65 points; at(ms) = progress for script-driven motion -publishSprings(root) // --spring-{bouncy,smooth,soft,quick} and --spring-*-dur on for CSS transitions +publishSprings(root) // --spring-{bouncy,smooth,soft,pop,quick,glide} and --spring-*-dur on (the admin's host) for CSS transitions play(el, frames, o) // el.animate() with the reduced-motion policy; a large element (> 30 000 px²) fades without its blur rubber(dist, dim) // (1 − 1 / (dist·0.55/dim + 1))·dim: resistance that grows with the pull unrubber(d, dim) // rubber() undone: the pull that puts an edge d past it (a sheet taken while it settles back) @@ -1141,6 +1272,7 @@ A press shrinks a control, but it keeps the footprint it had when pressed: let g | Accordion row | — | raised+knob 40% (inset: field+knob 50%; nested in an inset row: `knob`) | 150 ms | | `.swrow` (option row) | none | field+knob 50% | 200 ms | | Switch knob (`.sw`) | held: stretches 20 → 27 px toward where it goes | — | SMOOTH 524 (travel, width, colour) | +| Admin switch that writes (`flipping`) | from the click a ring comes in on the knob as the busy orb does (`in, s.6, b2 → 0`, 340 / 70 EASE_OUT: whole by 410 ms) and rides it (SMOOTH); the change is sent once the knob is over (524); the ring turns (700 ms a turn) until the answer, then stops where it is and goes (`out, s.6, b2`, 180 EASE_IN), carried across the repaint the answer brings | — | as said | | Picker item | — | `text-3` → `text-2` | 200 ms colour | | Spark / month bar | — | `--bar` → `text-2` (today: accent+text 25%) | 150 / 120 ms | | Field | — | focus ring inset 1.5 px | SMOOTH 524 | @@ -1156,14 +1288,14 @@ Notation: - `y10` means `translateY(10px)`; - timings are `duration / delay`. -#### 1. Page intro (first paint, once per visit) +#### 1. Page intro (first paint, once per visit) · `ui/rise.ts` | What | From → to | Timing | |---|---|---| | Each block (crumbs, notice, section heads, each card, the limit note, each access row, the gone card), in the order they stand on screen (top to bottom, then left to right), from the first one on screen | `opacity 0 → its own opacity, y10 → 0, b4 → 0` | 520 / 60 + 40·i, EASE_OUT, fill backwards | | The sun of the logo | `translateY(7px) → 0`, clipped above the horizon bar: the sun rises | 900 / 150, EASE_OUT | -A disabled card rises to its own 50%, not to 1. On a phone the wave runs from the crumbs through "Your access" and its rows down to "Your devices" and the cards. The first block on screen always rises at 60 ms: a reload that goes back deep into the page starts the wave there, and the blocks above it rise with it. +A disabled card rises to its own 50%, not to 1. On a phone the wave runs from the crumbs through "Your access" and its rows down to "Your devices" and the cards. The first block on screen always rises at 60 ms: a reload that goes back deep into the page starts the wave there, and the blocks above it rise with it. A block still rising is let go on, never begun again (`data-rising`). The admin's pages come in by this same wave (*16*). #### 2. Repaint choreography (the page after a change) @@ -1249,7 +1381,7 @@ A click mid-way (a double click) turns every row and body back from where it sta | | scrim | `in` | 420, ease-out | | Phone close | sheet | from its current transform → `translateY(100% + 40px)` | 420, DRAWER | | | scrim | from its current opacity → 0 | 320, ease-out | -| Escape | everything | gone at once | 0 | +| Escape | sheet and scrim | as the × closes it, above (a menu over it: gone at once, first) | as above | **View swap:** @@ -1405,6 +1537,35 @@ The ring does not travel: the old tile's ring fades and the new tile's ring draw | Top edge fade | opacity 0 ↔ 1 at `scrollY > 2` | 200 ms | | Demo scenario switch | page `out, b4` 160 EASE_OUT → repaint → `in, y6, b4 → 0` 420 EASE_OUT | demo only | +#### 16. Admin: the pages stand still (`portal/motion.ts` `standStill`, set in `admin/main.ts`) + +The admin's pages are drawn again from data on every change, and they are too many and too dense to move piece by piece on each answer from the router without something tearing (chips crossing, a tooltip left behind, a number shrinking for the length of its morph). So the admin does not animate a repaint's blocks at all: **a change is drawn in place at once**, and only a page or a view coming in, what the person opens or presses, and **the words of a value that changed** move. `standStill()` turns the repaint vocabulary off in one place (`morphInto`, `appear`, `fadeAway`, `fold`; `reshape`, `refill`, `unfold`; the pages' own FLIPs ask `still()`); `morphText` is not part of it (it asks only for reduced motion): a value changing where it stands is one small thing, not a block rebuilt. The portal never calls `standStill()` and moves as this file says. + +| What | Motion | +|---|---| +| A block drawn again (a person's or a device's blocks, Overview, a Settings section, the Log, a head's facts, the filter chips, the people's cards, a list that is reordered) | none: the new content stands in its place | +| A number or a line that changes (a live speed, a count of bytes, «Running for 16d 4h», a tile's line, a head's state, the MTU's number under its slider) | its words morph as *Text morph* says (the owner, 2026-11-12: «имплементируй лайв обновление и добавь анимацию морфа текста, также морф текста нужен на элементах где изменяются данные по типу MTU числа при изменении слайдера»): the letters both texts keep stay, the others lift away and rise in, so «30.4 GB» after «28.1 GB» moves three digits and nothing else. A repaint puts the new block in and then morphs the values in it that say something else (`ui/reshape.ts valuesOf`/`morphValues`, called by `refill`, by `state/regions.ts rows` and by the people's cards): a value is `.num`, a keyed text (`data-t`), a tile's line (`.stat-sub`), a head's state (`.ph-state`) or what a build marks `data-live`; a keyed one is paired by its key, the others by their order when the block still has as many. A live speed's words change every third second (they are the mean of those three) and a server's «Now» on its Overview card with them, read from the same meter. The MTU's number is an input, which cannot change by the letter: at rest the same number stands over it as words and those morph while the slider moves; typed in, the field shows its own text (`widgets/link-values.ts`). A readout under the pointer (a chart's day, a week's bar) never morphs | +| A fold somebody opens («N interfaces are not offered», a choice row's options, an event's details in the Log, the notices' fold on a phone) | as *4. Accordion* (`ui/reshape.ts unfold`; the owner, 2026-11-12: «для аккордионов и выпадающих компонентов такую же анимацию как на портале»): height from where it stands on SOFT 476, clipped (shutting on SMOOTH 524: a height cannot go under nothing, and a spring with give stops dead at the floor); its own margins and paddings fold with it and the gap its parent keeps over it is taken back, so the block loses no pixels at a stroke when the body is hidden (the owner: «в конце анимирования снап происходит», 10 px of a column's gap; measured after: the last steps are 0.1 px); the body `in, b2 → 0` over what is left of 300 ms (`cubic-bezier(0,0,.58,1)`), `out, b2` over what is left of 160 (EASE_IN); its chevron turns on SOFT. A part that comes or goes by itself («Now» in Traffic, a notice, the term's block): none, there or not | +| A view that swaps (cards ↔ map, a person's page ↔ the list, a server's part, a Settings section) | comes in as a page does (below); the view that goes is gone at once. The list comes back where it was, the item opened from ringed (the ring fades over 1800 ms: a mark, not a move); Escape brings it back at once. Inside a view: the map's places ↔ a city, a period on a timeline: none | +| The rail's highlight | glides from link to link on GLIDE (the stylesheet); the first time it stands on a link (the rail just came on screen) it fades in there (320 / 100 EASE_OUT), with its link's rise: what is laid over the flow (a highlight, a pill, a mark in a corner) is no block of the entrance's wave (`ui/entrance.ts`), or it rose to its own nothing and stood there at a stroke; the section row's pill as a track's | +| A move from one page of Dawnline's to another (the section row, the way back, a link to a server or to Settings, Back and Forward between them) | the row stays the node it is and never blinks (`shell/pages.ts`; the owner, 2026-11-12: «мне не нравится то, что это мигает при переходах»): the page under it is changed in place, without the theme's navigation, the address pushed; the row's pill stretches to the section as a track's does (`shell/nav.ts`); the row's track is a card's surface (`raised`, as the panels under it: the owner, «сделай у нава фон как на втором скрине») and its pill `raised` with 7 % of `text` (`--page-pill`), a step off it in either theme; a server's track of parts under it is drawn the same («и это»), so a page's own tracks and its panels are one surface, while a track inside a card keeps `on-ground`, and the new page comes in as every page (above). A reload, a bookmark and a link from outside open the section's own view | +| A device's dialog | opens whole (`pages/server/device-dialog.ts`; the owner, 2026-11-12: «может чтобы не анимировать все по отдельности подождать пока все внутри модалки прогрузится?»): its panel reads its log, its configuration and its places first and the dialog opens with all of it in place, so nothing lands in it after; it opens by 700 ms whatever is still on its way, and what is late then goes to its place as the row below says | +| What lands in a block a moment after it stood (a device's panel that had to open before its data, in its first seconds: the latest events, the set-up's lines, the Places' rows) or changes whole on a pick (the Places' period) | the block goes to its new height from the one it has (`ui/reshape.ts grown`: `height` on SMOOTH, what it holds clipped on the way), so what stands under it travels with its edge and a dialog follows by itself; rows that are new blur in (280 / 60), a block that stood there already does not fade, and nothing is slid apart from its block (the owner, 2026-11-12, of a first try that brought whole blocks into focus and slid the next one over: «появляются со странным фейдом и накладываются друг на друга»). Heights are the layout's (`offsetHeight`), never read off the screen: a dialog still opening is drawn at nine tenths. The form of a set-up (QR, .conf, text) changes through the sheet's own glide (*5. Sheet › Content glide*); a view is whole the moment it is put in a sheet, which measures it then | +| A page opened (every opening asks the router: until it answers the section row stands alone, then the page is drawn whole) | its blocks rise as the portal's page does (*1. Page intro*): `opacity 0 → own, y10, b4`, 520 / 60 + 40·i, EASE_OUT, at most 14 steps, only what stands within 1.25 windows of the top. A repaint after that stands still as every other | +| A sheet or a dialog (open, close, a step and Back, its height and width between views) | as *5. Sheet*, unchanged | +| A ⋯ menu, a list of choices, a field's list (`ui/list-drop.ts`, `ui/combo.ts`), a tooltip, a toast, the dock at the window's foot | as their own sections, unchanged: a dropdown opens `in, s.5 → 1, b6 → 0` on SOFT from its button's side and shuts in 110 ms (*6*) | +| A switch, a checkbox, a segmented track's pill, hover and press on any control, a meter's bar | their own CSS transitions, unchanged | +| A control a pick draws again (the part it stands in is rebuilt from data: a server's track, a track of presets, the MTU's knob, a chip that toggles) | goes on from where the one it replaces stood (`ui/carry.ts`; the owner, 2026-11-12: «нужно добавить анимации на компоненты»): a track's pill stretches to the picked tab as *10* (leading edge LEAD, trailing SMOOTH) from where the last pill is, mid-way included; the MTU's knob moves as a slider of iOS does (`ui/range.ts`; the owner: «сделай в стиле ios анимации движения», after a knob that floated to a press on a transition): its place is a spring worked out every frame, taken on from where it stands with the speed it has; under the pointer a stiff one with no give (1400 / 75: on the finger within a frame or two, the steps between values smoothed), a value set from outside («Auto», a number typed) on SMOOTH's (300 / 35); it never goes past where it is headed (the owner: «убери у слайдера овершут»): neither spring has give, and a knob let go while it still moves stops on its value instead of crossing it (measured: 0 px past the end, 0 px backwards); the keyboard puts it there at once; its look turns in 200 ms; a chip's check opens its width on SMOOTH and comes in as the copy check does (POP from `s.6, b3`), its fill and words turning in 200 ms. A control names itself (`keep`), one name a control on screen; a part drawn again in the background has the same state, so nothing moves. A switch, a tile, a chip without a name of its own is carried with its region (`carryControls`, where a standing page draws a region again: Settings' parts, `ui/reshape.ts`): paired with the old one by its kind and title, it starts as that one stood and turns to its own state. A switch moves its knob at the press, before it asks (`flippedNow`), and a staged change draws its part again in the same task: the new switch starts from the other state and is put as far into the move as the old one was, so the knob goes on, not again and not from its end (the owner, 2026-11-12: «у чекбоксов/свитчей нет больше анимаций как на портале»; measured in both engines: the knob at 14.1 px in the old node and 14.1 in the new one a frame later). The turn is made in the task that puts the control in the page, so no frame shows where it started from | +| The map (camera, markers, the replay) and the live line under a speed | unchanged. A map comes in, it does not strike (`map.ts mount`; the owner, 2026-11-12: «сделай чтобы карты появлялись плавно»): its canvas and markers stay unseen until the first whole frame is drawn, then fade in together (420 ms EASE_OUT; 160 with less motion), in every place a map stands (People › Map, a device's «Map and replay», the close-up); its box is there from the first frame | +| A step's check on a job's stage, the selection's pause/play icon | as the copy check: POP from `s.6, b3` (a restore's four steps fill one after another, 60 ms apart) | +| A job's stage (a step that comes, the line under the title, the job's end) | nothing is slid to a new place: its three parts (the top, the steps or what stands in their place, the foot with the actions) each go to their new height where they stand (`portal/ui/grown.ts`: `height` on SMOOTH, clipped on the way), so the log's row and the actions travel with the edge of what is over them; what changed (the picture in its new tone, the title, the line, what a check found, the actions) comes into focus as the sheet's own glide brings a changed block in (`in, b4 → 0`, 280 EASE_OUT). The sheet's FLIP was tried first and is not used here: the log's row, still on its way up from under the steps, crossed the button that had just come (the owner, 2026-11-12: «журнал операций плавает под кнопкой») | +| Escape | shuts a sheet or a dialog as its × does (*5. Sheet*, the same on the portal; `shell/layer.ts`); a menu, a field's edit and a person's page going back to the list answer it at once | +| Typing in a search | at once, as everywhere | + +What the stylesheet glides on its own when a class or a size changes (a switch's knob, a bar's width) still runs; nothing is choreographed around it. + +**How a page of the admin comes in** (`admin/ui/entrance.ts enter`; the owner, 2026-11-12: «убрать скелетон загрузку с админки и сделать анимацию появления и перехода по страницам как на портале»). There is no skeleton and no sample: the page waits under its section row (known without the router, it stands from the first frame and never rises). An answer that takes longer than 600 ms is said there, never left as a black page (`shell/waiting.ts`; the owner, 2026-11-12: «нужно сделать чтобы было видно что бекенд поднимается а не была черная страница»): the portal's one card under the row (*Single card mode*: `.gone`'s 400 px, radius 36, padding `32 24 28`, 12vh down; the owner: «сделай его в стиле дизайн мд»): Dawnline's mark at 48 px in `text` (`shared/mark.ts`, the portal's crumbs' own; its sun rises from behind the line as the card comes in, 900 / 150 EASE_OUT), a 22 px title, a 14/20 `text-2` line of what the start is doing, and its three steps as a track of three parts (6 high, 6 apart, 168 wide, `knob`, filling in the accent; orange while the router does not answer). No «Step N of 3» (the owner: «убрать step n of n»): the parts say it. The steps are what the page really sees (`state/stream.ts startPhase`): «Waiting for the backend» (its `hello` not answered), «Reading the router» (it answered, the router's state is not in hand), «Opening the page» (it is, the page asks the rest). The track is one progress drawn over the three parts, per frame: within a step it goes toward 86% of the step's part, a third of what is left every 3 s (never there); a step done moves it on; what is drawn follows it with a 420 ms lag (140 ms at the end), so a step done glides and nothing snaps (the owner of the first try: «полоски прогресса резко снапают»; measured, at most 1.1% of the track a frame). It goes on with less motion asked for: it tells, it does not travel. The line rolls when it changes (the owner: «не морф а скролл блюр фейд»): the old words go up into a blur (`out, y −0.6em, b4`, 180 EASE_IN, from where they stand), the new come up out of one (`in, y +0.6em → 0, b4 → 0`, 280 / 60 EASE_OUT), both in one cell while they cross; a reason from the router rolls in the same way. The title does not move (the owner: «заголовок не анимировать»): it changes in place. The card comes in as a page's block rises (*1*); when the answer comes the track runs full, the card fades where it stood (`out, b4`, 180 EASE_IN) and the page comes in. Its title is «Dawnline is starting» while the backend does not answer its `hello` (an update or a deploy restarted it), «Waiting for the router» otherwise, «Dawnline is starting» over «Trying again in a moment» once a question failed (asked again every 3 s until the page comes in; a refusal of the bus is never shown as words, the owner: «в лоадере в тексте появилась RPC ошибка»), and «The router is not answering yet» in orange after three in a row. The page is then drawn whole from the router's answer (its regions painted at once, the 30 days' chart drawn in the frame it is put in, the live line from the meter's two minutes asked with the status), and then comes in. Its blocks are found, not listed: from the page down, a block is what reads as one thing (a painted surface: a card, a tile, a field; anything 64 px high or lower: a head, a caption, a row of chips; a heading; a leaf), and a box that only lays others out is gone through, eight levels deep at most. They rise in the order they stand, top to bottom and then left to right. A view swapped in on the page rises the same way, measured once it is drawn and scrolled to; a view inside a block that is still rising comes in with it. Health and a server's interfaces, which come a moment after the page, fill in place. + ### Shimmer · `ui/shimmer.ts` Words being saved (a name on its card) shimmer as an assistant's "thinking" line does. A copy of the words is laid exactly over them (same font, clipped to the input and scrolled as it is) and the input's own go transparent. The copy is the words' colour (`text`) over a muted base (`text` 38% into `raised`), painted as a gradient clipped to the text: a band 2.2 em either side with a bell falloff (0, .5, .9, 1, .9, .5, 0) crosses it from left to right in 1.8 s, linear, then rests 0.58 s and goes again. It starts solid (the swap shows nothing), dims in 240 ms; stopping, the band holds where it is and the words fade back to their colour around it (480 ms, standard curve), and only then does the copy go. With less motion asked for there is no band: it only dims and comes back. @@ -1453,13 +1614,16 @@ Words being saved (a name on its card) shimmer as an assistant's "thinking" line | OS mark alternation | Marks swap instantly (the word still changes) | | Sheets, menus, toasts | Fade only | | Arrival reading time (2.4 s) | Unchanged | +| Admin: a deep refill, the tooltip's glide, the Traffic tiles' glide, folds | Put in at once (a refill), jumps (glides), fades only (what blurs in, what fades out, a fold's opacity, the docks) | +| Admin: the switch's waiting ring | Fades in and out (160), stands still | +| Admin: a page or a view coming in | Each block fades in (160), no travel, no blur, no wave | CSS hover and press transitions (`scale(.8–.98)`, colours, the switch) are not reduced. They are small, direct responses to input. ### Performance notes - Animated properties are `transform`, `opacity` and `filter: blur` almost everywhere. Layout properties animate only where the layout must truly change: `height`, `width`, `max-width`, margins and radii (sheet height, accordion rows, morph width, folds), `flex-grow` (picker) and `clip-path` (way fill). -- Morphs skip elements that are not on screen. The OS alternation skips while folded. +- Morphs skip elements that are not on screen. A layer of many small pieces (a strip's stays) is marked `data-flat`: a deep refill reads, keeps or crosses it as one piece and never goes into it. The OS alternation skips while folded. - The caret runs one `requestAnimationFrame` loop for itself and both selection edges, writes only `transform` (and the wash's width), and stops once all three rest. Its measuring copy of the text sits out of sight with the input's font, and several events in one frame make one measure. - Blur radii stay at ≤ 6 px; the edge fade's 12 px backdrop blur is the only large one. - One animation per property per element at a time: new runs cancel old ones after starting from their computed state. The exception is a FLIP inside the sheet, which adds to one still under way (`composite: 'add'`). @@ -1470,9 +1634,12 @@ CSS hover and press transitions (`scale(.8–.98)`, colours, the switch) are not - **Do** make the entering part wait 60–110 ms in a cross-fade, and keep exits under 220 ms. - **Do** start from the current computed state and cancel after. - **Do** keep loops tied to a real wait: a request, a connection, an alternation the person reads. -- **Don't** animate Escape, a language change or a reload. +- **Do** let a page with nothing to show yet wait, and come in whole once it has (*1. Page intro*, *16*); **don't** stand a sample or a placeholder in for the router's answer. +- **Don't** animate a language change or a reload, or what Escape does to a menu or a field; a sheet it closes goes as its × sends it. - **Don't** morph a hover readout: it follows the pointer and must be instant. - **Don't** use `transition: all`, bounces on exits, or travel over ~20 px except the drawer and the FLIP. +- **Do** let an admin repaint change in place (`admin/ui/reshape.ts`, *16. Admin*): deep refill, never a whole block crossing because its height changed. Nothing appears or vanishes at once: home's details under «Home network», a diagnosis, a notice, the Traffic card's «Now». +- **Do** let a switch that writes to the router finish its move first (`flipping`): the knob goes over with its ring coming in, the change is sent, the ring turns until the answer and goes from where it stands; refused, the knob goes back. - **Don't** re-run an entrance animation on a repaint the person didn't cause: the calendar's days come in when its row is opened, not when a repaint keeps it open. --- @@ -1492,7 +1659,7 @@ CSS hover and press transitions (`scale(.8–.98)`, colours, the switch) are not ## Accessibility - **Focus:** `:focus-visible` draws a 2 px outline in accent at 65% with a 2 px offset, only while the keyboard is moving focus: `main.ts` sets `.kbd` on `` at Tab or an arrow key and drops it at any press. Focus a script moves, or one left after a click or a touch, shows nothing. -- **Keyboard:** Escape closes the menu, then the sheet, without animation. +- **Keyboard:** Escape closes the menu (at once), then the sheet (as its × does). - **Words only on hover:** a device card's status stays one line, so a longer reason sits in `title` for a pointer and in hidden text right after the status for a screen reader (`.offscreen`). A touch screen shows neither: the trade-off for cards of one height. - **Hidden decoration:** icons and glass icons are `aria-hidden`. Morph overlays and ghosts are `aria-hidden` and click-through. A field's drawn caret, selection and handles are click-through, and its measuring copy is `aria-hidden`; the input underneath stays the browser's own (typing, IME, its real selection). - **Contrast:** see the table in *Colors*. `--text-3` and white-on-accent are below AA. diff --git a/README.md b/README.md index a70d46a..09e65fa 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Dawnline runs an [AmneziaWG] server on your OpenWrt router and gives every person you invite **a personal link**. They open it, **add their own phones and computers** and connect with AmneziaVPN, AmneziaWG or WireGuard. You decide **what each of them may reach** (the home network, the internet, or both) and -**for how long, how much and when**. +**for how long and how much**.

The personal portal: devices and access, and adding a phone in three steps @@ -89,7 +89,7 @@ follows a modern design.

👥 People, not peers

-

One card per person with their devices, who is online, traffic, end date and data limit. Filter by who needs attention or is paused.

+

A card for each person that says only what matters in their state: who waits for a decision and the one button that settles it, who is online since when and how fast, what each moved this week and this month. Filter, order, search by name, device or IP; a person or a device opens as a page of its own and Back returns you to the same place, and the same people stand on a map of where they connect from.

🧭 Who reaches what

@@ -99,7 +99,7 @@ follows a modern design.

⏳ Limits

-

End dates, monthly or total data limits, allowed hours, a pause button. Changes apply at once, without dropping anyone else's connection.

+

End dates, monthly or total data limits, a pause button. Changes apply at once, without dropping anyone else's connection.

🕶️ Disguise

@@ -113,7 +113,7 @@ follows a modern design.

🗺️ Overview and places

-

Who is online with what, speed now, the last 30 days, and a map of where people connect from, at city level.

+

One page that says whether everything works: the health checks, who waits for a decision, who is online, speed now and who moves most, today by the hour, the last 30 days against the 30 before, and the servers with who still has to take a new configuration. Where people connect from, at city level, is a map in People.

@@ -160,20 +160,30 @@ flowchart LR ## 📸 A closer look

- Overview: who is online, speed, the last 30 days and where people connect from + People: who needs a decision, who is online, everyone else, who is paused
- Overview: who is online, speed now, the last 30 days and a map of where people connect from. + People: who needs a decision, who is online, everyone else, who is paused.

+ + + +
- People: everyone on the server, with their devices, data and state -

People: online, ending soon, over the limit, outside their hours, paused.

+ A person: their traffic, devices, places, term, usage and what they reach +

A person: their traffic, devices and places; the term, the usage and what they reach.

- A person: their devices, traffic, places and limits -

A person: their devices, traffic, places and limits.

+ Places: where devices connect from, on the map and in a list +

Places: where devices connect from, now and over the last 30 days.

+
+ A device: when it was online, its traffic, places and set-up +

A device: when it was online, its traffic, places and set-up.

+
+ A server's core: the disguise, MTU and keep-alive of its AmneziaWG tunnel +

A server's core: the disguise, MTU and keep-alive of its AmneziaWG tunnel.

@@ -227,9 +237,9 @@ sh /tmp/dawnline-install.sh --lang ru # with the admin's Russian tra | `-n`, `--dry-run` | Check the system, resolve, download and verify the release; change nothing | | `-v`, `--verbose` / `-q`, `--quiet` | More detail / only warnings and errors | | `--tag X.Y.Z` | A given release (`sh install.sh 0.3.1` works too) | -| `--awg auto\|slava\|grey\|skip` | Where AmneziaWG comes from when it is missing: [Slava-Shchipunov], then [2Grey] (`auto`, the default), only one of them, or not at all (install it later from **Dawnline → Components**). `DAWNLINE_AWG` does the same | +| `--awg auto\|slava\|grey\|skip` | Where AmneziaWG comes from when it is missing: [Slava-Shchipunov], then [2Grey] (`auto`, the default), only one of them, or not at all (install it later from **Dawnline → Settings → Updates**). `DAWNLINE_AWG` does the same | | `--no-awg` | Same as `--awg skip` | -| `--lang auto\|ru\|none` | The admin's translation, `luci-i18n-dawnline-`: `auto` (the default) adds it when LuCI is set to that language or has its LuCI translation; `none` adds none. An installed one is always kept up to date. Later: **Dawnline → Components → Translation**. `DAWNLINE_LANG` does the same | +| `--lang auto\|ru\|none` | The admin's translation, `luci-i18n-dawnline-`: `auto` (the default) adds it when LuCI is set to that language or has its LuCI translation; `none` adds none. An installed one is always kept up to date. Later: **Dawnline → Settings → Updates**, Dawnline's ⋯. `DAWNLINE_LANG` does the same | @@ -265,7 +275,7 @@ release, installed the same way after the app (then `/etc/init.d/uhttpd restart` -**Upgrade** from Dawnline › Components, or run the installer +**Upgrade** from Dawnline › Settings › Updates, or run the installer again. Settings, keys and history are kept, and a backup is made first. ### Remove @@ -275,7 +285,7 @@ sh -c "$(wget -qO- https://raw.githubusercontent.com/tickcount/luci-app-dawnline ``` It backs up the configuration to `/etc/dawnline/backups`, runs Dawnline's own -removal (the same as Settings › Remove Dawnline from this router), +removal (the same as Settings › Remove Dawnline), removes the package and cleans up what is left. After installing Dawnline again, restore the backup in Settings › Backups. @@ -302,7 +312,7 @@ sh /tmp/dawnline-uninstall.sh --dry-run | `--remove-awg` | Also remove AmneziaWG, unless another interface still uses it (`--keep-awg`, the default, keeps it) | | `-n`, `--dry-run` | Show what would be removed; change nothing | -By hand: Settings › Remove Dawnline from this router +By hand: Settings › Remove Dawnline (keeps a backup), then `opkg remove luci-app-dawnline` or `apk del luci-app-dawnline`. @@ -333,6 +343,25 @@ keep working, unless you tick the ones to remove with it. +
+Can another place's whole network join (site to site)? + +
+ +Yes. Add that place's router to a person as a device of the kind «Router» and +name the networks behind it (a server's Settings → Network → «Networks behind +people's routers»). The tunnel then carries them both ways: home devices and +people with home access reach hosts there, and hosts there reach what the +router's owner reaches. A person can also ask for a router and its networks on +their own page; you accept or decline each (or let them be added at once, per +server). The two ends need different addresses: a network that overlaps your +home network, a tunnel or another router's network is refused. The far router +must route its network into the tunnel without NAT, or your home will not +reach hosts behind it. Hosts at home reach it only where this router is their +gateway (or they have a route to that network through it). + +
+
Does it touch the rest of my router? @@ -359,7 +388,7 @@ one, install Dawnline on the new one and import the file there.
From the address a device connects from, looked up at city level and cached on -the router. It can be turned off in Settings. +the router. It can be turned off in Settings › History and storage.
@@ -369,7 +398,8 @@ Only objects it created: network interfaces tagged `_dawnline`, firewall sections named `dawnline_*`, the `inet dawnline` nft table, `/tmp/hosts/dawnline`, the `dawnline` network namespace with its two veth links (`dlx0`, `dll0`, the latter a port of the LAN bridge, which needs `kmod-veth`), policy rules for the -tunnel interfaces with one routing table, a second dnsmasq instance on port +tunnel interfaces with one routing table, routes to the networks behind people's +routers (routing protocol 205 in the main table), a second dnsmasq instance on port 5354 (`/var/etc/dawnline-dns.conf`), a cron line for the agent's heartbeat check and, while the portal is on, a uhttpd instance for it. `dawnline teardown` removes all of them. @@ -385,7 +415,7 @@ event with its syslog priority: `logread -e dawnline` shows `[info] [service] starting`, `[info] [apply] configuration applied in 310 ms · …`, tunnels and the portal going down and back, crashes with what syslog knew about them, every settings change (`admin changed settings · domain: lan → home`) and -people's and devices' changes. Settings → Logs & history → System log picks the +people's and devices' changes. Settings → History and storage → System log picks the level: errors, warnings, normal or verbose (each step of a start and an apply). ## 🧰 Development @@ -398,7 +428,8 @@ package/luci-app-dawnline/ root/usr/libexec/dawnline/ agent (usage, limits, presence) and updater root/usr/share/dawnline/portal/ portal CGI wrapper and its (minified) assets root/usr/bin/dawnline command line (`dawnline help`) - htdocs/ LuCI views and the generated module dawnline/app.js + htdocs/ LuCI views and the generated modules dawnline/app.js (pages), + style.js (their stylesheet), map.js (the map, loaded on demand) po/ the admin's string catalog (dawnline.pot, ru/dawnline.po) web/ TypeScript sources of the admin UI and the portal web/i18n/ catalog tools: collect strings, merge .po files, compile .lmo @@ -417,8 +448,8 @@ scripts/lint-ucode.py # static ucode checks scripts/check-ucode.sh root@router # compile every ucode file on a router scripts/deploy.sh root@router # install the working tree (backs up configs first) scripts/build-packages.sh all # .ipk and .apk with the OpenWrt SDK in Docker -scripts/capture-screenshots.mjs --demo # the admin's README screenshots from a router, a demo cast in place of its people -scripts/capture-portal.mjs # the portal's from its demo, in English and Russian +scripts/capture-screenshots.mjs # the admin's README screenshots from its demo (no router; needs a build of the Outline theme beside) +scripts/capture-portal.mjs # the portal's from its demo; both in English and Russian scripts/frame-screenshots.py # frame them for this README ``` diff --git a/README_ru.md b/README_ru.md index 85b87e7..629a2e8 100644 --- a/README_ru.md +++ b/README_ru.md @@ -30,7 +30,7 @@ Dawnline запускает сервер [AmneziaWG] на вашем роуте кого вы пригласите, **личную ссылку**. По ней человек **сам добавляет свои телефоны и компьютеры** и подключается через AmneziaVPN, AmneziaWG или WireGuard. Вы решаете, **что ему доступно** (домашняя сеть, интернет или и то и другое), и -**на какой срок, сколько трафика и в какие часы**. +**на какой срок и сколько трафика**.

Личный портал: устройства и доступ, добавление телефона в три шага @@ -90,7 +90,7 @@ Dawnline запускает сервер [AmneziaWG] на вашем роуте

👥 Люди, а не пиры

-

Карточка на каждого человека: устройства, кто в сети, трафик, дата окончания и лимит. Фильтры по тем, кто требует внимания или на паузе.

+

Карточка на человека, где сказано только то, что важно в его состоянии: кто ждёт решения и одна кнопка, которая его решает, кто в сети, с какого времени и с какой скоростью, сколько скачано за неделю и за месяц. Фильтры, порядок, поиск по имени, устройству или IP; человек и устройство открываются отдельной страницей, а «Назад» возвращает на то же место, и те же люди стоят на карте мест, откуда они подключаются.

🧭 Кому что доступно

@@ -100,7 +100,7 @@ Dawnline запускает сервер [AmneziaWG] на вашем роуте

⏳ Лимиты

-

Даты окончания, лимит трафика на месяц или за всё время, часы доступа, кнопка паузы. Изменения применяются сразу и не обрывают подключения остальных.

+

Даты окончания, лимит трафика на месяц или за всё время, кнопка паузы. Изменения применяются сразу и не обрывают подключения остальных.

🕶️ Маскировка

@@ -114,7 +114,7 @@ Dawnline запускает сервер [AmneziaWG] на вашем роуте

🗺️ Обзор и места

-

Кто в сети и с чего, скорость сейчас, последние 30 дней и карта, откуда подключаются, с точностью до города.

+

Одна страница, на которой видно, всё ли работает: проверки состояния, кто ждёт решения, кто в сети, скорость сейчас и кто нагружает больше всех, сегодня по часам, последние 30 дней рядом с предыдущими и серверы с теми, кто ещё не забрал новую настройку. Откуда подключаются (с точностью до города), показывает карта в «Людях».

@@ -161,20 +161,30 @@ flowchart LR ## 📸 Как это выглядит

- Обзор: кто в сети, скорость, последние 30 дней и откуда подключаются + Люди: кому нужно решение, кто в сети, остальные, кто на паузе
- Обзор: кто в сети, скорость сейчас, последние 30 дней и карта, откуда подключаются. + Люди: кому нужно решение, кто в сети, остальные, кто на паузе.

+ + + +
- Люди: все на сервере, с устройствами, трафиком и состоянием -

Люди: в сети, доступ скоро закончится, сверх лимита, вне часов доступа, на паузе.

+ Человек: его трафик, устройства, места, срок, использование и куда он доходит +

Человек: его трафик, устройства и места; срок, использование и куда он доходит.

- Человек: его устройства, трафик, места и лимиты -

Человек: его устройства, трафик, места и лимиты.

+ Места: откуда подключаются устройства, на карте и списком +

Места: откуда подключаются устройства, сейчас и за последние 30 дней.

+
+ Устройство: когда было в сети, его трафик, места и настройка +

Устройство: когда было в сети, его трафик, места и настройка.

+
+ Ядро сервера: маскировка, MTU и keep-alive туннеля AmneziaWG +

Ядро сервера: маскировка, MTU и keep-alive туннеля AmneziaWG.

@@ -228,9 +238,9 @@ sh /tmp/dawnline-install.sh --lang ru # с русским перев | `-n`, `--dry-run` | Проверить систему, найти, скачать и проверить релиз; ничего не менять | | `-v`, `--verbose` / `-q`, `--quiet` | Подробнее / только предупреждения и ошибки | | `--tag X.Y.Z` | Конкретный релиз (`sh install.sh 0.3.1` тоже работает) | -| `--awg auto\|slava\|grey\|skip` | Откуда брать AmneziaWG, если его нет: [Slava-Shchipunov], затем [2Grey] (`auto`, по умолчанию), только один из них или вообще не ставить (потом можно в **Dawnline → Компоненты**). То же самое делает `DAWNLINE_AWG` | +| `--awg auto\|slava\|grey\|skip` | Откуда брать AmneziaWG, если его нет: [Slava-Shchipunov], затем [2Grey] (`auto`, по умолчанию), только один из них или вообще не ставить (потом можно в **Dawnline → Настройки → Обновления**). То же самое делает `DAWNLINE_AWG` | | `--no-awg` | То же, что `--awg skip` | -| `--lang auto\|ru\|none` | Перевод админки, `luci-i18n-dawnline-<язык>`: `auto` (по умолчанию) ставит его, если LuCI настроен на этот язык или в нём стоит перевод LuCI на него; `none` не ставит. Уже установленный перевод всегда обновляется вместе с Dawnline. Позже: **Dawnline → Компоненты → Перевод**. То же самое делает `DAWNLINE_LANG` | +| `--lang auto\|ru\|none` | Перевод админки, `luci-i18n-dawnline-<язык>`: `auto` (по умолчанию) ставит его, если LuCI настроен на этот язык или в нём стоит перевод LuCI на него; `none` не ставит. Уже установленный перевод всегда обновляется вместе с Dawnline. Позже: **Dawnline → Настройки → Обновления**, ⋯ у Dawnline. То же самое делает `DAWNLINE_LANG` | @@ -266,7 +276,7 @@ apk update && apk add --allow-untrusted ./luci-app-dawnline-0.1.0.apk # Open -**Обновление**: в Dawnline › Компоненты или повторным +**Обновление**: в Dawnline › Настройки › Обновления или повторным запуском установщика. Настройки, ключи и история сохраняются, перед обновлением делается резервная копия. @@ -278,7 +288,7 @@ sh -c "$(wget -qO- https://raw.githubusercontent.com/tickcount/luci-app-dawnline Деинсталлятор сохраняет конфигурацию в `/etc/dawnline/backups`, запускает удаление средствами самого Dawnline (как Настройки › Удалить -Dawnline с этого роутера), удаляет пакет и подчищает остатки. После +Dawnline), удаляет пакет и подчищает остатки. После повторной установки Dawnline восстановите копию в Настройки › Резервные копии. @@ -305,7 +315,7 @@ sh /tmp/dawnline-uninstall.sh --dry-run | `--remove-awg` | Удалить также AmneziaWG, если его не использует другой интерфейс (`--keep-awg`, по умолчанию, оставляет его) | | `-n`, `--dry-run` | Показать, что будет удалено; ничего не менять | -Вручную: Настройки › Удалить Dawnline с этого роутера +Вручную: Настройки › Удалить Dawnline (резервная копия сохраняется), затем `opkg remove luci-app-dawnline` или `apk del luci-app-dawnline`. @@ -337,6 +347,25 @@ AmneziaVPN или AmneziaWG на телефонах и компьютерах, V +
+Можно ли подключить целую сеть другого места (site-to-site)? + +
+ +Да. Добавьте роутер того места человеку как устройство типа «Роутер» и укажите +сети за ним (настройки сервера → Сеть → «Сети за роутерами людей»). Туннель +понесёт их в обе стороны: домашние устройства и люди с доступом к дому попадают +в узлы там, а узлам там доступно то же, что владельцу роутера. Человек может и +сам попросить роутер и его сети на своей странице; вы принимаете или отклоняете +каждый запрос (или разрешаете добавлять сразу, для каждого сервера отдельно). +Двум концам нужны разные адреса: сеть, которая пересекается с вашей домашней +сетью, туннелем или сетью другого роутера, не принимается. Дальний роутер +должен маршрутизировать свою сеть в туннель без NAT, иначе из дома до узлов за +ним не добраться. Домашние узлы попадают туда только там, где этот роутер у них +шлюз (или у них есть маршрут в ту сеть через него). + +
+
Затрагивает ли он остальной роутер? @@ -363,7 +392,7 @@ AmneziaVPN или AmneziaWG на телефонах и компьютерах, V
Из адреса, с которого подключается устройство: город определяется по нему и -кешируется на роутере. Это можно выключить в Настройках. +кешируется на роутере. Это можно выключить в Настройки › История и хранение.
@@ -373,7 +402,8 @@ AmneziaVPN или AmneziaWG на телефонах и компьютерах, V межсетевого экрана `dawnline_*`, таблицу nft `inet dawnline`, `/tmp/hosts/dawnline`, сетевое пространство имён `dawnline` с двумя veth-связями (`dlx0` и `dll0`, вторая подключена к мосту LAN и требует `kmod-veth`), правила маршрутизации для -интерфейсов туннелей с одной таблицей маршрутизации, второй экземпляр dnsmasq на +интерфейсов туннелей с одной таблицей маршрутизации, маршруты к сетям за +роутерами людей (протокол маршрутизации 205 в основной таблице), второй экземпляр dnsmasq на порту 5354 (`/var/etc/dawnline-dns.conf`), строку cron для проверки пульса агента и, пока портал включён, экземпляр uhttpd для него. `dawnline teardown` убирает всё это. @@ -389,8 +419,8 @@ AmneziaVPN или AmneziaWG на телефонах и компьютерах, V `[info] [service] starting`, `[info] [apply] configuration applied in 310 ms · …`, падения и восстановление туннелей и портала, сбои с тем, что о них знал syslog, каждое изменение настроек (`admin changed settings · domain: lan → home`) и -изменения людей и устройств. Уровень выбирается в «Настройки → Журналы и -история → Системный журнал»: ошибки, предупреждения, обычный или подробный +изменения людей и устройств. Уровень выбирается в «Настройки → История и +хранение → Системный журнал»: ошибки, предупреждения, обычный или подробный (каждый шаг запуска и применения настроек). ## 🧰 Разработка @@ -403,7 +433,8 @@ package/luci-app-dawnline/ root/usr/libexec/dawnline/ агент (трафик, лимиты, присутствие) и апдейтер root/usr/share/dawnline/portal/ CGI-обёртка портала и его (минифицированные) файлы root/usr/bin/dawnline командная строка (`dawnline help`) - htdocs/ представления LuCI и сгенерированный модуль dawnline/app.js + htdocs/ представления LuCI и сгенерированные модули dawnline/app.js (страницы), + style.js (их стили), map.js (карта, загружается по запросу) po/ каталог строк админки (dawnline.pot, ru/dawnline.po) web/ исходники админки и портала на TypeScript web/i18n/ инструменты каталогов: сбор строк, слияние .po, сборка .lmo @@ -422,8 +453,8 @@ scripts/lint-ucode.py # статические проверк scripts/check-ucode.sh root@router # скомпилировать все файлы ucode на роутере scripts/deploy.sh root@router # поставить рабочую копию (сначала сохраняет конфиги) scripts/build-packages.sh all # .ipk и .apk в OpenWrt SDK в Docker -scripts/capture-screenshots.mjs --demo # скриншоты админки для README с роутера, с демо-людьми вместо настоящих -scripts/capture-portal.mjs # скриншоты портала для README из его демо, на английском и русском +scripts/capture-screenshots.mjs # скриншоты админки для README из её демо (без роутера; рядом нужна сборка темы Outline) +scripts/capture-portal.mjs # скриншоты портала из его демо; и те и другие на английском и русском scripts/frame-screenshots.py # оформить их для README ``` diff --git a/backend/access/access.go b/backend/access/access.go new file mode 100644 index 0000000..d29e8ea --- /dev/null +++ b/backend/access/access.go @@ -0,0 +1,551 @@ +// Package access is "Check access": it walks the same rules the access table and a device's configuration +// apply, and says in words where a connection stops, each step a whole sentence in the reader's language +// (dawnline.access). Held to ucode's own output on a made-up household (testdata, scripts/ucode-golden.sh). +package access + +import ( + "errors" + "fmt" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" +) + +// Step is one step of the walk. +type Step struct { + OK bool `json:"ok"` + Title string `json:"title"` + Detail string `json:"detail"` +} + +// Ctx is what the walk reads besides the settings: each person's state, the tunnels' peers, who is online +// and the router's interfaces. +type Ctx struct { + States map[string]string + Peers map[string]awg.Peer + Online func(d *model.Device, peer awg.Peer) bool + Snap *netview.Snapshot + T *i18n.Catalog +} + +// Said is a refusal to check at all, as a sentence to translate and what goes into it. +type Said struct { + Msg string + Args []any +} + +func (s Said) Error() string { return fmt.Sprintf(s.Msg, s.Args...) } + +type walk struct { + Ctx + m *model.Model +} + +func (w *walk) f(msg string, args ...any) string { return fmt.Sprintf(w.T.T(msg), args...) } + +// inNets is the first of nets that holds ip, or "". +func inNets(ip string, nets []string) string { + n, ok := ipnet.IP(ip) + if !ok { + return "" + } + for _, s := range nets { + if c, ok := ipnet.Any(s); ok && c.Holds(n) { + return s + } + } + return "" +} + +func (w *walk) cantConnect(name, st string) string { + switch st { + case "no_server": + return w.f("%s can't connect: they have no server", name) + case "server_off": + return w.f("%s can't connect: their server is turned off", name) + case "paused": + return w.f("%s can't connect: they are paused", name) + case "expired": + return w.f("%s can't connect: their access has ended", name) + case "quota": + return w.f("%s can't connect: they used up their data", name) + } + return w.f("%s can't connect: %s", name, st) +} + +func (w *walk) cantReach(who string, disabled bool, st string) string { + switch { + case disabled: + return w.f("%s can't be reached: it is turned off", who) + case st == "no_server": + return w.f("%s can't be reached: they have no server", who) + case st == "server_off": + return w.f("%s can't be reached: their server is turned off", who) + case st == "paused": + return w.f("%s can't be reached: they are paused", who) + case st == "expired": + return w.f("%s can't be reached: their access has ended", who) + case st == "quota": + return w.f("%s can't be reached: they used up their data", who) + } + return w.f("%s can't be reached: %s", who, st) +} + +func (w *walk) accessText(a string) string { + switch a { + case "lan": + return w.T.T("Home only") + case "internet": + return w.T.T("Internet only") + case "both": + return w.T.T("Home and Internet") + } + return a +} + +func (w *walk) hasAccess(name, a string) string { + switch a { + case "lan": + return w.f("%s has Home only", name) + case "internet": + return w.f("%s has Internet only", name) + } + return w.f("%s has Home and Internet", name) +} + +func (w *walk) reaches(name string, devs []string) string { + if len(devs) > 0 { + return w.f("%s reaches %s.", name, strings.Join(devs, ", ")) + } + return w.f("%s reaches no home network.", name) +} + +// tunnelOf is a server's tunnel network when it runs one of Dawnline's own, else "". +func tunnelOf(srv *model.Server) string { + if srv == nil || srv.PrivateKey == "" || srv.Blocked != nil || !model.ValidIfname(srv.Ifname) { + return "" + } + if _, ok := ipnet.Subnet(srv.Subnet); !ok { + return "" + } + return srv.Subnet +} + +// inTunnels is the tunnel network (of any server) that holds ip: never home, whatever routes cover it. +func (w *walk) inTunnels(ip string) string { + var nets []string + for _, id := range w.m.ServerIDs() { + if t := tunnelOf(w.m.Servers[id]); t != "" { + nets = append(nets, t) + } + } + return inNets(ip, nets) +} + +type target struct { + dev *model.Device + ip string + port int // 0: none + // net: the address is a host in this network behind dev (a router): the rules see it as they see the router + net string +} + +var address = regexp.MustCompile(`^([0-9.]+)(:([0-9]{1,5}))?$`) + +// parse reads "10.0.1.20:445" or a device id. +func (w *walk) parse(s string) (target, bool) { + s = strings.Trim(s, " \t\r\n\v\f") + if d := w.m.Devices[s]; d != nil { + return target{dev: d, ip: d.Address}, true + } + mm := address.FindStringSubmatch(s) + if mm == nil { + return target{}, false + } + if _, ok := ipnet.IP(mm[1]); !ok { + return target{}, false + } + t := target{ip: mm[1]} + if mm[3] != "" { + t.port, _ = strconv.Atoi(mm[3]) + } + for _, id := range w.m.DeviceIDs() { + if d := w.m.Devices[id]; d.Address == t.ip { + t.dev = d + break + } + } + // a host behind someone's router: the networks in effect on this router, as the access table has them + if t.dev == nil { + behind := w.Snap.Behind(w.m) + for _, id := range w.m.DeviceIDs() { + if n := inNets(t.ip, behind[id]); n != "" { + t.dev, t.net = w.m.Devices[id], n + break + } + } + } + return t, true +} + +// behindStep says that an address is a host behind a router, which the rest of the walk is then about. +func (w *walk) behindStep(t target) Step { + who := t.dev.Name + if p := w.m.People[t.dev.Person]; p != nil { + who = p.Name + " · " + t.dev.Name + } + return Step{true, w.f("%s is behind %s", t.ip, who), w.f("%s: the tunnel carries this network, and the rules see a host there as they see the router.", t.net)} +} + +// personHome is the home networks a person reaches: all of the server's, or the interfaces ticked on their page. +func (w *walk) personHome(srv *model.Server, p *model.Person) (all bool, nets, devs []string) { + _, home, every, _ := w.Snap.ServerNet(srv) + if len(p.HomeNets) == 0 { + for _, h := range home { + devs = append(devs, h.Dev) + } + return true, every, devs + } + var picked []string + for _, h := range home { + for _, want := range p.HomeNets { + if want == h.Dev { + picked = append(picked, h.Nets...) + devs = append(devs, h.Dev) + break + } + } + } + return false, ipnet.Collapse(picked), devs +} + +// homeDevOf is the home network (interface) of a server that holds an address. +func (w *walk) homeDevOf(srv *model.Server, ip string) string { + _, home, _, _ := w.Snap.ServerNet(srv) + for _, h := range home { + if inNets(ip, h.Nets) != "" { + return h.Dev + } + } + return "" +} + +func (w *walk) routerHas(ip string) bool { + for _, d := range w.Snap.Devices { + for _, a := range d.Addrs { + if strings.SplitN(a, "/", 2)[0] == ip { + return true + } + } + } + return false +} + +func (w *walk) state(p *model.Person) string { + if st := w.States[p.ID]; st != "" { + return st + } + return "active" +} + +func (w *walk) personOK(p *model.Person, d *model.Device) Step { + if d.Disabled { + return Step{false, w.f("%s is turned off", d.Name), w.T.T("Turn the device on again on its page.")} + } + if st := w.state(p); st != "active" { + return Step{false, w.cantConnect(p.Name, st), ""} + } + return Step{true, w.f("%s is active", p.Name), w.accessText(p.Access)} +} + +func (w *walk) connected(d *model.Device, who string) Step { + peer, has := w.Peers[d.PublicKey] + if !has || peer.Handshake <= 0 { + return Step{false, w.f("%s has never connected", who), w.T.T("There is no session the router could reach.")} + } + if w.Online == nil || !w.Online(d, peer) { + return Step{false, w.f("%s isn't connected right now", who), w.T.T("The router reaches it only while its VPN is on.")} + } + return Step{true, w.f("%s is connected", who), ""} +} + +func (w *walk) circle(p *model.Person) *model.Circle { + if c := w.m.Circles[p.Circle]; c != nil && c.Server == p.Server { + return c + } + return nil +} + +// fromDevice: a device to somewhere, the router, home, another device or the internet. +func (w *walk) fromDevice(d *model.Device, t target) []Step { + m, T := w.m, w.T + p := m.People[d.Person] + var srv *model.Server + if p != nil { + srv = m.Servers[p.Server] + } + if p == nil || srv == nil { + return []Step{{false, w.f("%s has no server", d.Name), ""}} + } + steps := []Step{w.personOK(p, d)} + if !steps[0].OK { + return steps + } + all, homeNets, homeDevs := w.personHome(srv, p) + allowed := handout.AllowedIPs(m, srv, p, d, homeNets) + via := func(ip string) Step { + // the configuration's own words: the option and its value + var v4 []string + for _, x := range allowed { + if !strings.Contains(x, ":") { + v4 = append(v4, x) + } + } + what := "AllowedIPs " + strings.Join(v4, ", ") + if inNets(ip, allowed) != "" { + return Step{true, T.T("Its configuration sends it to the router"), what} + } + return Step{false, T.T("Its configuration doesn't send it to the router"), w.f("%s: the device's own network handles it.", what)} + } + // another device + if t.dev != nil { + q := m.People[t.dev.Person] + qname := "?" + if q != nil { + qname = q.Name + } + who := qname + " · " + t.dev.Name + if t.dev.ID == d.ID { + // its own network: a router reaches what is behind it without the tunnel + if t.net != "" { + return []Step{{false, w.f("%s is behind this device", t.ip), T.T("A router reaches its own network without the tunnel.")}} + } + return []Step{{false, T.T("That is the same device"), ""}} + } + if q == nil || q.Server != p.Server { + return append(steps, Step{false, w.f("%s is on another server", who), T.T("Devices of different servers never reach each other.")}) + } + if !p.HomeAccess() { + return append(steps, Step{false, w.hasAccess(p.Name, p.Access), T.T("Only people with home access reach other devices.")}) + } + if !q.HomeAccess() { + return append(steps, Step{false, w.hasAccess(q.Name, q.Access), T.T("Only devices of people with home access can be reached.")}) + } + if srv.Mesh == "off" { + return append(steps, Step{false, w.f(`"Devices reach each other" is off on %s`, srv.Name), T.T("Server → Access → Home network.")}) + } + if srv.Mesh == "circles" && q.ID != p.ID { + a, b := w.circle(p), w.circle(q) + if a == nil || b == nil || a.ID != b.ID { + name := func(c *model.Circle) string { + if c == nil { + return T.T("no circle") + } + return c.Name + } + return append(steps, Step{false, w.f("%s and %s are not in one circle", p.Name, q.Name), p.Name + ": " + name(a) + " · " + q.Name + ": " + name(b)}) + } + steps = append(steps, Step{true, w.f("Both are in %s", a.Name), T.T("Devices in one circle reach each other.")}) + } else if q.ID == p.ID { + steps = append(steps, Step{true, w.f("Both are %s's devices", p.Name), ""}) + } else { + steps = append(steps, Step{true, T.T("Devices reach each other on this server"), ""}) + } + if st := w.state(q); st != "active" || t.dev.Disabled { + return append(steps, Step{false, w.cantReach(who, t.dev.Disabled, st), ""}) + } + return append(steps, via(t.ip), w.connected(t.dev, who)) + } + // a device that keeps its own local network out of the tunnel sends a private address there, router or + // home address alike: it never reaches this router's rules + if d.LanBypass && p.Access != "lan" && inNets(t.ip, allowed) == "" { + return append(steps, via(t.ip)) + } + // the router itself + if w.routerHas(t.ip) { + s := m.Settings + plain := false + for _, h := range append([]string{s.PortalHost}, s.PortalAlt...) { + if _, ip := ipnet.IP(h); ip { + plain = true + } + } + portal := s.PortalEnabled && t.port != 0 && (t.port == s.PortalPort || (plain && t.port == s.PortalPort+1)) + switch { + case t.port == 53: + steps = append(steps, Step{true, w.f("%s is this router: DNS is open to everyone", t.ip), ""}) + case portal: + steps = append(steps, Step{true, w.f("%s is this router: the personal portal is open to everyone", t.ip), ""}) + case !p.HomeAccess(): + detail := w.f("%s has Internet only: only DNS and the portal on the router.", p.Name) + if p.Access == "lan" { + detail = w.f("%s has Home only: only DNS and the portal on the router.", p.Name) + } + return append(steps, Step{false, w.f("%s is this router", t.ip), detail}) + default: + // like any home address: only on the networks the person reaches + if !all && inNets(t.ip, homeNets) == "" { + return append(steps, Step{false, w.f("%s is this router on a network %s doesn't reach", t.ip, p.Name), w.reaches(p.Name, homeDevs)}) + } + detail := w.f("On one of the networks %s reaches.", p.Name) + if all { + detail = T.T("Home access includes the router.") + } + steps = append(steps, Step{true, w.f("%s is this router", t.ip), detail}) + } + return append(steps, via(t.ip)) + } + // a tunnel address no device has + if tn := w.inTunnels(t.ip); tn != "" { + return append(steps, Step{false, w.f("No device uses %s", t.ip), w.f("It is in the tunnel network %s.", tn)}) + } + // home + wan, _, _, zones := w.Snap.ServerNet(srv) + if hdev := w.homeDevOf(srv, t.ip); hdev != "" { + if p.Access == "internet" { + return append(steps, Step{false, w.f("%s is at home (%s)", t.ip, hdev), w.f("%s has Internet only.", p.Name)}) + } + if p.Access == "lan" && len(p.Services) > 0 { + var hit *model.Service + var names []string + for _, sid := range p.Services { + s := m.Services[sid] + if s == nil { + continue + } + names = append(names, s.Name) + open := len(s.Ports) == 0 || t.port == 0 + for _, port := range s.Ports { + open = open || port == strconv.Itoa(t.port) + } + if s.Address == t.ip && open { + hit = s + } + } + if hit == nil { + what := t.ip + if t.port != 0 { + what += ":" + strconv.Itoa(t.port) + } + return append(steps, Step{false, w.f("%s is not one of %s's home services", what, p.Name), w.f("Allowed: %s", strings.Join(names, ", "))}) + } + detail := T.T("All ports") + if len(hit.Ports) > 0 { + detail = w.f("Ports %s", strings.Join(hit.Ports, ", ")) + } + steps = append(steps, Step{true, w.f("%s is %s, one of %s's home services", t.ip, hit.Name, p.Name), detail}) + } else { + if inNets(t.ip, homeNets) == "" { + return append(steps, Step{false, w.f("%s is in %s, which %s doesn't reach", t.ip, hdev, p.Name), w.reaches(p.Name, homeDevs)}) + } + detail := w.f("One of the networks %s reaches.", p.Name) + if all { + detail = T.T("Home access reaches every home network.") + } + steps = append(steps, Step{true, w.f("%s is in home network %s", t.ip, hdev), detail}) + } + to := strings.Join(zones, ", ") + if to == "" { + to = T.T("home") + } + return append(steps, via(t.ip), Step{true, T.T("The firewall lets it through"), srv.Ifname + " → " + to}) + } + // another private address, or the internet + if inNets(t.ip, []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10", "169.254.0.0/16"}) != "" { + return append(steps, Step{false, w.f("%s isn't in %s's home network", t.ip, srv.Name), T.T("Private addresses outside the home network are blocked.")}) + } + if p.Access == "lan" { + return append(steps, Step{true, w.f("%s is on the internet", t.ip), w.f("%s has Home only: their device's own internet reaches it, not the tunnel.", p.Name)}) + } + leaves := T.T("It leaves through the WAN.") + if srv.LanLike { + leaves = T.T("It leaves like a home device would.") + } else if wan.Dev != "" { + leaves = w.f("It leaves through %s.", wan.Dev) + } + return append(steps, via(t.ip), Step{true, w.f("%s is on the internet", t.ip), leaves}) +} + +// toDevice: a home address to a device. +func (w *walk) toDevice(ip string, d *model.Device) []Step { + m, T := w.m, w.T + p := m.People[d.Person] + var srv *model.Server + if p != nil { + srv = m.Servers[p.Server] + } + if p == nil || srv == nil { + return []Step{{false, w.f("%s has no server", d.Name), ""}} + } + who := p.Name + " · " + d.Name + hdev := "" + if w.inTunnels(ip) == "" { + hdev = w.homeDevOf(srv, ip) + } + if hdev == "" { + return []Step{{false, w.f("%s isn't in %s's home network", ip, srv.Name), T.T("Only home devices reach people's devices.")}} + } + steps := []Step{{true, w.f("%s is at home (%s)", ip, hdev), ""}} + if !p.HomeAccess() { + title := w.hasAccess(p.Name, p.Access) + if p.Access == "lan" { + title = w.f("%s has only some home services", p.Name) + } + return append(steps, Step{false, title, T.T("Home devices reach only people with home access.")}) + } + if _, nets, _ := w.personHome(srv, p); inNets(ip, nets) == "" { + return append(steps, Step{false, w.f("%s doesn't reach %s", p.Name, hdev), T.T("Networks a person does not reach cannot reach them either.")}) + } + steps = append(steps, w.personOK(p, d)) + if !steps[len(steps)-1].OK { + return steps + } + _, _, _, zones := w.Snap.ServerNet(srv) + from := strings.Join(zones, ", ") + if from == "" { + from = T.T("home") + } + return append(steps, Step{true, T.T("The firewall lets it through"), from + " → " + srv.Ifname}, w.connected(d, who)) +} + +// Check walks from one side to the other: each a device's id, or an IPv4 address (with a port when given). +// ok tells whether every step passed. +func Check(m *model.Model, from, to string, ctx Ctx) (ok bool, steps []Step, err error) { + w := &walk{ctx, m} + a, aok := w.parse(from) + if !aok { + return false, nil, Said{`"%s" is not a device or an IPv4 address.`, []any{from}} + } + b, bok := w.parse(to) + if !bok { + return false, nil, Said{`"%s" is not a device or an IPv4 address.`, []any{to}} + } + switch { + case a.dev != nil: + steps = w.fromDevice(a.dev, b) + case b.dev != nil: + steps = w.toDevice(a.ip, b.dev) + default: + return false, nil, errors.New("Choose a device on at least one side.") + } + // a side that is a host behind a router: said first, for each such side + var lead []Step + for _, t := range []target{a, b} { + if t.net != "" { + lead = append(lead, w.behindStep(t)) + } + } + steps = append(lead, steps...) + ok = true + for _, s := range steps { + ok = ok && s.OK + } + return ok, steps, nil +} diff --git a/backend/access/access_test.go b/backend/access/access_test.go new file mode 100644 index 0000000..72b1c0f --- /dev/null +++ b/backend/access/access_test.go @@ -0,0 +1,95 @@ +package access + +import ( + "encoding/json" + "os" + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Every connection of the made-up household, step for step and sentence for sentence as ucode says it +// (testdata/trace.uc on testdata/access.uci, on the router netview's golden is taken from). +func TestHouseholdAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + States map[string]string `json:"states"` + Peers map[string]awg.Peer `json:"peers"` + Online map[string]bool `json:"online"` + Cases []struct { + From, To string + OK bool `json:"ok"` + Steps []Step `json:"steps"` + Error string `json:"error"` + } `json:"cases"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + text, _ := os.ReadFile("testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + // the router: what the golden's container said of itself + raw, err = os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + fw, _ := uci.Parse(router.Firewall) + snap := netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + ctx := Ctx{States: trace.States, Peers: trace.Peers, Snap: snap, Online: func(d *model.Device, _ awg.Peer) bool { return trace.Online[d.ID] }} + if len(trace.Cases) < 500 { + t.Fatalf("only %d cases", len(trace.Cases)) + } + passed, stopped, refused, titles, bad := 0, 0, 0, map[string]bool{}, 0 + for _, want := range trace.Cases { + ok, steps, err := Check(m, want.From, want.To, ctx) + if want.Error != "" { + refused++ + if err == nil || err.Error() != want.Error { + t.Errorf("%s → %s: %v, ucode refuses with %q", want.From, want.To, err, want.Error) + } + continue + } + if ok { + passed++ + } else { + stopped++ + } + for _, s := range steps { + titles[s.Title] = true + } + if err != nil || ok != want.OK || !reflect.DeepEqual(steps, want.Steps) { + if bad++; bad <= 12 { + g, _ := json.Marshal(steps) + u, _ := json.Marshal(want.Steps) + t.Errorf("%s → %s (%v)\n go: %v %s\n ucode: %v %s", want.From, want.To, err, ok, g, want.OK, u) + } + } + } + if bad > 0 { + t.Errorf("%d of %d cases differ", bad, len(trace.Cases)) + } + if passed < 30 || stopped < 100 || refused < 3 || len(titles) < 60 { + t.Fatalf("the household exercises too little: %d pass, %d stop, %d refused, %d different steps", passed, stopped, refused, len(titles)) + } +} diff --git a/backend/access/behind_test.go b/backend/access/behind_test.go new file mode 100644 index 0000000..ec5cd15 --- /dev/null +++ b/backend/access/behind_test.go @@ -0,0 +1,95 @@ +package access + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// A host behind someone's router is checked as the router is: the household on the golden's router, with +// Boris's router in Anna's circle (192.168.2.0/24 behind it) and Kira's where everyone reaches everyone. +func TestAHostBehindARouter(t *testing.T) { + text, _ := os.ReadFile("testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + for id, net := range map[string]string{"bphone": "192.168.2.0/24", "kphone": "192.168.3.0/24"} { + c.Set(id, "kind", "router") + c.SetList(id, "behind_net", []string{net}) + } + c.Set("laptop", "lan_bypass", "1") + m := model.Load(c, nil) + raw, err := os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + fw, _ := uci.Parse(router.Firewall) + snap := netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = "active" + } + // every device has a session and is connected now: what stops a connection here is the rules alone + peers := map[string]awg.Peer{} + for _, id := range m.DeviceIDs() { + peers[m.Devices[id].PublicKey] = awg.Peer{Handshake: 1700000000} + } + ctx := Ctx{States: states, Peers: peers, Snap: snap, Online: func(*model.Device, awg.Peer) bool { return true }} + said := func(steps []Step) string { + var out []string + for _, s := range steps { + out = append(out, s.Title) + } + return strings.Join(out, " | ") + } + for _, c := range []struct { + from, to string + ok bool + has string + }{ + // Anna's laptop (it keeps its own local network outside, so its configuration names the network) to a host behind Boris's router, in her circle + {"laptop", "192.168.2.10", true, "192.168.2.10 is behind Boris · Bphone"}, + // and back: the host has Boris's access, so it reaches what his router reaches + {"192.168.2.10", "laptop", true, "192.168.2.10 is behind Boris · Bphone"}, + // Fedor is in another circle + {"fphone", "192.168.2.10", false, "are not in one circle"}, + // a home address reaches it as it reaches the router, and it reaches home + {"192.168.77.20", "192.168.2.10", true, "192.168.77.20 is at home"}, + {"192.168.2.10", "192.168.77.20", true, "192.168.2.10 is behind Boris · Bphone"}, + // the router itself and what is behind it need no tunnel between them + {"bphone", "192.168.2.10", false, "192.168.2.10 is behind this device"}, + // two hosts behind one router likewise + {"192.168.2.10", "192.168.2.20", false, "192.168.2.20 is behind this device"}, + // another server's network is another server's + {"phone", "192.168.3.10", false, "is on another server"}, + // an address behind nobody is what it always was + {"phone", "192.168.9.10", false, ""}, + } { + ok, steps, err := Check(m, c.from, c.to, ctx) + if err != nil || ok != c.ok || !strings.Contains(said(steps), c.has) { + t.Errorf("%s → %s: %v %v, want %v with %q\n %s", c.from, c.to, ok, err, c.ok, c.has, said(steps)) + } + } + // a router that waits for the admin's answer stands for nothing yet + m.Devices["bphone"].Waiting = true + if _, steps, _ := Check(m, "laptop", "192.168.2.10", ctx); strings.Contains(said(steps), "is behind") { + t.Errorf("a waiting router's network is checked as its own: %s", said(steps)) + } +} diff --git a/backend/access/testdata/access.uci b/backend/access/testdata/access.uci new file mode 100644 index 0000000..427b386 --- /dev/null +++ b/backend/access/testdata/access.uci @@ -0,0 +1,214 @@ +config settings 'settings' + option portal_enabled '1' + option portal_port '4500' + option portal_host 'vpn.example.org' + list portal_alt '203.0.113.7' + +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=' + option public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA=' + option auto_lan '0' + list lan_device 'dlhome' + list lan_device 'br-lan' + option mesh 'circles' + option lan_like '0' + +config server 'cabin' + option name 'Cabin' + option ifname 'dawn1' + option port '4600' + option subnet '10.78.0.0/24' + option private_key 'ccccccccccccccccccccccccccccccccccccccccccA=' + option public_key 'ddddddddddddddddddddddddddddddddddddddddddA=' + option auto_lan '0' + list lan_device 'dlhome' + option mesh 'off' + +config server 'open' + option name 'Open' + option ifname 'dawn2' + option port '4700' + option subnet '10.79.0.0/24' + option private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=' + option public_key 'ffffffffffffffffffffffffffffffffffffffffffA=' + option auto_lan '0' + list lan_device 'br-lan' + option mesh 'all' + +config circle 'fam' + option server 'home' + option name 'Family' + +config circle 'work' + option server 'home' + option name 'Work' + +config service 'nas' + option name 'NAS' + option address '192.168.77.5' + list ports '445' + list ports '139' + +config service 'cam' + option name 'Camera' + option address '192.168.50.30' + +config person 'anna' + option server 'home' + option name 'Anna' + option access 'both' + option circle 'fam' + +config person 'boris' + option server 'home' + option name 'Boris' + option access 'both' + option circle 'fam' + +config person 'clara' + option server 'home' + option name 'Clara' + option access 'internet' + +config person 'dima' + option server 'home' + option name 'Dima' + option access 'lan' + list home_net 'dlhome' + +config person 'eva' + option server 'home' + option name 'Eva' + option access 'lan' + list service 'nas' + list service 'cam' + +config person 'fedor' + option server 'home' + option name 'Fedor' + option access 'both' + option circle 'work' + +config person 'gleb' + option server 'home' + option name 'Gleb' + option access 'both' + option paused '1' + +config person 'hana' + option server 'cabin' + option name 'Hana' + option access 'both' + +config person 'ivan' + option server 'cabin' + option name 'Ivan' + option access 'both' + +config person 'kira' + option server 'open' + option name 'Kira' + option access 'both' + +config person 'lev' + option server 'open' + option name 'Lev' + option access 'both' + +config person 'nora' + option server 'home' + option name 'Nora' + option access 'both' + option circle 'fam' + list home_net 'br-lan' + +config device 'phone' + option person 'anna' + option name 'Phone' + option address '10.77.0.2' + option public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=' + +config device 'laptop' + option person 'anna' + option name 'Laptop' + option address '10.77.0.3' + option public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=' + option lan_bypass '1' + option kind 'computer' + +config device 'old' + option person 'anna' + option name 'Old' + option address '10.77.0.4' + option public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA=' + option disabled '1' + +config device 'bphone' + option person 'boris' + option name 'Bphone' + option address '10.77.0.5' + option public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=' + +config device 'cphone' + option person 'clara' + option name 'Cphone' + option address '10.77.0.6' + option public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=' + +config device 'dphone' + option person 'dima' + option name 'Dphone' + option address '10.77.0.7' + option public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=' + +config device 'ephone' + option person 'eva' + option name 'Ephone' + option address '10.77.0.8' + option public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=' + +config device 'fphone' + option person 'fedor' + option name 'Fphone' + option address '10.77.0.9' + option public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=' + +config device 'gphone' + option person 'gleb' + option name 'Gphone' + option address '10.77.0.10' + option public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA=' + +config device 'hphone' + option person 'hana' + option name 'Hphone' + option address '10.78.0.2' + option public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=' + +config device 'iphone' + option person 'ivan' + option name 'Iphone' + option address '10.78.0.3' + option public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=' + +config device 'kphone' + option person 'kira' + option name 'Kphone' + option address '10.79.0.2' + option public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=' + +config device 'lphone' + option person 'lev' + option name 'Lphone' + option address '10.79.0.3' + option public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=' + +config device 'nphone' + option person 'nora' + option name 'Nphone' + option address '10.77.0.11' + option public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=' diff --git a/backend/access/testdata/trace.json b/backend/access/testdata/trace.json new file mode 100644 index 0000000..e8a7ee6 --- /dev/null +++ b/backend/access/testdata/trace.json @@ -0,0 +1,10583 @@ +{ + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "peers": { + "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=": { + "ifname": "dawn1", + "handshake": 1799999990 + }, + "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=": { + "ifname": "dawn2", + "handshake": 1799999990 + }, + "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=": { + "ifname": "dawn2", + "handshake": 1799999990 + }, + "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=": { + "ifname": "dawn0", + "handshake": 1799999990 + }, + "JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA=": { + "ifname": "dawn0", + "handshake": 0 + } + }, + "online": { + "phone": true, + "laptop": true, + "cphone": true, + "dphone": true, + "ephone": true, + "fphone": false, + "hphone": true, + "kphone": true, + "lphone": true, + "nphone": true + }, + "cases": [ + { + "from": "phone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "phone", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are Anna's devices", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "phone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are Anna's devices", + "detail": "" + }, + { + "ok": false, + "title": "Anna · Old can't be reached: it is turned off", + "detail": "" + } + ] + }, + { + "from": "phone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "phone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "phone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Dima are not in one circle", + "detail": "Anna: Family · Dima: no circle" + } + ] + }, + { + "from": "phone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "phone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Fedor are not in one circle", + "detail": "Anna: Family · Fedor: Work" + } + ] + }, + { + "from": "phone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Gleb are not in one circle", + "detail": "Anna: Family · Gleb: no circle" + } + ] + }, + { + "from": "phone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "phone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "phone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "phone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "phone", + "to": "nphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Nora · Nphone is connected", + "detail": "" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "phone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "phone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "phone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "phone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "phone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "phone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "phone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "phone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "laptop", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are Anna's devices", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "laptop", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "laptop", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are Anna's devices", + "detail": "" + }, + { + "ok": false, + "title": "Anna · Old can't be reached: it is turned off", + "detail": "" + } + ] + }, + { + "from": "laptop", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "laptop", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "laptop", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Dima are not in one circle", + "detail": "Anna: Family · Dima: no circle" + } + ] + }, + { + "from": "laptop", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "laptop", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Fedor are not in one circle", + "detail": "Anna: Family · Fedor: Work" + } + ] + }, + { + "from": "laptop", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna and Gleb are not in one circle", + "detail": "Anna: Family · Gleb: no circle" + } + ] + }, + { + "from": "laptop", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "laptop", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "laptop", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "laptop", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "laptop", + "to": "nphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "Nora · Nphone is connected", + "detail": "" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "laptop", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "laptop", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "laptop", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "laptop", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "laptop", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "laptop", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "laptop", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "laptop", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "laptop", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Its configuration doesn't send it to the router", + "detail": "AllowedIPs 0.0.0.0/5, 8.0.0.0/7, 10.77.0.0/24, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.168.77.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4: the device's own network handles it." + } + ] + }, + { + "from": "old", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "old", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.1:53", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.1:4500", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.1:4501", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.1:22", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.77.1:22", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "8.8.8.8", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "8.8.8.8:443", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "old", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "bphone", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "bphone", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "bphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": false, + "title": "Anna · Old can't be reached: it is turned off", + "detail": "" + } + ] + }, + { + "from": "bphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "bphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "bphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris and Dima are not in one circle", + "detail": "Boris: Family · Dima: no circle" + } + ] + }, + { + "from": "bphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "bphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris and Fedor are not in one circle", + "detail": "Boris: Family · Fedor: Work" + } + ] + }, + { + "from": "bphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris and Gleb are not in one circle", + "detail": "Boris: Family · Gleb: no circle" + } + ] + }, + { + "from": "bphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "bphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "bphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "bphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "bphone", + "to": "nphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Nora · Nphone is connected", + "detail": "" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "bphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "bphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "bphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "bphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "bphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "bphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "bphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "bphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "cphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "cphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "cphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "cphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "cphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "cphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.50.1 is this router", + "detail": "Clara has Internet only: only DNS and the portal on the router." + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.50.1 is this router", + "detail": "Clara has Internet only: only DNS and the portal on the router." + } + ] + }, + { + "from": "cphone", + "to": "192.168.77.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.77.1 is this router", + "detail": "Clara has Internet only: only DNS and the portal on the router." + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.50.30 is at home (dlhome)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.50.30 is at home (dlhome)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "Clara has Internet only." + } + ] + }, + { + "from": "cphone", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "10.20.4.1 is this router", + "detail": "Clara has Internet only: only DNS and the portal on the router." + } + ] + }, + { + "from": "cphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "cphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "cphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "cphone", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "10.66.0.2 is this router", + "detail": "Clara has Internet only: only DNS and the portal on the router." + } + ] + }, + { + "from": "cphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "cphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "cphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "cphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Clara is active", + "detail": "Internet only" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "dphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Anna are not in one circle", + "detail": "Dima: no circle · Anna: Family" + } + ] + }, + { + "from": "dphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Anna are not in one circle", + "detail": "Dima: no circle · Anna: Family" + } + ] + }, + { + "from": "dphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Anna are not in one circle", + "detail": "Dima: no circle · Anna: Family" + } + ] + }, + { + "from": "dphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Boris are not in one circle", + "detail": "Dima: no circle · Boris: Family" + } + ] + }, + { + "from": "dphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "dphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "dphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "dphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Fedor are not in one circle", + "detail": "Dima: no circle · Fedor: Work" + } + ] + }, + { + "from": "dphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Gleb are not in one circle", + "detail": "Dima: no circle · Gleb: no circle" + } + ] + }, + { + "from": "dphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "dphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "dphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "dphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "dphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Dima and Nora are not in one circle", + "detail": "Dima: no circle · Nora: Family" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "On one of the networks Dima reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "On one of the networks Dima reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + } + ] + }, + { + "from": "dphone", + "to": "192.168.77.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.77.1 is this router on a network Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "One of the networks Dima reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "One of the networks Dima reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "dphone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "One of the networks Dima reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "dphone", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.77.5 is in br-lan, which Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.77.5 is in br-lan, which Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.77.5 is in br-lan, which Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.20.4.1 is this router on a network Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "dphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "dphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "dphone", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.66.0.2 is this router on a network Dima doesn't reach", + "detail": "Dima reaches dlhome." + } + ] + }, + { + "from": "dphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "Dima has Home only: their device's own internet reaches it, not the tunnel." + } + ] + }, + { + "from": "dphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "Dima has Home only: their device's own internet reaches it, not the tunnel." + } + ] + }, + { + "from": "dphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "dphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "ephone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "ephone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "ephone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "ephone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "ephone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "ephone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only people with home access reach other devices." + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.50.1 is this router", + "detail": "Eva has Home only: only DNS and the portal on the router." + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.50.1 is this router", + "detail": "Eva has Home only: only DNS and the portal on the router." + } + ] + }, + { + "from": "ephone", + "to": "192.168.77.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.77.1 is this router", + "detail": "Eva has Home only: only DNS and the portal on the router." + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "192.168.50.20 is not one of Eva's home services", + "detail": "Allowed: NAS, Camera" + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.30 is Camera, one of Eva's home services", + "detail": "All ports" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "ephone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.50.30 is Camera, one of Eva's home services", + "detail": "All ports" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "ephone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.77.5 is NAS, one of Eva's home services", + "detail": "All ports" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "ephone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.77.5 is NAS, one of Eva's home services", + "detail": "All ports" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "ephone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "192.168.77.5 is NAS, one of Eva's home services", + "detail": "All ports" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 10.77.0.0/24, 192.168.50.0/24, 192.168.77.0/24" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "ephone", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.20.4.1 is this router", + "detail": "Eva has Home only: only DNS and the portal on the router." + } + ] + }, + { + "from": "ephone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "ephone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "ephone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "ephone", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "10.66.0.2 is this router", + "detail": "Eva has Home only: only DNS and the portal on the router." + } + ] + }, + { + "from": "ephone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "Eva has Home only: their device's own internet reaches it, not the tunnel." + } + ] + }, + { + "from": "ephone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "Eva has Home only: their device's own internet reaches it, not the tunnel." + } + ] + }, + { + "from": "ephone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "ephone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Eva is active", + "detail": "Home only" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "fphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Anna are not in one circle", + "detail": "Fedor: Work · Anna: Family" + } + ] + }, + { + "from": "fphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Anna are not in one circle", + "detail": "Fedor: Work · Anna: Family" + } + ] + }, + { + "from": "fphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Anna are not in one circle", + "detail": "Fedor: Work · Anna: Family" + } + ] + }, + { + "from": "fphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Boris are not in one circle", + "detail": "Fedor: Work · Boris: Family" + } + ] + }, + { + "from": "fphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "fphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Dima are not in one circle", + "detail": "Fedor: Work · Dima: no circle" + } + ] + }, + { + "from": "fphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "fphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "fphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Gleb are not in one circle", + "detail": "Fedor: Work · Gleb: no circle" + } + ] + }, + { + "from": "fphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "fphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "fphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "fphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "fphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor and Nora are not in one circle", + "detail": "Fedor: Work · Nora: Family" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "fphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "fphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "fphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "fphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "fphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "fphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "fphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "fphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "gphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.1:53", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.1:4500", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.1:4501", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.1:22", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.77.1:22", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "8.8.8.8", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "8.8.8.8:443", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "gphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "hphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Phone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Laptop is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Old is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris · Bphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara · Cphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Dima · Dphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva · Ephone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor · Fphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Gleb · Gphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "hphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "\"Devices reach each other\" is off on Cabin", + "detail": "Server → Access → Home network." + } + ] + }, + { + "from": "hphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora · Nphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "hphone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "hphone", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "hphone", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "hphone", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "hphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "hphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "hphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "hphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "hphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "hphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "hphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "hphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Phone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Laptop is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Old is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris · Bphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara · Cphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Dima · Dphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva · Ephone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor · Fphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Gleb · Gphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "\"Devices reach each other\" is off on Cabin", + "detail": "Server → Access → Home network." + } + ] + }, + { + "from": "iphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "iphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora · Nphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.20", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.20 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.30", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "iphone", + "to": "192.168.50.30:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.30 is in home network dlhome", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn1 → home" + } + ] + }, + { + "from": "iphone", + "to": "192.168.77.5", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "192.168.77.5:445", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "192.168.77.5:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "iphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "iphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "iphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "iphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "iphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "iphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Cabin's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Phone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Laptop is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Old is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris · Bphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara · Cphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Dima · Dphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva · Ephone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor · Fphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Gleb · Gphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "kphone", + "to": "lphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Devices reach each other on this server", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Lev · Lphone is connected", + "detail": "" + } + ] + }, + { + "from": "kphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora · Nphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.20 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "kphone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "kphone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "kphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "kphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "kphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "kphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "kphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "kphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "kphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Phone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Laptop is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Anna · Old is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Boris · Bphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara · Cphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Dima · Dphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva · Ephone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Fedor · Fphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Gleb · Gphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "kphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Devices reach each other on this server", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Kira · Kphone is connected", + "detail": "" + } + ] + }, + { + "from": "lphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "lphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora · Nphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.20 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "lphone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "lphone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "Home access reaches every home network." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn2 → home" + } + ] + }, + { + "from": "lphone", + "to": "10.20.4.1", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.20.4.1 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "lphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "lphone", + "to": "10.66.0.2", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "10.66.0.2 is this router", + "detail": "Home access includes the router." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "lphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "lphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves like a home device would." + } + ] + }, + { + "from": "lphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "lphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Open's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "nphone", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "nphone", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "nphone", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": false, + "title": "Anna · Old can't be reached: it is turned off", + "detail": "" + } + ] + }, + { + "from": "nphone", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "nphone", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "nphone", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora and Dima are not in one circle", + "detail": "Nora: Family · Dima: no circle" + } + ] + }, + { + "from": "nphone", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Eva has Home only", + "detail": "Only devices of people with home access can be reached." + } + ] + }, + { + "from": "nphone", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora and Fedor are not in one circle", + "detail": "Nora: Family · Fedor: Work" + } + ] + }, + { + "from": "nphone", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Nora and Gleb are not in one circle", + "detail": "Nora: Family · Gleb: no circle" + } + ] + }, + { + "from": "nphone", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Hana · Hphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "nphone", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Ivan · Iphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "nphone", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Kira · Kphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "nphone", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "Lev · Lphone is on another server", + "detail": "Devices of different servers never reach each other." + } + ] + }, + { + "from": "nphone", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "That is the same device", + "detail": "" + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.1 is this router on a network Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.1:53", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: DNS is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.1:4500", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.1:4501", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.50.1 is this router: the personal portal is open to everyone", + "detail": "" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.1:22", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.1 is this router on a network Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "192.168.77.1:22", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.1 is this router", + "detail": "On one of the networks Nora reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.20", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.20 is in dlhome, which Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.30", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 is in dlhome, which Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "192.168.50.30:80", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "192.168.50.30 is in dlhome, which Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "192.168.77.5", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "One of the networks Nora reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "nphone", + "to": "192.168.77.5:445", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "One of the networks Nora reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "nphone", + "to": "192.168.77.5:80", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "192.168.77.5 is in home network br-lan", + "detail": "One of the networks Nora reaches." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "dawn0 → home" + } + ] + }, + { + "from": "nphone", + "to": "10.20.4.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.1 is this router on a network Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "10.20.4.9", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "nphone", + "to": "10.77.0.99", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.77.0.99", + "detail": "It is in the tunnel network 10.77.0.0/24." + } + ] + }, + { + "from": "nphone", + "to": "10.78.0.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "No device uses 10.78.0.1", + "detail": "It is in the tunnel network 10.78.0.0/24." + } + ] + }, + { + "from": "nphone", + "to": "10.66.0.2", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "10.66.0.2 is this router on a network Nora doesn't reach", + "detail": "Nora reaches br-lan." + } + ] + }, + { + "from": "nphone", + "to": "8.8.8.8", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "nphone", + "to": "8.8.8.8:443", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "8.8.8.8 is on the internet", + "detail": "It leaves through eth0." + } + ] + }, + { + "from": "nphone", + "to": "172.20.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "172.20.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "nphone", + "to": "169.254.1.1", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": false, + "title": "169.254.1.1 isn't in Home's home network", + "detail": "Private addresses outside the home network are blocked." + } + ] + }, + { + "from": "192.168.50.20", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.20", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.20", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "192.168.50.20", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "192.168.50.20", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.50.20", + "to": "dphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Dima · Dphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.20", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Eva has only some home services", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.50.20", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Fedor · Fphone isn't connected right now", + "detail": "The router reaches it only while its VPN is on." + } + ] + }, + { + "from": "192.168.50.20", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "192.168.50.20", + "to": "hphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn1" + }, + { + "ok": true, + "title": "Hana · Hphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.20", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn1" + }, + { + "ok": false, + "title": "Ivan · Iphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "192.168.50.20", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.50.20 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.50.20", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.50.20 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.50.20", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.20 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Nora doesn't reach dlhome", + "detail": "Networks a person does not reach cannot reach them either." + } + ] + }, + { + "from": "192.168.77.5", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.77.5", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.77.5", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "192.168.77.5", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "192.168.77.5", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.77.5", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": false, + "title": "Dima doesn't reach br-lan", + "detail": "Networks a person does not reach cannot reach them either." + } + ] + }, + { + "from": "192.168.77.5", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": false, + "title": "Eva has only some home services", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.77.5", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Fedor · Fphone isn't connected right now", + "detail": "The router reaches it only while its VPN is on." + } + ] + }, + { + "from": "192.168.77.5", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "192.168.77.5", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.77.5", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.77.5 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.77.5", + "to": "kphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Kira is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn2" + }, + { + "ok": true, + "title": "Kira · Kphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.77.5", + "to": "lphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Lev is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn2" + }, + { + "ok": true, + "title": "Lev · Lphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.77.5", + "to": "nphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.77.5 is at home (br-lan)", + "detail": "" + }, + { + "ok": true, + "title": "Nora is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Nora · Nphone is connected", + "detail": "" + } + ] + }, + { + "from": "10.20.4.9", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "old", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.20.4.9", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.20.4.9 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "old", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "8.8.8.8", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "8.8.8.8 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "phone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "laptop", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "old", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "dphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "hphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Cabin's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "10.77.0.99", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "10.77.0.99 isn't in Home's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.50.1", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.1", + "to": "laptop", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Anna · Laptop is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.1", + "to": "old", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Old is turned off", + "detail": "Turn the device on again on its page." + } + ] + }, + { + "from": "192.168.50.1", + "to": "bphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "192.168.50.1", + "to": "cphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Clara has Internet only", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.50.1", + "to": "dphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Dima is active", + "detail": "Home only" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": true, + "title": "Dima · Dphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.1", + "to": "ephone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Eva has only some home services", + "detail": "Home devices reach only people with home access." + } + ] + }, + { + "from": "192.168.50.1", + "to": "fphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Fedor is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn0" + }, + { + "ok": false, + "title": "Fedor · Fphone isn't connected right now", + "detail": "The router reaches it only while its VPN is on." + } + ] + }, + { + "from": "192.168.50.1", + "to": "gphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Gleb can't connect: they are paused", + "detail": "" + } + ] + }, + { + "from": "192.168.50.1", + "to": "hphone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Hana is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn1" + }, + { + "ok": true, + "title": "Hana · Hphone is connected", + "detail": "" + } + ] + }, + { + "from": "192.168.50.1", + "to": "iphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": true, + "title": "Ivan is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "The firewall lets it through", + "detail": "home → dawn1" + }, + { + "ok": false, + "title": "Ivan · Iphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "192.168.50.1", + "to": "kphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.50.1 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.50.1", + "to": "lphone", + "ok": false, + "steps": [ + { + "ok": false, + "title": "192.168.50.1 isn't in Open's home network", + "detail": "Only home devices reach people's devices." + } + ] + }, + { + "from": "192.168.50.1", + "to": "nphone", + "ok": false, + "steps": [ + { + "ok": true, + "title": "192.168.50.1 is at home (dlhome)", + "detail": "" + }, + { + "ok": false, + "title": "Nora doesn't reach dlhome", + "detail": "Networks a person does not reach cannot reach them either." + } + ] + }, + { + "from": "8.8.8.8", + "to": "192.168.50.20", + "error": "Choose a device on at least one side." + }, + { + "from": "nothing", + "to": "phone", + "error": "\"nothing\" is not a device or an IPv4 address." + }, + { + "from": "phone", + "to": "999.1.1.1", + "error": "\"999.1.1.1\" is not a device or an IPv4 address." + }, + { + "from": " phone ", + "to": "10.77.0.5", + "ok": false, + "steps": [ + { + "ok": true, + "title": "Anna is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": false, + "title": "Boris · Bphone has never connected", + "detail": "There is no session the router could reach." + } + ] + }, + { + "from": "10.77.0.5:80", + "to": "phone", + "ok": true, + "steps": [ + { + "ok": true, + "title": "Boris is active", + "detail": "Home and Internet" + }, + { + "ok": true, + "title": "Both are in Family", + "detail": "Devices in one circle reach each other." + }, + { + "ok": true, + "title": "Its configuration sends it to the router", + "detail": "AllowedIPs 0.0.0.0/0" + }, + { + "ok": true, + "title": "Anna · Phone is connected", + "detail": "" + } + ] + }, + { + "from": "phone", + "to": "8.8.8.8:999999", + "error": "\"8.8.8.8:999999\" is not a device or an IPv4 address." + } + ] +} diff --git a/backend/api/audience.go b/backend/api/audience.go new file mode 100644 index 0000000..39e9129 --- /dev/null +++ b/backend/api/audience.go @@ -0,0 +1,78 @@ +// Who is looking: producers of live state work only while a page shows it. +// A page that follows the stream says which topics it shows (with every +// question it asks, and a `watch` call for the ones it keeps open); each such +// word holds for a short while. Nothing asked, nobody subscribed: nothing is +// read from the tunnels for the pages, as before the stream existed. +package api + +import ( + "sync" + "time" +) + +// Lease is how long a page's interest in a topic holds after it said so. +// Pages renew it at about a third of that. +const Lease = 30 * time.Second + +// Audience remembers who looks at what. +type Audience struct { + mu sync.Mutex + until map[string]time.Time + stream bool + now func() time.Time +} + +// NewAudience makes an empty audience. +func NewAudience() *Audience { + return &Audience{until: map[string]time.Time{}, now: time.Now} +} + +// everything stands for a page that named no topic: it follows them all. +const everything = "*" + +// Touch notes that someone looks at these topics now (none named: at all of +// them, which keeps the audience present but wakes no topic that must be +// asked for by name, like the meter). +func (a *Audience) Touch(topics []string) { + end := a.now().Add(Lease) + a.mu.Lock() + if len(topics) == 0 { + a.until[everything] = end + } + for _, t := range topics { + a.until[t] = end + } + a.mu.Unlock() +} + +// Streaming notes whether the event stream has subscribers (ubusd tells). +func (a *Audience) Streaming(on bool) { + a.mu.Lock() + a.stream = on + a.mu.Unlock() +} + +// Wants tells whether someone looked at the topic within the lease. +func (a *Audience) Wants(topic string) bool { + a.mu.Lock() + defer a.mu.Unlock() + return a.now().Before(a.until[topic]) +} + +// Present tells whether any page is there at all: one that follows the +// stream, or one that asked for anything within the lease. +func (a *Audience) Present() bool { + a.mu.Lock() + defer a.mu.Unlock() + if a.stream { + return true + } + now := a.now() + for t, end := range a.until { + if now.Before(end) { + return true + } + delete(a.until, t) + } + return false +} diff --git a/backend/api/broadcast.go b/backend/api/broadcast.go new file mode 100644 index 0000000..ccd33b5 --- /dev/null +++ b/backend/api/broadcast.go @@ -0,0 +1,58 @@ +// The stream side of the object: every event of the hub goes to the object's +// subscribers as a notification, in order, and a `ping` when nothing happened +// for a while (a page tells a dead connection from a quiet one by it; the +// ping carries the number the stream is at, so a page that missed the last +// event before a silence learns it). +package api + +import ( + "context" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/ubus" +) + +// PingEvery is the longest a stream stays silent. +const PingEvery = 15 * time.Second + +// Notifier is the bus as the broadcast needs it. +type Notifier interface { + Notify(o *ubus.Object, kind string, data map[string]any) error +} + +// Broadcast forwards the hub's events to the object's subscribers until ctx +// ends. A notification the bus did not take (ubusd away, an event over its +// size limit) is not retried: the next ping or event shows a page the gap, +// and it asks for what it missed with sync. +func Broadcast(ctx context.Context, h *hub.Hub, bus Notifier, o *ubus.Object) { + ping := time.NewTicker(PingEvery) + defer ping.Stop() + for ctx.Err() == nil { + sub := h.Follow() + follow(ctx, h, sub, bus, o, ping) + sub.Close() + } +} + +// follow forwards one subscription's events; it returns when the hub let the +// subscription go (this side fell behind) or ctx ended. +func follow(ctx context.Context, h *hub.Hub, sub *hub.Sub, bus Notifier, o *ubus.Object, ping *time.Ticker) { + for { + select { + case <-ctx.Done(): + return + case e, ok := <-sub.Events(): + if !ok { + return + } + t := eventTable(e) + t["epoch"] = h.Epoch() + bus.Notify(o, "event", t) + ping.Reset(PingEvery) + case <-ping.C: + at := h.Sync(h.Epoch(), 0, func(string) bool { return false }) + bus.Notify(o, "ping", map[string]any{"epoch": at.Epoch, "seq": at.Seq, "now": time.Now().Unix()}) + } + } +} diff --git a/backend/api/object.go b/backend/api/object.go new file mode 100644 index 0000000..bf3917e --- /dev/null +++ b/backend/api/object.go @@ -0,0 +1,205 @@ +// Package api is the admin's door to the live state: the ubus object +// `dawnline`, which LuCI reaches through uhttpd with rpcd's access lists in +// between (acl.d/luci-app-dawnline.json names every method here; a test holds +// the two together). +// +// hello where the stream is and how to follow it +// sync {epoch, seq, topics} a snapshot, or the events since seq +// wait {epoch, seq, topics, timeout} +// the same, held until there is an event (long poll) +// watch {topics} "these topics are on screen", renewed while they are +// +// and the notifications `event` (one change, hub.Event with the epoch) and +// `ping` to whoever subscribed (uhttpd: GET /ubus/subscribe/dawnline, an event +// stream). The two ways to follow give the same events with the same numbers; +// a page uses the stream where the web server can hold one and the long poll +// where it cannot (hello's `stream`). +// +// Arguments are checked here, once; the hub is trusted with what passes. +package api + +import ( + "context" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/ubus" +) + +// ObjectName is the backend's object on ubus. The ucode backend's is +// luci.dawnline; methods move from there to here as they are ported. +const ObjectName = "dawnline" + +// The limits of what a caller may send. +const ( + maxTopics = 32 + maxTopicLen = 64 + maxEpochLen = 32 + // A held call must end before uhttpd gives up on it (script_timeout, 60 s). + maxWait = 50 * time.Second + defaultWait = 25 * time.Second +) + +// Info is what hello tells besides the stream's position. +type Info struct { + // Version is the backend's. + Version string + // Stream is how a page should follow: "sse" (GET /ubus/subscribe/dawnline) + // or "poll" (the wait method). + Stream string + // Refresh has the topics read from the router now (the bridge's Look); nil when nothing needs it. + Refresh func(ctx context.Context) + // More is the questions the backend answers besides the stream's (package methods): hello names them, + // so a page asks them here and not of the ucode backend. + More []ubus.Method +} + +// Object builds the ubus object over a hub. Who looks is noted in audience. +func Object(h *hub.Hub, audience *Audience, info Info) *ubus.Object { + more := []string{} + for _, m := range info.More { + more = append(more, m.Name) + } + return &ubus.Object{ + Name: ObjectName, + Methods: append([]ubus.Method{ + {Name: "hello", Handle: func(context.Context, map[string]any) (map[string]any, error) { + at := h.Sync(h.Epoch(), 0, func(string) bool { return false }) + return map[string]any{ + "version": info.Version, "stream": info.Stream, + "epoch": at.Epoch, "seq": at.Seq, "lease": int(Lease / time.Second), + "now": time.Now().Unix(), "methods": more, + }, nil + }}, + {Name: "sync", Params: map[string]ubus.Kind{"epoch": ubus.String, "seq": ubus.Int, "topics": ubus.Array}, + Handle: func(_ context.Context, args map[string]any) (map[string]any, error) { + q, err := parse(args) + if err != nil { + return nil, err + } + audience.Touch(q.topics) + return answer(h.Sync(q.epoch, q.seq, q.want())), nil + }}, + {Name: "wait", Waits: true, + Params: map[string]ubus.Kind{"epoch": ubus.String, "seq": ubus.Int, "topics": ubus.Array, "timeout": ubus.Int}, + Handle: func(ctx context.Context, args map[string]any) (map[string]any, error) { + q, err := parse(args) + if err != nil { + return nil, err + } + audience.Touch(q.topics) + ctx, cancel := context.WithTimeout(ctx, q.timeout) + defer cancel() + a := h.Wait(ctx, q.epoch, q.seq, q.want()) + // Still looking after the wait: the next call renews it again. + audience.Touch(q.topics) + return answer(a), nil + }}, + // After its own edit a page reads what it wrote: the topics are brought to what is on disk, and + // the answer is where the stream stands then. The page catches up to it (sync). + {Name: "refresh", Waits: true, Handle: func(ctx context.Context, _ map[string]any) (map[string]any, error) { + audience.Touch(nil) + if info.Refresh != nil { + ctx, cancel := context.WithTimeout(ctx, defaultWait) + defer cancel() + info.Refresh(ctx) + } + at := h.Sync(h.Epoch(), 0, func(string) bool { return false }) + return map[string]any{"epoch": at.Epoch, "seq": at.Seq}, nil + }}, + {Name: "watch", Params: map[string]ubus.Kind{"topics": ubus.Array}, + Handle: func(_ context.Context, args map[string]any) (map[string]any, error) { + q, err := parse(args) + if err != nil { + return nil, err + } + audience.Touch(q.topics) + return map[string]any{"lease": int(Lease / time.Second)}, nil + }}, + }, info.More...), + Watched: audience.Streaming, + } +} + +// query is a caller's arguments, checked. +type query struct { + epoch string + seq uint64 + topics []string + timeout time.Duration +} + +// want is the topics the caller named; none named means all of them. +func (q query) want() func(string) bool { + if len(q.topics) == 0 { + return nil + } + set := make(map[string]bool, len(q.topics)) + for _, t := range q.topics { + set[t] = true + } + return func(topic string) bool { return set[topic] } +} + +func parse(args map[string]any) (query, error) { + q := query{timeout: defaultWait} + if v, ok := args["epoch"]; ok { + s, isString := v.(string) + if !isString || len(s) > maxEpochLen { + return q, ubus.StatusInvalidArgument + } + q.epoch = s + } + if v, ok := args["seq"]; ok { + n, isInt := v.(int64) + if !isInt || n < 0 { + return q, ubus.StatusInvalidArgument + } + q.seq = uint64(n) + } + if v, ok := args["timeout"]; ok { + n, isInt := v.(int64) + if !isInt || n < 1 { + return q, ubus.StatusInvalidArgument + } + q.timeout = min(time.Duration(n)*time.Second, maxWait) + } + if v, ok := args["topics"]; ok { + list, isList := v.([]any) + if !isList || len(list) > maxTopics { + return q, ubus.StatusInvalidArgument + } + for _, e := range list { + s, isString := e.(string) + if !isString || s == "" || len(s) > maxTopicLen { + return q, ubus.StatusInvalidArgument + } + q.topics = append(q.topics, s) + } + } + return q, nil +} + +// answer is a hub.Answer as a ubus table. +func answer(a hub.Answer) map[string]any { + out := map[string]any{"epoch": a.Epoch, "seq": a.Seq} + if a.Docs != nil { + out["docs"] = a.Docs + } + if a.Events != nil { + events := make([]any, len(a.Events)) + for i, e := range a.Events { + events[i] = eventTable(e) + } + out["events"] = events + } + return out +} + +func eventTable(e hub.Event) map[string]any { + t := map[string]any{"seq": e.Seq, "topic": e.Topic, "op": e.Op} + if e.Data != nil { + t["data"] = e.Data + } + return t +} diff --git a/backend/apply/apply.go b/backend/apply/apply.go new file mode 100644 index 0000000..995e348 --- /dev/null +++ b/backend/apply/apply.go @@ -0,0 +1,238 @@ +package apply + +import ( + "fmt" + "os" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// The full apply (dawnline.apply apply): the settings turned into router state. Network interfaces, the +// firewall, the home-like path and the Home-only resolver, the reply table, then the runtime sync with the +// access table rebuilt. One lock ("apply") for all of it, the settings read inside it, so a rebuild and a +// runtime sync never interleave and the last one to run works from the newest settings. + +// Full is what a full apply came to. +type Full struct { + Network, Firewall bool + // LikeHome is true while the home-like path is up, false when nobody wants it, or why it cannot be: + // {error: a sentence in the admin's language}. + LikeHome any + Peers map[string]string + Warning string +} + +// uc writes a value as ucode's "%J" does: the agent compares the signature as text. +func uc(v any) string { + switch x := v.(type) { + case nil: + return "null" + case bool: + return strconv.FormatBool(x) + case string: + return strconv.Quote(x) + case []string: + if len(x) == 0 { + return "[ ]" + } + q := make([]string, len(x)) + for i, s := range x { + q[i] = strconv.Quote(s) + } + return "[ " + strings.Join(q, ", ") + " ]" + case []any: + if len(x) == 0 { + return "[ ]" + } + q := make([]string, len(x)) + for i, s := range x { + q[i] = uc(s) + } + return "[ " + strings.Join(q, ", ") + " ]" + case [][2]any: + if len(x) == 0 { + return "{ }" + } + q := make([]string, len(x)) + for i, kv := range x { + q[i] = strconv.Quote(kv[0].(string)) + ": " + uc(kv[1]) + } + return "{ " + strings.Join(q, ", ") + " }" + } + return "null" +} + +func orNull(s string) any { + if s == "" { + return nil + } + return s +} + +// NetSignature is everything on the router that Dawnline's state is derived from: WAN and LAN, the home +// networks and zones of each server, the netns address and the LAN's DNS (dawnline.apply net_signature). +// An apply is due again when it changes (LAN renumbered, interface added, bridge recreated, DHCP DNS changed). +func (r *Router) NetSignature(m *model.Model) string { + snap := r.Snapshot() + var servers [][2]any + for _, id := range m.ServerIDs() { + wan, home, nets, zones := snap.ServerNet(m.Servers[id]) + homes := []any{} + for _, h := range home { + homes = append(homes, [][2]any{{"dev", h.Dev}, {"auto", h.Auto}, {"nets", append([]string{}, h.Nets...)}, {"zone", orNull(h.Zone)}, {"missing", h.Missing}}) + } + servers = append(servers, [2]any{id, [][2]any{ + {"wan", [][2]any{{"dev", orNull(wan.Dev)}, {"auto", wan.Auto}, {"zone", wan.Zone}, {"missing", wan.Missing}}}, + {"home", homes}, {"nets", append([]string{}, nets...)}, {"zones", append([]string{}, zones...)}}}) + } + var addrs any + if lan := snap.Devices[snap.LAN]; lan != nil { + addrs = append([]string{}, lan.Addrs...) + } + active, address, known, _ := r.likeHome() + var loop any + if active { + loop = orNull(address) + } + return uc([][2]any{{"wan", orNull(snap.WAN)}, {"lan", orNull(snap.LAN)}, {"addrs", addrs}, {"servers", servers}, + {"dns", orNull(r.lanDNS(snap, known))}, {"loop", loop}}) +} + +// loopErrorText says why the home-like path is off, in the reader's language (dawnline.loop error_text). +func loopErrorText(e map[string]any, t *i18n.Catalog) string { + switch e["code"] { + case "no_lan": + return t.T("No LAN detected.") + case "not_bridge": + return fmt.Sprintf(t.T("%s is not a bridge, so Dawnline cannot join the LAN as a device."), e["dev"]) + case "no_ipv4": + return fmt.Sprintf(t.T("%s has no IPv4 address."), e["dev"]) + case "no_address": + return fmt.Sprintf(t.T("No free address on %s."), e["net"]) + case "no_transit": + return t.T("No free link-local range for the internal link.") + case "no_table": + return t.T("No free routing table.") + } + return fmt.Sprintf(t.T("Setup failed: %s"), e["detail"]) +} + +func count(n int, one, many string) string { + if n == 1 { + return "1 " + one + } + return strconv.Itoa(n) + " " + many +} + +// Apply is the full apply. load reads the settings anew (with the LAN address kept for the home-like +// path) once the lock is held; tools tells whether amneziawg-tools is there, caps what this AmneziaWG runs. +func (r *Router) Apply(load func() (*model.Model, string, error), u *usage.Usage, t *i18n.Catalog, tools bool, caps awg.Caps) Full { + t0 := time.Now() + r.say("debug", "apply", "applying the configuration") + step := func(name string, fn func() string) { + at := time.Now() + what := fn() + if what != "" { + what = " · " + what + } + r.say("debug", "apply", fmt.Sprintf("%s done in %d ms%s", name, time.Since(at).Milliseconds(), what)) + } + changed := func(x bool) string { + if x { + return "changed" + } + return "unchanged" + } + unlock := files.Lock(r.RunDir, "apply") + m, saved, err := load() + if err != nil { + unlock() + r.say("error", "apply", "the settings could not be read: nothing was applied · "+err.Error()) + return Full{Warning: err.Error(), LikeHome: false} + } + var out Full + var lp Loop + var s Result + step("network (netifd)", func() string { out.Network = r.Netifd(m, tools, caps); return changed(out.Network) }) + step("firewall (fw4)", func() string { out.Firewall = r.Fw(m); return changed(out.Firewall) }) + step("internet like a home device", func() string { lp = r.LoopEnsure(m, saved, true); return "" }) + step("resolver for Home-only devices", func() string { r.SyncResolver(m); return "" }) + step("reply routes", func() string { r.ReplyRoutes(m); return "" }) + step("access rules and devices", func() string { s = r.sync(m, u, time.Now().Unix(), true, t); return "" }) + os.MkdirAll(r.RunDir, 0o755) + os.WriteFile(r.RunDir+"/net.sig", []byte(r.NetSignature(m)), 0o644) + present := s.Table != "" && r.Present() + unlock() + // the address is kept once the lock is released: the settings' own lock is never taken inside it + if lp.Plan != nil && lp.Plan.Address != "" && lp.Plan.Address != saved && r.Remember != nil { + r.Remember(lp.Plan.Address) + } + took := fmt.Sprintf("configuration applied in %d ms · %s, %s, %s", time.Since(t0).Milliseconds(), + count(len(m.Servers), "server", "servers"), count(len(m.People), "person", "people"), count(len(m.Devices), "device", "devices")) + // the same as the warning, for syslog: in English whatever the admin's language + var facts []string + if s.Table != "" { + if present { + facts = append(facts, "access rules not updated, the previous ones stay: "+s.Table) + } else { + facts = append(facts, "access rules not loaded, no device loaded: "+s.Table) + } + } + for _, id := range m.ServerIDs() { + if res, has := s.Peers[id]; has && res != "ok" && res != "down" { + facts = append(facts, m.Servers[id].Name+": devices not loaded: "+res) + } + } + if len(facts) > 0 { + r.say("warn", "apply", took+" · "+strings.Join(facts, " · ")) + } else { + r.say("info", "apply", took) + } + out.Peers, out.Warning = s.Peers, s.Warning + out.LikeHome = !lp.Off + if lp.Error != nil { + note := LoopErrorNote(lp.Error) + if lp.Error["code"] == "setup" { + note = fmt.Sprintf("Setup failed: %v", lp.Error["detail"]) + } + r.say("warn", "apply", "internet like a home device: "+note) + out.LikeHome = map[string]any{"error": loopErrorText(lp.Error, t)} + } + return out +} + +// NetChanged tells whether the router's networks differ from what the last apply worked from. +func (r *Router) NetChanged(m *model.Model) bool { + was, err := os.ReadFile(r.RunDir + "/net.sig") + return err != nil || string(was) != r.NetSignature(m) +} + +// Teardown removes everything Dawnline made on the router (dawnline.apply teardown): the home-like path, +// the resolver's configuration, every tunnel interface and firewall section of ours, the reply table, the +// access table and the device names. m is the settings as they stand; nothing of them is written here. +func (r *Router) Teardown(m *model.Model) { + defer files.Lock(r.RunDir, "apply")() + var ifnames []string + for _, id := range m.ServerIDs() { + ifnames = append(ifnames, m.Servers[id].Ifname) + } + r.LoopRemove(ifnames) + os.Remove(r.varEtc() + "/dawnline-dns.conf") + // as with no server and no portal: what is ours is then nobody's, and goes + bare := m.WithoutServers() + bare.Settings.PortalEnabled = false + r.Netifd(bare, true, awg.Caps{}) + r.Fw(bare) + r.ReplyRoutes(bare) + r.Exec("nft", "delete", "table", "inet", "dawnline") + os.Remove(r.HostsFile) + os.Remove(r.RunDir + "/net.sig") + r.Exec("killall", "-HUP", "dnsmasq") +} diff --git a/backend/apply/apply_test.go b/backend/apply/apply_test.go new file mode 100644 index 0000000..228ae95 --- /dev/null +++ b/backend/apply/apply_test.go @@ -0,0 +1,243 @@ +package apply + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The network signature is ucode's own text: its agent applies again when the two differ (testdata/sig.uc). +func TestNetSignatureAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/sig.json") + if err != nil { + t.Fatal(err) + } + var g struct { + Sigs []string `json:"sigs"` + } + if err := json.Unmarshal(raw, &g); err != nil || len(g.Sigs) != 3 { + t.Fatal("the golden is not as expected") + } + raw, err = os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + fw, _ := uci.Parse(router.Firewall) + dir := t.TempDir() + r := &Router{RunDir: dir, Snapshot: func() *netview.Snapshot { + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + }} + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + for i, want := range g.Sigs { + switch i { + case 1: + c.SetList("home", "lan_device", []string{"dlhome", "nope0", "lanp1"}) + c.Set("cabin", "auto_lan", "1") + c.Set("open", "auto_wan", "0") + c.Set("open", "wan_device", "wg9") + case 2: + c.Set("open", "wan_device", "gone7") + c.SetList("open", "lan_device", []string{"gone8"}) + c.Set("cabin", "lan_zone", "lan") + } + m := model.Load(c, nil) + if got := r.NetSignature(m); got != want { + t.Errorf("signature %d:\n%s\n--- ucode:\n%s", i, got, want) + } + if i == 0 { + if !r.NetChanged(m) { + t.Error("no signature kept, and nothing is due") + } + os.WriteFile(dir+"/net.sig", []byte(want), 0o644) + if r.NetChanged(m) { + t.Error("an apply is due with the networks as they were") + } + } else if !r.NetChanged(m) { + t.Error("the networks changed, and no apply is due") + } + } +} + +// A plan of the full apply changes nothing: after a real apply of the same settings it finds nothing to +// do, and after a change it names the lines and the commands, with the router's own files as they were. +func TestApplyPlanChangesNothing(t *testing.T) { + raw, _ := os.ReadFile("../netview/testdata/trace.json") + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + dir := t.TempDir() + network, _ := os.ReadFile("testdata/network.uci") + os.WriteFile(dir+"/network", network, 0o644) + os.WriteFile(dir+"/firewall", []byte(router.Firewall), 0o644) + var ran []string + r := &Router{RunDir: dir + "/run", VarEtc: dir + "/etc", ResolverPid: dir + "/pid", SysNet: dir + "/sys", NetnsDir: dir + "/netns", Leases: dir + "/leases", + Network: dir + "/network", Firewall: dir + "/firewall", HostsFile: dir + "/hosts", + Exec: func(name string, args ...string) (string, int) { + line := name + " " + strings.Join(args, " ") + if !asks(name, args) { + ran = append(ran, line) + } + if strings.HasPrefix(line, "nft list") { + return "", 1 + } + return "", 0 + }} + r.Snapshot = func() *netview.Snapshot { + text, _ := os.ReadFile(dir + "/firewall") + fw, _ := uci.Parse(string(text)) + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + // nobody like a home device here: that path has its own test, with a router to answer it + for _, id := range []string{"home", "cabin", "open"} { + c.Set(id, "lan_like", "0") + } + load := func() *model.Model { + var blocked map[string]any + if raw, err := os.ReadFile(dir + "/run/netifd-blocked.json"); err == nil { + json.Unmarshal(raw, &blocked) + } + return model.Load(c, blocked) + } + caps := awg.Caps{V2: true, V3: true} + m := load() + r.Netifd(m, true, caps) + r.Fw(m) + r.LoopEnsure(m, "", true) + r.SyncResolver(m) + r.ReplyRoutes(m) + os.WriteFile(dir+"/run/net.sig", []byte(r.NetSignature(m)), 0o644) + keep := func() string { + out := "" + for _, f := range []string{"/network", "/firewall", "/run/netifd-blocked.json", "/run/loop.json", "/run/iface-intent.json", "/etc/dawnline-dns.conf", "/run/net.sig"} { + raw, _ := os.ReadFile(dir + f) + out += f + "\n" + string(raw) + "\n" + } + return out + } + before := keep() + ran = nil + plan := r.ApplyPlan(load(), "", true, caps) + js, _ := json.Marshal(plan) + if plan["network"] != false || plan["firewall"] != false || plan["resolver"] != false || plan["signature"] != true || + len(plan["would_run"].([]string)) != 0 || len(plan["network_lines"].([]string)) != 0 || plan["like_home"] != "off" { + t.Errorf("something to do right after an apply: %s", js) + } + // a port moved: the plan says so, and the router is as it was + c.Set("home", "port", "4999") + plan = r.ApplyPlan(load(), "", true, caps) + js, _ = json.Marshal(plan) + if plan["network"] != true || plan["firewall"] != true { + t.Errorf("a moved port changes nothing: %s", js) + } + lines := strings.Join(plan["network_lines"].([]string), "\n") + "\n" + strings.Join(plan["firewall_lines"].([]string), "\n") + if !strings.Contains(lines, "- \toption listen_port '4500'") || !strings.Contains(lines, "+ \toption listen_port '4999'") || !strings.Contains(lines, "+ \toption dest_port '4999'") { + t.Errorf("the lines of the change:\n%s", lines) + } + would := strings.Join(plan["would_run"].([]string), "; ") + if !strings.Contains(would, "ubus call network reload") || !strings.Contains(would, "ifup dawn0") || !strings.Contains(would, "fw4 -q reload") { + t.Errorf("the commands of the change: %s", would) + } + if strings.Contains(string(js), "aaaaaaaa") { + t.Error("a key in the plan") + } + if keep() != before || len(ran) != 0 { + t.Errorf("the plan changed the router: ran %v", ran) + } +} + +// A teardown leaves the router's network and firewall as they were before Dawnline: what is ours goes, +// what is not stays, an interface of someone else's under a tunnel's name too. +func TestTeardown(t *testing.T) { + raw, _ := os.ReadFile("../netview/testdata/trace.json") + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + dir := t.TempDir() + network, _ := os.ReadFile("testdata/network.uci") + os.WriteFile(dir+"/network", network, 0o644) + os.WriteFile(dir+"/firewall", []byte(router.Firewall), 0o644) + os.WriteFile(dir+"/hosts", []byte("10.77.0.2 phone.anna.vpn\n"), 0o644) + var ran []string + r := &Router{RunDir: dir + "/run", VarEtc: dir + "/etc", SysNet: dir + "/sys", NetnsDir: dir + "/netns", Leases: dir + "/leases", + Network: dir + "/network", Firewall: dir + "/firewall", HostsFile: dir + "/hosts", + Exec: func(name string, args ...string) (string, int) { + if !asks(name, args) { + ran = append(ran, name+" "+strings.Join(args, " ")) + } + return "", 0 + }} + r.Snapshot = func() *netview.Snapshot { + text, _ := os.ReadFile(dir + "/firewall") + fw, _ := uci.Parse(string(text)) + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + m := model.Load(c, nil) + r.Netifd(m, true, awg.Caps{V2: true, V3: true}) + r.Fw(m) + os.WriteFile(dir+"/run/net.sig", []byte("x"), 0o644) + if now, _ := os.ReadFile(dir + "/firewall"); !strings.Contains(string(now), "dawnline_home_zone") { + t.Fatal("nothing was set up to take down") + } + ran = nil + r.Teardown(model.Load(c, nil)) + as := func(text []byte) string { c, _ := uci.Parse(string(text)); return c.Format() } + if now, _ := os.ReadFile(dir + "/network"); string(now) != as(network) { + t.Errorf("the network configuration after:\n%s", now) + } + if now, _ := os.ReadFile(dir + "/firewall"); string(now) != as([]byte(router.Firewall)) { + t.Errorf("the firewall after:\n%s", now) + } + for _, f := range []string{"/hosts", "/run/net.sig"} { + if _, err := os.Stat(dir + f); err == nil { + t.Errorf("%s stays", f) + } + } + did := strings.Join(ran, "; ") + for _, want := range []string{"ifdown dawn0", "ifdown dawn1", "ubus call network reload", "fw4 -q reload", "nft delete table inet dawnline", "killall -HUP dnsmasq"} { + if !strings.Contains(did, want) { + t.Errorf("%s was not run: %s", want, did) + } + } + if strings.Contains(did, "ifdown dawn2") || strings.Contains(did, "ifup") { + t.Errorf("more than ours was touched: %s", did) + } +} diff --git a/backend/apply/dry.go b/backend/apply/dry.go new file mode 100644 index 0000000..51e0d39 --- /dev/null +++ b/backend/apply/dry.go @@ -0,0 +1,139 @@ +package apply + +import ( + "os" + "regexp" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// A full apply with nothing applied: every step runs on copies of the files it would write, the commands +// that only ask the router something are run, and the ones that would change it are noted instead. For +// holding Go's apply to what a router runs now: after the ucode backend applied, it must find nothing to do. + +var ( + asksOnly = regexp.MustCompile(`^ip (-n dawnline )?(-j |-4 |-6 )*(neigh|link|rule|route|addr) show\b[^;|&]*( 2>/dev/null)?$`) + secret = regexp.MustCompile(`((private|preshared|protection)_?key) '[^']*'`) +) + +func asks(name string, args []string) bool { + line := strings.Join(args, " ") + switch name { + case "sh": + return len(args) == 2 && args[0] == "-c" && asksOnly.MatchString(args[1]) + case "ip": + return asksOnly.MatchString("ip " + line) + case "nft": + return len(args) > 0 && args[0] == "list" + case "ubus": + return len(args) == 3 && args[0] == "call" && strings.HasPrefix(args[1], "network.interface.") && args[2] == "status" + } + return false +} + +// changes is the lines two texts differ in ("-" gone, "+" new), keys never shown. +func changes(was, now string) []string { + out := []string{} + if was == now { + return out + } + count := map[string]int{} + for _, l := range strings.Split(was, "\n") { + count[l]++ + } + var added []string + for _, l := range strings.Split(now, "\n") { + if count[l] > 0 { + count[l]-- + } else { + added = append(added, l) + } + } + for _, l := range strings.Split(was, "\n") { + if count[l] > 0 { + count[l]-- + out = append(out, "- "+secret.ReplaceAllString(l, "$1 '***'")) + } + } + for _, l := range added { + out = append(out, "+ "+secret.ReplaceAllString(l, "$1 '***'")) + } + return out +} + +// ApplyPlan is what a full apply would do now, with nothing done: which files would change (their lines), +// which commands would be run, what the home-like path would come to. The runtime sync is Plan's. +func (r *Router) ApplyPlan(m *model.Model, saved string, tools bool, caps awg.Caps) map[string]any { + dir, err := os.MkdirTemp("", "dawnline-plan-") + if err != nil { + return map[string]any{"error": err.Error()} + } + defer os.RemoveAll(dir) + read := func(path string) string { + raw, _ := os.ReadFile(path) + return string(raw) + } + etc := r.varEtc() + os.MkdirAll(dir+"/run", 0o755) + os.MkdirAll(dir+"/etc", 0o755) + for _, f := range []string{"netifd-blocked.json", "netifd-no-awg", "iface-intent.json", "loop.json", "reply.nft", "net.sig"} { + if raw, err := os.ReadFile(r.RunDir + "/" + f); err == nil { + os.WriteFile(dir+"/run/"+f, raw, 0o600) + } + } + for _, f := range []string{"dawnline-dns.conf", "dawnline-dns.resolv", "dawnline-ns.nft"} { + if raw, err := os.ReadFile(etc + "/" + f); err == nil { + os.WriteFile(dir+"/etc/"+f, raw, 0o600) + } + } + os.WriteFile(dir+"/network", []byte(read(r.Network)), 0o600) + os.WriteFile(dir+"/firewall", []byte(read(r.Firewall)), 0o600) + would := []string{} + d := *r + d.RunDir, d.VarEtc, d.Network, d.Firewall, d.Log, d.Remember, d.dry = dir+"/run", dir+"/etc", dir+"/network", dir+"/firewall", nil, nil, true + d.ResolverPid = r.resolverPid() + d.Exec = func(name string, args ...string) (string, int) { + if asks(name, args) { + return r.Exec(name, args...) + } + line := name + " " + strings.Join(args, " ") + if name == "sh" && len(args) == 2 { + line = args[1] + } + would = append(would, strings.ReplaceAll(line, dir+"/etc", etc)) + return "", 0 + } + out := map[string]any{} + out["network"] = d.Netifd(m, tools, caps) + out["network_lines"] = changes(read(r.Network), read(dir+"/network")) + out["firewall"] = d.Fw(m) + out["firewall_lines"] = changes(read(r.Firewall), read(dir+"/firewall")) + at := len(would) + lp := d.LoopEnsure(m, saved, false) + switch { + case lp.Off: + out["like_home"] = "off" + case lp.Error != nil: + out["like_home"] = lp.Error + default: + out["like_home"] = lp.Plan + } + out["like_home_runs"] = append([]string{}, would[at:]...) + out["like_home_state"] = changes(read(r.RunDir+"/loop.json"), read(dir+"/run/loop.json")) + out["resolver"] = d.SyncResolver(m) + out["resolver_lines"] = append(changes(read(etc+"/dawnline-dns.conf"), read(dir+"/etc/dawnline-dns.conf")), + changes(read(etc+"/dawnline-dns.resolv"), read(dir+"/etc/dawnline-dns.resolv"))...) + at = len(would) + d.ReplyRoutes(m) + out["reply_runs"] = append([]string{}, would[at:]...) + out["reply_lines"] = changes(read(r.RunDir+"/reply.nft"), read(dir+"/run/reply.nft")) + sig := r.NetSignature(m) + out["signature"] = sig == read(r.RunDir+"/net.sig") + if sig != read(r.RunDir+"/net.sig") { + out["signature_now"], out["signature_kept"] = sig, read(r.RunDir+"/net.sig") + } + out["would_run"] = would + return out +} diff --git a/backend/apply/fw.go b/backend/apply/fw.go new file mode 100644 index 0000000..2394845 --- /dev/null +++ b/backend/apply/fw.go @@ -0,0 +1,250 @@ +package apply + +import ( + "fmt" + "os" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// fw4 around the tunnels (dawnline.fw): each tunnel's zone, its forwardings to home and WAN, the WAN rules +// for the tunnels and the portal. Only sections named dawnline_* are ever changed. + +const loopZone = "dl_loop" + +var notWord = regexp.MustCompile(`[^A-Za-z0-9_]`) + +// portalPortOK: never SSH, DNS or the LuCI web server's ports for the portal, whatever the settings say. +func portalPortOK(p int) bool { + return p >= 1 && p <= 65535 && p != 22 && p != 53 && p != 80 && p != 443 +} + +// portalHTTP tells whether the portal also answers plain HTTP: IP addresses have no certificate. +func portalHTTP(m *model.Model) bool { + for _, h := range view.PortalHosts(m) { + if _, is := ipnet.IP(h); is { + return true + } + } + return false +} + +// firewall brings a firewall configuration in line with the servers and the portal; whether it changed, +// and what changed section by section (level, line) for the log. +func (r *Router) firewall(c *uci.Config, m *model.Model) (changed bool, notes [][2]string) { + want := map[string]bool{} + sec := func(name, kind string, opts ...opt) { + want[name] = true + created := false + if s := c.Section(name); s == nil || s.Type != kind { + c.DeleteSection(name) + c.Add(kind, name) + created = true + } + var diff []opt + for _, o := range opts { + if put(c, name, o) { + diff = append(diff, o) + } + } + switch { + case created: + changed = true + notes = append(notes, [2]string{"info", fmt.Sprintf("%s %s: created · %s", kind, name, optsText(opts))}) + case len(diff) > 0: + changed = true + notes = append(notes, [2]string{"info", fmt.Sprintf("%s %s: updated · %s", kind, name, optsText(diff))}) + default: + notes = append(notes, [2]string{"debug", fmt.Sprintf("%s %s: unchanged", kind, name)}) + } + } + snap := r.Snapshot() + portalZone := "" + wantLoop, anyLoop := false, false + // Where tunnel DNS is sent (dawnline.nft): into the netns for home names while any server runs "like a + // home device", and to the LAN's DNS for everyone else. A server that does not forward to those zones on + // its own gets a rule for port 53 alone. + for _, srv := range m.Servers { + anyLoop = anyLoop || (srv.LanLike && tunnelOK(srv)) + } + _, _, known, _ := r.likeHome() + lanDNS := r.lanDNS(snap, known) + lanDNSZone := "" + if ip, ok := ipnet.IP(lanDNS); ok { + for _, name := range snap.Names() { + d := snap.Devices[name] + if d.Zone == "" || lanDNSZone != "" { + continue + } + for _, n := range d.Nets { + if c, ok := ipnet.Any(n); ok && c.Holds(ip) { + lanDNSZone = d.Zone + break + } + } + } + } + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + if !tunnelOK(srv) { + continue + } + z := "dawnline_" + id + wan, _, _, zones := snap.ServerNet(srv) + if portalZone == "" { + portalZone = wan.Zone + } + if !srv.LanLike && anyLoop { + sec(z+"_loopdns", "rule", opt{key: "name", val: "Dawnline-" + srv.Ifname + "-names"}, opt{key: "src", val: srv.Ifname}, opt{key: "dest", val: loopZone}, + opt{key: "proto", val: "tcp udp"}, opt{key: "dest_port", val: "53"}, opt{key: "target", val: "ACCEPT"}) + } + reaches := false + for _, zone := range zones { + reaches = reaches || zone == lanDNSZone + } + if lanDNSZone != "" && lanDNSZone != srv.Ifname && !reaches { + sec(z+"_landns", "rule", opt{key: "name", val: "Dawnline-" + srv.Ifname + "-dns"}, opt{key: "src", val: srv.Ifname}, opt{key: "dest", val: lanDNSZone}, + opt{key: "dest_ip", val: lanDNS}, opt{key: "proto", val: "tcp udp"}, opt{key: "dest_port", val: "53"}, opt{key: "target", val: "ACCEPT"}) + } + // forward within the zone (device to device) is decided by the inet dawnline table + sec(z+"_zone", "zone", opt{key: "name", val: srv.Ifname}, opt{key: "network", list: []string{srv.Ifname}}, + opt{key: "input", val: "ACCEPT"}, opt{key: "output", val: "ACCEPT"}, opt{key: "forward", val: "ACCEPT"}) + // Access per person is enforced by the inet dawnline table; the zone only needs to be allowed to reach + // each home-network zone and WAN. The home network may open connections to the devices too (a router + // or a NAS on the tunnel); their answers pass the table as established. + for i, zone := range zones { + if zone == wan.Zone || zone == srv.Ifname { + continue + } + sfx := "" + if i > 0 { + sfx = "_" + notWord.ReplaceAllString(zone, "_") + } + sec(z+"_lan"+sfx, "forwarding", opt{key: "src", val: srv.Ifname}, opt{key: "dest", val: zone}) + sec(z+"_from_lan"+sfx, "forwarding", opt{key: "src", val: zone}, opt{key: "dest", val: srv.Ifname}) + } + sec(z+"_wan", "forwarding", opt{key: "src", val: srv.Ifname}, opt{key: "dest", val: wan.Zone}) + if srv.LanLike { + sec(z+"_loop", "forwarding", opt{key: "src", val: srv.Ifname}, opt{key: "dest", val: loopZone}) + wantLoop = true + } + off := opt{key: "enabled"} + if !srv.Enabled { + off.val = "0" + } + sec(z+"_port", "rule", opt{key: "name", val: "Dawnline-" + srv.Ifname}, opt{key: "src", val: wan.Zone}, opt{key: "proto", val: "udp"}, + opt{key: "dest_port", val: strconv.Itoa(srv.Port)}, opt{key: "target", val: "ACCEPT"}, off) + } + outside := portalZone + if outside == "" { + outside = "wan" + } + // the link into the netns that re-enters the router from the LAN + if wantLoop { + sec("dawnline_loop", "zone", opt{key: "name", val: loopZone}, opt{key: "device", list: []string{"dlx0"}}, + opt{key: "input", val: "REJECT"}, opt{key: "output", val: "ACCEPT"}, opt{key: "forward", val: "REJECT"}) + // the Home-only resolver in the netns reaches its upstream DNS this way + sec("dawnline_loop_wan", "forwarding", opt{key: "src", val: loopZone}, opt{key: "dest", val: outside}) + } + if s := m.Settings; s.PortalEnabled && portalPortOK(s.PortalPort) { + sec("dawnline_portal", "rule", opt{key: "name", val: "Dawnline-Portal"}, opt{key: "src", val: outside}, opt{key: "proto", val: "tcp"}, + opt{key: "dest_port", val: strconv.Itoa(s.PortalPort)}, opt{key: "target", val: "ACCEPT"}) + // IP addresses in links: plain HTTP next to the HTTPS port (80 and 443 stay with the LuCI web server) + if portalHTTP(m) && portalPortOK(s.PortalPort+1) { + sec("dawnline_portal_http", "rule", opt{key: "name", val: "Dawnline-Portal-HTTP"}, opt{key: "src", val: outside}, opt{key: "proto", val: "tcp"}, + opt{key: "dest_port", val: strconv.Itoa(s.PortalPort + 1)}, opt{key: "target", val: "ACCEPT"}) + } + } + var stale [][2]string + for _, s := range c.Sections { + if strings.HasPrefix(s.Name, "dawnline_") && !want[s.Name] { + stale = append(stale, [2]string{s.Name, s.Type}) + } + } + for _, s := range stale { + notes = append(notes, [2]string{"info", fmt.Sprintf("%s %s: removed", s[1], s[0])}) + c.DeleteSection(s[0]) + changed = true + } + return changed, notes +} + +func (r *Router) firewallConfig() (*uci.Config, bool) { + text, _ := os.ReadFile(r.Firewall) + c, err := uci.Parse(string(text)) + if err != nil { + r.say("error", "firewall", r.Firewall+" does not parse: nothing was changed · "+err.Error()) + return nil, false + } + return c, true +} + +// FirewallDiffers tells whether the firewall configuration differs from what Dawnline wants; nothing is +// written (the watchdog's question). +func (r *Router) FirewallDiffers(m *model.Model) bool { + c, ok := r.firewallConfig() + if !ok { + return false + } + changed, _ := r.firewall(c, m) + return changed +} + +// Fw brings fw4's configuration in line with the servers and the portal, and reloads fw4 when it +// changed; true when it did. +func (r *Router) Fw(m *model.Model) bool { + c, ok := r.firewallConfig() + if !ok { + return false + } + changed, notes := r.firewall(c, m) + for _, n := range notes { + r.say(n[0], "firewall", n[1]) + } + if !changed { + return false + } + if err := commit(r.Firewall, c); err != nil { + r.say("error", "firewall", r.Firewall+" could not be written · "+err.Error()) + return false + } + r.ack("firewall") + r.say("info", "firewall", "fw4 -q reload") + r.Exec("fw4", "-q", "reload") + return true +} + +// FirewallDrift is what is wrong with Dawnline's firewall, for the watchdog (dawnline.fw drift): "" when +// nothing is; "off": fw4 is not running at all (not ours to start); "changed": the configuration lost or +// changed Dawnline's sections; "not loaded": fw4 runs without them. +func (r *Router) FirewallDrift(m *model.Model) string { + table, code := r.Exec("nft", "-t", "list", "table", "inet", "fw4") + if code != 0 || strings.Trim(table, " \t\r\n\v\f") == "" { + return "off" + } + if r.FirewallDiffers(m) { + return "changed" + } + // named rules show up in fw4's ruleset as comments + var names []string + for _, id := range m.ServerIDs() { + if srv := m.Servers[id]; srv.Enabled && tunnelOK(srv) { + names = append(names, "Dawnline-"+srv.Ifname) + } + } + if m.Settings.PortalEnabled { + names = append(names, "Dawnline-Portal") + } + for _, n := range names { + if !strings.Contains(table, n+`"`) { + return "not loaded" + } + } + return "" +} diff --git a/backend/apply/fw_test.go b/backend/apply/fw_test.go new file mode 100644 index 0000000..c079c47 --- /dev/null +++ b/backend/apply/fw_test.go @@ -0,0 +1,146 @@ +package apply + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The router's firewall configuration through a row of changes to access's household: after each, the file +// ucode's firewall sync leaves, whether it changed and what it ran (testdata/fw.uc). +func TestFirewallAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/fw.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + Steps []struct { + What string `json:"what"` + Dry bool `json:"dry"` + Changed bool `json:"changed"` + Before string `json:"before"` + Firewall string `json:"firewall"` + Cmds []string `json:"cmds"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Steps) != 11 { + t.Fatalf("%d steps", len(trace.Steps)) + } + // the router the golden ran on: what its container said of itself (netview's golden, the same run) + raw, err = os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + dir := t.TempDir() + os.WriteFile(dir+"/firewall", []byte(trace.Steps[0].Before), 0o644) + var cmds []string + r := &Router{RunDir: dir + "/run", Firewall: dir + "/firewall", Exec: func(name string, args ...string) (string, int) { + cmds = append(cmds, strings.Join(append([]string{name}, args...), " ")) + return "", 0 + }} + // as ucode's: the zones are read anew from the firewall as it stands + r.Snapshot = func() *netview.Snapshot { + text, _ := os.ReadFile(dir + "/firewall") + fw, _ := uci.Parse(string(text)) + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + for i, want := range trace.Steps { + switch i { + case 2: + c.Set("home", "port", "4501") + c.Set("cabin", "enabled", "0") + c.SetList("home", "lan_device", []string{"dlhome", "dlguest"}) + case 3: + c.SetList("open", "lan_device", []string{"dlguest"}) + case 4: + c.Set("settings", "portal_port", "443") + case 5: + c.Set("settings", "portal_port", "8443") + c.Delete("settings", "portal_alt") + case 6: + c.Set("home", "port", "4502") + case 7: + c.DeleteSection("cabin") + c.Set("home", "lan_like", "1") + case 8: + c.Set("home", "lan_like", "0") + c.Set("open", "lan_like", "0") + case 9: + text, _ := os.ReadFile(dir + "/firewall") + fw, _ := uci.Parse(string(text)) + fw.DeleteSection("dawnline_home_zone") + fw.Add("rule", "dawnline_home_zone") + fw.Set("dawnline_home_zone", "name", "Not a zone") + fw.Add("forwarding", "dawnline_old_wan") + fw.Set("dawnline_old_wan", "src", "dawn9") + os.WriteFile(dir+"/firewall", []byte(fw.Format()), 0o644) + c.Set("settings", "portal_enabled", "0") + } + fail := func(what string, got, exp any) { + t.Errorf("step %d (%s): %s\n go: %v\n ucode: %v", i, want.What, what, got, exp) + } + if got, _ := os.ReadFile(dir + "/firewall"); string(got) != want.Before { + fail("the firewall the step starts from", string(got), want.Before) + } + cmds = nil + m := model.Load(c, nil) + var changed bool + if want.Dry { + changed = r.FirewallDiffers(m) + } else { + changed = r.Fw(m) + } + if changed != want.Changed { + fail("whether it changed", changed, want.Changed) + } + if got, _ := os.ReadFile(dir + "/firewall"); string(got) != want.Firewall { + g, w := strings.Split(string(got), "\n"), strings.Split(want.Firewall, "\n") + for n := 0; n < len(g) || n < len(w); n++ { + if n >= len(g) || n >= len(w) || g[n] != w[n] { + a, b := "(the end)", "(the end)" + if n < len(g) { + a = g[n] + } + if n < len(w) { + b = w[n] + } + fail("the firewall configuration, from a line on", a, b) + break + } + } + os.WriteFile(dir+"/firewall", []byte(want.Firewall), 0o644) + } + // the snapshot's own question to netifd is not the sync's + var ran []string + for _, l := range want.Cmds { + if l != "ubus call network.interface dump" { + ran = append(ran, l) + } + } + if strings.Join(cmds, "; ") != strings.Join(ran, "; ") { + fail("what was run", cmds, ran) + } + } +} diff --git a/backend/apply/keep.go b/backend/apply/keep.go new file mode 100644 index 0000000..96c93e3 --- /dev/null +++ b/backend/apply/keep.go @@ -0,0 +1,201 @@ +package apply + +import ( + "fmt" + "os" + "syscall" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// The keeper is what holds the router to the settings between the admin's changes (the ucode agent's +// steps "Access rules", "Internet like a home device" and "Router"): once a minute it pushes devices and +// access sets when something moved, keeps the home-like path and the resolver in step, and applies +// everything again when the router's networks changed under it. + +// resyncEvery is how long at most between two runtime syncs, whatever happened. +const resyncEvery = 600 + +// Keeper keeps one router. The zero value of what it remembers is "nothing seen yet". +type Keeper struct { + R *Router + // Load reads the settings anew, with the LAN address kept for the home-like path. + Load func() (*model.Model, string, error) + // Usage is the counters as the watcher has them; Dump what the tunnels hold right now. + Usage func() *usage.Usage + Dump func() (peers map[string]awg.Peer, reads map[string]string) + // Config is the settings' file: a change by anyone (a method, the CLI, a restore) is seen by its + // inode and time. + Config string + Tools func() bool + Caps func() awg.Caps + // Words is the catalog the log's sentences are written in (English). + Words *i18n.Catalog + + states map[string]string + lastSync int64 + peers map[string]string + conf string + seenConf bool + baseNet string + pending string + failed map[string]string +} + +func (k *Keeper) step(who string, fn func()) { + defer func() { + if e := recover(); e != nil { + msg := fmt.Sprint(e) + if k.failed == nil { + k.failed = map[string]string{} + } + // a new failure in the service log, a repeat in syslog alone + if k.failed[who] != msg && k.R.Log != nil { + k.R.Log.Write("dawnline", "error", "failed: "+msg, "", who, servicelog.Extra{}) + } else { + k.R.say("error", "keeper", who+": "+msg) + } + k.failed[who] = msg + return + } + delete(k.failed, who) + }() + fn() +} + +func fileSig(path string) string { + st, err := os.Stat(path) + if err != nil { + return "" + } + ino := uint64(0) + if sys, is := st.Sys().(*syscall.Stat_t); is { + ino = uint64(sys.Ino) + } + return fmt.Sprintf("%d/%d", st.ModTime().UnixNano(), ino) +} + +func sameStates(a, b map[string]string) bool { + if len(a) != len(b) { + return false + } + for k, v := range a { + if w, has := b[k]; !has || w != v { + return false + } + } + return true +} + +// runtime pushes devices and access sets when people's states changed, the settings' file was written, +// the access table is gone (a flushed ruleset: the firewall alone would let every device reach +// everything, so the sync unloads them until it is back), a running tunnel holds other devices than it +// should, or every ten minutes anyway. +func (k *Keeper) runtime(m *model.Model, u *usage.Usage, now int64) { + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = state.Of(m, m.People[id], u, now) + } + // A running tunnel without all of its devices, or with ones it should not have: now, not up to ten + // minutes later. Only where the last sync took: a server that refuses its devices has said so. + if k.Dump != nil { + peers, reads := k.Dump() + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + last := k.peers[id] + if reads[srv.Ifname] != awg.Read || (last != "" && last != "ok" && last != "down") { + continue + } + if d := health.PeerDiff(health.TunnelDevices(m, id, states), peers, srv.Ifname); d.Missing > 0 || d.Extra > 0 { + k.lastSync = 0 + } + } + } + conf := fileSig(k.Config) + changed := k.states == nil || !sameStates(states, k.states) || (k.seenConf && conf != k.conf) + if changed || now-k.lastSync > resyncEvery || (len(m.Servers) > 0 && !k.R.Present()) { + k.peers = k.R.Sync(m, u, now, false, k.Words).Peers + k.lastSync = now + } + k.conf, k.seenConf, k.states = conf, true, states +} + +// KeepLoop keeps the home-like path and the resolver in step. Cheap when nothing changed; the access +// table is rebuilt when the netns address appears, moves or goes away (the guard allows DNS to it). +func (r *Router) KeepLoop(m *model.Model, saved string, u *usage.Usage, now int64, t *i18n.Catalog) Loop { + unlock := files.Lock(r.RunDir, "apply") + where := func() string { + active, address, _, _ := r.likeHome() + if !active { + address = "" + } + return address + " " + r.ResolverTarget().Mode + } + before := where() + lp := r.LoopEnsure(m, saved, false) + r.SyncResolver(m) + r.ReplyRoutes(m) + if where() != before { + r.sync(m, u, now, true, t) + } + unlock() + if lp.Plan != nil && lp.Plan.Address != "" && lp.Plan.Address != saved && r.Remember != nil { + r.Remember(lp.Plan.Address) + } + return lp +} + +// network applies everything again when the router's networks changed under us. Only a change seen on two +// ticks in a row (a bridge recreated or an interface restarting passes), against what the last apply used. +func (k *Keeper) network(m *model.Model, u *usage.Usage) { + sig := k.R.NetSignature(m) + applied := k.baseNet + if raw, err := os.ReadFile(k.R.RunDir + "/net.sig"); err == nil { + applied = string(raw) + } + if applied == "" || sig == applied { + if k.baseNet == "" { + k.baseNet = sig + } + k.pending = "" + return + } + if k.pending != sig { + k.pending = sig + return + } + k.pending = "" + if k.R.Log != nil { + k.R.Log.Write("dawnline", "info", "network changed - Dawnline set itself up again", "", "Router", servicelog.Extra{}) + } + k.R.Apply(k.Load, u, k.Words, k.Tools(), k.Caps()) + k.baseNet = sig + if raw, err := os.ReadFile(k.R.RunDir + "/net.sig"); err == nil { + k.baseNet = string(raw) + } +} + +// Tick is one minute's keeping. Each step on its own: a failing one is logged and the others still run. +func (k *Keeper) Tick() { + m, saved, err := k.Load() + if err != nil { + k.R.say("error", "keeper", "the settings could not be read · "+err.Error()) + return + } + u := k.Usage() + if u == nil { + return + } + now := time.Now().Unix() + k.step("Access rules", func() { k.runtime(m, u, now) }) + k.step("Internet like a home device", func() { k.R.KeepLoop(m, saved, u, now, k.Words) }) + k.step("Router", func() { k.network(m, u) }) +} diff --git a/backend/apply/keep_test.go b/backend/apply/keep_test.go new file mode 100644 index 0000000..384e31f --- /dev/null +++ b/backend/apply/keep_test.go @@ -0,0 +1,139 @@ +package apply + +import ( + "encoding/json" + "os" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// The keeper syncs when something moved and not otherwise: the first time, when the settings' file was +// written, when the access table is gone; and it applies everything again only when the router's networks +// stay changed for two ticks. +func TestKeeper(t *testing.T) { + raw, _ := os.ReadFile("../netview/testdata/trace.json") + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + dir := t.TempDir() + network, _ := os.ReadFile("testdata/network.uci") + os.WriteFile(dir+"/network", network, 0o644) + os.WriteFile(dir+"/firewall", []byte(router.Firewall), 0o644) + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + for _, id := range []string{"home", "cabin", "open"} { + c.Set(id, "lan_like", "0") + } + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + present := false + loads, reloads := 0, 0 + addrs := router.Addrs + r := &Router{RunDir: dir + "/run", VarEtc: dir + "/etc", SysNet: dir + "/sys", NetnsDir: dir + "/netns", Leases: dir + "/leases", + Network: dir + "/network", Firewall: dir + "/firewall", HostsFile: dir + "/hosts", + Exec: func(name string, args ...string) (string, int) { + line := name + " " + strings.Join(args, " ") + switch { + case line == "nft list table inet dawnline": + if present { + return "", 0 + } + return "", 1 + case strings.HasPrefix(line, "nft list"): + return "", 1 + case name == "nft" && args[0] == "-f": + script, _ := os.ReadFile(args[1]) + if strings.HasPrefix(string(script), "flush set") && !present { + return "Error: No such file or directory", 1 + } + loads++ + present = true + case line == "fw4 -q reload": + reloads++ + case name == "awg" && args[0] == "show": + return "", 1 + } + return "", 0 + }} + r.Snapshot = func() *netview.Snapshot { + text, _ := os.ReadFile(dir + "/firewall") + fw, _ := uci.Parse(string(text)) + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + } + u := &usage.Usage{} + k := &Keeper{R: r, Config: dir + "/dawnline", Words: i18n.Use("", ""), Usage: func() *usage.Usage { return u }, + Tools: func() bool { return true }, Caps: func() awg.Caps { return awg.Caps{V2: true, V3: true} }, + Load: func() (*model.Model, string, error) { + text, _ := os.ReadFile(dir + "/dawnline") + c, err := uci.Parse(string(text)) + if err != nil { + return nil, "", err + } + return model.Load(c, nil), "", nil + }} + tick := func(what string, want int) { + t.Helper() + before := loads + k.Tick() + if loads-before != want { + t.Errorf("%s: the table was loaded %d times, not %d", what, loads-before, want) + } + } + tick("the first tick", 1) + tick("nothing moved", 0) + // the settings written by anyone: seen by the file itself + time.Sleep(5 * time.Millisecond) + os.WriteFile(dir+"/dawnline.new", []byte(c.Format()), 0o600) + os.Rename(dir+"/dawnline.new", dir+"/dawnline") + tick("the settings' file replaced", 1) + tick("and nothing since", 0) + // a flushed ruleset: the table is put back on the next tick + present = false + tick("the access table gone", 1) + if reloads != 0 { + t.Errorf("the firewall was reloaded %d times with the networks as they were", reloads) + } + // The router's networks: nothing kept of an apply yet, so the first look is the base. A change that + // passes within a tick sets nothing up again; one that stays does, once. + other := json.RawMessage(strings.ReplaceAll(string(router.Addrs), "192.168.77.1", "192.168.78.1")) + if string(other) == string(router.Addrs) { + t.Fatal("the router's addresses are not what this test changes") + } + addrs = other + k.Tick() + addrs = router.Addrs + k.Tick() + if _, err := os.Stat(dir + "/run/net.sig"); err == nil { + t.Error("a change that passed set everything up again") + } + addrs = other + k.Tick() + k.Tick() + sig, err := os.ReadFile(dir + "/run/net.sig") + if err != nil || !strings.Contains(string(sig), "192.168.78.1") { + t.Errorf("a change that stayed did not set everything up again: %s", sig) + } + if now, _ := os.ReadFile(dir + "/firewall"); !strings.Contains(string(now), "dawnline_home_zone") { + t.Error("the apply after the change left no firewall of ours") + } + before := reloads + k.Tick() + k.Tick() + if reloads != before { + t.Error("applied again with the networks as the last apply saw them") + } +} diff --git a/backend/apply/loop.go b/backend/apply/loop.go new file mode 100644 index 0000000..82595ea --- /dev/null +++ b/backend/apply/loop.go @@ -0,0 +1,807 @@ +package apply + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "reflect" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// "Like a home device" (dawnline.loop): tunnel clients' internet traffic enters the router from the LAN, +// so whatever handles LAN traffic there (proxies, DPI bypass, DNS filters, fw4's lan zone) handles it too. +// +// dawn0 ──policy route──▶ dlx0 ═veth═ dlx1 ┐ netns "dawnline" ┌ dll1 ═veth═ dll0 ── br-lan +// └── NAT to a LAN address ┘ +// +// The netns is one more device on the LAN bridge with its own address (picked from the LAN's network above +// the DHCP pool) and its own MAC (hashed from the bridge's), the same each time it is made. Everything is +// derived from the router at run time. If the LAN is not a bridge or setup fails, the direct path stays and +// loop.json says why, as a code with its values. + +const ( + loopNS = "dawnline" + txRoot, txNS, lanRoot, lanNS = "dlx0", "dlx1", "dll0", "dll1" + prefLoopDNS, prefMain, prefLoop = 5205, 5210, 5290 + loopWho = "Internet like a home device" +) + +// LoopServer is one tunnel on the path: its networks that keep their direct route, and of those the ones +// behind people's routers (nil when there are none: the plan is compared with the one kept in loop.json), +// which the netns answers through the tunnel as it does the tunnel's own subnet. +type LoopServer struct { + Ifname string `json:"ifname"` + Subnet string `json:"subnet"` + Direct []string `json:"direct"` + Behind []string `json:"behind,omitempty"` +} + +// LoopPlan is what should exist (dawnline.loop plan), kept in loop.json in ucode's own order of keys. +type LoopPlan struct { + Dev string `json:"dev"` + Gateway string `json:"gateway"` + Address string `json:"address"` + MAC string `json:"mac"` + Prefix int `json:"prefix"` + DNS string `json:"dns"` + Transit uint32 `json:"transit"` + TxRoot string `json:"tx_root"` + TxNS string `json:"tx_ns"` + Table int `json:"table"` + Servers []LoopServer `json:"servers"` +} + +// Loop is what bringing the path to the settings came to: off (nobody wants it), a reason it cannot be +// (a code with its values), or the plan that is in place. +type Loop struct { + Off bool + Error map[string]any + Plan *LoopPlan +} + +func (r *Router) sysNet() string { + if r.SysNet != "" { + return r.SysNet + } + return "/sys/class/net" +} + +func (r *Router) netnsFile() string { + if r.NetnsDir != "" { + return r.NetnsDir + "/" + loopNS + } + return "/var/run/netns/" + loopNS +} + +func (r *Router) linkThere(dev string) bool { + _, err := os.Stat(r.sysNet() + "/" + dev) + return err == nil +} + +func (r *Router) nsThere() bool { + _, err := os.Stat(r.netnsFile()) + return err == nil +} + +// sh runs a shell command as ucode's sh(): what it said (both streams) and its exit code. +func (r *Router) sh(cmd string) (string, int) { return r.Exec("sh", "-c", cmd) } + +// q quotes a word for the shell. +func q(s string) string { return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" } + +func trimmed(s string) string { return strings.Trim(s, " \t\r\n\v\f") } + +// run gives the commands that set the path up or take it down, each in the log as it is given; what failed, +// each with what it said. +func (r *Router) run(cmds []string) []string { + var errs []string + for _, c := range cmds { + r.say("info", "loop", "$ "+c) + } + for _, c := range cmds { + if out, code := r.sh(c); code != 0 { + errs = append(errs, c+": "+trimmed(out)) + r.say("error", "loop", "failed: "+c+" · "+trimmed(out)) + } + } + return errs +} + +func (r *Router) loopLog(level, msg, detail string) { + if r.Log != nil { + r.Log.Write("dawnline", level, msg, detail, loopWho, servicelog.Extra{}) + } +} + +/* ---------- facts about the LAN ---------- */ + +type dhcpFacts struct { + pool *[2]uint32 + dns string + statics []uint32 +} + +// dhcpOf is the DHCP pool, static leases and the DNS handed to LAN clients, for one netifd interface. +func (r *Router) dhcpOf(logical string, lan ipnet.Net) dhcpFacts { + var f dhcpFacts + raw, err := os.ReadFile(r.DHCP) + if err != nil { + return f + } + c, err := uci.Parse(string(raw)) + if err != nil { + return f + } + for _, s := range c.OfType("dhcp") { + iface, _ := s.Get("interface") + if ignore, _ := s.Get("ignore"); iface != logical || ignore == "1" { + continue + } + num := func(key string, dflt float64) (float64, bool) { + v, has := s.Get(key) + if !has { + return dflt, true + } + return model.Number(v) + } + start, ok1 := num("start", 100) + limit, ok2 := num("limit", 150) + f.pool = nil + if ok1 && ok2 { + f.pool = &[2]uint32{lan.Base + uint32(int64(start)), lan.Base + uint32(int64(start)+int64(limit)) - 1} + } + v := s.Values["dhcp_option"] + opts := v.List + if !v.IsList && v.Str != "" { + opts = []string{v.Str} + } + for _, o := range opts { + if m := dnsOption.FindStringSubmatch(o); m != nil && f.dns == "" { + f.dns = m[2] + } + } + } + for _, s := range c.OfType("host") { + v, _ := s.Get("ip") + if ip, ok := ipnet.IP(v); ok { + f.statics = append(f.statics, ip) + } + } + return f +} + +// usedAddresses is the addresses other devices are using right now (neighbour table and leases): each +// with the MAC that holds it ("": one is not known). +func (r *Router) usedAddresses(dev string) map[string]string { + used := map[string]string{} + if out, code := r.sh("ip -j -4 neigh show dev " + q(dev)); code == 0 { + var list []struct { + Dst string `json:"dst"` + Lladdr string `json:"lladdr"` + State []string `json:"state"` + } + if json.Unmarshal([]byte(trimmed(out)), &list) == nil { + for _, n := range list { + if n.Dst != "" && !has(n.State, "FAILED") && !has(n.State, "INCOMPLETE") { + used[n.Dst] = n.Lladdr + } + } + } + } + leases := r.Leases + if leases == "" { + leases = "/tmp/dhcp.leases" + } + raw, _ := os.ReadFile(leases) + for _, l := range strings.Split(string(raw), "\n") { + if f := strings.Split(l, " "); len(f) >= 3 { + used[f[2]] = f[1] + } + } + return used +} + +func has(list []string, v string) bool { + for _, x := range list { + if x == v { + return true + } + } + return false +} + +// ourMAC is the MAC the netns's LAN link has now; "" without the link. +func (r *Router) ourMAC() string { + out, code := r.sh("ip -n " + loopNS + " -j link show " + lanNS + " 2>/dev/null") + if code != 0 { + return "" + } + var list []struct { + Address string `json:"address"` + } + if json.Unmarshal([]byte(trimmed(out)), &list) != nil || len(list) == 0 { + return "" + } + return list[0].Address +} + +func fnv1a(s string, h uint32) uint32 { + for i := 0; i < len(s); i++ { + h = (h ^ uint32(s[i])) * 16777619 + } + return h +} + +// LanMAC is the MAC for the netns's LAN link, from the bridge's: a locally administered unicast address +// hashed from it, so it is the same every time and differs between routers. Not the bridge's MAC with a +// bit flipped: radios and ports often get those. +func LanMAC(bridge string) string { + s := strings.ToLower(trimmed(bridge)) + h1 := fnv1a("dawnline lan "+s, 0x811c9dc5) + h2 := fnv1a(s, h1) + return fmt.Sprintf("%02x:%02x:%02x:%02x:%02x:%02x", ((h1>>24)&0xfc)|0x02, (h1>>16)&0xff, (h1>>8)&0xff, h1&0xff, (h2>>24)&0xff, (h2>>16)&0xff) +} + +// addressFree tells whether the netns may use a LAN address: a host of the network, not the router's, not +// a static lease, outside the DHCP pool and not held by another device (an entry with one of the MACs in +// mine is the netns itself, also from before it was made again). +func addressFree(ip, router uint32, lan ipnet.Net, f dhcpFacts, used map[string]string, mine []string) bool { + if ip <= lan.Base || uint64(ip) >= uint64(lan.Base)+lan.Size()-1 || ip == router { + return false + } + for _, s := range f.statics { + if s == ip { + return false + } + } + if f.pool != nil && ip >= f.pool[0] && ip <= f.pool[1] { + return false + } + u, held := used[ipnet.String(ip)] + return !held || (u != "" && has(mine, u)) +} + +// pickAddress is a LAN address for the netns: the saved one while it is free, otherwise the highest free +// host that does not answer. +func (r *Router) pickAddress(lan ipnet.Net, router uint32, f dhcpFacts, saved, dev string, mine []string) string { + used := r.usedAddresses(dev) + if sv, ok := ipnet.IP(saved); ok && addressFree(sv, router, lan, f, used, mine) { + return ipnet.String(sv) + } + for ip := lan.Base + uint32(lan.Size()) - 2; ip > lan.Base; ip-- { + if !addressFree(ip, router, lan, f, used, mine) { + continue + } + // last check: nobody answers on it + r.sh("ping -c 1 -W 1 -I " + q(dev) + " " + ipnet.String(ip)) + if addressFree(ip, router, lan, f, r.usedAddresses(dev), mine) { + return ipnet.String(ip) + } + } + return "" +} + +// pickTransit is a /30 in 169.254.0.0/16 that no route or address on the router overlaps. +func (r *Router) pickTransit() (uint32, bool) { + var busy []ipnet.Net + snap := r.Snapshot() + for _, d := range snap.Devices { + for _, n := range append(append([]string{}, d.Nets...), d.Addrs...) { + if c, ok := ipnet.Any(n); ok { + busy = append(busy, c) + } + } + } + for k := 77; k < 77+256; k++ { + base, _ := ipnet.IP(fmt.Sprintf("169.254.%d.0", k%256)) + free := true + for _, c := range busy { + if uint64(base) < uint64(c.Base)+c.Size() && uint64(c.Base) < uint64(base)+4 { + free = false + break + } + } + if free { + return base, true + } + } + return 0, false +} + +// pickTable is a routing table nobody else uses (ours holds a single route via the transit link). +func (r *Router) pickTable(saved int) (int, bool) { + free := func(t int) bool { + out, code := r.sh("ip -4 route show table " + strconv.Itoa(t)) + said := trimmed(out) + if code != 0 || said == "" { + return true + } + return !strings.Contains(said, "\n") && strings.Contains(said, " dev "+txRoot) + } + if saved != 0 && free(saved) { + return saved, true + } + for t := 2077; t < 2177; t++ { + if free(t) { + return t, true + } + } + return 0, false +} + +// LoopErrorNote is a reason the path is off, for the service log and syslog: English, like every log line. +func LoopErrorNote(e map[string]any) string { + switch e["code"] { + case "no_lan": + return "No LAN detected." + case "not_bridge": + return fmt.Sprintf("%v is not a bridge, so Dawnline cannot join the LAN as a device.", e["dev"]) + case "no_ipv4": + return fmt.Sprintf("%v has no IPv4 address.", e["dev"]) + case "no_address": + return fmt.Sprintf("No free address on %v.", e["net"]) + case "no_transit": + return "No free link-local range for the internal link." + } + return "No free routing table." +} + +/* ---------- plan ---------- */ + +type loopState struct { + Applied int64 `json:"applied"` + Plan *LoopPlan `json:"plan"` + Transit uint32 `json:"transit"` + Fast *bool `json:"fast"` + Error any `json:"error"` + Off bool `json:"off"` +} + +func (r *Router) loopState() loopState { + var s loopState + files.ReadJSON(r.RunDir+"/loop.json", &s) + return s +} + +// LoopPlanFor is what should exist for these settings; saved is the LAN address kept from before +// (settings.lan_address). Pure apart from reading the router (and one ping a candidate address). +func (r *Router) LoopPlanFor(m *model.Model, saved string) Loop { + var wanted []*model.Server + for _, id := range m.ServerIDs() { + if s := m.Servers[id]; tunnelOK(s) && s.Enabled && s.LanLike { + wanted = append(wanted, s) + } + } + if len(wanted) == 0 { + return Loop{Off: true} + } + snap := r.Snapshot() + dev := snap.LAN + d := snap.Devices[dev] + if dev == "" || d == nil { + return Loop{Error: map[string]any{"code": "no_lan"}} + } + if d.Kind != "bridge" { + return Loop{Error: map[string]any{"code": "not_bridge", "dev": dev}} + } + var lan ipnet.Net + var router uint32 + ok := len(d.Addrs) > 0 + if ok { + if lan, ok = ipnet.Subnet(d.Addrs[0]); ok { + router, ok = ipnet.IP(strings.SplitN(d.Addrs[0], "/", 2)[0]) + } + } + if !ok { + return Loop{Error: map[string]any{"code": "no_ipv4", "dev": dev}} + } + facts := r.dhcpOf(d.Logical, lan) + bridge, _ := os.ReadFile(r.sysNet() + "/" + dev + "/address") + mac := LanMAC(string(bridge)) + // the netns's MACs: the one it gets, and the one it has (a random one from an older version) + addr := r.pickAddress(lan, router, facts, saved, dev, []string{mac, r.ourMAC()}) + if addr == "" { + return Loop{Error: map[string]any{"code": "no_address", "net": lan.String()}} + } + last := r.loopState() + tx, ok := r.pickTransit() + if !ok { + return Loop{Error: map[string]any{"code": "no_transit"}} + } + saw := 0 + if last.Plan != nil { + saw = last.Plan.Table + } + table, ok := r.pickTable(saw) + if !ok { + return Loop{Error: map[string]any{"code": "no_table"}} + } + p := &LoopPlan{Dev: dev, Gateway: ipnet.String(router), Address: addr, MAC: mac, Prefix: lan.Prefix, DNS: facts.dns, Transit: tx, + TxRoot: ipnet.String(tx + 1), TxNS: ipnet.String(tx + 2), Table: table, Servers: []LoopServer{}} + if p.DNS == "" { + p.DNS = p.Gateway + } + // by the settings alone, whoever is loaded now: the path does not move with people's states + behind := snap.Behind(m) + for _, srv := range wanted { + _, _, nets, _ := snap.ServerNet(srv) + var sites []string + for _, id := range m.DeviceIDs() { + if p := m.People[m.Devices[id].Person]; p != nil && p.Server == srv.ID { + sites = append(sites, behind[id]...) + } + } + if sites != nil { + sites = ipnet.Collapse(sites) + } + p.Servers = append(p.Servers, LoopServer{Ifname: srv.Ifname, Subnet: srv.Subnet, + Direct: ipnet.Collapse(append(append([]string{srv.Subnet}, nets...), sites...)), Behind: sites}) + } + return Loop{Plan: p} +} + +/* ---------- apply ---------- */ + +// NSRules is the netns's nft script as text. With fast, a flowtable on the netns's own two links takes +// established TCP and UDP flows past conntrack and the forward hook here. Only dlx1 and dll1: the root +// namespace's links stay out, the guard there sees every packet. +func NSRules(p *LoopPlan, fast bool) string { + ft, add := "", "" + if fast { + ft = "\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"" + txNS + "\", \"" + lanNS + "\" };\n\t}" + add = "\n\t\tct state established meta l4proto { tcp, udp } flow add @ft" + } + return "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {" + ft + ` + chain nat_pre { + type nat hook prerouting priority dstnat; policy accept; + iifname "` + txNS + `" ip daddr ` + p.Address + ` meta l4proto { tcp, udp } th dport 53 dnat ip to ` + p.DNS + `:53 + } + chain nat_post { + type nat hook postrouting priority srcnat; policy accept; + oifname "` + lanNS + `" masquerade + } + chain filter_forward { + type filter hook forward priority filter; policy drop;` + add + ` + ct state established,related accept + iifname "` + txNS + `" oifname "` + lanNS + `" accept + } + chain filter_input { + type filter hook input priority filter; policy drop; + ct state established,related accept + iifname "lo" accept + icmp type echo-request accept + iifname "` + txNS + `" meta l4proto { tcp, udp } th dport 53 accept + } +} +` +} + +// loadNSRules loads the netns's rules, with the flowtable when the kernel takes it, else without (the path +// works either way): slow is why the flowtable failed, err why the rules without it failed too. +func (r *Router) loadNSRules(p *LoopPlan) (fast bool, slow, err string) { + os.MkdirAll(r.varEtc(), 0o755) + path := r.varEtc() + "/dawnline-ns.nft" + load := func(fast bool) string { + os.WriteFile(path, []byte(NSRules(p, fast)), 0o644) + if errs := r.run([]string{"ip netns exec " + loopNS + " nft -f " + path}); len(errs) > 0 { + return errs[0] + } + return "" + } + if slow = load(true); slow == "" { + return true, "", "" + } + return false, slow, load(false) +} + +// LoopRule is one policy rule of the path (To "": all). +type LoopRule struct { + Pref int + Iif string + To string + Table string +} + +// LoopRules is the policy rules a plan wants, in order. A server interface: DNS to the netns address +// through the netns, home networks and the tunnel network by main, the rest into the netns. +func LoopRules(p *LoopPlan) []LoopRule { + var out []LoopRule + if p == nil { + return out + } + table := strconv.Itoa(p.Table) + for _, s := range p.Servers { + out = append(out, LoopRule{prefLoopDNS, s.Ifname, p.Address + "/32", table}) + for _, n := range s.Direct { + out = append(out, LoopRule{prefMain, s.Ifname, n, "main"}) + } + out = append(out, LoopRule{prefLoop, s.Ifname, "", table}) + } + return out +} + +// IPRule is a policy rule as `ip -j -4 rule show` prints it. +type IPRule struct { + Priority int `json:"priority"` + Src string `json:"src"` + Srclen *int `json:"srclen"` + Dst string `json:"dst"` + Dstlen *int `json:"dstlen"` + Iif string `json:"iif"` + Table string `json:"table"` + Detached json.RawMessage `json:"iif_detached"` +} + +// currentRules is our policy rules: in our priority band and bound to a Dawnline tunnel interface, or left +// behind by a removed tunnel (its interface is gone). +func (r *Router) currentRules(ifnames []string) []IPRule { + var out []IPRule + said, code := r.sh("ip -j -4 rule show") + if code != 0 { + return out + } + var all []IPRule + if json.Unmarshal([]byte(trimmed(said)), &all) != nil { + return out + } + for _, x := range all { + if x.Priority >= 5200 && x.Priority < 5300 && x.Iif != "" && (has(ifnames, x.Iif) || x.Detached != nil) { + out = append(out, x) + } + } + return out +} + +// ruleNet is a source or destination as `ip -j rule` has it, or "" for all. +func ruleNet(addr string, n *int) string { + if addr == "" || addr == "all" { + return "" + } + if n != nil { + return addr + "/" + strconv.Itoa(*n) + } + return addr +} + +func ruleKey(pref int, from, iif, to, table string) string { + // `ip -j rule` shows a /32 source or destination without its length + full := func(n string) string { + switch { + case n == "": + return "all" + case !strings.Contains(n, "/"): + return n + "/32" + } + return n + } + return fmt.Sprintf("%d %s %s %s %s", pref, full(from), iif, full(to), table) +} + +func ruleDel(x IPRule) string { + cmd := "ip -4 rule del priority " + strconv.Itoa(x.Priority) + if from := ruleNet(x.Src, x.Srclen); from != "" { + cmd += " from " + from + } + cmd += " iif " + q(x.Iif) + if to := ruleNet(x.Dst, x.Dstlen); to != "" { + cmd += " to " + to + } + return cmd + " lookup " + x.Table +} + +// RuleCmds is the commands that turn the rules there are into the ones a plan wants: the missing ones +// added first, then the ones no longer wanted removed, so a device's traffic never falls between two +// rules while others change. None when they are as wanted. +func RuleCmds(p *LoopPlan, current []IPRule) []string { + have, want := map[string]IPRule{}, map[string]bool{} + var order, cmds, twice []string + for _, x := range current { + k := ruleKey(x.Priority, ruleNet(x.Src, x.Srclen), x.Iif, ruleNet(x.Dst, x.Dstlen), x.Table) + if _, seen := have[k]; seen { + twice = append(twice, ruleDel(x)) + } else { + order = append(order, k) + } + have[k] = x + } + for _, w := range LoopRules(p) { + k := ruleKey(w.Pref, "", w.Iif, w.To, w.Table) + if _, there := have[k]; !there && !want[k] { + cmd := "ip -4 rule add priority " + strconv.Itoa(w.Pref) + " iif " + q(w.Iif) + if w.To != "" { + cmd += " to " + w.To + } + cmds = append(cmds, cmd+" lookup "+w.Table) + } + want[k] = true + } + for _, k := range order { + if !want[k] { + cmds = append(cmds, ruleDel(have[k])) + } + } + // the same rule twice (one deletion removes one of them) + return append(cmds, twice...) +} + +// LoopRemove takes away the netns, links and rules, and the router's neighbour entry for the netns. +func (r *Router) LoopRemove(ifnames []string) { + last := r.loopState().Plan + // read while the link is there: the entry is ours when it carries the netns's MAC + stale := false + if last != nil && last.Dev != "" { + held := r.usedAddresses(last.Dev)[last.Address] + stale = held != "" && (held == last.MAC || held == r.ourMAC()) + } + var cmds []string + for _, x := range r.currentRules(ifnames) { + cmds = append(cmds, ruleDel(x)) + } + if last != nil && last.Table != 0 { + cmds = append(cmds, "ip -4 route flush table "+strconv.Itoa(last.Table)) + } + if r.linkThere(txRoot) { + cmds = append(cmds, "ip link del "+txRoot) + } + if r.linkThere(lanRoot) { + cmds = append(cmds, "ip link del "+lanRoot) + } + if r.nsThere() { + cmds = append(cmds, "ip netns del "+loopNS) + } + // left there, it would hold the address for a MAC nobody has + if stale { + cmds = append(cmds, "ip -4 neigh del "+q(last.Address)+" dev "+q(last.Dev)) + } + r.run(cmds) + os.Remove(r.RunDir + "/loop.json") +} + +func sameJSON(a, b any) bool { + x, _ := json.Marshal(a) + y, _ := json.Marshal(b) + return string(x) == string(y) +} + +// LoopEnsure brings the path to the plan. Cheap when nothing changed: it compares with the last applied +// plan and only checks that links, bridge port and rules exist. saved is the LAN address kept from before. +func (r *Router) LoopEnsure(m *model.Model, saved string, force bool) Loop { + state := r.RunDir + "/loop.json" + var ifnames []string + for _, id := range m.ServerIDs() { + ifnames = append(ifnames, m.Servers[id].Ifname) + } + res := r.LoopPlanFor(m, saved) + if res.Plan == nil { + // read before the removal, which deletes it: the error is logged once, not every tick + was := r.loopState() + if was.Plan != nil || r.linkThere(txRoot) || r.linkThere(lanRoot) || len(r.currentRules(ifnames)) > 0 { + r.LoopRemove(ifnames) + } + os.MkdirAll(r.RunDir, 0o755) + var why any + if res.Error != nil { + why = res.Error + } + files.WriteJSON(state, map[string]any{"error": why, "off": res.Off}, 0o644) + if res.Error != nil && !sameJSON(res.Error, was.Error) { + r.loopLog("error", "is off", LoopErrorNote(res.Error)) + } + return res + } + p := res.Plan + last := r.loopState() + same := !force && last.Applied != 0 && last.Plan != nil && reflect.DeepEqual(last.Plan, p) + master, _ := os.Readlink(r.sysNet() + "/" + lanRoot + "/master") + healthy := r.linkThere(txRoot) && r.linkThere(lanRoot) && r.nsThere() && master != "" && filepath.Base(master) == p.Dev + if same && healthy && len(RuleCmds(p, r.currentRules(ifnames))) == 0 { + return res + } + // A link made by an older version has a random MAC (its plan had none, so this runs once after an + // update): it gets the stable one. + remac := r.linkThere(lanRoot) && r.ourMAC() != p.MAC + var cmds []string + if !r.nsThere() { + cmds = append(cmds, "ip netns add "+loopNS) + } + if !r.linkThere(txRoot) { + cmds = append(cmds, "ip link add "+txRoot+" type veth peer name "+txNS+" netns "+loopNS) + } + if !r.linkThere(lanRoot) { + cmds = append(cmds, "ip link add "+lanRoot+" type veth peer name "+lanNS+" address "+p.MAC+" netns "+loopNS) + } + if remac { + cmds = append(cmds, "ip -n "+loopNS+" link set "+lanNS+" down", "ip -n "+loopNS+" link set "+lanNS+" address "+p.MAC) + } + errs := r.run(cmds) + n := "ip -n " + loopNS + " " + cmds = []string{ + "ip addr flush dev " + txRoot, + "ip addr add " + p.TxRoot + "/30 dev " + txRoot, + "ip link set " + txRoot + " up", + "ip link set " + lanRoot + " master " + q(p.Dev), + "ip link set " + lanRoot + " up", + n + "link set lo up", + n + "addr flush dev " + txNS, + n + "addr add " + p.TxNS + "/30 dev " + txNS, + n + "link set " + txNS + " up", + n + "addr flush dev " + lanNS, + n + "addr add " + p.Address + "/" + strconv.Itoa(p.Prefix) + " dev " + lanNS, + n + "link set " + lanNS + " up", + n + "route replace default via " + p.Gateway + " dev " + lanNS, + // the resolver's own queries (from the transit address) go back out the transit link + n + "route replace default via " + p.TxRoot + " dev " + txNS + " table 100", + n + "rule del from " + p.TxNS + " lookup 100 2>/dev/null; " + n + "rule add from " + p.TxNS + " lookup 100", + "ip netns exec " + loopNS + " sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via " + p.TxNS + " dev " + txRoot + " table " + strconv.Itoa(p.Table), + } + // the networks behind routers are answered through the tunnel too; the ones of the plan before go first + sites := false + for _, s := range p.Servers { + sites = sites || len(s.Behind) > 0 + } + if last.Plan != nil { + for _, s := range last.Plan.Servers { + sites = sites || len(s.Behind) > 0 + } + } + if sites { + cmds = append(cmds, n+"route flush proto "+routeProto+" 2>/dev/null || true") + } + for _, s := range p.Servers { + cmds = append(cmds, n+"route replace "+q(s.Subnet)+" via "+q(p.TxRoot)+" dev "+txNS) + for _, b := range s.Behind { + cmds = append(cmds, n+"route replace "+q(b)+" via "+q(p.TxRoot)+" dev "+txNS+" proto "+routeProto) + } + } + // the router knows the address by the old MAC: ask again now, not when the entry expires + if remac { + cmds = append(cmds, "ip -4 neigh flush to "+p.Address+" dev "+q(p.Dev)) + } + errs = append(errs, r.run(cmds)...) + fast, slow, err := r.loadNSRules(p) + if err != "" { + errs = append(errs, err) + } + errs = append(errs, r.run(RuleCmds(p, r.currentRules(ifnames)))...) + if len(errs) > 0 { + why := map[string]any{"code": "setup", "detail": errs[0]} + if !sameJSON(r.loopState().Error, why) { + r.loopLog("error", "failed - internet goes out directly for now", errs[0]) + } + r.LoopRemove(ifnames) + files.WriteJSON(state, map[string]any{"error": why}, 0o644) + return Loop{Error: why} + } + os.MkdirAll(r.RunDir, 0o755) + files.WriteJSON(state, loopState2{Applied: time.Now().Unix(), Plan: p, Transit: p.Transit, Fast: fast}, 0o644) + switch { + case last.Applied == 0 || last.Plan == nil || last.Plan.Dev != p.Dev || last.Plan.Address != p.Address: + r.loopLog("up", fmt.Sprintf("is on · traffic enters %s as %s", p.Dev, p.Address), "") + case !healthy: + r.loopLog("repair", fmt.Sprintf("was broken - set up again (%s as %s)", p.Dev, p.Address), "") + } + // once, not again on every apply while the module is still missing + if !fast && (last.Fast == nil || *last.Fast) { + r.loopLog("info", "runs without its fast path", + "Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline.\n"+slow) + } + return res +} + +// loopState2 is loop.json while the path is up, in ucode's own order of keys. +type loopState2 struct { + Applied int64 `json:"applied"` + Plan *LoopPlan `json:"plan"` + Transit uint32 `json:"transit"` + Fast bool `json:"fast"` +} diff --git a/backend/apply/loop_test.go b/backend/apply/loop_test.go new file mode 100644 index 0000000..2019863 --- /dev/null +++ b/backend/apply/loop_test.go @@ -0,0 +1,372 @@ +package apply + +import ( + "encoding/json" + "os" + "reflect" + "strconv" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +type loopGolden struct { + Bridge string `json:"bridge"` + DHCP string `json:"dhcp"` + Steps []struct { + What string `json:"what"` + Force bool `json:"force"` + Result json.RawMessage `json:"result"` + State any `json:"state"` + NSRules string `json:"ns_rules"` + Log []map[string]any `json:"log"` + Ran []string `json:"ran"` + Failed []string `json:"failed"` + Pings []string `json:"pings"` + Sys struct { + Dlx0 bool `json:"dlx0"` + Dll0 bool `json:"dll0"` + Netns bool `json:"netns"` + } `json:"sys"` + } `json:"steps"` + Macs [][2]*string `json:"macs"` + Rules struct { + Plan *LoopPlan `json:"plan"` + Want []struct { + Pref int `json:"pref"` + Iif string `json:"iif"` + To *string `json:"to"` + Table string `json:"table"` + } `json:"want"` + Current []IPRule `json:"current"` + Cmds []string `json:"cmds"` + FromNothing []string `json:"from_nothing"` + ToNothing []string `json:"to_nothing"` + } `json:"rules"` + NSRules []string `json:"ns_rules"` + Notes []string `json:"notes"` +} + +func loopTrace(t *testing.T) loopGolden { + raw, err := os.ReadFile("testdata/loop.json") + if err != nil { + t.Fatal(err) + } + var g loopGolden + if err := json.Unmarshal(raw, &g); err != nil { + t.Fatal(err) + } + return g +} + +// The pure parts of the home-like path, on ucode's own answers (testdata/loop.uc). +func TestLoopPartsAsUcode(t *testing.T) { + g := loopTrace(t) + if len(g.Macs) != 5 { + t.Fatal("the golden is too small") + } + for _, m := range g.Macs { + in := "" + if m[0] != nil { + in = *m[0] + } + if got := LanMAC(in); got != *m[1] { + t.Errorf("the MAC from %q: %s, ucode %s", in, got, *m[1]) + } + } + want := LoopRules(g.Rules.Plan) + if len(want) != len(g.Rules.Want) || len(want) == 0 { + t.Fatalf("%d rules, ucode %d", len(want), len(g.Rules.Want)) + } + for i, w := range g.Rules.Want { + to := "" + if w.To != nil { + to = *w.To + } + if want[i] != (LoopRule{w.Pref, w.Iif, to, w.Table}) { + t.Errorf("rule %d: %v, ucode %v", i, want[i], w) + } + } + if len(LoopRules(nil)) != 0 { + t.Error("rules from no plan") + } + for _, c := range []struct { + what string + got []string + want []string + }{{"from what there is", RuleCmds(g.Rules.Plan, g.Rules.Current), g.Rules.Cmds}, {"from nothing", RuleCmds(g.Rules.Plan, nil), g.Rules.FromNothing}, + {"to nothing", RuleCmds(&LoopPlan{}, g.Rules.Current), g.Rules.ToNothing}} { + if strings.Join(c.got, "\n") != strings.Join(c.want, "\n") || len(c.want) == 0 { + t.Errorf("the commands %s:\n%s\n--- ucode:\n%s", c.what, strings.Join(c.got, "\n"), strings.Join(c.want, "\n")) + } + } + if NSRules(g.Rules.Plan, true) != g.NSRules[0] || NSRules(g.Rules.Plan, false) != g.NSRules[1] { + t.Errorf("the netns's rules:\n%s\n--- ucode:\n%s", NSRules(g.Rules.Plan, true), g.NSRules[0]) + } + for i, e := range []map[string]any{{"code": "no_lan"}, {"code": "not_bridge", "dev": "eth1"}, {"code": "no_ipv4", "dev": "br-lan"}, + {"code": "no_address", "net": "10.0.1.0/24"}, {"code": "no_transit"}, {"code": "no_table"}} { + if got := LoopErrorNote(e); got != g.Notes[i] { + t.Errorf("the note for %v: %q, ucode %q", e, got, g.Notes[i]) + } + } +} + +// The home-like path through a row of states of the router: the plan, the commands in their order, +// loop.json, the netns's rules and the service log are ucode's own (testdata/loop.uc). The stand-in for ip +// here keeps the same state the golden's does. +func TestLoopAsUcode(t *testing.T) { + g := loopTrace(t) + if len(g.Steps) != 15 { + t.Fatalf("%d steps", len(g.Steps)) + } + raw, err := os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + dir := t.TempDir() + sys, etc := dir+"/sys", dir+"/etc" + os.MkdirAll(sys+"/br-lan", 0o755) + os.WriteFile(sys+"/br-lan/address", []byte(g.Bridge+"\n"), 0o644) + os.MkdirAll(dir+"/netns", 0o755) + os.WriteFile(dir+"/dhcp", []byte(g.DHCP), 0o644) + // what the stand-in is told and keeps + var neigh, nsmac, mac, rules, fail string + var ftFail bool + tables := map[string]string{} + var pings, said []string + there := func(p string) bool { _, err := os.Stat(p); return err == nil } + r := &Router{RunDir: dir + "/run", VarEtc: etc, SysNet: sys, NetnsDir: dir + "/netns", Leases: dir + "/leases", DHCP: dir + "/dhcp"} + r.Snapshot = func() *netview.Snapshot { + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, + Logical: func() map[string]netview.Logical { + return map[string]netview.Logical{"br-lan": {Name: "lan", Proto: "static"}} + }}) + } + r.Log = &servicelog.Log{RunDir: dir + "/run", Level: func() string { return "info" }, Syslog: func(_, line string) { said = append(said, line) }} + r.Exec = func(name string, args ...string) (string, int) { + if name != "sh" || len(args) != 2 || args[0] != "-c" { + t.Fatalf("not through the shell: %s %v", name, args) + } + cmd := args[1] + plain := strings.ReplaceAll(cmd, "'", "") + if strings.HasPrefix(cmd, "ping ") { + pings = append(pings, plain) + return "", 1 + } + if fail != "" && strings.Contains(plain, fail) { + return "RTNETLINK answers: a made-up failure\n", 2 + } + word := strings.Fields(plain) + switch { + case strings.HasPrefix(cmd, "ip -j -4 neigh show dev "): + if neigh == "" { + return "[]\n", 0 + } + return neigh, 0 + case strings.HasPrefix(cmd, "ip -n dawnline -j link show dll1"): + if !there(sys + "/dll0") { + return "", 1 + } + if nsmac != "" { + return `[{"address":"` + nsmac + `"}]`, 0 + } + return `[{"address":"` + mac + `"}]`, 0 + case cmd == "ip -j -4 rule show": + if rules == "" { + return "[]", 0 + } + return rules, 0 + case strings.HasPrefix(cmd, "ip -4 route show table "): + return tables[word[5]], 0 + case cmd == "ip netns add dawnline": + os.WriteFile(dir+"/netns/dawnline", nil, 0o644) + case cmd == "ip netns del dawnline": + os.Remove(dir + "/netns/dawnline") + case strings.HasPrefix(cmd, "ip netns exec dawnline nft -f "): + if text, _ := os.ReadFile(word[6]); ftFail && strings.Contains(string(text), "flowtable") { + return word[6] + ":4:2-10: Error: Could not process rule: No such file or directory\n", 1 + } + case strings.HasPrefix(cmd, "ip link add dlx0 "): + os.MkdirAll(sys+"/dlx0", 0o755) + case strings.HasPrefix(cmd, "ip link add dll0 "): + for i, w := range word { + if w == "address" { + mac = word[i+1] + } + } + os.MkdirAll(sys+"/dll0", 0o755) + case strings.HasPrefix(cmd, "ip link del "): + os.RemoveAll(sys + "/" + word[3]) + case strings.HasPrefix(cmd, "ip link set dll0 master "): + os.Remove(sys + "/dll0/master") + os.Symlink("../"+word[5], sys+"/dll0/master") + case strings.HasPrefix(cmd, "ip -n dawnline link set dll1 address "): + mac, nsmac = word[7], "" + } + return "", 0 + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + var last *LoopPlan + // the rules a plan wants, as `ip -j -4 rule show` prints them once they are in + shown := func() []map[string]any { + var out []map[string]any + for _, w := range LoopRules(last) { + o := map[string]any{"priority": w.Pref, "src": "all", "iif": w.Iif, "table": w.Table} + if w.To != "" { + parts := strings.SplitN(w.To, "/", 2) + o["dst"] = parts[0] + if n, _ := strconv.Atoi(parts[1]); n != 32 { + o["dstlen"] = n + } + } + out = append(out, o) + } + return out + } + put := func(list []map[string]any) { + raw, _ := json.Marshal(list) + rules = string(raw) + } + saved, logged := "", 0 + for i, want := range g.Steps { + switch i { + case 1, 7, 8, 9, 12, 13: + put(shown()) + case 2: + l := shown() + put(append(append([]map[string]any{}, l[1:]...), l[1], map[string]any{"priority": 5210, "src": "10.9.0.2", "iif": "dawn1", "dst": "10.1.0.0", "dstlen": 16, "table": "main"}, + map[string]any{"priority": 5290, "src": "all", "iif": "dawn7", "iif_detached": nil, "table": "2077"}, + map[string]any{"priority": 5290, "src": "all", "iif": "eth9", "table": "2077"}, map[string]any{"priority": 100, "src": "all", "iif": "dawn1", "table": "main"})) + case 3: + put(shown()) + ftFail = true + case 5: + ftFail, nsmac = false, "5e:00:11:22:33:44" + case 6: + nsmac, saved = "", "192.168.77.200" + neigh = `[{"dst":"192.168.77.200","lladdr":"aa:bb:cc:00:00:01","state":["REACHABLE"]},{"dst":"192.168.77.254","lladdr":"aa:bb:cc:00:00:02","state":["FAILED"]},{"dst":"192.168.77.253","state":["STALE"]}]` + os.WriteFile(dir+"/leases", []byte("1700000000 aa:bb:cc:00:00:03 192.168.77.252 phone *\n"), 0o644) + d, _ := uci.Parse(g.DHCP) + d.Add("host", "nas") + d.Set("nas", "ip", "192.168.77.251") + d.Set("lan", "start", "240") + d.Set("lan", "limit", "11") + d.SetList("lan", "dhcp_option", []string{"3,192.168.77.1", "6,192.168.77.53,192.168.77.54"}) + os.WriteFile(dir+"/dhcp", []byte(d.Format()), 0o644) + case 14: + put(nil) + } + switch i { + case 7: + saved = "192.168.77.201" + case 8: + tables["2077"] = "default via 10.0.0.1 dev eth5\n10.0.0.0/24 dev eth5\n" + tables["2078"] = "default via 169.254.77.2 dev dlx0\n" + case 9: + fail = "route replace default via 192.168.77.1" + case 11: + fail = "" + case 12: + c.Set("cabin", "lan_like", "0") + case 13: + c.Set("open", "lan_like", "0") + } + pings, said = nil, nil + res := r.LoopEnsure(model.Load(c, nil), saved, want.Force) + if res.Plan != nil { + last = res.Plan + } + fail := func(what string, got, exp any) { + a, _ := json.Marshal(got) + b, _ := json.Marshal(exp) + t.Errorf("step %d (%s): %s\n go: %s\n ucode: %s", i, want.What, what, a, b) + } + same := func(got, exp any) bool { + var a, b any + x, _ := json.Marshal(got) + y, _ := json.Marshal(exp) + json.Unmarshal(x, &a) + json.Unmarshal(y, &b) + return reflect.DeepEqual(a, b) + } + // where the files are kept here is not where the router keeps them + home := func(s string) string { return strings.ReplaceAll(s, etc, "/var/etc") } + var result any = res.Plan + switch { + case res.Off: + result = map[string]any{"off": true} + case res.Error != nil: + result = map[string]any{"error": map[string]any{"code": res.Error["code"], "detail": home(res.Error["detail"].(string))}} + } + if !same(result, want.Result) { + fail("what it came to", result, want.Result) + } + var ran, failed []string + for _, l := range said { + if s, is := strings.CutPrefix(l, "[info] [loop] $ "); is { + ran = append(ran, home(s)) + } + if s, is := strings.CutPrefix(l, "[error] [loop] failed: "); is { + failed = append(failed, home(s)) + } + } + if strings.Join(ran, "\n") != strings.Join(want.Ran, "\n") { + fail("the commands", ran, want.Ran) + } + if strings.Join(failed, "\n") != strings.Join(want.Failed, "\n") { + fail("what failed", failed, want.Failed) + } + if strings.Join(pings, "\n") != strings.Join(want.Pings, "\n") { + fail("who was asked whether they answer", pings, want.Pings) + } + var state any + if raw, err := os.ReadFile(dir + "/run/loop.json"); err == nil { + json.Unmarshal([]byte(home(string(raw))), &state) + if s, is := state.(map[string]any); is && s["applied"] != nil { + s["applied"] = float64(1) + } + } + if !same(state, want.State) { + fail("loop.json", state, want.State) + } + if got, _ := os.ReadFile(etc + "/dawnline-ns.nft"); string(got) != want.NSRules { + fail("the netns's rules", string(got), want.NSRules) + } + var log []map[string]any + lines, _ := os.ReadFile(dir + "/run/service.log") + all := strings.Split(strings.TrimRight(string(lines), "\n"), "\n") + if len(lines) == 0 { + all = nil + } + for _, l := range all[logged:] { + var e map[string]any + json.Unmarshal([]byte(home(l)), &e) + delete(e, "ts") + log = append(log, e) + } + logged = len(all) + if !same(log, want.Log) && !(len(log) == 0 && len(want.Log) == 0) { + fail("the service log", log, want.Log) + } + if there(sys+"/dlx0") != want.Sys.Dlx0 || there(sys+"/dll0") != want.Sys.Dll0 || there(dir+"/netns/dawnline") != want.Sys.Netns { + fail("what is left on the router", []bool{there(sys + "/dlx0"), there(sys + "/dll0"), there(dir + "/netns/dawnline")}, want.Sys) + } + } +} diff --git a/backend/apply/netifd.go b/backend/apply/netifd.go new file mode 100644 index 0000000..0d21922 --- /dev/null +++ b/backend/apply/netifd.go @@ -0,0 +1,430 @@ +package apply + +import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/disguise" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// netifd: one AmneziaWG interface a server, named after its ifname and marked `_dawnline` = the server's +// id (dawnline.netifd). Only interfaces Dawnline made are changed or removed: a name another interface has +// is left alone, and the server is kept down and said so (netifd-blocked.json: a code with its values). + +// opt is one option of an interface: a string, a list, or nothing (the option goes). +type opt struct { + key string + val string + list []string +} + +// put sets an option only when it differs (nothing deletes it); true when something changed. +func put(c *uci.Config, sec string, o opt) bool { + cur, has := c.Section(sec).Values[o.key] + if o.val == "" && len(o.list) == 0 { + if has { + c.Delete(sec, o.key) + return true + } + return false + } + if o.list != nil { + if has && cur.IsList && strings.Join(cur.List, "\n") == strings.Join(o.list, "\n") { + return false + } + c.SetList(sec, o.key, o.list) + return true + } + if has && !cur.IsList && cur.Str == o.val { + return false + } + c.Set(sec, o.key, o.val) + return true +} + +// options is what is written into network. apart from the markers: what netifd sets the tunnel up from. +func options(srv *model.Server) []opt { + prefix := "" + if i := strings.Index(srv.Subnet, "/"); i >= 0 { + prefix = srv.Subnet[i+1:] + } + o := []opt{{key: "proto", val: "amneziawg"}, {key: "private_key", val: srv.PrivateKey}, {key: "listen_port", val: strconv.Itoa(srv.Port)}, + {key: "addresses", list: []string{model.ServerAddress(srv) + "/" + prefix}}, {key: "mtu", val: strconv.Itoa(model.TunnelMTU(srv))}} + for _, k := range model.ObfKeys { + v := srv.Obf[k] + // DisableCookies is the devices' alone: on the server it would turn off WireGuard's own defence + // against a flood of handshakes. Nothing takes it off an interface that had it. + if k == "disable_cookies" { + v = "" + } + o = append(o, opt{key: "awg_" + k, val: v}) + } + off := opt{key: "disabled"} + auto := opt{key: "auto"} + if !srv.Enabled { + off.val, auto.val = "1", "0" + } + return append(o, off, auto) +} + +// optsText is options as a log line's words (secrets masked, nothing as "-"). +func optsText(list []opt) string { + var out []string + for _, o := range list { + s := "-" + if o.list != nil { + s = strings.Join(o.list, " ") + } else if o.val != "" { + s = o.val + } + if strings.Contains(o.key, "private_key") || strings.Contains(o.key, "preshared_key") || strings.Contains(o.key, "protection_key") || + strings.Contains(o.key, "privatekey") || strings.Contains(o.key, "presharedkey") || strings.Contains(o.key, "protectionkey") { + s = "***" + } + out = append(out, o.key+"="+s) + } + return strings.Join(out, ", ") +} + +// unsupported is why this AmneziaWG cannot run a server's disguise values, or nil when it can +// (dawnline.awg obf_unsupported). +func unsupported(o map[string]string, c awg.Caps) map[string]any { + has := func(keys ...string) bool { + for _, k := range keys { + if o[k] != "" { + return true + } + } + return false + } + installed := c.Kmod + if installed == nil { + installed = c.Tools + } + ranged := false + for _, k := range []string{"h1", "h2", "h3", "h4"} { + ranged = ranged || strings.Contains(o[k], "-") + } + switch { + case has("header_protection_key", "content_padding_addition", "rekey_after_time", "rekey_timeout", "reject_after_time", "keepalive_timeout", + "max_handshake_attempts", "random_trailers", "disable_cookies") && !c.V3: + return map[string]any{"code": "disguise", "need": "3.1", "installed": installed} + case (has("s3", "s4", "i1", "i2", "i3", "i4", "i5") || ranged) && !c.V2: + return map[string]any{"code": "disguise", "need": "2.0", "installed": installed} + } + return nil +} + +// blockedNote is why a server is kept down, for the service log (dawnline.awg blocked_note). +func blockedNote(why map[string]any) string { + switch why["code"] { + case "ifname": + return fmt.Sprintf(`has an invalid interface name "%v"`, why["ifname"]) + case "taken": + return fmt.Sprintf("can't use the network interface %v: it exists and isn't Dawnline's", why["ifname"]) + case "disguise": + if in, _ := why["installed"].(string); in != "" { + return fmt.Sprintf("is kept down: its disguise needs AmneziaWG %v (installed: %s)", why["need"], in) + } + return fmt.Sprintf("is kept down: its disguise needs AmneziaWG %v (installed: none)", why["need"]) + case "disguise_invalid": + return "is kept down: its disguise has values AmneziaWG cannot take" + } + return "is kept down" +} + +func blockedFix(why map[string]any) string { + switch why["code"] { + case "disguise": + return "Install that AmneziaWG build in Settings → Updates, or switch the disguise in Settings → Disguise." + case "disguise_invalid": + return "Choose a disguise in Settings → Disguise: it replaces the values set by hand." + } + return "Choose another interface name in the server settings." +} + +// intent notes why Dawnline itself is about to take a tunnel down, so the hotplug log can tell that from +// a tunnel that stopped on its own. reason: settings | off | removed. Kept for two minutes. +func (r *Router) intent(ifname, reason, name string) { + path := r.RunDir + "/iface-intent.json" + all := map[string]map[string]any{} + files.ReadJSON(path, &all) + now := time.Now().Unix() + for k, v := range all { + if ts, _ := v["ts"].(float64); float64(now)-ts >= 120 { + delete(all, k) + } + } + all[ifname] = map[string]any{"reason": reason, "name": name, "ts": now} + os.MkdirAll(r.RunDir, 0o755) + files.WriteJSON(path, all, 0o600) +} + +// commit writes a configuration file in place whole, under a hidden name first. +func commit(path string, c *uci.Config) error { + var b [4]byte + rand.Read(b[:]) + tmp := filepath.Join(filepath.Dir(path), "."+filepath.Base(path)+".dl-"+hex.EncodeToString(b[:])) + mode := os.FileMode(0o644) + if st, err := os.Stat(path); err == nil { + mode = st.Mode().Perm() + } + if err := os.WriteFile(tmp, []byte(c.Format()), mode); err != nil { + os.Remove(tmp) + return err + } + os.Chmod(tmp, mode) + if err := os.Rename(tmp, path); err != nil { + os.Remove(tmp) + return err + } + return nil +} + +// ack records a configuration's new checksum after Dawnline committed and applied it itself, so a later +// `reload_config` does not treat it as changed and restart services that reload on any network change. +func (r *Router) ack(conf string) { + const md5f = "/var/run/config.md5" + if r.dry { + return + } + raw, err := os.ReadFile(md5f) + if err != nil { + return + } + sum, _ := r.Exec("sh", "-c", "uci show "+conf+" | md5sum | cut -d' ' -f1") + sum = strings.TrimSpace(sum) + if sum == "" { + return + } + path := "/var/run/config.check/" + conf + lines := strings.Split(strings.Trim(string(raw), " \t\r\n\v\f"), "\n") + found := false + for i, l := range lines { + if strings.HasSuffix(l, " "+path) { + lines[i], found = sum+" "+path, true + } + } + if !found { + lines = append(lines, sum+" "+path) + } + os.WriteFile(md5f, []byte(strings.Join(lines, "\n")+"\n"), 0o644) +} + +// Netifd brings the router's network configuration in line with the servers; true when it changed. tools +// tells whether amneziawg-tools is there (without its protocol script, changing or bringing up an +// interface would only stop a tunnel that still runs); caps what this AmneziaWG can run. Each server that +// cannot have its interface is marked Blocked in m, as the rest of an apply works from the same model. +func (r *Router) Netifd(m *model.Model, tools bool, caps awg.Caps) bool { + text, _ := os.ReadFile(r.Network) + c, err := uci.Parse(string(text)) + if err != nil { + r.say("error", "network", r.Network+" does not parse: nothing was changed · "+err.Error()) + return false + } + changed := false + var touched []string + want := map[string]bool{} + was := map[string]any{} + files.ReadJSON(r.RunDir+"/netifd-blocked.json", &was) + blocked := map[string]any{} + block := func(srv *model.Server, why map[string]any, detail string) { + blocked[srv.ID] = why + srv.Blocked = why + a, _ := json.Marshal(was[srv.ID]) + b, _ := json.Marshal(why) + if string(a) != string(b) && r.Log != nil { + r.Log.Write("dawnline", "error", blockedNote(why), detail, srv.Name, servicelog.Extra{}) + } + } + flag := r.RunDir + "/netifd-no-awg" + _, flagged := os.Stat(flag) + keyed := false + for _, s := range m.Servers { + keyed = keyed || s.PrivateKey != "" + } + if tools && flagged == nil { + os.Remove(flag) + } else if !tools && keyed && flagged != nil { + if r.Log != nil { + r.Log.Write("dawnline", "error", "isn't installed: tunnels were left as they are", "Install it in Dawnline → Components.", "AmneziaWG", servicelog.Extra{}) + } + os.MkdirAll(r.RunDir, 0o755) + os.WriteFile(flag, []byte(strconv.FormatInt(time.Now().Unix(), 10)), 0o644) + } + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + if srv.PrivateKey == "" { + continue + } + ifn := srv.Ifname + if !model.ValidIfname(ifn) { + block(srv, map[string]any{"code": "ifname", "ifname": ifn}, "Interface name: 1-12 lowercase letters, digits or _.") + continue + } + // whose the section is: nobody's, this server's, or someone else's + if s := c.Section(ifn); s != nil { + if owner := s.Values["_dawnline"].Str; owner != id { + block(srv, map[string]any{"code": "taken", "ifname": ifn}, "Dawnline never changes interfaces it did not create. Choose another interface name for this server.") + continue + } + } + // disguise values AmneziaWG refuses or crashes on never reach the kernel, and a disguise this build + // cannot run would come up as a tunnel no device reaches: down, and said so + var why map[string]any + if tools { + if len(disguise.Unsafe(srv.Obf)) > 0 { + why = map[string]any{"code": "disguise_invalid"} + } else { + why = unsupported(srv.Obf, caps) + } + } + if why != nil { + block(srv, why, blockedFix(why)) + continue + } + srv.Blocked = nil + want[ifn] = true + if !tools { + continue + } + created := false + if s := c.Section(ifn); s == nil || s.Type != "interface" { + c.DeleteSection(ifn) + c.Add("interface", ifn) + created = true + } + mine := created + var diff []opt + for _, o := range options(srv) { + if put(c, ifn, o) { + mine = true + diff = append(diff, o) + } + } + if mine { + how := "updated" + if created { + how = "created" + } + r.say("info", "network", fmt.Sprintf("interface %s (%s): %s · %s", ifn, srv.Name, how, optsText(diff))) + } else { + r.say("debug", "network", fmt.Sprintf("interface %s (%s): unchanged · %s", ifn, srv.Name, optsText(options(srv)))) + } + // the markers are saved, but netifd does not read them: a renamed server keeps its tunnel and every session in it + if put(c, ifn, opt{key: "_dawnline", val: id}) { + changed = true + } + if put(c, ifn, opt{key: "_dawnline_name", val: srv.Name}) { + changed = true + } + if mine { + changed = true + touched = append(touched, ifn) + reason := "settings" + if !srv.Enabled { + reason = "off" + } + r.intent(ifn, reason, srv.Name) + } + } + a, _ := json.Marshal(blocked) + b, _ := json.Marshal(was) + if string(a) != string(b) { + os.MkdirAll(r.RunDir, 0o755) + files.WriteJSON(r.RunDir+"/netifd-blocked.json", blocked, 0o644) + } + // interfaces Dawnline made for servers that are no more + var stale []string + for _, s := range c.OfType("interface") { + if s.Values["_dawnline"].Str != "" && !want[s.Name] { + stale = append(stale, s.Name) + } + } + for _, ifn := range stale { + name := c.Section(ifn).Values["_dawnline_name"].Str + shown := name + if name == "" { + name, shown = ifn, "a removed server" + } + r.intent(ifn, "removed", name) + r.say("info", "network", fmt.Sprintf("interface %s (%s): removed, ifdown %s", ifn, shown, ifn)) + r.Exec("ifdown", ifn) + c.DeleteSection(ifn) + changed = true + } + if changed { + if err := commit(r.Network, c); err != nil { + r.say("error", "network", r.Network+" could not be written · "+err.Error()) + return false + } + r.ack("network") + } + // only the markers changed: nothing for netifd to read + if len(touched) > 0 || len(stale) > 0 { + r.say("info", "network", "ubus call network reload") + r.Exec("ubus", "call", "network", "reload") + for _, ifn := range touched { + if srv := m.Servers[c.Section(ifn).Values["_dawnline"].Str]; srv != nil && srv.Enabled { + r.say("info", "network", "ifup "+ifn) + r.Exec("ifup", ifn) + } + } + } + return changed +} + +// NetifdOwner is whose an interface of the network configuration is: has false when there is none, id "" +// when it is not Dawnline's. +func (r *Router) NetifdOwner(ifname string) (id string, has bool) { + text, _ := os.ReadFile(r.Network) + c, err := uci.Parse(string(text)) + if err != nil || c.Section(ifname) == nil { + return "", false + } + return c.Section(ifname).Values["_dawnline"].Str, true +} + +// NetifdDrift is what of each running server's interface differs from what Netifd writes, by option name +// (a LuCI or uci edit of network., which would otherwise last until the next apply): an empty list +// when it is as Dawnline set it. Only enabled servers whose section exists and is theirs (a missing one is +// the tunnel probe's); the markers are not compared, netifd does not read them. Nothing is saved. +func (r *Router) NetifdDrift(m *model.Model) map[string][]string { + out := map[string][]string{} + text, _ := os.ReadFile(r.Network) + c, err := uci.Parse(string(text)) + if err != nil { + return out + } + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + s := c.Section(srv.Ifname) + if !srv.Enabled || !tunnelOK(srv) || s == nil || s.Values["_dawnline"].Str != id || s.Type != "interface" { + continue + } + diff := []string{} + for _, o := range options(srv) { + if put(c, srv.Ifname, o) { + diff = append(diff, o.key) + } + } + out[id] = diff + } + return out +} + +// BlockedNote and BlockedFix word why a server is kept down, for the service log. +func BlockedNote(why map[string]any) string { return blockedNote(why) } +func BlockedFix(why map[string]any) string { return blockedFix(why) } diff --git a/backend/apply/netifd_test.go b/backend/apply/netifd_test.go new file mode 100644 index 0000000..5097a0a --- /dev/null +++ b/backend/apply/netifd_test.go @@ -0,0 +1,154 @@ +package apply + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The router's network configuration through a row of changes to access's household: after each, the file +// ucode's netifd sync leaves, the servers it keeps down and why, and what it ran (testdata/netifd.uc). +func TestNetifdAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/netifd.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + Steps []struct { + What string `json:"what"` + Changed bool `json:"changed"` + Network string `json:"network"` + Blocked map[string]any `json:"blocked"` + ModelBlocked map[string]any `json:"model_blocked"` + Cmds []string `json:"cmds"` + Intents map[string]map[string]any `json:"intents"` + NoAWG bool `json:"no_awg"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Steps) != 9 { + t.Fatalf("%d steps", len(trace.Steps)) + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + dir := t.TempDir() + network, _ := os.ReadFile("testdata/network.uci") + os.WriteFile(dir+"/network", network, 0o644) + var cmds []string + r := &Router{RunDir: dir + "/run", Network: dir + "/network", Exec: func(name string, args ...string) (string, int) { + cmds = append(cmds, strings.Join(append([]string{name}, args...), " ")) + return "", 0 + }} + tools := true + caps := awg.Caps{V2: true, V3: true, Tools: "3.1"} + for i, want := range trace.Steps { + switch i { + case 2: + c.Set("home", "port", "4501") + c.Set("cabin", "enabled", "0") + case 3: + c.Set("home", "jmin", "90") + c.Set("home", "jmax", "50") + case 4: + c.Delete("home", "jmin") + c.Delete("home", "jmax") + c.Set("home", "name", "Anna's house") + case 5: + c.Set("home", "name", "House") + case 6: + c.DeleteSection("cabin") + c.Set("open", "ifname", "Not-A-Name") + case 7: + c.Set("home", "header_protection_key", "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=") + for _, k := range []string{"s1", "s2", "s3", "s4"} { + c.Set("home", k, "12") + } + c.Set("home", "i1", "") + c.Set("home", "disable_cookies", "on") + case 8: + tools = false + c.Set("home", "port", "4502") + } + cmds = nil + // as ucode's: each sync reads the settings anew, with who was kept down before + var before map[string]any + if raw, err := os.ReadFile(dir + "/run/netifd-blocked.json"); err == nil { + json.Unmarshal(raw, &before) + } + m := model.Load(c, before) + changed := r.Netifd(m, tools, caps) + fail := func(what string, got, exp any) { + t.Errorf("step %d (%s): %s\n go: %v\n ucode: %v", i, want.What, what, got, exp) + } + if changed != want.Changed { + fail("whether it changed", changed, want.Changed) + } + if got, _ := os.ReadFile(dir + "/network"); string(got) != want.Network { + g, w := strings.Split(string(got), "\n"), strings.Split(want.Network, "\n") + for n := 0; n < len(g) || n < len(w); n++ { + if n >= len(g) || n >= len(w) || g[n] != w[n] { + a, b := "(the end)", "(the end)" + if n < len(g) { + a = g[n] + } + if n < len(w) { + b = w[n] + } + fail("the network configuration, line "+string(rune('0'+(n+1)/10))+string(rune('0'+(n+1)%10)), a, b) + break + } + } + } + var blocked map[string]any + if raw, err := os.ReadFile(dir + "/run/netifd-blocked.json"); err == nil { + json.Unmarshal(raw, &blocked) + } + if !reflect.DeepEqual(blocked, want.Blocked) { + fail("who is kept down", blocked, want.Blocked) + } + kept := map[string]any{} + for id, srv := range m.Servers { + kept[id] = srv.Blocked + if why, is := srv.Blocked.(map[string]any); is { + kept[id] = why + } + } + if !reflect.DeepEqual(kept, want.ModelBlocked) { + fail("who the model holds as kept down", kept, want.ModelBlocked) + } + if strings.Join(cmds, "; ") != strings.Join(want.Cmds, "; ") { + fail("what was run", cmds, want.Cmds) + } + var all map[string]map[string]any + if raw, err := os.ReadFile(dir + "/run/iface-intent.json"); err == nil { + json.Unmarshal(raw, &all) + } + intents := map[string]map[string]any{} + for k, v := range all { + intents[k] = map[string]any{"reason": v["reason"], "name": v["name"]} + } + if !reflect.DeepEqual(intents, want.Intents) { + fail("why each tunnel goes down", intents, want.Intents) + } + if _, err := os.Stat(dir + "/run/netifd-no-awg"); (err == nil) != want.NoAWG { + fail("whether missing tools were told", err == nil, want.NoAWG) + } + } + left, _ := os.ReadDir(dir) + for _, e := range left { + if strings.HasPrefix(e.Name(), ".") { + t.Errorf("%s stays beside the configuration", e.Name()) + } + } +} diff --git a/backend/apply/reply.go b/backend/apply/reply.go new file mode 100644 index 0000000..7bb3809 --- /dev/null +++ b/backend/apply/reply.go @@ -0,0 +1,90 @@ +package apply + +import ( + "fmt" + "os" + "regexp" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// Our own answers leave by the main table: the portal's (TCP) and each tunnel's (UDP). Proxies on the +// router mark the router's own traffic in an output route chain, which diverts replies to outside clients +// into lo; a later output chain of our own (table inet dawnline_reply) clears exactly those marks on +// packets from our listening ports (dawnline.fw sync_reply_routes). + +const replyTable = "dawnline_reply" + +// Older versions kept answers out of proxies with `ip rule` at priority 90; it never matched. +var oldReplyRule = regexp.MustCompile(`(iif lo )?ipproto (tcp|udp) sport ([0-9]+) lookup main`) + +// Diverts is the policy rules that send marked traffic into a table with `local default`, the way +// transparent proxies capture the router's own traffic. +func (r *Router) Diverts() []health.Divert { + return health.ProxyDiverts(func(fam string) string { + out, _ := r.Exec("ip", fam, "rule", "show") + return out + }, func(fam, name string) string { + out, _ := r.Exec("ip", fam, "route", "show", "table", name) + return out + }) +} + +func (r *Router) replyLoaded() bool { + _, code := r.Exec("nft", "list", "table", "inet", replyTable) + return code == 0 +} + +// ReplyOK tells whether answers from our ports are kept out of these diverts right now (the watchdog's question). +func (r *Router) ReplyOK(m *model.Model, diverts []health.Divert) bool { + s := health.ReplyScript(m, diverts) + if s == "" { + return true + } + was, _ := os.ReadFile(r.RunDir + "/reply.nft") + return s == string(was) && r.replyLoaded() +} + +// ReplyRoutes keeps the reply table in step with our ports and the proxies' diverts (an apply, and every +// tick: a proxy may start after Dawnline). Cheap when nothing changed. +func (r *Router) ReplyRoutes(m *model.Model) { + sig := r.RunDir + "/reply.nft" + for _, fam := range []string{"-4", "-6"} { + out, _ := r.Exec("ip", fam, "rule", "show", "priority", "90") + for _, line := range strings.Split(out, "\n") { + if mm := oldReplyRule.FindStringSubmatch(line); mm != nil { + args := []string{fam, "rule", "del", "priority", "90"} + if mm[1] != "" { + args = append(args, "iif", "lo") + } + r.Exec("ip", append(args, "ipproto", mm[2], "sport", mm[3], "lookup", "main")...) + } + } + } + s := health.ReplyScript(m, r.Diverts()) + if s == "" { + if r.replyLoaded() { + r.say("info", "nftables", "table inet "+replyTable+": removed (no proxy to keep Dawnline's answers out of)") + r.Exec("nft", "delete", "table", "inet", replyTable) + } + os.Remove(sig) + return + } + if was, _ := os.ReadFile(sig); s == string(was) && r.replyLoaded() { + r.say("debug", "nftables", "table inet "+replyTable+": unchanged") + return + } + if err := r.load("table inet " + replyTable + "\ndelete table inet " + replyTable + "\n" + s); err != "" { + os.Remove(sig) + r.say("error", "nftables", "table inet "+replyTable+": loading failed · "+err) + return + } + r.say("info", "nftables", fmt.Sprintf("table inet %s: loaded · %d lines (Dawnline's own answers kept out of proxies)", replyTable, strings.Count(s, "\n")+1)) + for _, l := range strings.Split(strings.TrimRight(s, "\n"), "\n") { + r.say("debug", "nftables", "table inet "+replyTable+": "+l) + } + os.MkdirAll(r.RunDir, 0o755) + os.WriteFile(sig, []byte(s), 0o644) +} diff --git a/backend/apply/reply_test.go b/backend/apply/reply_test.go new file mode 100644 index 0000000..4347609 --- /dev/null +++ b/backend/apply/reply_test.go @@ -0,0 +1,108 @@ +package apply + +import ( + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The reply table follows the proxies: loaded when one diverts the router's own traffic, left alone while +// nothing changed, taken away with the proxy; the rules older versions left are removed. +func TestReplyRoutes(t *testing.T) { + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + dir := t.TempDir() + proxy, loaded, refuse := true, false, false + var ran []string + var script string + r := &Router{RunDir: dir, Exec: func(name string, args ...string) (string, int) { + line := name + " " + strings.Join(args, " ") + switch { + case line == "ip -4 rule show priority 90": + return "90:\tfrom all iif lo ipproto udp sport 51820 lookup main\n", 0 + case line == "ip -6 rule show priority 90": + return "90:\tfrom all ipproto tcp sport 8443 lookup main\n", 0 + case line == "ip -4 rule show" && proxy: + return "0:\tfrom all lookup local\n1000:\tfrom all fwmark 0x1/0xff lookup 100\n32766:\tfrom all lookup main\n", 0 + case line == "ip -4 route show table 100": + return "local default dev lo scope host\n", 0 + case strings.HasPrefix(line, "ip ") && strings.Contains(line, " show"): + return "", 0 + case line == "nft list table inet dawnline_reply": + if loaded { + return "", 0 + } + return "", 1 + case name == "nft" && args[0] == "-f": + raw, _ := os.ReadFile(args[1]) + script = string(raw) + if refuse { + return args[1] + ":1:1-5: Error: a made-up failure", 1 + } + loaded = true + return "", 0 + case line == "nft delete table inet dawnline_reply": + loaded = false + } + ran = append(ran, line) + return "", 0 + }} + sig := func() string { raw, _ := os.ReadFile(dir + "/reply.nft"); return string(raw) } + + r.ReplyRoutes(m) + if want := "ip -4 rule del priority 90 iif lo ipproto udp sport 51820 lookup main; ip -6 rule del priority 90 ipproto tcp sport 8443 lookup main"; strings.Join(ran, "; ") != want { + t.Errorf("the old rules: %v", ran) + } + if !loaded || !strings.HasPrefix(script, "table inet dawnline_reply\ndelete table inet dawnline_reply\ntable inet dawnline_reply {\n") || + !strings.Contains(script, "tcp sport { 4500, 4501 } meta mark & 0xff == 0x1 meta mark set meta mark & 0xffffff00\n") || + !strings.Contains(script, "udp sport { 4500, 4600, 4700 } meta mark & 0xff == 0x1") { + t.Errorf("the table was not loaded as it should be:\n%s", script) + } + if sig() == "" || !strings.HasSuffix(script, sig()) || !r.ReplyOK(m, r.Diverts()) { + t.Error("what was loaded is not remembered") + } + script = "" + r.ReplyRoutes(m) + if script != "" { + t.Error("loaded again with nothing changed") + } + // the table went (fw4 restarted, say): loaded again + loaded = false + if r.ReplyOK(m, r.Diverts()) { + t.Error("fine without the table") + } + r.ReplyRoutes(m) + if !loaded { + t.Error("not loaded again") + } + // a load that fails forgets what was loaded, so the next tick tries again + c.Set("home", "port", "4555") + m = model.Load(c, nil) + refuse = true + r.ReplyRoutes(m) + if sig() != "" { + t.Error("a failed load is remembered") + } + refuse = false + r.ReplyRoutes(m) + if !strings.Contains(sig(), "4555") { + t.Error("not loaded after the failure") + } + // the proxy is gone: so is the table + proxy = false + r.ReplyRoutes(m) + if loaded || sig() != "" || !r.ReplyOK(m, r.Diverts()) { + t.Error("the table stays without a proxy") + } + left, _ := os.ReadDir(dir) + for _, e := range left { + t.Errorf("%s stays in the state directory", e.Name()) + } +} diff --git a/backend/apply/resolver.go b/backend/apply/resolver.go new file mode 100644 index 0000000..08b1204 --- /dev/null +++ b/backend/apply/resolver.go @@ -0,0 +1,198 @@ +package apply + +import ( + "encoding/json" + "os" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The plain resolver for people with Home-only access (dawnline.resolver): real addresses from the WAN's +// DNS, home names from the LAN's. Their internet does not use the tunnel, so fake-IP answers would break +// it. It runs inside the netns while that exists, otherwise on the tunnel interfaces; procd runs dnsmasq +// through /usr/libexec/dawnline/resolver, which reads where from the configuration's first line. + +// ResolverPort is the port on the tunnel addresses while the resolver runs on the router itself. +const ResolverPort = 5354 + +var ( + dotted = regexp.MustCompile(`^[0-9.]+$`) + digits = regexp.MustCompile(`^[0-9]+$`) + netifdOK = regexp.MustCompile(`^[A-Za-z0-9_.-]+$`) +) + +// Target is where the resolver runs: "ns" (inside the netns, on Address) or "root" (on the tunnels). +type Target struct { + Mode string + Address string + Port int +} + +func (r *Router) varEtc() string { + if r.VarEtc != "" { + return r.VarEtc + } + return "/var/etc" +} + +func (r *Router) resolverPid() string { + if r.ResolverPid != "" { + return r.ResolverPid + } + return "/var/run/dawnline-dns.pid" +} + +// ResolverTarget is where Home-only devices' DNS goes now: inside the netns while it is up, otherwise on +// the tunnel addresses (dawnline.loop resolver_target). +func (r *Router) ResolverTarget() Target { + if active, _, _, transit := r.likeHome(); active && transit != "" { + return Target{Mode: "ns", Address: transit, Port: 53} + } + return Target{Mode: "root", Port: ResolverPort} +} + +// wanDNS is the DNS servers the WAN was given (IPv4), else two public ones. +func (r *Router) wanDNS() []string { + var out []string + snap := r.Snapshot() + wan := "" + if d := snap.Devices[snap.WAN]; d != nil { + wan = d.Logical + } + for _, name := range uniq([]string{wan, "wan", "wan6"}) { + if name == "" || !netifdOK.MatchString(name) { + continue + } + said, _ := r.Exec("ubus", "call", "network.interface."+name, "status") + var st struct { + DNS []string `json:"dns-server"` + } + if json.Unmarshal([]byte(said), &st) != nil { + continue + } + for _, a := range st.DNS { + if dotted.MatchString(a) { + out = append(out, a) + } + } + } + if len(out) == 0 { + return []string{"1.1.1.1", "8.8.8.8"} + } + return uniq(out) +} + +// lanDomains is the local domain of the LAN's DNS (dnsmasq `domain`) and Dawnline's own for device names. +func (r *Router) lanDomains(m *model.Model) []string { + var out []string + if raw, err := os.ReadFile(r.DHCP); err == nil { + if c, err := uci.Parse(string(raw)); err == nil { + for _, s := range c.OfType("dnsmasq") { + if d, _ := s.Get("domain"); d != "" { + out = append(out, d) + break + } + } + } + } + if m.Settings.Domain != "" { + out = append(out, m.Settings.Domain) + } + return uniq(out) +} + +// ResolverRunning tells whether the resolver's process is alive. +func (r *Router) ResolverRunning() bool { + raw, _ := os.ReadFile(r.resolverPid()) + pid := strings.Trim(string(raw), " \t\r\n\v\f") + if !digits.MatchString(pid) { + return false + } + _, err := os.Stat("/proc/" + pid) + return err == nil +} + +// Resolver writes the resolver's configuration for target, with home names from lan (the LAN's DNS, "": +// none); true when it changed (the running one is killed, and procd starts it again from the new file). +func (r *Router) Resolver(m *model.Model, target Target, lan string) bool { + etc := r.varEtc() + os.MkdirAll(etc, 0o755) + conf, resolv := etc+"/dawnline-dns.conf", etc+"/dawnline-dns.resolv" + // servers that are on: with none, the resolver idles on loopback + var ifs []string + for _, id := range m.ServerIDs() { + if s := m.Servers[id]; s.Enabled && tunnelOK(s) { + ifs = append(ifs, s.Ifname) + } + } + // the paths dnsmasq is told are the router's own, wherever a test keeps the files + lines := []string{"# mode=" + target.Mode, "# Generated by Dawnline: plain DNS for Home-only tunnel clients.", "port=" + strconv.Itoa(target.Port), + "no-hosts", "bogus-priv", "cache-size=1000", "pid-file=/var/run/dawnline-dns.pid", "user=dnsmasq", "group=dnsmasq"} + upstream := r.wanDNS() + if target.Mode == "ns" { + lines = append(lines, "listen-address="+target.Address, "bind-interfaces", "no-resolv") + // upstream from the transit address: forwarded through the router to the WAN + for _, a := range upstream { + lines = append(lines, "server="+a+"@"+target.Address) + } + } else { + // no tunnel on: loopback only (without any interface= line dnsmasq would answer everywhere) + lines = append(lines, "bind-dynamic") + if len(ifs) == 0 { + lines = append(lines, "listen-address=127.0.0.1") + } + for _, i := range ifs { + lines = append(lines, "interface="+i) + } + lines = append(lines, "resolv-file=/var/etc/dawnline-dns.resolv") + body := "" + for _, a := range upstream { + body += "nameserver " + a + "\n" + } + if was, _ := os.ReadFile(resolv); string(was) != body { + os.WriteFile(resolv, []byte(body), 0o644) + os.Chmod(resolv, 0o644) + } + } + if lan != "" { + for _, d := range r.lanDomains(m) { + lines = append(lines, "server=/"+d+"/"+lan) + } + } + text := strings.Join(lines, "\n") + "\n" + where := "loopback only (no tunnel on)" + if target.Mode == "ns" { + where = target.Address + ":" + strconv.Itoa(target.Port) + " in the netns" + } else if len(ifs) > 0 { + where = "port " + strconv.Itoa(target.Port) + " on " + strings.Join(ifs, ", ") + } + if was, _ := os.ReadFile(conf); string(was) == text { + r.say("debug", "dns", "resolver for Home-only devices: unchanged · "+where) + return false + } + os.WriteFile(conf, []byte(text), 0o644) + os.Chmod(conf, 0o644) + home := "" + if lan != "" { + home = " · home names via " + lan + } + r.say("info", "dns", "resolver for Home-only devices: "+conf+" written · "+where+" · upstream "+strings.Join(upstream, " ")+home+"; restarting it") + for _, l := range lines { + r.say("debug", "dns", "dnsmasq: "+l) + } + raw, _ := os.ReadFile(r.resolverPid()) + if pid := strings.Trim(string(raw), " \t\r\n\v\f"); digits.MatchString(pid) { + r.Exec("kill", pid) + } + return true +} + +// SyncResolver writes the resolver's configuration where it should run now; true when it changed. +func (r *Router) SyncResolver(m *model.Model) bool { + _, _, known, _ := r.likeHome() + return r.Resolver(m, r.ResolverTarget(), r.lanDNS(r.Snapshot(), known)) +} diff --git a/backend/apply/resolver_test.go b/backend/apply/resolver_test.go new file mode 100644 index 0000000..794ace5 --- /dev/null +++ b/backend/apply/resolver_test.go @@ -0,0 +1,94 @@ +package apply + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The Home-only resolver's configuration in each place it may run: the files ucode's own sync writes, and +// whether it changed (testdata/resolver.uc). +func TestResolverAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/resolver.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + DHCP string `json:"dhcp"` + Steps []struct { + What string `json:"what"` + Target struct { + Mode string `json:"mode"` + Address string `json:"address"` + Port int `json:"port"` + } `json:"target"` + Lan string `json:"lan"` + Changed bool `json:"changed"` + Conf string `json:"conf"` + Resolv string `json:"resolv"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Steps) != 6 { + t.Fatalf("%d steps", len(trace.Steps)) + } + dir := t.TempDir() + os.WriteFile(dir+"/dhcp", []byte(trace.DHCP), 0o644) + wanDNS := true + var killed []string + r := &Router{RunDir: dir + "/run", VarEtc: dir + "/etc", ResolverPid: dir + "/pid", DHCP: dir + "/dhcp", + Snapshot: func() *netview.Snapshot { return &netview.Snapshot{Devices: map[string]*netview.Device{}} }, + Exec: func(name string, args ...string) (string, int) { + line := name + " " + strings.Join(args, " ") + switch { + case name == "kill": + killed = append(killed, args...) + case !wanDNS: + case line == "ubus call network.interface.wan status": + return `{ "dns-server": [ "9.9.9.9", "2001:db8::1", "149.112.112.112" ] }`, 0 + case line == "ubus call network.interface.wan6 status": + return `{ "dns-server": [ "9.9.9.9" ] }`, 0 + } + return "", 0 + }} + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + for i, want := range trace.Steps { + switch i { + case 3: + c.Set("cabin", "enabled", "0") + os.WriteFile(dir+"/pid", []byte("4242\n"), 0o644) + case 4: + c.Set("home", "enabled", "0") + c.Set("open", "enabled", "0") + os.Remove(dir + "/pid") + case 5: + wanDNS = false + } + killed = nil + changed := r.Resolver(model.Load(c, nil), Target{Mode: want.Target.Mode, Address: want.Target.Address, Port: want.Target.Port}, want.Lan) + if changed != want.Changed { + t.Errorf("step %d (%s): changed %v, ucode %v", i, want.What, changed, want.Changed) + } + if got, _ := os.ReadFile(dir + "/etc/dawnline-dns.conf"); string(got) != want.Conf { + t.Errorf("step %d (%s): the configuration\n%s--- ucode:\n%s", i, want.What, got, want.Conf) + } + if got, _ := os.ReadFile(dir + "/etc/dawnline-dns.resolv"); string(got) != want.Resolv { + t.Errorf("step %d (%s): the upstream file\n%s--- ucode:\n%s", i, want.What, got, want.Resolv) + } + // the one that ran is stopped, so procd starts it from the new file + if stop := i == 3; stop != (strings.Join(killed, " ") == "4242") || (!stop && killed != nil) { + t.Errorf("step %d (%s): stopped %v", i, want.What, killed) + } + } +} diff --git a/backend/apply/routes.go b/backend/apply/routes.go new file mode 100644 index 0000000..9271ecf --- /dev/null +++ b/backend/apply/routes.go @@ -0,0 +1,127 @@ +package apply + +import ( + "encoding/json" + "os" + "sort" + + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" +) + +// The networks behind people's routers, as the router's own routes: a packet for one leaves through the +// tunnel of the router it stands behind (the tunnel then picks the device by the peers' AllowedIPs). +// +// Reconciled, not patched: every route of ours carries one routing protocol number, so what the main table +// holds of them is read back and brought to what the settings and people's states want. Netifd takes a +// tunnel's routes away with its interface; the sync that follows the interface coming up puts them back. + +// routeProto marks the routes Dawnline keeps (/etc/iproute2/rt_protos has no name for it). +const routeProto = "205" + +// RoutesWanted is the networks that get a route, by the tunnel's interface, sorted: those behind the +// devices a tunnel was given (peers: each server's "ok"), so a route never leads into a tunnel that would +// drop the packet. +func RoutesWanted(m *model.Model, states, peers map[string]string, behind map[string][]string) map[string][]string { + want := map[string][]string{} + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + if !srv.Enabled || !tunnelOK(srv) || peers[id] != "ok" { + continue + } + for _, d := range health.TunnelDevices(m, id, states) { + want[srv.Ifname] = append(want[srv.Ifname], behind[d.ID]...) + } + sort.Strings(want[srv.Ifname]) + if len(want[srv.Ifname]) == 0 { + delete(want, srv.Ifname) + } + } + return want +} + +// IPRoute is a route as `ip -j -4 route show` prints it. +type IPRoute struct { + Dst string `json:"dst"` + Dev string `json:"dev"` +} + +// RouteCmds is the `ip` arguments that turn the routes of ours there are into the wanted ones: the missing +// ones first, then the ones nobody has any more. None when they are as wanted. +func RouteCmds(want map[string][]string, have []IPRoute) [][]string { + there, wanted := map[string]bool{}, map[string]bool{} + for _, x := range have { + there[x.Dev+" "+x.Dst] = true + } + var cmds [][]string + ifnames := make([]string, 0, len(want)) + for ifname := range want { + ifnames = append(ifnames, ifname) + } + sort.Strings(ifnames) + for _, ifname := range ifnames { + for _, n := range want[ifname] { + if k := ifname + " " + n; !there[k] && !wanted[k] { + cmds = append(cmds, []string{"-4", "route", "replace", n, "dev", ifname, "proto", routeProto, "scope", "link"}) + } + wanted[ifname+" "+n] = true + } + } + for _, x := range have { + if !wanted[x.Dev+" "+x.Dst] { + cmds = append(cmds, []string{"-4", "route", "del", x.Dst, "dev", x.Dev, "proto", routeProto}) + } + } + return cmds +} + +// routes keeps the routes to the networks behind routers as RoutesWanted says: "" when they are, else what +// `ip` said of the first that failed. states is whose devices were loaded, peers what each tunnel answered. +func (r *Router) routes(m *model.Model, states, peers map[string]string, behind map[string][]string) string { + out, code := r.Exec("ip", "-j", "-4", "route", "show", "proto", routeProto) + var have []IPRoute + if code == 0 { + json.Unmarshal([]byte(trimmed(out)), &have) + } + failed := "" + var added, removed []string + for _, args := range RouteCmds(RoutesWanted(m, states, peers, behind), have) { + said, code := r.Exec("ip", args...) + what := args[3] + " dev " + args[5] + switch { + case code != 0 && args[2] == "replace": + if failed == "" { + failed = what + ": " + trimmed(said) + } + case args[2] == "replace": + added = append(added, what) + case code == 0: + removed = append(removed, what) + } + } + if len(added) > 0 || len(removed) > 0 { + line := "networks behind routers:" + if len(added) > 0 { + line += " added " + someOf(added) + } + if len(removed) > 0 { + line += " removed " + someOf(removed) + } + r.say("info", "routes", line) + } + // once per distinct failure, as the access table's + path := r.RunDir + "/routes.err" + was, werr := os.ReadFile(path) + switch { + case failed == "" && werr == nil: + os.Remove(path) + case failed != "" && (werr != nil || string(was) != failed): + if r.Log != nil { + r.Log.Write("dawnline", "error", "couldn't set a route to a network behind a router", failed, "Routes", servicelog.Extra{}) + } + os.MkdirAll(r.RunDir, 0o755) + os.WriteFile(path, []byte(failed), 0o644) + } + return failed +} diff --git a/backend/apply/routes_test.go b/backend/apply/routes_test.go new file mode 100644 index 0000000..6be70df --- /dev/null +++ b/backend/apply/routes_test.go @@ -0,0 +1,191 @@ +package apply + +import ( + "encoding/json" + "os" + "reflect" + "sort" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// routed is a router that keeps the routes it is given, besides what stand keeps. +type routed struct { + stand + routes map[string]bool + fail string + ran []string +} + +func (s *routed) exec(name string, args ...string) (string, int) { + if name != "ip" { + return s.stand.exec(name, args...) + } + line := strings.Join(args, " ") + switch { + case line == "-j -4 route show proto "+routeProto: + var list []IPRoute + for k := range s.routes { + f := strings.Fields(k) + list = append(list, IPRoute{Dev: f[0], Dst: f[1]}) + } + sort.Slice(list, func(i, j int) bool { return list[i].Dev+list[i].Dst < list[j].Dev+list[j].Dst }) + raw, _ := json.Marshal(list) + return string(raw), 0 + case strings.HasPrefix(line, "-4 route replace ") && strings.HasSuffix(line, " proto "+routeProto+" scope link"): + s.ran = append(s.ran, line) + if s.fail != "" && strings.Contains(line, s.fail) { + return "RTNETLINK answers: a made-up failure\n", 2 + } + s.routes[args[5]+" "+args[3]] = true + case strings.HasPrefix(line, "-4 route del ") && strings.HasSuffix(line, " proto "+routeProto): + s.ran = append(s.ran, line) + delete(s.routes, args[5]+" "+args[3]) + default: + return "unknown: ip " + line, 1 + } + return "", 0 +} + +// Access's household on the golden's router, with two routers that have networks behind them and one +// whose network the router has itself. +func sites(t *testing.T) (*uci.Config, *netview.Snapshot) { + t.Helper() + text, err := os.ReadFile("../access/testdata/access.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + c.Set("bphone", "kind", "router") + c.SetList("bphone", "behind_net", []string{"192.168.2.0/24", "172.20.0.0/16"}) + c.Set("kphone", "kind", "router") + c.SetList("kphone", "behind_net", []string{"192.168.3.0/24"}) + c.Set("hphone", "kind", "router") + c.SetList("hphone", "behind_net", []string{"192.168.50.0/24"}) + raw, err := os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + return c, netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }}) +} + +func TestRoutesFollowTheTunnels(t *testing.T) { + c, snap := sites(t) + dir := t.TempDir() + s := &routed{stand: stand{dir: dir, refuse: map[string]bool{}, down: map[string]bool{}, confs: map[string]string{}}, routes: map[string]bool{}} + r := &Router{RunDir: dir, HostsFile: dir + "/hosts/dawnline", DHCP: dir + "/no-dhcp", Exec: s.exec, Snapshot: func() *netview.Snapshot { return snap }} + words := i18n.Use("", "") + have := func() []string { + out := []string{} + for k := range s.routes { + out = append(out, k) + } + sort.Strings(out) + return out + } + sync := func() Result { + s.ran = nil + return r.Sync(model.Load(c, nil), &usage.Usage{}, 1700000000, false, words) + } + // each router's networks leave through its own tunnel; what the router has itself gets no route + res := sync() + all := []string{"dawn0 172.20.0.0/16", "dawn0 192.168.2.0/24", "dawn2 192.168.3.0/24"} + if !reflect.DeepEqual(have(), all) || res.Routes != "" || res.Warning != "" { + t.Fatalf("routes %v, %q, %q", have(), res.Routes, res.Warning) + } + // the tunnel is told whose they are, and nobody else gets more than an address + if conf := s.confs["dawn0"]; !strings.Contains(conf, "AllowedIPs = 10.77.0.5/32, 192.168.2.0/24, 172.20.0.0/16\n") || + strings.Count(conf, "/32\n") != strings.Count(conf, "AllowedIPs = ")-1 { + t.Errorf("dawn0's devices:\n%s", conf) + } + if conf := s.confs["dawn1"]; strings.Contains(conf, "192.168.50.0/24") { + t.Errorf("dawn1 was given a network the router has itself:\n%s", conf) + } + // nothing moved: nothing is run + if sync(); len(s.ran) != 0 { + t.Errorf("ran %v with nothing to do", s.ran) + } + // its owner paused: the route goes with the device + c.Set("boris", "paused", "1") + if sync(); !reflect.DeepEqual(have(), []string{"dawn2 192.168.3.0/24"}) { + t.Errorf("with Boris paused: %v", have()) + } + c.Delete("boris", "paused") + // a tunnel that refuses its devices, and one that is down: no route leads into either + s.refuse["dawn0"], s.down["dawn2"] = true, true + if sync(); len(have()) != 0 { + t.Errorf("into tunnels that hold nobody: %v", have()) + } + s.refuse["dawn0"], s.down["dawn2"] = false, false + // a route that will not go in is told, once in the log's file, and the others still go in + s.fail = "192.168.2.0/24" + res = sync() + if !reflect.DeepEqual(have(), []string{"dawn0 172.20.0.0/16", "dawn2 192.168.3.0/24"}) || !strings.Contains(res.Routes, "192.168.2.0/24 dev dawn0: RTNETLINK answers: a made-up failure") || + !strings.Contains(res.Warning, "192.168.2.0/24 dev dawn0") { + t.Errorf("a route refused: %v, %q, %q", have(), res.Routes, res.Warning) + } + if kept, _ := os.ReadFile(dir + "/routes.err"); string(kept) != res.Routes { + t.Errorf("kept %q", kept) + } + s.fail = "" + if res = sync(); !reflect.DeepEqual(have(), all) || res.Routes != "" { + t.Errorf("after the failure: %v, %q", have(), res.Routes) + } + if _, err := os.Stat(dir + "/routes.err"); err == nil { + t.Error("the failure is still kept") + } + // a network taken off, a router that is one no more, and a route of ours nobody wants + c.SetList("bphone", "behind_net", []string{"172.20.0.0/16"}) + c.Set("kphone", "kind", "phone") + s.routes["dawn9 192.168.99.0/24"] = true + if sync(); !reflect.DeepEqual(have(), []string{"dawn0 172.20.0.0/16"}) { + t.Errorf("after the changes: %v", have()) + } + // a router that waits for the admin's answer: no device of the tunnel, no route to what it asks for + c.Set("kphone", "kind", "router") + c.Set("kphone", "waiting", "1") + if sync(); !reflect.DeepEqual(have(), []string{"dawn0 172.20.0.0/16"}) || strings.Contains(s.confs["dawn2"], "10.79.0.2/32") || !strings.Contains(s.confs["dawn2"], "10.79.0.3/32") { + t.Errorf("with Kira's router waiting: %v\n%s", have(), s.confs["dawn2"]) + } + // the plan of a sync names them too + p := r.Plan(model.Load(c, nil), &usage.Usage{}, 1700000000) + if !reflect.DeepEqual(p.Routes, map[string][]string{"dawn0": {"172.20.0.0/16"}}) { + t.Errorf("the plan's routes: %v", p.Routes) + } +} + +func TestRouteCommands(t *testing.T) { + want := map[string][]string{"dawn1": {"192.168.3.0/24"}, "dawn0": {"172.20.0.0/16", "192.168.2.0/24"}} + have := []IPRoute{{Dst: "192.168.2.0/24", Dev: "dawn0"}, {Dst: "192.168.2.0/24", Dev: "dawn1"}, {Dst: "10.9.0.0/24", Dev: "dawn7"}} + got := RouteCmds(want, have) + exp := [][]string{ + {"-4", "route", "replace", "172.20.0.0/16", "dev", "dawn0", "proto", routeProto, "scope", "link"}, + {"-4", "route", "replace", "192.168.3.0/24", "dev", "dawn1", "proto", routeProto, "scope", "link"}, + {"-4", "route", "del", "192.168.2.0/24", "dev", "dawn1", "proto", routeProto}, + {"-4", "route", "del", "10.9.0.0/24", "dev", "dawn7", "proto", routeProto}, + } + if !reflect.DeepEqual(got, exp) { + t.Errorf("commands:\n%v\nwant\n%v", got, exp) + } + if got := RouteCmds(want, []IPRoute{{Dst: "172.20.0.0/16", Dev: "dawn0"}, {Dst: "192.168.2.0/24", Dev: "dawn0"}, {Dst: "192.168.3.0/24", Dev: "dawn1"}}); len(got) != 0 { + t.Errorf("as wanted, yet %v", got) + } +} diff --git a/backend/apply/sync.go b/backend/apply/sync.go new file mode 100644 index 0000000..5ec33cd --- /dev/null +++ b/backend/apply/sync.go @@ -0,0 +1,545 @@ +// Package apply puts the settings into effect on the router, as dawnline.apply does. This file is the +// runtime sync: the access table's sets, the devices into the tunnels (AmneziaWG peers) and the hostnames. +// Cheap, and safe to call often. +// +// Fail closed: without the table the firewall would let every loaded device reach everything, so while it +// is missing no device is loaded at all. An older table that survived a failed rebuild keeps limiting them +// with the sets it has, and the devices still follow people's states (a revoked one leaves). +// +// Held to ucode on a router whose `nft` and `awg` are stand-ins that keep what they are given +// (testdata/trace.uc, scripts/ucode-golden.sh): the scripts loaded, the peers of each tunnel, the +// hostnames and what is answered, through a table that is not there yet, one that will not load and a +// tunnel that refuses its devices. +package apply + +import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "fmt" + "os" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/nft" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// Router is the router a sync works on. +type Router struct { + // RunDir is the state directory (locks, what was last loaded); HostsFile where dnsmasq reads extra names; + // Network the router's network configuration, Firewall its firewall's. + RunDir, HostsFile, Network, Firewall string + // VarEtc is where generated configurations go ("": /var/etc); ResolverPid the Home-only resolver's pid file. + VarEtc, ResolverPid string + // Remember keeps the LAN address the home-like path chose (settings.lan_address), so it is the same after a restart. + Remember func(address string) + // dry: nothing outside the files this router is given is written (ApplyPlan). + dry bool + // SysNet is where the kernel shows interfaces ("": /sys/class/net), NetnsDir where named network + // namespaces are ("": /var/run/netns), Leases dnsmasq's leases ("": /tmp/dhcp.leases). + SysNet, NetnsDir, Leases string + // Exec runs a command: what it said (both streams) and its exit code. + Exec func(name string, args ...string) (out string, code int) + // Snapshot is the router's interfaces; DHCP the path of its DHCP settings. + Snapshot func() *netview.Snapshot + DHCP string + Log *servicelog.Log +} + +// Result is what a sync came to: each server's devices ("ok", "down", or what awg said), people's states, +// the table's error ("" when it loaded), the routes' ("" when they are as wanted) and a sentence for the +// admin when it did not fully take. +type Result struct { + Peers map[string]string + States map[string]string + Table string + Routes string + Warning string +} + +func (r *Router) say(level, src, line string) { + if r.Log != nil { + r.Log.Say(level, src, line) + } +} + +// someOf names up to ten of a list, and how many more there are. +func someOf(list []string) string { + if len(list) <= 10 { + return strings.Join(list, ", ") + } + return strings.Join(list[:10], ", ") + " and " + strconv.Itoa(len(list)-10) + " more" +} + +func minus(a, b []string) []string { + in := map[string]bool{} + for _, x := range b { + in[x] = true + } + var out []string + for _, x := range a { + if !in[x] { + out = append(out, x) + } + } + return out +} + +func uniq(list []string) []string { + out := []string{} + seen := map[string]bool{} + for _, x := range list { + if !seen[x] { + seen[x] = true + out = append(out, x) + } + } + return out +} + +// tunnelOK tells a server that runs one of Dawnline's own tunnels. +func tunnelOK(srv *model.Server) bool { + _, ok := ipnet.Subnet(srv.Subnet) + return ok && srv.PrivateKey != "" && srv.Blocked == nil && model.ValidIfname(srv.Ifname) +} + +// likeHome is the home-like path as it stands (dawnline.loop status): whether it is up, its address on the +// LAN, the LAN's DNS it found and its address on the inner link. +func (r *Router) likeHome() (active bool, address, dns, transit string) { + var s struct { + Plan *struct { + Address string `json:"address"` + DNS string `json:"dns"` + TxNS string `json:"tx_ns"` + } `json:"plan"` + } + files.ReadJSON(r.RunDir+"/loop.json", &s) + if s.Plan == nil { + return false, "", "", "" + } + _, e1 := os.Stat("/sys/class/net/dlx0") + _, e2 := os.Stat("/sys/class/net/dll0") + return e1 == nil && e2 == nil, s.Plan.Address, s.Plan.DNS, s.Plan.TxNS +} + +var dnsOption = regexp.MustCompile(`^(option:dns-server|6),([0-9.]+)`) + +// lanDNS is the DNS the LAN gets from DHCP (option 6), else the router on the LAN (dawnline.loop lan_dns); +// known is what the home-like path found already. +func (r *Router) lanDNS(snap *netview.Snapshot, known string) string { + out := known + if lan := snap.Devices[snap.LAN]; out == "" && lan != nil && len(lan.Addrs) > 0 { + out = strings.SplitN(lan.Addrs[0], "/", 2)[0] + if _, ok := ipnet.Subnet(lan.Addrs[0]); ok { + if raw, err := os.ReadFile(r.DHCP); err == nil { + if c, err := uci.Parse(string(raw)); err == nil { + found := "" + for _, s := range c.OfType("dhcp") { + iface, _ := s.Get("interface") + if ignore, _ := s.Get("ignore"); iface != lan.Logical || ignore == "1" { + continue + } + v := s.Values["dhcp_option"] + opts := v.List + if !v.IsList && v.Str != "" { + opts = []string{v.Str} + } + for _, o := range opts { + if m := dnsOption.FindStringSubmatch(o); m != nil && found == "" { + found = m[2] + } + } + } + if found != "" { + out = found + } + } + } + } + } + return out +} + +// Ctx is what the table is made from besides the settings, read from the router (dawnline.nft router_ctx). +func (r *Router) Ctx(snap *netview.Snapshot) nft.Ctx { + active, address, dns, transit := r.likeHome() + ctx := nft.Ctx{Snap: snap, ResolverPort: 5354} + if active { + ctx.DNSAddr = address + if transit != "" { + ctx.ResolverNS, ctx.ResolverPort = transit, 53 + } + } + ctx.LanDNS = r.lanDNS(snap, dns) + return ctx +} + +// load runs an nft script (one transaction): "" when it loaded, else what nft said. +func (r *Router) load(script string) string { + os.MkdirAll(r.RunDir, 0o755) + // a file of its own: two writers must never load each other's script + var b [4]byte + rand.Read(b[:]) + f := r.RunDir + "/nft." + hex.EncodeToString(b[:]) + ".rules" + if os.WriteFile(f, []byte(script), 0o600) != nil { + return "couldn't write " + f + } + out, code := r.Exec("nft", "-f", f) + os.Remove(f) + if code == 0 { + return "" + } + // without the random file name, so the same failure reads the same every time + if said := strings.ReplaceAll(strings.Trim(out, " \t\r\n\v\f"), f, "rules"); said != "" { + return said + } + return fmt.Sprintf("nft exited with %d", code) +} + +// Present tells whether the table is loaded. +func (r *Router) Present() bool { + _, code := r.Exec("nft", "list", "table", "inet", "dawnline") + return code == 0 +} + +// logSets tells the sets in syslog: each that changed, or that none did; remembered for the next time. +func (r *Router) logSets(sets nft.Sets, how string) { + path := r.RunDir + "/nft-sets.json" + var was map[string][]string + first := !files.ReadJSON(path, &was) || was == nil + now := map[string][]string{} + var diff, counts []string + for _, name := range nft.Names { + a, b := uniq(was[name]), uniq(sets[name]) + now[name] = b + counts = append(counts, name+" "+strconv.Itoa(len(b))) + add, del := minus(b, a), minus(a, b) + if len(add) > 0 || len(del) > 0 { + line := fmt.Sprintf("%s %d → %d", name, len(a), len(b)) + if len(add) > 0 { + line += ": +" + someOf(add) + } + if len(del) > 0 { + if len(add) > 0 { + line += " -" + someOf(del) + } else { + line += ": -" + someOf(del) + } + } + diff = append(diff, line) + } + } + files.WriteJSON(path, now, 0o600) + switch { + // the first load since the router started: how many in each set (the members at debug) + case first: + r.say("info", "nftables", "table inet dawnline: "+how+" · "+strings.Join(counts, ", ")) + for _, n := range nft.Names { + if len(now[n]) > 0 { + r.say("debug", "nftables", "set "+n+": "+strings.Join(now[n], " ")) + } + } + case len(diff) > 0: + r.say("info", "nftables", "table inet dawnline: "+how+" · "+strings.Join(diff, "; ")) + default: + r.say("debug", "nftables", "table inet dawnline: "+how+" · sets unchanged ("+strings.Join(counts, ", ")+")") + } +} + +// rebuild replaces the whole table: "" or the error. +// +// members: a runtime sync, where only who is in the sets may have moved. The table is replaced whole all +// the same: to add an element to a set that exists, nft first reads the router's whole ruleset, every +// other program's sets with it (0.9 s on an MT7981 beside a proxy's lists), where replacing our own table +// reads nothing (0.06 s). The line in the log is then the sets', and the rebuild's own is for a debug log. +func (r *Router) rebuild(m *model.Model, sets nft.Sets, snap *netview.Snapshot, members bool) string { + table := nft.Render(m, sets, r.Ctx(snap)) + if err := r.load(nft.Rebuild(table)); err != "" { + r.say("error", "nftables", "table inet dawnline: rebuild failed · "+err) + return err + } + chains, nsets, rules := nft.Shape(table) + level, how := "info", "sets loaded with the table" + if members { + level, how = "debug", "sets updated" + } + r.say(level, "nftables", fmt.Sprintf("table inet dawnline: rebuilt · %d chains, %d sets, %d rules", chains, nsets, rules)) + r.logSets(sets, how) + return "" +} + +// table has the table in place, replaced whole every time: with `full` after a change of its shape, +// otherwise for who is in its sets. A failure is told in the service log once per distinct error. +func (r *Router) table(m *model.Model, sets nft.Sets, snap *netview.Snapshot, full bool) string { + err := r.rebuild(m, sets, snap, !full) + path := r.RunDir + "/nft.err" + was, werr := os.ReadFile(path) + if err == "" { + if werr == nil { + os.Remove(path) + } + return "" + } + if werr != nil || string(was) != err { + msg := "couldn't load - no device is loaded into the tunnels until they do" + if r.Present() { + msg = "couldn't be updated - the previous rules stay, and changes to access wait until they load" + } + if r.Log != nil { + r.Log.Write("dawnline", "error", msg, err, "Access rules", servicelog.Extra{}) + } + os.MkdirAll(r.RunDir, 0o755) + os.WriteFile(path, []byte(err), 0o644) + } + return err +} + +// PeersConf is what a tunnel is given to hold: its own key and port, then each device that belongs there +// with the networks behind it (behind: by the device's id), and who they are for a log line +// ("Person · Device (address)"). +func PeersConf(m *model.Model, srv *model.Server, states map[string]string, behind map[string][]string) (conf string, who []string) { + lines := []string{"[Interface]", "PrivateKey = " + srv.PrivateKey, "ListenPort = " + strconv.Itoa(srv.Port), ""} + who = []string{} + for _, d := range health.TunnelDevices(m, srv.ID, states) { + lines = append(lines, "[Peer]", "PublicKey = "+d.PublicKey) + if d.PresharedKey != "" { + lines = append(lines, "PresharedKey = "+d.PresharedKey) + } + // a router brings the networks behind it: the tunnel takes their packets from it and sends theirs to it + lines = append(lines, "AllowedIPs = "+strings.Join(append([]string{d.Address + "/32"}, behind[d.ID]...), ", "), "") + name := d.Person + if p := m.People[d.Person]; p != nil { + name = p.Name + } + who = append(who, name+" · "+d.Name+" ("+strings.Join(append([]string{d.Address}, behind[d.ID]...), ", ")+")") + } + return strings.Join(lines, "\n"), who +} + +// peers pushes every server's devices to the kernel without restarting its tunnel. +func (r *Router) peers(m *model.Model, states map[string]string, behind map[string][]string) map[string]string { + os.MkdirAll(r.RunDir, 0o755) + res := map[string]string{} + path := r.RunDir + "/peers-seen.json" + seen := map[string][]string{} + files.ReadJSON(path, &seen) + now := map[string][]string{} + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + // only Dawnline's own interfaces: never another tunnel of the same name + if !srv.Enabled || !tunnelOK(srv) { + continue + } + if _, code := r.Exec("awg", "show", srv.Ifname, "public-key"); code != 0 { + res[id] = "down" + r.say("debug", "awg", "interface "+srv.Ifname+" ("+srv.Name+"): down, no devices to load") + continue + } + conf, who := PeersConf(m, srv, states, behind) + f := r.RunDir + "/" + srv.Ifname + ".conf" + os.WriteFile(f, []byte(conf), 0o600) + out, code := r.Exec("awg", "syncconf", srv.Ifname, f) + os.Remove(f) + if code != 0 { + res[id] = strings.Trim(out, " \t\r\n\v\f") + if r.Log != nil { + r.Log.Write("awg", "error", "couldn't load devices into the tunnel", res[id], srv.Name, servicelog.Extra{}) + } + continue + } + res[id] = "ok" + // who came in and who left since the last load: info; the same peers: debug + now[srv.Ifname] = who + plural := "peers" + if len(who) == 1 { + plural = "peer" + } + head := fmt.Sprintf("interface %s (%s): awg syncconf · listen port %d · %d %s", srv.Ifname, srv.Name, srv.Port, len(who), plural) + was, had := seen[srv.Ifname] + if !had { + r.say("info", "awg", head+" loaded") + r.say("debug", "awg", "interface "+srv.Ifname+": "+strings.Join(who, ", ")) + continue + } + add, del := minus(who, was), minus(was, who) + switch { + case len(add) > 0 || len(del) > 0: + line := head + if len(add) > 0 { + line += " · added " + someOf(add) + } + if len(del) > 0 { + line += " · removed " + someOf(del) + } + r.say("info", "awg", line) + default: + r.say("debug", "awg", head+", unchanged") + } + } + a, _ := json.Marshal(now) + b, _ := json.Marshal(seen) + if string(a) != string(b) { + files.WriteJSON(path, now, 0o600) + } + return res +} + +// Hosts is the names dnsmasq is given for people's devices: one label a device, unique within the person +// (the pages show the same), and the router's own on the LAN while the home-like path is up. +func Hosts(m *model.Model, lanAddress string) (body string, names int) { + var lines []string + if m.Settings.Hostnames { + for _, pid := range m.PersonIDs() { + p := m.People[pid] + labels := view.Labels(m, p) + for _, id := range p.Devices { + if d := m.Devices[id]; d != nil { + if _, ok := ipnet.IP(d.Address); ok { + lines = append(lines, d.Address+" "+labels[id]+"."+p.ID+"."+m.Settings.Domain) + } + } + } + } + } + if lanAddress != "" { + lines = append(lines, lanAddress+" dawnline."+m.Settings.Domain) + } + if len(lines) == 0 { + return "", 0 + } + return strings.Join(lines, "\n") + "\n", len(lines) +} + +// hosts keeps the names file as Hosts says and has dnsmasq read it again when it changed. +func (r *Router) hosts(m *model.Model) bool { + active, address, _, _ := r.likeHome() + if !active { + address = "" + } + body, n := Hosts(m, address) + was, _ := os.ReadFile(r.HostsFile) + // dnsmasq runs as its own user: a file only root reads is no use to it + readable := false + if st, err := os.Stat(r.HostsFile); err == nil { + readable = st.Mode().Perm()&0o004 != 0 + } + if string(was) == body && (body == "" || readable) { + r.say("debug", "dns", fmt.Sprintf("%s: unchanged · %d names", r.HostsFile, n)) + return false + } + if i := strings.LastIndex(r.HostsFile, "/"); i > 0 { + os.MkdirAll(r.HostsFile[:i], 0o755) + } + if body == "" { + os.Remove(r.HostsFile) + r.say("info", "dns", r.HostsFile+": removed (no device names)") + } else { + os.WriteFile(r.HostsFile, []byte(body), 0o644) + os.Chmod(r.HostsFile, 0o644) + r.say("info", "dns", fmt.Sprintf("%s: %d names written (*.%s) · killall -HUP dnsmasq", r.HostsFile, n, m.Settings.Domain)) + } + r.Exec("killall", "-HUP", "dnsmasq") + return true +} + +// Sync is the runtime sync: with the apply lock held, the access sets first, then the devices into the +// tunnels, then the hostnames. `full` rebuilds the whole table (its shape changed). +func (r *Router) Sync(m *model.Model, u *usage.Usage, now int64, full bool, t *i18n.Catalog) Result { + defer files.Lock(r.RunDir, "apply")() + return r.sync(m, u, now, full, t) +} + +// sync is Sync with the apply lock held already. +func (r *Router) sync(m *model.Model, u *usage.Usage, now int64, full bool, t *i18n.Catalog) Result { + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = state.Of(m, m.People[id], u, now) + } + snap := r.Snapshot() + sets := nft.AccessSets(m, states, snap) + table := r.table(m, sets, snap, full) + // fail closed: with no table at all, nobody is loaded + loaded := states + if table != "" && !r.Present() { + loaded = map[string]string{} + } + behind := snap.Behind(m) + peers := r.peers(m, loaded, behind) + routes := r.routes(m, loaded, peers, behind) + r.hosts(m) + os.MkdirAll(r.RunDir, 0o755) + files.WriteJSON(r.RunDir+"/states.json", states, 0o644) + // what an admin should hear when it did not fully take, with what nft or awg said + var out []string + if table != "" { + if r.Present() { + out = append(out, fmt.Sprintf(t.T("Access rules couldn't be updated (%s): the previous rules stay, so this change isn't in effect yet."), table)) + } else { + out = append(out, fmt.Sprintf(t.T("Access rules couldn't load (%s): no device is loaded into the tunnels until they do."), table)) + } + } + for _, id := range m.ServerIDs() { + if res, has := peers[id]; has && res != "ok" && res != "down" { + out = append(out, fmt.Sprintf(t.T("Couldn't load devices into %s: %s."), m.Servers[id].Name, res)) + } + } + if routes != "" { + out = append(out, fmt.Sprintf(t.T("Couldn't set the routes to the networks behind routers (%s): they aren't reachable yet."), routes)) + } + warning := "" + if len(out) > 0 { + warning = strings.Join(append(out, t.T("Open Overview → Health.")), " ") + } + return Result{Peers: peers, States: states, Table: table, Routes: routes, Warning: warning} +} + +// Plan is what a sync would load, with nothing loaded: the table's text, the script for its sets, each +// tunnel's peers by interface, the routes to the networks behind routers by interface (as if every tunnel +// took its devices) and the hostnames. For holding the Go sync to what a router runs now. +type Plan struct { + Table string `json:"table"` + Update string `json:"update"` + Peers map[string]string `json:"peers"` + Routes map[string][]string `json:"routes,omitempty"` + Hosts string `json:"hosts"` +} + +// Plan works a sync out and loads nothing. +func (r *Router) Plan(m *model.Model, u *usage.Usage, now int64) Plan { + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = state.Of(m, m.People[id], u, now) + } + snap := r.Snapshot() + sets := nft.AccessSets(m, states, snap) + p := Plan{Table: nft.Render(m, sets, r.Ctx(snap)), Update: nft.Update(sets), Peers: map[string]string{}} + behind := snap.Behind(m) + took := map[string]string{} + for _, id := range m.ServerIDs() { + if srv := m.Servers[id]; srv.Enabled && tunnelOK(srv) { + p.Peers[srv.Ifname], _ = PeersConf(m, srv, states, behind) + took[id] = "ok" + } + } + if want := RoutesWanted(m, states, took, behind); len(want) > 0 { + p.Routes = want + } + active, address, _, _ := r.likeHome() + if !active { + address = "" + } + p.Hosts, _ = Hosts(m, address) + return p +} diff --git a/backend/apply/sync_test.go b/backend/apply/sync_test.go new file mode 100644 index 0000000..1a02757 --- /dev/null +++ b/backend/apply/sync_test.go @@ -0,0 +1,190 @@ +package apply + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// stand is a router whose nft and awg keep what they are given, as the golden's stand-ins do. +type stand struct { + dir string + present, nftFail bool + refuse, down map[string]bool + scripts []string + confs map[string]string +} + +func (s *stand) exec(name string, args ...string) (string, int) { + switch { + case name == "nft" && args[0] == "-f": + raw, _ := os.ReadFile(args[1]) + s.scripts = append(s.scripts, string(raw)) + if s.nftFail { + return args[1] + ":1:1-5: Error: a made-up failure\n", 1 + } + if strings.HasPrefix(string(raw), "flush set") { + if !s.present { + return args[1] + ":1:1-9: Error: No such file or directory\n", 1 + } + } else { + s.present = true + } + return "", 0 + case name == "nft" && args[0] == "list": + if s.present { + return "", 0 + } + return "", 1 + case name == "awg" && args[0] == "show": + if s.down[args[1]] { + return "", 1 + } + return "", 0 + case name == "awg" && args[0] == "syncconf": + raw, _ := os.ReadFile(args[2]) + s.confs[args[1]] = string(raw) + if s.refuse[args[1]] { + return "Line unrecognized: a made-up refusal\n", 1 + } + return "", 0 + } + return "", 0 +} + +// A row of syncs of access's household, each as ucode's sync does it on the golden's router: the scripts +// loaded, each tunnel's peers, the hostnames, the states and what is answered (testdata/trace.uc). +func TestSyncAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + Steps []struct { + What string `json:"what"` + Peers map[string]string `json:"peers"` + Table *string `json:"table"` + Warning *string `json:"warning"` + States map[string]string `json:"states"` + Scripts []string `json:"scripts"` + Confs map[string]string `json:"confs"` + Hosts *string `json:"hosts"` + HostsMode *bool `json:"hosts_mode"` + NftErr *string `json:"nft_err"` + Present bool `json:"present"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Steps) != 9 { + t.Fatalf("%d steps", len(trace.Steps)) + } + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + raw, _ = os.ReadFile("../netview/testdata/trace.json") + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + json.Unmarshal(raw, &router) + fw, _ := uci.Parse(router.Firewall) + snap := netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + dir := t.TempDir() + s := &stand{dir: dir, refuse: map[string]bool{}, down: map[string]bool{}} + r := &Router{RunDir: dir, HostsFile: dir + "/hosts/dawnline", DHCP: dir + "/no-dhcp", Exec: s.exec, Snapshot: func() *netview.Snapshot { return snap }} + str := func(p *string) string { + if p == nil { + return "" + } + return *p + } + for i, want := range trace.Steps { + // what the golden does before each step + switch i { + case 2: + c.Set("anna", "paused", "1") + case 3: + c.Delete("anna", "paused") + s.nftFail = true + case 4: + s.present = false + case 6: + s.nftFail = false + s.refuse["dawn0"] = true + case 7: + s.refuse["dawn0"] = false + s.down["dawn1"] = true + case 8: + s.down["dawn1"] = false + } + s.scripts, s.confs = nil, map[string]string{} + res := r.Sync(model.Load(c, nil), usage.Empty(), 1_800_000_000, false, nil) + fail := func(what string, got, exp any) { + t.Errorf("step %d (%s): %s\n go: %v\n ucode: %v", i, want.What, what, got, exp) + } + if !reflect.DeepEqual(res.Peers, want.Peers) { + fail("each server's devices", res.Peers, want.Peers) + } + if res.Table != str(want.Table) || res.Warning != str(want.Warning) { + fail("the table and the warning", res.Table+" | "+res.Warning, str(want.Table)+" | "+str(want.Warning)) + } + if !reflect.DeepEqual(res.States, want.States) { + fail("the states", res.States, want.States) + } + if !reflect.DeepEqual(s.scripts, want.Scripts) { + for n := range want.Scripts { + if n >= len(s.scripts) || s.scripts[n] != want.Scripts[n] { + fail("script "+string(rune('1'+n))+" of "+string(rune('0'+len(want.Scripts))), len(s.scripts), "differs") + break + } + } + if len(s.scripts) != len(want.Scripts) { + fail("how many scripts were loaded", len(s.scripts), len(want.Scripts)) + } + } + if !reflect.DeepEqual(s.confs, want.Confs) { + fail("the tunnels' peers", s.confs, want.Confs) + } + hosts, herr := os.ReadFile(r.HostsFile) + if string(hosts) != str(want.Hosts) || (herr == nil) != (want.Hosts != nil) { + fail("the hostnames", string(hosts), str(want.Hosts)) + } + if st, err := os.Stat(r.HostsFile); err == nil && want.HostsMode != nil && (st.Mode().Perm()&0o004 != 0) != *want.HostsMode { + fail("who may read the hostnames", st.Mode().Perm(), *want.HostsMode) + } + nftErr, eerr := os.ReadFile(dir + "/nft.err") + if string(nftErr) != str(want.NftErr) || (eerr == nil) != (want.NftErr != nil) { + fail("the table's error kept", string(nftErr), str(want.NftErr)) + } + if s.present != want.Present { + fail("whether a table is there", s.present, want.Present) + } + var kept map[string]string + raw, _ := os.ReadFile(dir + "/states.json") + json.Unmarshal(raw, &kept) + if !reflect.DeepEqual(kept, want.States) { + fail("the states kept", kept, want.States) + } + } + // nobody's key stays on disk between syncs, nor a script + left, _ := os.ReadDir(dir) + for _, e := range left { + if strings.HasSuffix(e.Name(), ".conf") || strings.HasSuffix(e.Name(), ".rules") { + t.Errorf("%s stays in the state directory", e.Name()) + } + } +} diff --git a/backend/apply/testdata/fw.json b/backend/apply/testdata/fw.json new file mode 100644 index 0000000..31ee8ce --- /dev/null +++ b/backend/apply/testdata/fw.json @@ -0,0 +1,122 @@ +{ + "steps": [ + { + "what": "the first time: a zone a tunnel, the way home and out, the ports", + "dry": false, + "changed": true, + "before": "config defaults\n\toption syn_flood\t1\n\toption input\t\tREJECT\n\toption output\t\tACCEPT\n\toption forward\t\tREJECT\n# Uncomment this line to disable ipv6 rules\n#\toption disable_ipv6\t1\n\nconfig zone\n\toption name\t\tlan\n\tlist network\t\t'lan'\n\toption input\t\tACCEPT\n\toption output\t\tACCEPT\n\toption forward\t\tACCEPT\n\nconfig zone\n\toption name\t\twan\n\tlist network\t\t'wan'\n\tlist network\t\t'wan6'\n\toption input\t\tREJECT\n\toption output\t\tACCEPT\n\toption forward\t\tDROP\n\toption masq\t\t1\n\toption mtu_fix\t\t1\n\nconfig forwarding\n\toption src\t\tlan\n\toption dest\t\twan\n\n# We need to accept udp packets on port 68,\n# see https://dev.openwrt.org/ticket/4108\nconfig rule\n\toption name\t\tAllow-DHCP-Renew\n\toption src\t\twan\n\toption proto\t\tudp\n\toption dest_port\t68\n\toption target\t\tACCEPT\n\toption family\t\tipv4\n\n# Allow IPv4 ping\nconfig rule\n\toption name\t\tAllow-Ping\n\toption src\t\twan\n\toption proto\t\ticmp\n\toption icmp_type\techo-request\n\toption family\t\tipv4\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-IGMP\n\toption src\t\twan\n\toption proto\t\tigmp\n\toption family\t\tipv4\n\toption target\t\tACCEPT\n\n# Allow DHCPv6 replies\n# see https://github.com/openwrt/openwrt/issues/5066\nconfig rule\n\toption name\t\tAllow-DHCPv6\n\toption src\t\twan\n\toption proto\t\tudp\n\toption dest_port\t546\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-MLD\n\toption src\t\twan\n\toption proto\t\ticmp\n\toption src_ip\t\tfe80::/10\n\tlist icmp_type\t\t'130/0'\n\tlist icmp_type\t\t'131/0'\n\tlist icmp_type\t\t'132/0'\n\tlist icmp_type\t\t'143/0'\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\n# Allow essential incoming IPv6 ICMP traffic\nconfig rule\n\toption name\t\tAllow-ICMPv6-Input\n\toption src\t\twan\n\toption proto\ticmp\n\tlist icmp_type\t\techo-request\n\tlist icmp_type\t\techo-reply\n\tlist icmp_type\t\tdestination-unreachable\n\tlist icmp_type\t\tpacket-too-big\n\tlist icmp_type\t\ttime-exceeded\n\tlist icmp_type\t\tbad-header\n\tlist icmp_type\t\tunknown-header-type\n\tlist icmp_type\t\trouter-solicitation\n\tlist icmp_type\t\tneighbour-solicitation\n\tlist icmp_type\t\trouter-advertisement\n\tlist icmp_type\t\tneighbour-advertisement\n\toption limit\t\t1000/sec\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\n# Allow essential forwarded IPv6 ICMP traffic\nconfig rule\n\toption name\t\tAllow-ICMPv6-Forward\n\toption src\t\twan\n\toption dest\t\t*\n\toption proto\t\ticmp\n\tlist icmp_type\t\techo-request\n\tlist icmp_type\t\techo-reply\n\tlist icmp_type\t\tdestination-unreachable\n\tlist icmp_type\t\tpacket-too-big\n\tlist icmp_type\t\ttime-exceeded\n\tlist icmp_type\t\tbad-header\n\tlist icmp_type\t\tunknown-header-type\n\toption limit\t\t1000/sec\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-IPSec-ESP\n\toption src\t\twan\n\toption dest\t\tlan\n\toption proto\t\tesp\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-ISAKMP\n\toption src\t\twan\n\toption dest\t\tlan\n\toption dest_port\t500\n\toption proto\t\tudp\n\toption target\t\tACCEPT\n\n\n### EXAMPLE CONFIG SECTIONS\n# do not allow a specific ip to access wan\n#config rule\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption dest\t\twan\n#\toption proto\ttcp\n#\toption target\tREJECT\n\n# block a specific mac on wan\n#config rule\n#\toption dest\t\twan\n#\toption src_mac\t00:11:22:33:44:66\n#\toption target\tREJECT\n\n# block incoming ICMP traffic on a zone\n#config rule\n#\toption src\t\tlan\n#\toption proto\tICMP\n#\toption target\tDROP\n\n# port redirect port coming in on wan to lan\n#config redirect\n#\toption src\t\t\twan\n#\toption src_dport\t80\n#\toption dest\t\t\tlan\n#\toption dest_ip\t\t192.168.16.235\n#\toption dest_port\t80\n#\toption proto\t\ttcp\n\n# port redirect of remapped ssh port (22001) on wan\n#config redirect\n#\toption src\t\twan\n#\toption src_dport\t22001\n#\toption dest\t\tlan\n#\toption dest_port\t22\n#\toption proto\t\ttcp\n\n### FULL CONFIG SECTIONS\n#config rule\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption src_mac\t00:11:22:33:44:55\n#\toption src_port\t80\n#\toption dest\t\twan\n#\toption dest_ip\t194.25.2.129\n#\toption dest_port\t120\n#\toption proto\ttcp\n#\toption target\tREJECT\n\n#config redirect\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption src_mac\t00:11:22:33:44:55\n#\toption src_port\t\t1024\n#\toption src_dport\t80\n#\toption dest_ip\t194.25.2.129\n#\toption dest_port\t120\n#\toption proto\ttcp\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "again: nothing to do", + "dry": false, + "changed": false, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump" + ] + }, + { + "what": "a port changed, a server turned off, a second home zone", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "a server that does not reach the zone of the DNS of the LAN", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'home'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "the portal on a port it never takes", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4500'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal_http'\n\toption name 'Dawnline-Portal-HTTP'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "the portal back, with names only: no plain HTTP", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "would it change: asked only", + "dry": true, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump" + ] + }, + { + "what": "a server removed, another like a home device", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig rule 'dawnline_home_loopdns'\n\toption name 'Dawnline-dawn0-names'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4501'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_cabin_zone'\n\toption name 'dawn1'\n\tlist network 'dawn1'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_cabin_lan'\n\toption src 'dawn1'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_cabin_from_lan'\n\toption src 'home'\n\toption dest 'dawn1'\n\nconfig forwarding 'dawnline_cabin_wan'\n\toption src 'dawn1'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_cabin_loop'\n\toption src 'dawn1'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_cabin_port'\n\toption name 'Dawnline-dawn1'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4600'\n\toption target 'ACCEPT'\n\toption enabled '0'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_loop'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "nobody like a home device", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_open_loop'\n\toption src 'dawn2'\n\toption dest 'dl_loop'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_loop'\n\toption name 'dl_loop'\n\tlist device 'dlx0'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig forwarding 'dawnline_loop_wan'\n\toption src 'dl_loop'\n\toption dest 'wan'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_loop'\n\toption src 'dawn0'\n\toption dest 'dl_loop'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "a section of another kind under our name, one of a server long gone, the portal off", + "dry": false, + "changed": true, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_portal'\n\toption name 'Dawnline-Portal'\n\toption src 'wan'\n\toption proto 'tcp'\n\toption dest_port '8443'\n\toption target 'ACCEPT'\n\nconfig rule 'dawnline_home_zone'\n\toption name 'Not a zone'\n\nconfig forwarding 'dawnline_old_wan'\n\toption src 'dawn9'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump", + "fw4 -q reload" + ] + }, + { + "what": "would it change: no", + "dry": true, + "changed": false, + "before": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\n", + "firewall": "\nconfig defaults\n\toption syn_flood '1'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'REJECT'\n\nconfig zone\n\toption name 'lan'\n\tlist network 'lan'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig zone\n\toption name 'wan'\n\tlist network 'wan'\n\tlist network 'wan6'\n\toption input 'REJECT'\n\toption output 'ACCEPT'\n\toption forward 'DROP'\n\toption masq '1'\n\toption mtu_fix '1'\n\nconfig forwarding\n\toption src 'lan'\n\toption dest 'wan'\n\nconfig rule\n\toption name 'Allow-DHCP-Renew'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '68'\n\toption target 'ACCEPT'\n\toption family 'ipv4'\n\nconfig rule\n\toption name 'Allow-Ping'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption icmp_type 'echo-request'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IGMP'\n\toption src 'wan'\n\toption proto 'igmp'\n\toption family 'ipv4'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-DHCPv6'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '546'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-MLD'\n\toption src 'wan'\n\toption proto 'icmp'\n\toption src_ip 'fe80::/10'\n\tlist icmp_type '130/0'\n\tlist icmp_type '131/0'\n\tlist icmp_type '132/0'\n\tlist icmp_type '143/0'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Input'\n\toption src 'wan'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\tlist icmp_type 'router-solicitation'\n\tlist icmp_type 'neighbour-solicitation'\n\tlist icmp_type 'router-advertisement'\n\tlist icmp_type 'neighbour-advertisement'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ICMPv6-Forward'\n\toption src 'wan'\n\toption dest '*'\n\toption proto 'icmp'\n\tlist icmp_type 'echo-request'\n\tlist icmp_type 'echo-reply'\n\tlist icmp_type 'destination-unreachable'\n\tlist icmp_type 'packet-too-big'\n\tlist icmp_type 'time-exceeded'\n\tlist icmp_type 'bad-header'\n\tlist icmp_type 'unknown-header-type'\n\toption limit '1000/sec'\n\toption family 'ipv6'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-IPSec-ESP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption proto 'esp'\n\toption target 'ACCEPT'\n\nconfig rule\n\toption name 'Allow-ISAKMP'\n\toption src 'wan'\n\toption dest 'lan'\n\toption dest_port '500'\n\toption proto 'udp'\n\toption target 'ACCEPT'\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n\nconfig forwarding 'dawnline_home_lan'\n\toption src 'dawn0'\n\toption dest 'home'\n\nconfig forwarding 'dawnline_home_from_lan'\n\toption src 'home'\n\toption dest 'dawn0'\n\nconfig forwarding 'dawnline_home_wan'\n\toption src 'dawn0'\n\toption dest 'wan'\n\nconfig rule 'dawnline_home_port'\n\toption name 'Dawnline-dawn0'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4502'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_open_zone'\n\toption name 'dawn2'\n\tlist network 'dawn2'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\nconfig forwarding 'dawnline_open_lan'\n\toption src 'dawn2'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_open_from_lan'\n\toption src 'guest'\n\toption dest 'dawn2'\n\nconfig forwarding 'dawnline_open_wan'\n\toption src 'dawn2'\n\toption dest 'wan'\n\nconfig rule 'dawnline_open_port'\n\toption name 'Dawnline-dawn2'\n\toption src 'wan'\n\toption proto 'udp'\n\toption dest_port '4700'\n\toption target 'ACCEPT'\n\nconfig forwarding 'dawnline_home_lan_guest'\n\toption src 'dawn0'\n\toption dest 'guest'\n\nconfig forwarding 'dawnline_home_from_lan_guest'\n\toption src 'guest'\n\toption dest 'dawn0'\n\nconfig rule 'dawnline_open_landns'\n\toption name 'Dawnline-dawn2-dns'\n\toption src 'dawn2'\n\toption dest 'home'\n\toption dest_ip '192.168.77.1'\n\toption proto 'tcp udp'\n\toption dest_port '53'\n\toption target 'ACCEPT'\n\nconfig zone 'dawnline_home_zone'\n\toption name 'dawn0'\n\tlist network 'dawn0'\n\toption input 'ACCEPT'\n\toption output 'ACCEPT'\n\toption forward 'ACCEPT'\n\n", + "cmds": [ + "ubus call network.interface dump" + ] + } + ] +} diff --git a/backend/apply/testdata/loop.json b/backend/apply/testdata/loop.json new file mode 100644 index 0000000..7170821 --- /dev/null +++ b/backend/apply/testdata/loop.json @@ -0,0 +1,1537 @@ +{ + "bridge": "02:11:22:33:44:55", + "dhcp": "config dnsmasq\n\toption domainneeded\t1\n\toption boguspriv\t1\n\toption filterwin2k\t0 # enable for dial on demand\n\toption localise_queries\t1\n\toption rebind_protection 1 # disable if upstream must serve RFC1918 addresses\n\toption rebind_localhost 1 # enable for RBL checking and similar services\n\t#list rebind_domain example.lan # whitelist RFC1918 responses for domains\n\toption local\t'/lan/'\n\toption domain\t'lan'\n\toption expandhosts\t1\n\toption nonegcache\t0\n\toption cachesize\t1000\n\toption authoritative\t1\n\toption readethers\t1\n\toption leasefile\t'/tmp/dhcp.leases'\n\toption resolvfile\t'/tmp/resolv.conf.d/resolv.conf.auto'\n\t#list server\t\t'/mycompany.local/1.2.3.4'\n\toption nonwildcard\t1 # bind to & keep track of interfaces\n\t#list interface\t\tbr-lan\n\t#list notinterface\tlo\n\t#list bogusnxdomain '64.94.110.11'\n\toption localservice\t1 # disable to allow DNS requests from non-local subnets\n\toption ednspacket_max\t1232\n\toption filter_aaaa\t0\n\toption filter_a\t\t0\n\t#list addnmount\t\t/some/path # read-only mount path to expose it to dnsmasq\n\nconfig dhcp lan\n\toption interface\tlan\n\toption start \t100\n\toption limit\t150\n\toption leasetime\t12h\n\nconfig dhcp wan\n\toption interface\twan\n\toption ignore\t1\n", + "steps": [ + { + "what": "the first time: everything is made", + "force": true, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + { + "src": "dawnline", + "level": "up", + "msg": "is on · traffic enters br-lan as 192.168.77.254", + "who": "Internet like a home device" + } + ], + "ran": [ + "ip netns add dawnline", + "ip link add dlx0 type veth peer name dlx1 netns dawnline", + "ip link add dll0 type veth peer name dll1 address aa:a4:a8:84:2d:9d netns dawnline", + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule add priority 5205 iif 'dawn1' to 192.168.77.254/32 lookup 2077", + "ip -4 rule add priority 5210 iif 'dawn1' to 10.78.0.0/24 lookup main", + "ip -4 rule add priority 5210 iif 'dawn1' to 192.168.50.0/24 lookup main", + "ip -4 rule add priority 5290 iif 'dawn1' lookup 2077", + "ip -4 rule add priority 5205 iif 'dawn2' to 192.168.77.254/32 lookup 2077", + "ip -4 rule add priority 5210 iif 'dawn2' to 10.79.0.0/24 lookup main", + "ip -4 rule add priority 5210 iif 'dawn2' to 192.168.77.0/24 lookup main", + "ip -4 rule add priority 5290 iif 'dawn2' lookup 2077" + ], + "failed": [ + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "again, the rules in: nothing to do", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + ], + "failed": [ + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "a rule gone, one of ours with a source, one twice, one of a tunnel long gone", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule add priority 5205 iif 'dawn1' to 192.168.77.254/32 lookup 2077", + "ip -4 rule del priority 5210 from 10.9.0.2 iif 'dawn1' to 10.1.0.0/16 lookup main", + "ip -4 rule del priority 5290 iif 'dawn7' lookup 2077", + "ip -4 rule del priority 5210 iif 'dawn1' to 10.78.0.0/24 lookup main" + ], + "failed": [ + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "the kernel has no flowtables: the slow path, said once", + "force": true, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": false + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + { + "src": "dawnline", + "level": "info", + "msg": "runs without its fast path", + "who": "Internet like a home device", + "detail": "Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline.\nip netns exec dawnline nft -f /var/etc/dawnline-ns.nft: /var/etc/dawnline-ns.nft:4:2-10: Error: Could not process rule: No such file or directory" + } + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft" + ], + "failed": [ + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft · /var/etc/dawnline-ns.nft:4:2-10: Error: Could not process rule: No such file or directory" + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "and not said again", + "force": true, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": false + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft" + ], + "failed": [ + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft · /var/etc/dawnline-ns.nft:4:2-10: Error: Could not process rule: No such file or directory" + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "a link from an older version, with a MAC of its own", + "force": true, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.1", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip -n dawnline link set dll1 down", + "ip -n dawnline link set dll1 address aa:a4:a8:84:2d:9d", + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip -4 neigh flush to 192.168.77.254 dev 'br-lan'", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft" + ], + "failed": [ + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "the saved address held by another device, the next one a static lease, a third in the pool", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.254", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.254 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.254/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft" + ], + "failed": [ + ], + "pings": [ + "ping -c 1 -W 1 -I br-lan 192.168.77.254" + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "the saved address free: kept", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2077, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + { + "src": "dawnline", + "level": "up", + "msg": "is on · traffic enters br-lan as 192.168.77.201", + "who": "Internet like a home device" + } + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2077", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule add priority 5205 iif 'dawn1' to 192.168.77.201/32 lookup 2077", + "ip -4 rule add priority 5205 iif 'dawn2' to 192.168.77.201/32 lookup 2077", + "ip -4 rule del priority 5205 iif 'dawn1' to 192.168.77.254 lookup 2077", + "ip -4 rule del priority 5205 iif 'dawn2' to 192.168.77.254 lookup 2077" + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "a table of ours taken by someone else, the transit range too", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2078", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule add priority 5205 iif 'dawn1' to 192.168.77.201/32 lookup 2078", + "ip -4 rule add priority 5290 iif 'dawn1' lookup 2078", + "ip -4 rule add priority 5205 iif 'dawn2' to 192.168.77.201/32 lookup 2078", + "ip -4 rule add priority 5290 iif 'dawn2' lookup 2078", + "ip -4 rule del priority 5205 iif 'dawn1' to 192.168.77.201 lookup 2077", + "ip -4 rule del priority 5290 iif 'dawn1' lookup 2077", + "ip -4 rule del priority 5205 iif 'dawn2' to 192.168.77.201 lookup 2077", + "ip -4 rule del priority 5290 iif 'dawn2' lookup 2077" + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "a command fails: taken down, the direct path stays", + "force": true, + "result": { + "error": { + "code": "setup", + "detail": "ip -n dawnline route replace default via 192.168.77.1 dev dll1: RTNETLINK answers: a made-up failure" + } + }, + "state": { + "error": { + "code": "setup", + "detail": "ip -n dawnline route replace default via 192.168.77.1 dev dll1: RTNETLINK answers: a made-up failure" + } + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + { + "src": "dawnline", + "level": "error", + "msg": "failed - internet goes out directly for now", + "who": "Internet like a home device", + "detail": "ip -n dawnline route replace default via 192.168.77.1 dev dll1: RTNETLINK answers: a made-up failure" + } + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2078", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule del priority 5205 iif 'dawn1' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn1' to 10.78.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn1' to 192.168.50.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn1' lookup 2078", + "ip -4 rule del priority 5205 iif 'dawn2' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn2' to 10.79.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn2' to 192.168.77.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn2' lookup 2078", + "ip -4 route flush table 2078", + "ip link del dlx0", + "ip link del dll0", + "ip netns del dawnline" + ], + "failed": [ + "ip -n dawnline route replace default via 192.168.77.1 dev dll1 · RTNETLINK answers: a made-up failure" + ], + "pings": [ + ], + "sys": { + "dlx0": false, + "dll0": false, + "netns": false + } + }, + { + "what": "the same failure: not said again", + "force": true, + "result": { + "error": { + "code": "setup", + "detail": "ip -n dawnline route replace default via 192.168.77.1 dev dll1: RTNETLINK answers: a made-up failure" + } + }, + "state": { + "error": { + "code": "setup", + "detail": "ip -n dawnline route replace default via 192.168.77.1 dev dll1: RTNETLINK answers: a made-up failure" + } + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip netns add dawnline", + "ip link add dlx0 type veth peer name dlx1 netns dawnline", + "ip link add dll0 type veth peer name dll1 address aa:a4:a8:84:2d:9d netns dawnline", + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2078", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule del priority 5205 iif 'dawn1' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn1' to 10.78.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn1' to 192.168.50.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn1' lookup 2078", + "ip -4 rule del priority 5205 iif 'dawn2' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn2' to 10.79.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn2' to 192.168.77.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn2' lookup 2078", + "ip link del dlx0", + "ip link del dll0", + "ip netns del dawnline" + ], + "failed": [ + "ip -n dawnline route replace default via 192.168.77.1 dev dll1 · RTNETLINK answers: a made-up failure" + ], + "pings": [ + ], + "sys": { + "dlx0": false, + "dll0": false, + "netns": false + } + }, + { + "what": "it works again", + "force": true, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn1", + "subnet": "10.78.0.0/24", + "direct": [ + "10.78.0.0/24", + "192.168.50.0/24" + ] + }, + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + { + "src": "dawnline", + "level": "up", + "msg": "is on · traffic enters br-lan as 192.168.77.201", + "who": "Internet like a home device" + } + ], + "ran": [ + "ip netns add dawnline", + "ip link add dlx0 type veth peer name dlx1 netns dawnline", + "ip link add dll0 type veth peer name dll1 address aa:a4:a8:84:2d:9d netns dawnline", + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2078", + "ip -n dawnline route replace '10.78.0.0/24' via '169.254.77.1' dev dlx1", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft" + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "one server only", + "force": false, + "result": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "state": { + "applied": 1, + "plan": { + "dev": "br-lan", + "gateway": "192.168.77.1", + "address": "192.168.77.201", + "mac": "aa:a4:a8:84:2d:9d", + "prefix": 24, + "dns": "192.168.77.53", + "transit": 2852015360, + "tx_root": "169.254.77.1", + "tx_ns": "169.254.77.2", + "table": 2078, + "servers": [ + { + "ifname": "dawn2", + "subnet": "10.79.0.0/24", + "direct": [ + "10.79.0.0/24", + "192.168.77.0/24" + ] + } + ] + }, + "transit": 2852015360, + "fast": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip addr flush dev dlx0", + "ip addr add 169.254.77.1/30 dev dlx0", + "ip link set dlx0 up", + "ip link set dll0 master 'br-lan'", + "ip link set dll0 up", + "ip -n dawnline link set lo up", + "ip -n dawnline addr flush dev dlx1", + "ip -n dawnline addr add 169.254.77.2/30 dev dlx1", + "ip -n dawnline link set dlx1 up", + "ip -n dawnline addr flush dev dll1", + "ip -n dawnline addr add 192.168.77.201/24 dev dll1", + "ip -n dawnline link set dll1 up", + "ip -n dawnline route replace default via 192.168.77.1 dev dll1", + "ip -n dawnline route replace default via 169.254.77.1 dev dlx1 table 100", + "ip -n dawnline rule del from 169.254.77.2 lookup 100 2>/dev/null; ip -n dawnline rule add from 169.254.77.2 lookup 100", + "ip netns exec dawnline sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'", + "ip -4 route replace default via 169.254.77.2 dev dlx0 table 2078", + "ip -n dawnline route replace '10.79.0.0/24' via '169.254.77.1' dev dlx1", + "ip netns exec dawnline nft -f /var/etc/dawnline-ns.nft", + "ip -4 rule del priority 5205 iif 'dawn1' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn1' to 10.78.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn1' to 192.168.50.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn1' lookup 2078" + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": true, + "dll0": true, + "netns": true + } + }, + { + "what": "nobody wants it: taken away", + "force": false, + "result": { + "off": true + }, + "state": { + "error": null, + "off": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + "ip -4 rule del priority 5205 iif 'dawn2' to 192.168.77.201 lookup 2078", + "ip -4 rule del priority 5210 iif 'dawn2' to 10.79.0.0/24 lookup main", + "ip -4 rule del priority 5210 iif 'dawn2' to 192.168.77.0/24 lookup main", + "ip -4 rule del priority 5290 iif 'dawn2' lookup 2078", + "ip -4 route flush table 2078", + "ip link del dlx0", + "ip link del dll0", + "ip netns del dawnline" + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": false, + "dll0": false, + "netns": false + } + }, + { + "what": "and nothing more to take", + "force": false, + "result": { + "off": true + }, + "state": { + "error": null, + "off": true + }, + "ns_rules": "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 192.168.77.201 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "log": [ + ], + "ran": [ + ], + "failed": [ + ], + "pings": [ + ], + "sys": { + "dlx0": false, + "dll0": false, + "netns": false + } + } + ], + "macs": [ + [ + "02:11:22:33:44:55", + "aa:a4:a8:84:2d:9d" + ], + [ + " 00:1A:2B:3C:4D:5E\n", + "e6:d0:59:0a:12:23" + ], + [ + "", + "aa:0b:2a:56:aa:0b" + ], + [ + "ff:ff:ff:ff:ff:ff", + "1e:b1:22:bc:0d:2c" + ], + [ + null, + "aa:0b:2a:56:aa:0b" + ] + ], + "rules": { + "plan": { + "address": "10.0.1.250", + "dns": "10.0.1.53", + "table": 2077, + "servers": [ + { + "ifname": "dawn0", + "subnet": "10.8.0.0/24", + "direct": [ + "10.0.1.0/24", + "10.8.0.0/24" + ] + }, + { + "ifname": "wg'x", + "subnet": "10.9.0.0/24", + "direct": [ + ] + } + ] + }, + "want": [ + { + "pref": 5205, + "iif": "dawn0", + "to": "10.0.1.250/32", + "table": "2077" + }, + { + "pref": 5210, + "iif": "dawn0", + "to": "10.0.1.0/24", + "table": "main" + }, + { + "pref": 5210, + "iif": "dawn0", + "to": "10.8.0.0/24", + "table": "main" + }, + { + "pref": 5290, + "iif": "dawn0", + "to": null, + "table": "2077" + }, + { + "pref": 5205, + "iif": "wg'x", + "to": "10.0.1.250/32", + "table": "2077" + }, + { + "pref": 5290, + "iif": "wg'x", + "to": null, + "table": "2077" + } + ], + "none": [ + ], + "current": [ + { + "priority": 5205, + "src": "all", + "iif": "dawn0", + "dst": "10.0.1.250", + "table": "2077" + }, + { + "priority": 5210, + "src": "all", + "iif": "dawn0", + "dst": "10.0.1.0", + "dstlen": 24, + "table": "main" + }, + { + "priority": 5210, + "src": "all", + "iif": "dawn0", + "dst": "10.0.1.0", + "dstlen": 24, + "table": "main" + }, + { + "priority": 5210, + "src": "10.8.0.7", + "iif": "dawn0", + "dst": "10.0.9.0", + "dstlen": 24, + "table": "main" + }, + { + "priority": 5210, + "src": "10.8.1.0", + "srclen": 24, + "iif": "dawn0", + "table": "main" + }, + { + "priority": 5290, + "src": "all", + "iif": "dawn0", + "table": "2099" + } + ], + "cmds": [ + "ip -4 rule add priority 5210 iif 'dawn0' to 10.8.0.0/24 lookup main", + "ip -4 rule add priority 5290 iif 'dawn0' lookup 2077", + "ip -4 rule add priority 5205 iif 'wg'\\''x' to 10.0.1.250/32 lookup 2077", + "ip -4 rule add priority 5290 iif 'wg'\\''x' lookup 2077", + "ip -4 rule del priority 5210 from 10.8.0.7 iif 'dawn0' to 10.0.9.0/24 lookup main", + "ip -4 rule del priority 5210 from 10.8.1.0/24 iif 'dawn0' lookup main", + "ip -4 rule del priority 5290 iif 'dawn0' lookup 2099", + "ip -4 rule del priority 5210 iif 'dawn0' to 10.0.1.0/24 lookup main" + ], + "from_nothing": [ + "ip -4 rule add priority 5205 iif 'dawn0' to 10.0.1.250/32 lookup 2077", + "ip -4 rule add priority 5210 iif 'dawn0' to 10.0.1.0/24 lookup main", + "ip -4 rule add priority 5210 iif 'dawn0' to 10.8.0.0/24 lookup main", + "ip -4 rule add priority 5290 iif 'dawn0' lookup 2077", + "ip -4 rule add priority 5205 iif 'wg'\\''x' to 10.0.1.250/32 lookup 2077", + "ip -4 rule add priority 5290 iif 'wg'\\''x' lookup 2077" + ], + "to_nothing": [ + "ip -4 rule del priority 5205 iif 'dawn0' to 10.0.1.250 lookup 2077", + "ip -4 rule del priority 5210 iif 'dawn0' to 10.0.1.0/24 lookup main", + "ip -4 rule del priority 5210 from 10.8.0.7 iif 'dawn0' to 10.0.9.0/24 lookup main", + "ip -4 rule del priority 5210 from 10.8.1.0/24 iif 'dawn0' lookup main", + "ip -4 rule del priority 5290 iif 'dawn0' lookup 2099", + "ip -4 rule del priority 5210 iif 'dawn0' to 10.0.1.0/24 lookup main" + ] + }, + "ns_rules": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tflowtable ft {\n\t\thook ingress priority 0;\n\t\tdevices = { \"dlx1\", \"dll1\" };\n\t}\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 10.0.1.250 meta l4proto { tcp, udp } th dport 53 dnat ip to 10.0.1.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established meta l4proto { tcp, udp } flow add @ft\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n", + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tchain nat_pre {\n\t\ttype nat hook prerouting priority dstnat; policy accept;\n\t\tiifname \"dlx1\" ip daddr 10.0.1.250 meta l4proto { tcp, udp } th dport 53 dnat ip to 10.0.1.53:53\n\t}\n\tchain nat_post {\n\t\ttype nat hook postrouting priority srcnat; policy accept;\n\t\toifname \"dll1\" masquerade\n\t}\n\tchain filter_forward {\n\t\ttype filter hook forward priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"dlx1\" oifname \"dll1\" accept\n\t}\n\tchain filter_input {\n\t\ttype filter hook input priority filter; policy drop;\n\t\tct state established,related accept\n\t\tiifname \"lo\" accept\n\t\ticmp type echo-request accept\n\t\tiifname \"dlx1\" meta l4proto { tcp, udp } th dport 53 accept\n\t}\n}\n" + ], + "notes": [ + "No LAN detected.", + "eth1 is not a bridge, so Dawnline cannot join the LAN as a device.", + "br-lan has no IPv4 address.", + "No free address on 10.0.1.0/24.", + "No free link-local range for the internal link.", + "No free routing table." + ] +} diff --git a/backend/apply/testdata/netifd.json b/backend/apply/testdata/netifd.json new file mode 100644 index 0000000..a96d3bc --- /dev/null +++ b/backend/apply/testdata/netifd.json @@ -0,0 +1,307 @@ +{ + "steps": [ + { + "what": "the first time: two tunnels made, a third whose name is taken", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4500'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'Home'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\n", + "blocked": { + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": null, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + "ubus call network reload", + "ifup dawn0", + "ifup dawn1" + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Home" + }, + "dawn1": { + "reason": "settings", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "again: nothing to do", + "changed": false, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4500'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'Home'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\n", + "blocked": { + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": null, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Home" + }, + "dawn1": { + "reason": "settings", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "a port changed, a server turned off", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'Home'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\toption disabled '1'\n\toption auto '0'\n\n", + "blocked": { + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": null, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + "ubus call network reload", + "ifup dawn0" + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Home" + }, + "dawn1": { + "reason": "off", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "a disguise AmneziaWG cannot take: the tunnel goes", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\toption disabled '1'\n\toption auto '0'\n\n", + "blocked": { + "home": { + "code": "disguise_invalid" + }, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": { + "code": "disguise_invalid" + }, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + "ifdown dawn0", + "ubus call network reload" + ], + "intents": { + "dawn0": { + "reason": "removed", + "name": "Home" + }, + "dawn1": { + "reason": "off", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "put right, and the server renamed", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\toption disabled '1'\n\toption auto '0'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'Anna'\\''s house'\n\n", + "blocked": { + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": null, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + "ubus call network reload", + "ifup dawn0" + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Anna's house" + }, + "dawn1": { + "reason": "off", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "renamed again: only the marker moves", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn1'\n\toption proto 'amneziawg'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption listen_port '4600'\n\tlist addresses '10.78.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'cabin'\n\toption _dawnline_name 'Cabin'\n\toption disabled '1'\n\toption auto '0'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'House'\n\n", + "blocked": { + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "model_blocked": { + "home": null, + "cabin": null, + "open": { + "code": "taken", + "ifname": "dawn2" + } + }, + "cmds": [ + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Anna's house" + }, + "dawn1": { + "reason": "off", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "a server removed, another given a name that will not do", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1380'\n\toption _dawnline 'home'\n\toption _dawnline_name 'House'\n\n", + "blocked": { + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "model_blocked": { + "home": null, + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "cmds": [ + "ifdown dawn1", + "ubus call network reload" + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "Anna's house" + }, + "dawn1": { + "reason": "removed", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "a 3.1 disguise, and a list of DNS-shaped packets", + "changed": true, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1368'\n\toption _dawnline 'home'\n\toption _dawnline_name 'House'\n\toption awg_s1 '12'\n\toption awg_s2 '12'\n\toption awg_s3 '12'\n\toption awg_s4 '12'\n\toption awg_i1 ''\n\toption awg_header_protection_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\n", + "blocked": { + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "model_blocked": { + "home": null, + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "cmds": [ + "ubus call network reload", + "ifup dawn0" + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "House" + }, + "dawn1": { + "reason": "removed", + "name": "Cabin" + } + }, + "no_awg": false + }, + { + "what": "the tools are gone: nothing is touched", + "changed": false, + "network": "\nconfig interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\tlist ipaddr '127.0.0.1/8'\n\nconfig globals 'globals'\n\toption ula_prefix 'fd00:1234::/48'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'lan1'\n\tlist ports 'lan2'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '192.168.77.1/24'\n\toption note 'it'\\''s the LAN'\n\nconfig interface 'dawn2'\n\toption proto 'wireguard'\n\toption private_key 'someone else'\\''s'\n\nconfig interface 'dawn0'\n\toption proto 'amneziawg'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption listen_port '4501'\n\tlist addresses '10.77.0.1/24'\n\toption mtu '1368'\n\toption _dawnline 'home'\n\toption _dawnline_name 'House'\n\toption awg_s1 '12'\n\toption awg_s2 '12'\n\toption awg_s3 '12'\n\toption awg_s4 '12'\n\toption awg_i1 ''\n\toption awg_header_protection_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\n", + "blocked": { + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "model_blocked": { + "home": null, + "open": { + "code": "ifname", + "ifname": "Not-A-Name" + } + }, + "cmds": [ + ], + "intents": { + "dawn0": { + "reason": "settings", + "name": "House" + }, + "dawn1": { + "reason": "removed", + "name": "Cabin" + } + }, + "no_awg": true + } + ] +} diff --git a/backend/apply/testdata/network.uci b/backend/apply/testdata/network.uci new file mode 100644 index 0000000..ab35415 --- /dev/null +++ b/backend/apply/testdata/network.uci @@ -0,0 +1,25 @@ + +config interface 'loopback' + option device 'lo' + option proto 'static' + list ipaddr '127.0.0.1/8' + +config globals 'globals' + option ula_prefix 'fd00:1234::/48' + +config device + option name 'br-lan' + option type 'bridge' + list ports 'lan1' + list ports 'lan2' + +config interface 'lan' + option device 'br-lan' + option proto 'static' + option ipaddr '192.168.77.1/24' + option note 'it'\''s the LAN' + +config interface 'dawn2' + option proto 'wireguard' + option private_key 'someone else'\''s' + diff --git a/backend/apply/testdata/resolver.json b/backend/apply/testdata/resolver.json new file mode 100644 index 0000000..9cad941 --- /dev/null +++ b/backend/apply/testdata/resolver.json @@ -0,0 +1,107 @@ +{ + "dhcp": "config dnsmasq\n\toption domainneeded\t1\n\toption boguspriv\t1\n\toption filterwin2k\t0 # enable for dial on demand\n\toption localise_queries\t1\n\toption rebind_protection 1 # disable if upstream must serve RFC1918 addresses\n\toption rebind_localhost 1 # enable for RBL checking and similar services\n\t#list rebind_domain example.lan # whitelist RFC1918 responses for domains\n\toption local\t'/lan/'\n\toption domain\t'lan'\n\toption expandhosts\t1\n\toption nonegcache\t0\n\toption cachesize\t1000\n\toption authoritative\t1\n\toption readethers\t1\n\toption leasefile\t'/tmp/dhcp.leases'\n\toption resolvfile\t'/tmp/resolv.conf.d/resolv.conf.auto'\n\t#list server\t\t'/mycompany.local/1.2.3.4'\n\toption nonwildcard\t1 # bind to & keep track of interfaces\n\t#list interface\t\tbr-lan\n\t#list notinterface\tlo\n\t#list bogusnxdomain '64.94.110.11'\n\toption localservice\t1 # disable to allow DNS requests from non-local subnets\n\toption ednspacket_max\t1232\n\toption filter_aaaa\t0\n\toption filter_a\t\t0\n\t#list addnmount\t\t/some/path # read-only mount path to expose it to dnsmasq\n\nconfig dhcp lan\n\toption interface\tlan\n\toption start \t100\n\toption limit\t150\n\toption leasetime\t12h\n\nconfig dhcp wan\n\toption interface\twan\n\toption ignore\t1\n", + "steps": [ + { + "what": "on the tunnels, home names from the LAN", + "target": { + "mode": "root", + "port": 5354 + }, + "lan": "192.168.77.1", + "changed": true, + "conf": "# mode=root\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=5354\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nbind-dynamic\ninterface=dawn0\ninterface=dawn1\ninterface=dawn2\nresolv-file=/var/etc/dawnline-dns.resolv\nserver=/lan/192.168.77.1\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status", + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + }, + { + "what": "again: nothing to do", + "target": { + "mode": "root", + "port": 5354 + }, + "lan": "192.168.77.1", + "changed": false, + "conf": "# mode=root\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=5354\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nbind-dynamic\ninterface=dawn0\ninterface=dawn1\ninterface=dawn2\nresolv-file=/var/etc/dawnline-dns.resolv\nserver=/lan/192.168.77.1\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + }, + { + "what": "inside the netns", + "target": { + "mode": "ns", + "address": "100.127.0.2", + "port": 53 + }, + "lan": "192.168.77.53", + "changed": true, + "conf": "# mode=ns\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=53\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nlisten-address=100.127.0.2\nbind-interfaces\nno-resolv\nserver=9.9.9.9@100.127.0.2\nserver=149.112.112.112@100.127.0.2\nserver=/lan/192.168.77.53\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status", + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + }, + { + "what": "back on the tunnels with one of them off, no DNS on the LAN, a running one to stop", + "target": { + "mode": "root", + "port": 5354 + }, + "lan": null, + "changed": true, + "conf": "# mode=root\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=5354\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nbind-dynamic\ninterface=dawn0\ninterface=dawn2\nresolv-file=/var/etc/dawnline-dns.resolv\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status", + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + }, + { + "what": "no tunnel on: loopback only", + "target": { + "mode": "root", + "port": 5354 + }, + "lan": "192.168.77.1", + "changed": true, + "conf": "# mode=root\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=5354\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nbind-dynamic\nlisten-address=127.0.0.1\nresolv-file=/var/etc/dawnline-dns.resolv\nserver=/lan/192.168.77.1\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status", + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + }, + { + "what": "the WAN says nothing of DNS: two public ones", + "target": { + "mode": "ns", + "address": "100.127.0.2", + "port": 53 + }, + "lan": "192.168.77.1", + "changed": true, + "conf": "# mode=ns\n# Generated by Dawnline: plain DNS for Home-only tunnel clients.\nport=53\nno-hosts\nbogus-priv\ncache-size=1000\npid-file=/var/run/dawnline-dns.pid\nuser=dnsmasq\ngroup=dnsmasq\nlisten-address=100.127.0.2\nbind-interfaces\nno-resolv\nserver=1.1.1.1@100.127.0.2\nserver=8.8.8.8@100.127.0.2\nserver=/lan/192.168.77.1\n", + "resolv": "nameserver 9.9.9.9\nnameserver 149.112.112.112\n", + "cmds": [ + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status", + "ubus call network.interface.wan status", + "ubus call network.interface.wan6 status" + ] + } + ] +} diff --git a/backend/apply/testdata/sig.json b/backend/apply/testdata/sig.json new file mode 100644 index 0000000..cb06b45 --- /dev/null +++ b/backend/apply/testdata/sig.json @@ -0,0 +1,7 @@ +{ + "sigs": [ + "{ \"wan\": \"eth0\", \"lan\": \"br-lan\", \"addrs\": [ \"192.168.77.1/24\" ], \"servers\": { \"home\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false }, { \"dev\": \"br-lan\", \"auto\": false, \"nets\": [ \"192.168.77.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.50.0/24\", \"192.168.77.0/24\" ], \"zones\": [ \"home\" ] }, \"cabin\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.50.0/24\" ], \"zones\": [ \"home\" ] }, \"open\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"br-lan\", \"auto\": false, \"nets\": [ \"192.168.77.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.77.0/24\" ], \"zones\": [ \"home\" ] } }, \"dns\": \"192.168.77.1\", \"loop\": null }", + "{ \"wan\": \"eth0\", \"lan\": \"br-lan\", \"addrs\": [ \"192.168.77.1/24\" ], \"servers\": { \"home\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false }, { \"dev\": \"nope0\", \"auto\": false, \"nets\": [ ], \"zone\": null, \"missing\": true } ], \"nets\": [ \"192.168.50.0/24\" ], \"zones\": [ \"home\" ] }, \"cabin\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"br-lan\", \"auto\": true, \"nets\": [ \"192.168.77.0/24\" ], \"zone\": \"home\", \"missing\": false }, { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.50.0/24\", \"192.168.77.0/24\" ], \"zones\": [ \"home\" ] }, \"open\": { \"wan\": { \"dev\": \"wg9\", \"auto\": false, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"br-lan\", \"auto\": false, \"nets\": [ \"192.168.77.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.77.0/24\" ], \"zones\": [ \"home\" ] } }, \"dns\": \"192.168.77.1\", \"loop\": null }", + "{ \"wan\": \"eth0\", \"lan\": \"br-lan\", \"addrs\": [ \"192.168.77.1/24\" ], \"servers\": { \"home\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false }, { \"dev\": \"nope0\", \"auto\": false, \"nets\": [ ], \"zone\": null, \"missing\": true } ], \"nets\": [ \"192.168.50.0/24\" ], \"zones\": [ \"home\" ] }, \"cabin\": { \"wan\": { \"dev\": \"eth0\", \"auto\": true, \"zone\": \"wan\", \"missing\": false }, \"home\": [ { \"dev\": \"br-lan\", \"auto\": true, \"nets\": [ \"192.168.77.0/24\" ], \"zone\": \"home\", \"missing\": false }, { \"dev\": \"dlhome\", \"auto\": false, \"nets\": [ \"192.168.50.0/24\" ], \"zone\": \"home\", \"missing\": false } ], \"nets\": [ \"192.168.50.0/24\", \"192.168.77.0/24\" ], \"zones\": [ \"home\" ] }, \"open\": { \"wan\": { \"dev\": \"gone7\", \"auto\": false, \"zone\": \"wan\", \"missing\": true }, \"home\": [ { \"dev\": \"gone8\", \"auto\": false, \"nets\": [ ], \"zone\": null, \"missing\": true } ], \"nets\": [ ], \"zones\": [ ] } }, \"dns\": \"192.168.77.1\", \"loop\": null }" + ] +} diff --git a/backend/apply/testdata/trace.json b/backend/apply/testdata/trace.json new file mode 100644 index 0000000..51209da --- /dev/null +++ b/backend/apply/testdata/trace.json @@ -0,0 +1,328 @@ +{ + "steps": [ + { + "what": "no table yet: the update fails, the table is built", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": null, + "warning": null, + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + }, + { + "what": "again: the sets alone", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": null, + "warning": null, + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + }, + { + "what": "someone is paused", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": null, + "warning": null, + "states": { + "anna": "paused", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + }, + { + "what": "the table will not load, the old one stays", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": "rules:1:1-5: Error: a made-up failure", + "warning": "Access rules couldn't be updated (rules:1:1-5: Error: a made-up failure): the previous rules stay, so this change isn't in effect yet. Open Overview → Health.", + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": "rules:1:1-5: Error: a made-up failure", + "present": true + }, + { + "what": "the table will not load and there is none: nobody is loaded", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": "rules:1:1-5: Error: a made-up failure", + "warning": "Access rules couldn't load (rules:1:1-5: Error: a made-up failure): no device is loaded into the tunnels until they do. Open Overview → Health.", + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": "rules:1:1-5: Error: a made-up failure", + "present": false + }, + { + "what": "the same failure again: told once", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": "rules:1:1-5: Error: a made-up failure", + "warning": "Access rules couldn't load (rules:1:1-5: Error: a made-up failure): no device is loaded into the tunnels until they do. Open Overview → Health.", + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": "rules:1:1-5: Error: a made-up failure", + "present": false + }, + { + "what": "it loads again; a tunnel refuses its devices", + "peers": { + "home": "Line unrecognized: a made-up refusal", + "cabin": "ok", + "open": "ok" + }, + "table": null, + "warning": "Couldn't load devices into Home: Line unrecognized: a made-up refusal. Open Overview → Health.", + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + }, + { + "what": "a tunnel is down", + "peers": { + "home": "ok", + "cabin": "down", + "open": "ok" + }, + "table": null, + "warning": null, + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + }, + { + "what": "all is well", + "peers": { + "home": "ok", + "cabin": "ok", + "open": "ok" + }, + "table": null, + "warning": null, + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "paused", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "scripts": [ + "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n" + ], + "confs": { + "dawn0": "[Interface]\nPrivateKey = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=\nListenPort = 4500\n\n[Peer]\nPublicKey = BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=\nAllowedIPs = 10.77.0.2/32\n\n[Peer]\nPublicKey = CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=\nAllowedIPs = 10.77.0.3/32\n\n[Peer]\nPublicKey = EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=\nAllowedIPs = 10.77.0.5/32\n\n[Peer]\nPublicKey = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=\nAllowedIPs = 10.77.0.6/32\n\n[Peer]\nPublicKey = GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=\nAllowedIPs = 10.77.0.7/32\n\n[Peer]\nPublicKey = HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=\nAllowedIPs = 10.77.0.8/32\n\n[Peer]\nPublicKey = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=\nAllowedIPs = 10.77.0.9/32\n\n[Peer]\nPublicKey = OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA=\nAllowedIPs = 10.77.0.11/32\n", + "dawn1": "[Interface]\nPrivateKey = ccccccccccccccccccccccccccccccccccccccccccA=\nListenPort = 4600\n\n[Peer]\nPublicKey = KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA=\nAllowedIPs = 10.78.0.2/32\n\n[Peer]\nPublicKey = LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA=\nAllowedIPs = 10.78.0.3/32\n", + "dawn2": "[Interface]\nPrivateKey = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=\nListenPort = 4700\n\n[Peer]\nPublicKey = MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA=\nAllowedIPs = 10.79.0.2/32\n\n[Peer]\nPublicKey = NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA=\nAllowedIPs = 10.79.0.3/32\n" + }, + "hosts": "10.77.0.2 phone.anna.lan\n10.77.0.3 laptop.anna.lan\n10.77.0.4 old.anna.lan\n10.77.0.5 bphone.boris.lan\n10.77.0.6 cphone.clara.lan\n10.77.0.7 dphone.dima.lan\n10.77.0.8 ephone.eva.lan\n10.77.0.9 fphone.fedor.lan\n10.77.0.10 gphone.gleb.lan\n10.78.0.2 hphone.hana.lan\n10.78.0.3 iphone.ivan.lan\n10.79.0.2 kphone.kira.lan\n10.79.0.3 lphone.lev.lan\n10.77.0.11 nphone.nora.lan\n", + "hosts_mode": true, + "nft_err": null, + "present": true + } + ], + "settings": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\n" +} diff --git a/backend/awg/caps.go b/backend/awg/caps.go new file mode 100644 index 0000000..3c03db6 --- /dev/null +++ b/backend/awg/caps.go @@ -0,0 +1,189 @@ +package awg + +import ( + "bytes" + "fmt" + "os" + "os/exec" + "regexp" + "strings" + "sync" + + "github.com/tickcount/luci-app-dawnline/backend/files" +) + +// What the installed AmneziaWG can do, as dawnline.awg caps() works it out: the netifd protocol script and +// the awg tool say what the tools know, the kernel module's package version what the kernel runs, and a +// feature counts only when both have it. Held to ucode on testdata/caps.uc (scripts/ucode-golden.sh). + +// Caps: V2 is S3/S4, I1-I5 and header ranges (AWG 2.0), V3 header protection, trailers, padding and timing +// (AWG 3.1); Tools and Kmod are their generations ("1.0", "2.0", "3.1"; nil unknown); Pending, an installed +// module waits for a reboot. +type Caps struct { + V2 bool `json:"v2"` + V3 bool `json:"v3"` + Tools any `json:"tools"` + Kmod any `json:"kmod"` + Mismatch bool `json:"mismatch"` + Pending bool `json:"pending"` +} + +// Record is what an install of AmneziaWG left in awg.json, as far as the running module is concerned. +type Record struct { + Reloaded *bool `json:"reloaded"` + Boot *string `json:"boot"` + PrevCore *int64 `json:"prev_core"` + PrevGen *string `json:"prev_gen"` +} + +var tail = regexp.MustCompile(`([0-9]+\.[0-9]+\.[0-9]{8})(-r?[0-9]+)?$`) + +// Gen is the AmneziaWG generation of a package version: 3.x packages carry 3.1; 1.0.x ones are 2.0 from +// July 2025 on and the first generation before. A kernel module's version has the kernel release in front. +func Gen(version string) string { + v := version + if m := tail.FindStringSubmatch(version); m != nil { + v = m[1] + } + switch { + case strings.HasPrefix(v, "3."): + return "3.1" + case strings.HasPrefix(v, "1.0.2024"): + return "1.0" + case len(v) >= 10 && strings.HasPrefix(v, "1.0.20250") && v[9] >= '1' && v[9] <= '6': + return "1.0" + } + return "2.0" +} + +// Pending tells an installed update that waits for a reboot: the old module stayed loaded, this is still +// the boot it ran in, and the module loaded is still that one. boot "" and core 0 stand for "not known". +func Pending(rec *Record, boot string, core int64) bool { + return rec != nil && rec.Reloaded != nil && !*rec.Reloaded && rec.Boot != nil && boot != "" && *rec.Boot == boot && + core != 0 && rec.PrevCore != nil && *rec.PrevCore == core +} + +// RunningGen is the generation of the kernel module that runs: the one from before the install while it +// waits for a reboot, else the installed package's (version nil: no package). nil when not known. +func RunningGen(rec *Record, boot string, core int64, version *string) any { + if Pending(rec, boot, core) { + if rec.PrevGen == nil { + return nil + } + return *rec.PrevGen + } + if version == nil { + return nil + } + return Gen(*version) +} + +// Found is what of AmneziaWG the router has, for CapsOf. +type Found struct { + // Script is the netifd protocol script; Tool, whether the awg tool is there; Tool3, whether it knows the 3.1 keys. + Script string + Tool, Tool3 bool + Record *Record + Boot string + Core int64 + // Version is the kmod-amneziawg package's, nil when it is not a package. + Version *string +} + +// CapsOf works the capabilities out of what was found. +func CapsOf(f Found) Caps { + t2 := strings.Contains(f.Script, "awg_s3") && strings.Contains(f.Script, "awg_i1") + t3 := t2 && strings.Contains(f.Script, "awg_header_protection_key") && f.Tool3 + var tools any + if f.Tool { + tools = "1.0" + if t3 { + tools = "3.1" + } else if t2 { + tools = "2.0" + } + } + kmod := RunningGen(f.Record, f.Boot, f.Core, f.Version) + return Caps{ + V2: t2 && (kmod == nil || kmod != "1.0"), V3: t3 && (kmod == nil || kmod == "3.1"), + Tools: tools, Kmod: kmod, Mismatch: tools != nil && kmod != nil && tools != kmod, + Pending: Pending(f.Record, f.Boot, f.Core), + } +} + +const ( + toolPath = "/usr/bin/awg" + protoPath = "/lib/netifd/proto/amneziawg.sh" +) + +// Version is the installed version of a package (apk on OpenWrt 25.12, opkg before), or nil. +func Version(name string) *string { + if st, err := os.Stat("/usr/bin/apk"); err == nil && st.Mode()&0o111 != 0 { + out, _ := exec.Command("apk", "list", "--installed", name).CombinedOutput() + if m := regexp.MustCompile(`^` + regexp.QuoteMeta(name) + `-([^ ]+) `).FindSubmatch(out); m != nil { + v := string(m[1]) + return &v + } + return nil + } + out, _ := exec.Command("opkg", "list-installed").CombinedOutput() + re := regexp.MustCompile(`^` + regexp.QuoteMeta(name) + `([0-9]+)? - (.+)$`) + var found []string + for _, line := range strings.Split(string(out), "\n") { + if m := re.FindStringSubmatch(strings.TrimSpace(line)); m != nil && (found == nil || m[1] == "") { + found = m + } + } + if found == nil { + return nil + } + v := strings.TrimSpace(found[2]) + return &v +} + +var kept struct { + sync.Mutex + key string + caps Caps + ok bool +} + +// SystemCaps is this router's capabilities. Worked out again only when the module's file, the tool, the +// protocol script, the install's record (awg.json in dataDir) or the loaded module changed. +func SystemCaps(dataDir string) Caps { + mtime := func(path string) int64 { + st, err := os.Stat(path) + if err != nil { + return 0 + } + return st.ModTime().Unix() + } + read := func(path string) string { + raw, _ := os.ReadFile(path) + return strings.TrimSpace(string(raw)) + } + var core int64 + fmt.Sscan(read("/sys/module/amneziawg/coresize"), &core) + if core < 0 { + core = 0 + } + record := dataDir + "/awg.json" + key := fmt.Sprintf("%d/%d/%d/%d/%d", mtime("/lib/modules/"+read("/proc/sys/kernel/osrelease")+"/amneziawg.ko"), mtime(toolPath), mtime(protoPath), mtime(record), core) + kept.Lock() + defer kept.Unlock() + if kept.ok && kept.key == key { + return kept.caps + } + f := Found{Boot: read("/proc/sys/kernel/random/boot_id"), Core: core, Version: Version("kmod-amneziawg")} + script, _ := os.ReadFile(protoPath) + f.Script = string(script) + if tool, err := os.ReadFile(toolPath); err == nil { + f.Tool, f.Tool3 = true, bytes.Contains(tool, []byte("HeaderProtectionKey")) + } + var rec Record + if files.ReadJSON(record, &rec) { + f.Record = &rec + } + kept.key, kept.caps, kept.ok = key, CapsOf(f), true + return kept.caps +} diff --git a/backend/awg/caps_test.go b/backend/awg/caps_test.go new file mode 100644 index 0000000..4b3921f --- /dev/null +++ b/backend/awg/caps_test.go @@ -0,0 +1,86 @@ +package awg + +import ( + "encoding/json" + "os" + "testing" +) + +// Generations and the wait for a reboot, as ucode tells them (testdata/caps.uc, scripts/ucode-golden.sh). +func TestGenerationsAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/caps.json") + if err != nil { + t.Fatal(err) + } + var g struct { + Gens map[string]string `json:"gens"` + Runs []struct { + Rec *Record `json:"rec"` + Boot *string `json:"boot"` + Core *int64 `json:"core"` + Version *string `json:"version"` + Pending bool `json:"pending"` + Gen any `json:"gen"` + } `json:"runs"` + } + if err := json.Unmarshal(raw, &g); err != nil { + t.Fatal(err) + } + if len(g.Gens) < 12 || len(g.Runs) < 100 { + t.Fatalf("too little: %d versions, %d runs", len(g.Gens), len(g.Runs)) + } + for v, want := range g.Gens { + if got := Gen(v); got != want { + t.Errorf("Gen(%q) = %s, ucode %s", v, got, want) + } + } + waits := 0 + for i, r := range g.Runs { + boot, core := "", int64(0) + if r.Boot != nil { + boot = *r.Boot + } + if r.Core != nil { + core = *r.Core + } + if r.Pending { + waits++ + } + if got := Pending(r.Rec, boot, core); got != r.Pending { + t.Errorf("run %d: pending %v, ucode %v", i, got, r.Pending) + } + if got := RunningGen(r.Rec, boot, core, r.Version); got != r.Gen { + t.Errorf("run %d: generation %v, ucode %v", i, got, r.Gen) + } + } + if waits == 0 { + t.Fatal("no run waits for a reboot") + } +} + +func TestCapsOf(t *testing.T) { + s := func(v string) *string { return &v } + no := false + core := int64(65536) + v2 := "proto_config_add_int awg_s3\nawg_i1" + v3 := v2 + "\nawg_header_protection_key" + for name, c := range map[string]struct { + f Found + want Caps + }{ + "nothing installed": {Found{}, Caps{}}, + "3.1 all through": {Found{Script: v3, Tool: true, Tool3: true, Version: s("6.12.94.3.1.20260906-r1")}, Caps{V2: true, V3: true, Tools: "3.1", Kmod: "3.1"}}, + "3.1 tools over a 2.0 module": {Found{Script: v3, Tool: true, Tool3: true, Version: s("6.6.73.1.0.20250903-r2")}, + Caps{V2: true, Tools: "3.1", Kmod: "2.0", Mismatch: true}}, + "a script ahead of its tool": {Found{Script: v3, Tool: true, Version: s("3.1.20260906-r1")}, Caps{V2: true, Tools: "2.0", Kmod: "3.1", Mismatch: true}}, + "a module put there by hand": {Found{Script: v3, Tool: true, Tool3: true}, Caps{V2: true, V3: true, Tools: "3.1"}}, + "the first generation": {Found{Script: "awg_jc", Tool: true, Version: s("1.0.20240213")}, Caps{Tools: "1.0", Kmod: "1.0"}}, + "an update that waits for a reboot": {Found{Script: v3, Tool: true, Tool3: true, Version: s("3.1.20260906-r1"), Boot: "b", Core: core, + Record: &Record{Reloaded: &no, Boot: s("b"), PrevCore: &core, PrevGen: s("1.0")}}, + Caps{Tools: "3.1", Kmod: "1.0", Mismatch: true, Pending: true}}, + } { + if got := CapsOf(c.f); got != c.want { + t.Errorf("%s: %+v", name, got) + } + } +} diff --git a/backend/awg/dump.go b/backend/awg/dump.go new file mode 100644 index 0000000..a60464f --- /dev/null +++ b/backend/awg/dump.go @@ -0,0 +1,184 @@ +// Package awg is the backend's one door to AmneziaWG: what the tunnels say of their peers. +// +// This file reads `awg show dump`, as dawnline.awg dump() does: Dawnline's own tunnels only, each +// on its own (never `all`: another AmneziaWG interface on the router is not ours to read, and a long one +// would slow a read that runs every second). The tool and /sys are reached through Reader's two functions, +// so a test stands in for both. +package awg + +import ( + "os" + "os/exec" + "strconv" + "strings" +) + +// Peer is a device as its tunnel sees it. +type Peer struct { + Ifname string `json:"ifname"` + // Endpoint is where it last spoke from ("203.0.113.7:41821"), empty when it never did. + Endpoint string `json:"endpoint"` + // Handshake is when its session was last made (unix seconds), 0 for never. + Handshake int64 `json:"handshake"` + // Rx and Tx are the bytes received from it and sent to it since the tunnel last added it. + Rx int64 `json:"rx"` + Tx int64 `json:"tx"` +} + +// Iface is a tunnel's own line. +type Iface struct { + PublicKey string `json:"public_key"` + Port int `json:"port"` + // Ifindex is the link's index: a new one each time the tunnel is set up, so it is the epoch of its + // peers' counters. + Ifindex int `json:"ifindex"` +} + +// How a tunnel's read went. +const ( + Read = "read" + // Down: the interface does not exist; its peers and their counters are gone with it. + Down = "down" + // Failed: it exists but could not be read, or was set up again during the read: that says nothing + // about its peers. + Failed = "error" +) + +// Dump is one look at the tunnels. Ifaces and Peers hold only what was read; OK is false when any tunnel's +// read failed. +type Dump struct { + OK bool `json:"ok"` + Reads map[string]string `json:"reads"` + Ifaces map[string]Iface `json:"ifaces"` + Peers map[string]Peer `json:"peers"` +} + +// Reader reads tunnels. The zero value is not usable: System() is the router's. +type Reader struct { + // Show is `awg show dump`: its output, and whether it ran and ended well. + Show func(ifname string) (string, bool) + // Index is the interface's index while it exists. + Index func(ifname string) (int, bool) +} + +// System reads the router's own tunnels. +func System() Reader { + return Reader{ + Show: func(ifname string) (string, bool) { + out, err := exec.Command("awg", "show", ifname, "dump").Output() + return string(out), err == nil + }, + Index: func(ifname string) (int, bool) { + raw, err := os.ReadFile("/sys/class/net/" + ifname + "/ifindex") + if err != nil { + return 0, false + } + n, err := strconv.Atoi(strings.TrimSpace(string(raw))) + return n, err == nil + }, + } +} + +// Dump reads these tunnels. +func (r Reader) Dump(ifnames []string) Dump { + d := Dump{OK: true, Reads: map[string]string{}, Ifaces: map[string]Iface{}, Peers: map[string]Peer{}} + for _, ifname := range ifnames { + // Read around the call: a link set up again in between gave counters of either one. + before, there := r.Index(ifname) + // Not there (a tunnel netifd could not bring up, AmneziaWG gone after an upgrade): no process to + // learn it. One that appears is read next time. + if !there { + d.Reads[ifname] = Down + continue + } + out, ran := r.Show(ifname) + after, still := r.Index(ifname) + // Gone during the read: its peers and their counters are gone with it. + if !still { + d.Reads[ifname] = Down + continue + } + var iface *Iface + var peers map[string]Peer + if ran { + iface, peers = Parse(out, ifname) + } + if iface == nil || after != before { + d.Reads[ifname] = Failed + d.OK = false + continue + } + iface.Ifindex = after + d.Reads[ifname] = Read + d.Ifaces[ifname] = *iface + for k, p := range peers { + d.Peers[k] = p + } + } + return d +} + +// Parse reads a dump's lines. They are told apart by their shape, not their length (each AmneziaWG +// generation adds fields to the interface line): an interface line carries its private and public key and +// a port; a peer line the peer's key, a preshared key or "(none)", and an endpoint. The interface is nil +// when the dump has no such line. +func Parse(out, ifname string) (*Iface, map[string]Peer) { + var iface *Iface + peers := map[string]Peer{} + for _, line := range strings.Split(out, "\n") { + f := strings.Split(line, "\t") + if len(f) < 4 || !ValidKey(f[0]) { + continue + } + second := ValidKey(f[1]) + if second && digits(f[2]) { + port, _ := strconv.Atoi(f[2]) + iface = &Iface{PublicKey: f[1], Port: port} + continue + } + if len(f) >= 8 && (second || f[1] == "(none)") { + p := Peer{Ifname: ifname, Handshake: count(f[4]), Rx: count(f[5]), Tx: count(f[6])} + if f[2] != "(none)" { + p.Endpoint = f[2] + } + peers[f[0]] = p + } + } + return iface, peers +} + +func digits(s string) bool { + if s == "" { + return false + } + for i := 0; i < len(s); i++ { + if s[i] < '0' || s[i] > '9' { + return false + } + } + return true +} + +// count is a counter or a moment of the dump; what is no number counts as none. +func count(s string) int64 { + n, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return 0 + } + return n +} + +// ValidKey tells a WireGuard key: 32 bytes in base64, so 43 letters and "=", the last letter one of those +// that end 32 bytes. +func ValidKey(s string) bool { + if len(s) != 44 || s[43] != '=' || !strings.ContainsRune("AEIMQUYcgkosw048", rune(s[42])) { + return false + } + for i := 0; i < 42; i++ { + c := s[i] + if !(c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '+' || c == '/') { + return false + } + } + return true +} diff --git a/backend/awg/dump_test.go b/backend/awg/dump_test.go new file mode 100644 index 0000000..6b4b981 --- /dev/null +++ b/backend/awg/dump_test.go @@ -0,0 +1,101 @@ +package awg + +import ( + "os" + "reflect" + "strings" + "testing" +) + +const ( + serverKey = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=" + peerOn = "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" + peerNew = "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=" +) + +// The project's fixtures are `awg show all dump` (the ifname first); one interface's dump has no ifname. +func fixture(t *testing.T, name string) string { + raw, err := os.ReadFile("testdata/awg-dump-" + name + ".txt") + if err != nil { + t.Fatal(err) + } + var out []string + for _, l := range strings.Split(string(raw), "\n") { + if l != "" { + out = append(out, strings.TrimPrefix(l, "awgmain\t")) + } + } + return strings.Join(out, "\n") + "\n" +} + +// A stand-in for the router: the dump it prints and the index /sys gives, by the read. +func stand(out string, ok bool, indexes ...int) Reader { + i := 0 + return Reader{ + Show: func(string) (string, bool) { return out, ok }, + Index: func(string) (int, bool) { + ix := indexes[min(i, len(indexes)-1)] + i++ + return ix, ix != 0 + }, + } +} + +// What dawnline.awg dump() reads of the same fixtures (tests/ucode/awg.test.uc). +func TestDumpGenerations(t *testing.T) { + d := stand(fixture(t, "1.0"), true, 7).Dump([]string{"dawn0"}) + want := Dump{OK: true, Reads: map[string]string{"dawn0": Read}, + Ifaces: map[string]Iface{"dawn0": {PublicKey: serverKey, Port: 51820, Ifindex: 7}}, + Peers: map[string]Peer{ + peerOn: {Ifname: "dawn0", Endpoint: "203.0.113.7:41821", Handshake: 1760000000, Rx: 123456, Tx: 654321}, + peerNew: {Ifname: "dawn0"}, + }} + if !reflect.DeepEqual(d, want) { + t.Fatalf("1.0: %+v", d) + } + d = stand(fixture(t, "2.0"), true, 7).Dump([]string{"dawn0"}) + if d.Ifaces["dawn0"].Port != 51820 || len(d.Peers) != 1 || d.Peers[peerOn].Handshake == 0 { + t.Fatalf("2.0: %+v", d) + } + d = stand(fixture(t, "3.1"), true, 7).Dump([]string{"dawn0"}) + if d.Ifaces["dawn0"].PublicKey != serverKey || len(d.Peers) != 2 { + t.Fatalf("3.1: %+v", d) + } +} + +func TestDumpStates(t *testing.T) { + asked := false + r := Reader{Show: func(string) (string, bool) { asked = true; return "", true }, Index: func(string) (int, bool) { return 0, false }} + if d := r.Dump([]string{"dawn0"}); !d.OK || d.Reads["dawn0"] != Down || asked { + t.Fatalf("a tunnel that is not there: %+v, asked %v", d, asked) + } + one := fixture(t, "1.0") + if d := stand(one, true, 7, 0).Dump([]string{"dawn0"}); d.Reads["dawn0"] != Down || len(d.Peers) != 0 { + t.Fatalf("gone during the read: %+v", d) + } + if d := stand(one, true, 7, 9).Dump([]string{"dawn0"}); d.OK || d.Reads["dawn0"] != Failed || len(d.Peers) != 0 { + t.Fatalf("set up again during the read: %+v", d) + } + if d := stand("", false, 7).Dump([]string{"dawn0"}); d.OK || d.Reads["dawn0"] != Failed { + t.Fatalf("the tool failed: %+v", d) + } + if d := stand("not a dump\n", true, 7).Dump([]string{"dawn0"}); d.Reads["dawn0"] != Failed { + t.Fatalf("no interface line: %+v", d) + } + if d := (Reader{}).Dump(nil); !d.OK || len(d.Reads) != 0 { + t.Fatalf("no tunnels: %+v", d) + } +} + +func TestValidKey(t *testing.T) { + for _, k := range []string{serverKey, peerOn, peerNew} { + if !ValidKey(k) { + t.Errorf("%s refused", k) + } + } + for _, k := range []string{"", "(none)", serverKey[:43], serverKey[:42] + "B=", "!" + serverKey[1:], serverKey + "="} { + if ValidKey(k) { + t.Errorf("%q accepted", k) + } + } +} diff --git a/tests/ucode/fixtures/awg-dump-1.0.txt b/backend/awg/testdata/awg-dump-1.0.txt similarity index 100% rename from tests/ucode/fixtures/awg-dump-1.0.txt rename to backend/awg/testdata/awg-dump-1.0.txt diff --git a/tests/ucode/fixtures/awg-dump-2.0.txt b/backend/awg/testdata/awg-dump-2.0.txt similarity index 100% rename from tests/ucode/fixtures/awg-dump-2.0.txt rename to backend/awg/testdata/awg-dump-2.0.txt diff --git a/tests/ucode/fixtures/awg-dump-3.1.txt b/backend/awg/testdata/awg-dump-3.1.txt similarity index 100% rename from tests/ucode/fixtures/awg-dump-3.1.txt rename to backend/awg/testdata/awg-dump-3.1.txt diff --git a/backend/awg/testdata/caps.json b/backend/awg/testdata/caps.json new file mode 100644 index 0000000..50b4d87 --- /dev/null +++ b/backend/awg/testdata/caps.json @@ -0,0 +1,1730 @@ +{ + "gens": { + "6.12.94.3.1.20260906-r1": "3.1", + "6.12.94.3.1.20260906": "3.1", + "3.1.20260906-r1": "3.1", + "6.6.73.1.0.20241018-r1": "1.0", + "1.0.20250630-1": "1.0", + "1.0.20250701-1": "2.0", + "6.6.73.1.0.20250903-r2": "2.0", + "1.0.20240213": "1.0", + "5.15.167.1.0.20250105-1": "1.0", + "2.0": "2.0", + "odd": "2.0", + "": "2.0", + "3.x": "3.1", + "6.12.3.1.0.20260101": "2.0" + }, + "runs": [ + { + "rec": null, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": null, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": null, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": true, + "gen": "2.0" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": true, + "gen": "2.0" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "2.0" + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": true, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": true, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": 65536, + "prev_gen": null + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": true, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": null, + "boot": "b1", + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": null, + "prev_core": 65536, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b1", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": "b2", + "core": null, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": 65536, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": 73728, + "version": null, + "pending": false, + "gen": null + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": "6.12.94.3.1.20260906-r1", + "pending": false, + "gen": "3.1" + }, + { + "rec": { + "reloaded": false, + "boot": "b1", + "prev_core": null, + "prev_gen": "1.0" + }, + "boot": null, + "core": null, + "version": null, + "pending": false, + "gen": null + } + ] +} diff --git a/backend/bridge/bridge.go b/backend/bridge/bridge.go new file mode 100644 index 0000000..a98a579 --- /dev/null +++ b/backend/bridge/bridge.go @@ -0,0 +1,133 @@ +// Package bridge has the backend's topics told again when they may have moved without an event of their +// own: the settings or what was handed out changed on disk, somebody starts to look, or the minute passed +// (the counters and the clock move by themselves). It also gives the topics their shape on the stream +// (Split). The name is from the time it carried the ucode backend's answers over; nothing is asked of +// anyone now. +package bridge + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/hub" +) + +// Refresh is how old what is published may get while nothing on disk moved: traffic totals and uptimes +// change without an event. +const Refresh = 30 * time.Second + +// MeterKeep is how many points of the live meter are kept, one a second. +const MeterKeep = 120 + +// Audience tells whether anyone looks. +type Audience interface { + Present() bool + Wants(topic string) bool +} + +// Bridge has the topics told again. +type Bridge struct { + Hub *hub.Hub + Audience Audience + // Watch lists the files whose change means the topics changed (the settings, the configurations handed + // out, the servers kept down). + Watch []string + // Tell puts the topics again, as the router is at that moment, and says whether it could: false while + // there is nothing to make them from (the settings were not read yet). nil: nobody makes them here, a + // test stand. + Tell func() bool + // Log gets a line for the system log. + Log func(format string, args ...any) + + asks chan chan struct{} + sig string + told time.Time + wasAbsent bool +} + +// New makes a bridge ready to be asked (Look) before it runs. +func New(b Bridge) *Bridge { + b.asks = make(chan chan struct{}) + return &b +} + +// Look has the topics told now instead of at the next second, and returns once they hold what is on disk +// (or ctx ended). A page asks after its own edit, to read what it wrote. +func (b *Bridge) Look(ctx context.Context) { + done := make(chan struct{}) + select { + case b.asks <- done: + case <-ctx.Done(): + return + } + select { + case <-done: + case <-ctx.Done(): + } +} + +// Run works until ctx ends. +func (b *Bridge) Run(ctx context.Context) { + tick := time.NewTicker(time.Second) + defer tick.Stop() + b.wasAbsent = true + for { + var asked chan struct{} + select { + case <-ctx.Done(): + return + case asked = <-b.asks: + case <-tick.C: + } + if asked != nil { + // whoever asks is told at once + b.wasAbsent = true + b.status() + close(asked) + continue + } + if !b.Audience.Present() { + b.wasAbsent = true + continue + } + b.status() + } +} + +// status has the topics told when they are due: the first look after nobody looked, a change on disk, or +// Refresh since the last time. Topics that could not be made stay due, and the backend's own topic does not +// say they were: a page that asked in the backend's first second is told with the next one, not after +// Refresh. +func (b *Bridge) status() { + if b.Tell == nil { + return + } + sig := signature(b.Watch) + if !b.wasAbsent && sig == b.sig && time.Since(b.told) < Refresh { + return + } + if !b.Tell() { + return + } + b.sig, b.told, b.wasAbsent = sig, time.Now(), false + // `at`: when the topics were last made, so a page that opens on documents kept from an hour ago + // knows to wait for this instead of showing them + b.Hub.Put("backend", map[string]any{"ok": true, "at": time.Now().Unix()}) +} + +// signature is the files' identity: a commit of the settings replaces the +// file (a new inode within the same second), a counter is rewritten in place. +func signature(paths []string) string { + s := "" + for _, p := range paths { + st, err := os.Stat(p) + if err != nil { + s += "-;" + continue + } + s += fmt.Sprintf("%d/%d/%d;", st.ModTime().UnixNano(), st.Size(), inode(st)) + } + return s +} diff --git a/backend/bridge/bridge_test.go b/backend/bridge/bridge_test.go new file mode 100644 index 0000000..8f2f7b0 --- /dev/null +++ b/backend/bridge/bridge_test.go @@ -0,0 +1,80 @@ +package bridge + +import ( + "os" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/hub" +) + +// The topics are told again when somebody starts to look, when the settings change and with the minute, +// and not otherwise; the backend's own topic says it is well. +func TestToldWhenDue(t *testing.T) { + dir := t.TempDir() + conf := dir + "/dawnline" + os.WriteFile(conf, []byte("a"), 0o600) + h := hub.New() + told := 0 + b := New(Bridge{Hub: h, Log: func(string, ...any) {}, Watch: []string{conf}, Tell: func() bool { told++; return true }}) + b.wasAbsent = true + b.status() + b.status() + if told != 1 { + t.Fatalf("the first look: told %d times", told) + } + time.Sleep(10 * time.Millisecond) + os.WriteFile(conf, []byte("bb"), 0o600) + b.status() + b.status() + if told != 2 { + t.Fatalf("after the settings changed: told %d times", told) + } + b.told = time.Now().Add(-2 * Refresh) + b.status() + if told != 3 { + t.Fatalf("a minute later: told %d times", told) + } + if doc, ok := h.Sync("", 0, nil).Docs["backend"].(map[string]any); !ok || doc["ok"] != true { + t.Errorf("the backend's own topic: %v", h.Sync("", 0, nil).Docs["backend"]) + } + // a stand with nobody to make the topics tells nothing + quiet := New(Bridge{Hub: hub.New(), Watch: []string{conf}}) + quiet.wasAbsent = true + quiet.status() +} + +// Topics that could not be made yet (the backend just started: the settings are not read) stay due: they +// are asked for again with the next second, not after Refresh, and until then the backend's own topic does +// not say that they are there. +func TestStaysDueUntilTold(t *testing.T) { + h := hub.New() + asked, ready := 0, false + b := New(Bridge{Hub: h, Tell: func() bool { asked++; return ready }}) + b.wasAbsent = true + b.status() + b.status() + if asked != 2 { + t.Fatalf("not told yet: asked %d times", asked) + } + if doc, there := h.Sync("", 0, nil).Docs["backend"]; there { + t.Fatalf("the backend's own topic before any was made: %v", doc) + } + ready = true + b.status() + b.status() + if asked != 3 { + t.Fatalf("once told: asked %d times", asked) + } + if _, there := h.Sync("", 0, nil).Docs["backend"]; !there { + t.Fatal("told, and the backend's own topic is not there") + } + // the same when they are due by their age + ready = false + b.told = time.Now().Add(-2 * Refresh) + b.status() + b.status() + if asked != 5 { + t.Fatalf("due by age and not told: asked %d times", asked) + } +} diff --git a/backend/bridge/inode_unix.go b/backend/bridge/inode_unix.go new file mode 100644 index 0000000..7a8e874 --- /dev/null +++ b/backend/bridge/inode_unix.go @@ -0,0 +1,16 @@ +//go:build unix + +package bridge + +import ( + "os" + "syscall" +) + +// inode is the file's inode number (0 when the system does not tell). +func inode(st os.FileInfo) uint64 { + if s, ok := st.Sys().(*syscall.Stat_t); ok { + return uint64(s.Ino) + } + return 0 +} diff --git a/backend/bridge/testdata/status.json b/backend/bridge/testdata/status.json new file mode 100644 index 0000000..e5520f0 --- /dev/null +++ b/backend/bridge/testdata/status.json @@ -0,0 +1,1661 @@ +{ + "version": "0.18.0", + "now": 1800000000.0, + "tz": 180, + "hostname": "router", + "people": [ + { + "id": "sample0", + "name": "First person", + "server": "sample", + "access": "both", + "device_limit": 4, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 47000000000.0, + "quota_limit": 0, + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 4600000000.0, + 43000000000.0 + ], + "total": [ + 36000000000.0, + 350000000000.0 + ], + "online": 1, + "last_seen": 1800000000.0, + "devices": [ + { + "id": "sample0d0", + "name": "Device", + "kind": "phone", + "address": "10.0.0.10", + "disabled": false, + "created": 1800000000.0, + "created_by": "admin", + "online": true, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": true, + "month": [ + 1600000000.0, + 15000000000.0 + ], + "total": [ + 12000000000.0, + 120000000000.0 + ], + "spark": [ + [ + 280000000.0, + 2500000000.0 + ], + [ + 270000000.0, + 2500000000.0 + ], + [ + 260000000.0, + 1900000000.0 + ], + [ + 77000000.0, + 1000000000.0 + ], + [ + 120000000.0, + 1100000000.0 + ], + [ + 170000000.0, + 1300000000.0 + ], + [ + 76000000.0, + 970000000.0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": true, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 0, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + }, + { + "id": "sample0d1", + "name": "Device", + "kind": "computer", + "address": "10.0.0.11", + "disabled": false, + "created": 1800000000.0, + "created_by": "admin", + "online": false, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": false, + "month": [ + 2500000000.0, + 23000000000.0 + ], + "total": [ + 21000000000.0, + 220000000000.0 + ], + "spark": [ + [ + 89000000.0, + 1400000000.0 + ], + [ + 310000000.0, + 3200000000.0 + ], + [ + 400000000.0, + 3200000000.0 + ], + [ + 460000000.0, + 3600000000.0 + ], + [ + 560000000.0, + 5200000000.0 + ], + [ + 0, + 0 + ], + [ + 360000000.0, + 2900000000.0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": true, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 0, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + } + ], + "month_days": [ + [ + 880000000.0, + 8300000000.0 + ], + [ + 410000000.0, + 4300000000.0 + ], + [ + 640000000.0, + 6600000000.0 + ], + [ + 690000000.0, + 5400000000.0 + ], + [ + 590000000.0, + 5200000000.0 + ], + [ + 710000000.0, + 6700000000.0 + ], + [ + 210000000.0, + 1700000000.0 + ], + [ + 500000000.0, + 4400000000.0 + ] + ], + "has_link": false, + "note": "", + "services": [], + "home_nets": [], + "created": 1800000000.0, + "code_set": 1800000000.0, + "rate": [ + [ + 1800000000.0, + 341942, + 3800000.0 + ], + [ + 1800000000.0, + 37738, + 419311 + ], + [ + 1800000000.0, + 101093, + 1100000.0 + ], + [ + 1800000000.0, + 45619, + 506878 + ], + [ + 1800000000.0, + 102383, + 1100000.0 + ], + [ + 1800000000.0, + 60710, + 674558 + ], + [ + 1800000000.0, + 88785, + 986500 + ], + [ + 1800000000.0, + 49414, + 549044 + ], + [ + 1800000000.0, + 70331, + 781453 + ], + [ + 1800000000.0, + 48453, + 538372 + ], + [ + 1800000000.0, + 342452, + 3800000.0 + ], + [ + 1800000000.0, + 50077, + 556412 + ], + [ + 1800000000.0, + 64947, + 721636 + ], + [ + 1800000000.0, + 201883, + 2200000.0 + ], + [ + 1800000000.0, + 106357, + 1200000.0 + ] + ], + "quota_month": [ + 4600000000.0, + 43000000000.0 + ], + "quota_resets": 1800000000.0, + "quota_reset_day": "2026-11-20", + "circle": "" + }, + { + "id": "sample1", + "name": "Second one", + "server": "sample", + "access": "both", + "device_limit": 3, + "expires": "", + "quota_gb": 300, + "quota_period": "total", + "quota_used": 160000000000.0, + "quota_limit": 320000000000.0, + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 2200000000.0, + 21000000000.0 + ], + "total": [ + 14000000000.0, + 150000000000.0 + ], + "online": 1, + "last_seen": 1800000000.0, + "devices": [ + { + "id": "sample1d0", + "name": "Device", + "kind": "computer", + "address": "10.0.0.12", + "disabled": false, + "created": 1800000000.0, + "created_by": "admin", + "online": false, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": false, + "month": [ + 1500000000.0, + 13000000000.0 + ], + "total": [ + 10000000000.0, + 110000000000.0 + ], + "spark": [ + [ + 360000000.0, + 3200000000.0 + ], + [ + 260000000.0, + 2100000000.0 + ], + [ + 230000000.0, + 2700000000.0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": true, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 0, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + }, + { + "id": "sample1d1", + "name": "Device", + "kind": "phone", + "address": "10.0.0.13", + "disabled": false, + "created": 1800000000.0, + "created_by": "admin", + "online": true, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": true, + "month": [ + 720000000.0, + 7400000000.0 + ], + "total": [ + 4000000000.0, + 39000000000.0 + ], + "spark": [ + [ + 44000000.0, + 600000000.0 + ], + [ + 32000000.0, + 490000000.0 + ], + [ + 71000000.0, + 1200000000.0 + ], + [ + 88000000.0, + 1100000000.0 + ], + [ + 28000000.0, + 320000000.0 + ], + [ + 79000000.0, + 980000000.0 + ], + [ + 120000000.0, + 880000000.0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": true, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 0, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + } + ], + "month_days": [ + [ + 890000000.0, + 7100000000.0 + ], + [ + 400000000.0, + 3800000000.0 + ], + [ + 290000000.0, + 2600000000.0 + ], + [ + 300000000.0, + 3800000000.0 + ], + [ + 88000000.0, + 1100000000.0 + ], + [ + 28000000.0, + 320000000.0 + ], + [ + 79000000.0, + 980000000.0 + ], + [ + 120000000.0, + 880000000.0 + ] + ], + "has_link": false, + "note": "", + "services": [], + "home_nets": [], + "created": 1800000000.0, + "code_set": 1800000000.0, + "rate": [ + [ + 1800000000.0, + 132984, + 1500000.0 + ], + [ + 1800000000.0, + 134361, + 1500000.0 + ], + [ + 1800000000.0, + 136487, + 1500000.0 + ], + [ + 1800000000.0, + 134904, + 1500000.0 + ], + [ + 1800000000.0, + 115365, + 1300000.0 + ], + [ + 1800000000.0, + 113341, + 1300000.0 + ], + [ + 1800000000.0, + 86774, + 964159 + ], + [ + 1800000000.0, + 127959, + 1400000.0 + ], + [ + 1800000000.0, + 425615, + 4700000.0 + ], + [ + 1800000000.0, + 134439, + 1500000.0 + ], + [ + 1800000000.0, + 127749, + 1400000.0 + ], + [ + 1800000000.0, + 70012, + 777908 + ], + [ + 1800000000.0, + 50512, + 561242 + ], + [ + 1800000000.0, + 66701, + 741127 + ], + [ + 1800000000.0, + 48008, + 533424 + ] + ], + "quota_month": [ + 2200000000.0, + 21000000000.0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "circle": "" + }, + { + "id": "sample2", + "name": "Third person", + "server": "sample", + "access": "lan", + "device_limit": 2, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 51000000000.0, + "quota_limit": 0, + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 4500000000.0, + 46000000000.0 + ], + "total": [ + 36000000000.0, + 380000000000.0 + ], + "online": 1, + "last_seen": 1800000000.0, + "devices": [ + { + "id": "sample2d0", + "name": "Device", + "kind": "router", + "address": "10.0.0.14", + "disabled": false, + "created": 1800000000.0, + "created_by": "admin", + "online": true, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": true, + "month": [ + 4500000000.0, + 46000000000.0 + ], + "total": [ + 36000000000.0, + 380000000000.0 + ], + "spark": [ + [ + 1000000000.0, + 9400000000.0 + ], + [ + 790000000.0, + 7300000000.0 + ], + [ + 0, + 0 + ], + [ + 580000000.0, + 5300000000.0 + ], + [ + 520000000.0, + 6000000000.0 + ], + [ + 360000000.0, + 5000000000.0 + ], + [ + 360000000.0, + 3800000000.0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": false, + "mtu": 0, + "keepalive": 25, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + }, + { + "id": "sample2d1", + "name": "Device", + "kind": "other", + "address": "10.0.0.15", + "disabled": true, + "created": 1800000000.0, + "created_by": "admin", + "online": false, + "handshake": 1800000000.0, + "endpoint": "192.0.2.1", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "", + "browser_key": false, + "config_stale": false, + "lan_bypass": true, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 0, + "link": null, + "setup": null, + "config_issued": 1800000000.0 + } + ], + "month_days": [ + [ + 900000000.0, + 9200000000.0 + ], + [ + 1000000000.0, + 9400000000.0 + ], + [ + 790000000.0, + 7300000000.0 + ], + [ + 0, + 0 + ], + [ + 580000000.0, + 5300000000.0 + ], + [ + 520000000.0, + 6000000000.0 + ], + [ + 360000000.0, + 5000000000.0 + ], + [ + 360000000.0, + 3800000000.0 + ] + ], + "has_link": false, + "note": "", + "services": [], + "home_nets": [], + "created": 1800000000.0, + "code_set": 1800000000.0, + "rate": [ + [ + 1800000000.0, + 57644, + 640485 + ], + [ + 1800000000.0, + 70777, + 786407 + ], + [ + 1800000000.0, + 70595, + 784390 + ], + [ + 1800000000.0, + 54608, + 606752 + ], + [ + 1800000000.0, + 61016, + 677961 + ], + [ + 1800000000.0, + 39339, + 437100 + ], + [ + 1800000000.0, + 25723, + 285806 + ], + [ + 1800000000.0, + 45866, + 509624 + ], + [ + 1800000000.0, + 37693, + 418809 + ], + [ + 1800000000.0, + 53645, + 596061 + ], + [ + 1800000000.0, + 159863, + 1800000.0 + ], + [ + 1800000000.0, + 53430, + 593665 + ], + [ + 1800000000.0, + 64011, + 711233 + ], + [ + 1800000000.0, + 57272, + 636353 + ], + [ + 1800000000.0, + 67556, + 750626 + ] + ], + "quota_month": [ + 4500000000.0, + 46000000000.0 + ], + "quota_resets": 1800000000.0, + "quota_reset_day": "2026-11-20", + "circle": "" + } + ], + "servers": [ + { + "id": "sample", + "name": "Server name", + "ifname": "dawn0", + "port": 4500, + "subnet": "10.0.0.0/24", + "endpoint": "vpn.example.net", + "public_key": "", + "enabled": true, + "lan_like": false, + "device_mesh": true, + "mesh": "circles", + "home": [], + "preset": "balanced", + "mtu": 0, + "mtus": { + "computer": 1380, + "phone": 1280 + }, + "keepalive": 0, + "dns": [], + "series": [ + { + "day": "2026-08-26", + "rx": 39000000.0, + "tx": 360000000.0 + }, + { + "day": "2026-08-27", + "rx": 26000000.0, + "tx": 340000000.0 + }, + { + "day": "2026-08-28", + "rx": 66000000.0, + "tx": 630000000.0 + }, + { + "day": "2026-08-29", + "rx": 47000000.0, + "tx": 350000000.0 + }, + { + "day": "2026-08-30", + "rx": 160000000.0, + "tx": 1400000000.0 + }, + { + "day": "2026-08-31", + "rx": 73000000.0, + "tx": 570000000.0 + }, + { + "day": "2026-09-01", + "rx": 140000000.0, + "tx": 1700000000.0 + }, + { + "day": "2026-09-02", + "rx": 100000000.0, + "tx": 1500000000.0 + }, + { + "day": "2026-09-03", + "rx": 240000000.0, + "tx": 2300000000.0 + }, + { + "day": "2026-09-04", + "rx": 690000000.0, + "tx": 5900000000.0 + }, + { + "day": "2026-09-05", + "rx": 1900000000.0, + "tx": 16000000000.0 + }, + { + "day": "2026-09-06", + "rx": 1400000000.0, + "tx": 19000000000.0 + }, + { + "day": "2026-09-07", + "rx": 810000000.0, + "tx": 10000000000.0 + }, + { + "day": "2026-09-08", + "rx": 870000000.0, + "tx": 9900000000.0 + }, + { + "day": "2026-09-09", + "rx": 1300000000.0, + "tx": 16000000000.0 + }, + { + "day": "2026-09-10", + "rx": 1200000000.0, + "tx": 11000000000.0 + }, + { + "day": "2026-09-11", + "rx": 2000000000.0, + "tx": 20000000000.0 + }, + { + "day": "2026-09-12", + "rx": 2800000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-13", + "rx": 1700000000.0, + "tx": 23000000000.0 + }, + { + "day": "2026-09-14", + "rx": 2300000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-15", + "rx": 2200000000.0, + "tx": 21000000000.0 + }, + { + "day": "2026-09-16", + "rx": 2100000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-17", + "rx": 2800000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-18", + "rx": 2700000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-19", + "rx": 3800000000.0, + "tx": 38000000000.0 + }, + { + "day": "2026-09-20", + "rx": 2500000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-21", + "rx": 2400000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-22", + "rx": 2500000000.0, + "tx": 27000000000.0 + }, + { + "day": "2026-09-23", + "rx": 3100000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-09-24", + "rx": 3000000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-25", + "rx": 3100000000.0, + "tx": 28000000000.0 + }, + { + "day": "2026-09-26", + "rx": 2400000000.0, + "tx": 23000000000.0 + }, + { + "day": "2026-09-27", + "rx": 3600000000.0, + "tx": 37000000000.0 + }, + { + "day": "2026-09-28", + "rx": 2700000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-29", + "rx": 3600000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-09-30", + "rx": 4600000000.0, + "tx": 44000000000.0 + }, + { + "day": "2026-10-01", + "rx": 3700000000.0, + "tx": 40000000000.0 + }, + { + "day": "2026-10-02", + "rx": 3400000000.0, + "tx": 35000000000.0 + }, + { + "day": "2026-10-03", + "rx": 5300000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-10-04", + "rx": 5000000000.0, + "tx": 46000000000.0 + }, + { + "day": "2026-10-05", + "rx": 3200000000.0, + "tx": 33000000000.0 + }, + { + "day": "2026-10-06", + "rx": 4600000000.0, + "tx": 44000000000.0 + }, + { + "day": "2026-10-07", + "rx": 4200000000.0, + "tx": 39000000000.0 + }, + { + "day": "2026-10-08", + "rx": 3400000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-10-09", + "rx": 3700000000.0, + "tx": 39000000000.0 + }, + { + "day": "2026-10-10", + "rx": 4800000000.0, + "tx": 48000000000.0 + }, + { + "day": "2026-10-11", + "rx": 6100000000.0, + "tx": 58000000000.0 + }, + { + "day": "2026-10-12", + "rx": 3500000000.0, + "tx": 38000000000.0 + }, + { + "day": "2026-10-13", + "rx": 4500000000.0, + "tx": 46000000000.0 + }, + { + "day": "2026-10-14", + "rx": 4600000000.0, + "tx": 44000000000.0 + }, + { + "day": "2026-10-15", + "rx": 3500000000.0, + "tx": 38000000000.0 + }, + { + "day": "2026-10-16", + "rx": 5700000000.0, + "tx": 60000000000.0 + }, + { + "day": "2026-10-17", + "rx": 5000000000.0, + "tx": 56000000000.0 + }, + { + "day": "2026-10-18", + "rx": 5900000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-10-19", + "rx": 3600000000.0, + "tx": 42000000000.0 + }, + { + "day": "2026-10-20", + "rx": 4700000000.0, + "tx": 47000000000.0 + }, + { + "day": "2026-10-21", + "rx": 4400000000.0, + "tx": 42000000000.0 + }, + { + "day": "2026-10-22", + "rx": 5200000000.0, + "tx": 50000000000.0 + }, + { + "day": "2026-10-23", + "rx": 5300000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-10-24", + "rx": 7900000000.0, + "tx": 82000000000.0 + }, + { + "day": "2026-10-25", + "rx": 5900000000.0, + "tx": 60000000000.0 + }, + { + "day": "2026-10-26", + "rx": 4400000000.0, + "tx": 45000000000.0 + }, + { + "day": "2026-10-27", + "rx": 5100000000.0, + "tx": 47000000000.0 + }, + { + "day": "2026-10-28", + "rx": 6300000000.0, + "tx": 60000000000.0 + }, + { + "day": "2026-10-29", + "rx": 5300000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-10-30", + "rx": 4900000000.0, + "tx": 48000000000.0 + }, + { + "day": "2026-10-31", + "rx": 5100000000.0, + "tx": 50000000000.0 + }, + { + "day": "2026-11-01", + "rx": 7300000000.0, + "tx": 73000000000.0 + }, + { + "day": "2026-11-02", + "rx": 5200000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-11-03", + "rx": 5200000000.0, + "tx": 49000000000.0 + }, + { + "day": "2026-11-04", + "rx": 4700000000.0, + "tx": 43000000000.0 + }, + { + "day": "2026-11-05", + "rx": 4800000000.0, + "tx": 50000000000.0 + }, + { + "day": "2026-11-06", + "rx": 3300000000.0, + "tx": 37000000000.0 + }, + { + "day": "2026-11-07", + "rx": 5000000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-11-08", + "rx": 2900000000.0, + "tx": 27000000000.0 + } + ], + "rate": [ + [ + 1800000000.0, + 300000, + 2900000.0 + ], + [ + 1800000000.0, + 340000, + 3600000.0 + ] + ], + "address": "10.0.0.1", + "up": true, + "uptime": 1400000.0, + "peers": 40, + "online": 10, + "obf": {}, + "hpk": false + } + ], + "settings": { + "portal_enabled": true, + "portal_port": 8443, + "portal_host": "vpn.example.net", + "default_device_limit": 3, + "domain": "lan", + "hostnames": true, + "geo_enabled": true, + "home_dns_fallback": "" + }, + "geo": { + "enabled": true, + "provider": "ipwho.is", + "home": null, + "points": [] + }, + "events": [], + "services": [], + "circles": [], + "totals": { + "people": 3, + "devices": 6, + "online": 3, + "active": 0, + "today": [ + 2900000000.0, + 27000000000.0 + ], + "month": [ + 41000000000.0, + 400000000000.0 + ] + }, + "series": [ + { + "day": "2026-09-10", + "rx": 1200000000.0, + "tx": 11000000000.0 + }, + { + "day": "2026-09-11", + "rx": 2000000000.0, + "tx": 20000000000.0 + }, + { + "day": "2026-09-12", + "rx": 2800000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-13", + "rx": 1700000000.0, + "tx": 23000000000.0 + }, + { + "day": "2026-09-14", + "rx": 2400000000.0, + "tx": 26000000000.0 + }, + { + "day": "2026-09-15", + "rx": 2300000000.0, + "tx": 21000000000.0 + }, + { + "day": "2026-09-16", + "rx": 2100000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-17", + "rx": 2800000000.0, + "tx": 30000000000.0 + }, + { + "day": "2026-09-18", + "rx": 2800000000.0, + "tx": 30000000000.0 + }, + { + "day": "2026-09-19", + "rx": 3800000000.0, + "tx": 40000000000.0 + }, + { + "day": "2026-09-20", + "rx": 2500000000.0, + "tx": 25000000000.0 + }, + { + "day": "2026-09-21", + "rx": 2500000000.0, + "tx": 26000000000.0 + }, + { + "day": "2026-09-22", + "rx": 2600000000.0, + "tx": 28000000000.0 + }, + { + "day": "2026-09-23", + "rx": 3200000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-09-24", + "rx": 3100000000.0, + "tx": 30000000000.0 + }, + { + "day": "2026-09-25", + "rx": 3200000000.0, + "tx": 29000000000.0 + }, + { + "day": "2026-09-26", + "rx": 2400000000.0, + "tx": 23000000000.0 + }, + { + "day": "2026-09-27", + "rx": 3700000000.0, + "tx": 37000000000.0 + }, + { + "day": "2026-09-28", + "rx": 2700000000.0, + "tx": 30000000000.0 + }, + { + "day": "2026-09-29", + "rx": 3700000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-09-30", + "rx": 4600000000.0, + "tx": 44000000000.0 + }, + { + "day": "2026-10-01", + "rx": 3800000000.0, + "tx": 40000000000.0 + }, + { + "day": "2026-10-02", + "rx": 3500000000.0, + "tx": 35000000000.0 + }, + { + "day": "2026-10-03", + "rx": 5400000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-10-04", + "rx": 5000000000.0, + "tx": 46000000000.0 + }, + { + "day": "2026-10-05", + "rx": 3200000000.0, + "tx": 34000000000.0 + }, + { + "day": "2026-10-06", + "rx": 4600000000.0, + "tx": 45000000000.0 + }, + { + "day": "2026-10-07", + "rx": 4200000000.0, + "tx": 39000000000.0 + }, + { + "day": "2026-10-08", + "rx": 3400000000.0, + "tx": 32000000000.0 + }, + { + "day": "2026-10-09", + "rx": 3800000000.0, + "tx": 40000000000.0 + }, + { + "day": "2026-10-10", + "rx": 4900000000.0, + "tx": 49000000000.0 + }, + { + "day": "2026-10-11", + "rx": 6100000000.0, + "tx": 59000000000.0 + }, + { + "day": "2026-10-12", + "rx": 3500000000.0, + "tx": 38000000000.0 + }, + { + "day": "2026-10-13", + "rx": 4600000000.0, + "tx": 47000000000.0 + }, + { + "day": "2026-10-14", + "rx": 4600000000.0, + "tx": 45000000000.0 + }, + { + "day": "2026-10-15", + "rx": 3500000000.0, + "tx": 39000000000.0 + }, + { + "day": "2026-10-16", + "rx": 5800000000.0, + "tx": 61000000000.0 + }, + { + "day": "2026-10-17", + "rx": 5100000000.0, + "tx": 57000000000.0 + }, + { + "day": "2026-10-18", + "rx": 6000000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-10-19", + "rx": 3600000000.0, + "tx": 42000000000.0 + }, + { + "day": "2026-10-20", + "rx": 4800000000.0, + "tx": 48000000000.0 + }, + { + "day": "2026-10-21", + "rx": 4500000000.0, + "tx": 43000000000.0 + }, + { + "day": "2026-10-22", + "rx": 5300000000.0, + "tx": 51000000000.0 + }, + { + "day": "2026-10-23", + "rx": 5500000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-10-24", + "rx": 8000000000.0, + "tx": 83000000000.0 + }, + { + "day": "2026-10-25", + "rx": 6000000000.0, + "tx": 61000000000.0 + }, + { + "day": "2026-10-26", + "rx": 4500000000.0, + "tx": 46000000000.0 + }, + { + "day": "2026-10-27", + "rx": 5200000000.0, + "tx": 48000000000.0 + }, + { + "day": "2026-10-28", + "rx": 6400000000.0, + "tx": 60000000000.0 + }, + { + "day": "2026-10-29", + "rx": 5300000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-10-30", + "rx": 5000000000.0, + "tx": 49000000000.0 + }, + { + "day": "2026-10-31", + "rx": 5100000000.0, + "tx": 50000000000.0 + }, + { + "day": "2026-11-01", + "rx": 7300000000.0, + "tx": 73000000000.0 + }, + { + "day": "2026-11-02", + "rx": 5300000000.0, + "tx": 54000000000.0 + }, + { + "day": "2026-11-03", + "rx": 5200000000.0, + "tx": 49000000000.0 + }, + { + "day": "2026-11-04", + "rx": 4700000000.0, + "tx": 43000000000.0 + }, + { + "day": "2026-11-05", + "rx": 4800000000.0, + "tx": 50000000000.0 + }, + { + "day": "2026-11-06", + "rx": 3300000000.0, + "tx": 37000000000.0 + }, + { + "day": "2026-11-07", + "rx": 5000000000.0, + "tx": 53000000000.0 + }, + { + "day": "2026-11-08", + "rx": 2900000000.0, + "tx": 27000000000.0 + } + ], + "awg": { + "v2": true, + "v3": true + }, + "like_home": { + "active": false + }, + "awg_state": { + "ok": true, + "tools": true, + "loaded": true, + "missing": [], + "handler": true, + "kmod": true + }, + "wan": "91.203.14.7", + "hours": [ + [ + 64000000.0, + 610000000.0 + ], + [ + 120000000.0, + 1100000000.0 + ], + [ + 180000000.0, + 1700000000.0 + ], + [ + 140000000.0, + 1400000000.0 + ], + [ + 210000000.0, + 2000000000.0 + ], + [ + 180000000.0, + 1700000000.0 + ], + [ + 240000000.0, + 2300000000.0 + ], + [ + 300000000.0, + 2900000000.0 + ], + [ + 260000000.0, + 2500000000.0 + ], + [ + 310000000.0, + 2900000000.0 + ], + [ + 250000000.0, + 2400000000.0 + ], + [ + 290000000.0, + 2800000000.0 + ], + [ + 320000000.0, + 3000000000.0 + ] + ] +} \ No newline at end of file diff --git a/backend/bridge/testdata/topics.json b/backend/bridge/testdata/topics.json new file mode 100644 index 0000000..a38dcfe --- /dev/null +++ b/backend/bridge/testdata/topics.json @@ -0,0 +1,1882 @@ +{ + "circles": { + "items": {}, + "order": [] + }, + "clock": { + "now": 1800000000, + "tz": 180 + }, + "people": { + "items": { + "sample0": { + "access": "both", + "bonus_gb": 0, + "circle": "", + "code_set": 1800000000, + "created": 1800000000, + "device_limit": 4, + "devices": { + "items": { + "sample0d0": { + "active": true, + "address": "10.0.0.10", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": false, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample0d0", + "keepalive": { + "$null": true + }, + "keepalive_used": 0, + "kind": "phone", + "lan_bypass": true, + "link": { + "$null": true + }, + "month": [ + 1600000000, + 15000000000 + ], + "mtu": 0, + "mtu_used": 1280, + "name": "Device", + "online": true, + "setup": { + "$null": true + }, + "spark": [ + [ + 280000000, + 2500000000 + ], + [ + 270000000, + 2500000000 + ], + [ + 260000000, + 1900000000 + ], + [ + 77000000, + 1000000000 + ], + [ + 120000000, + 1100000000 + ], + [ + 170000000, + 1300000000 + ], + [ + 76000000, + 970000000 + ] + ], + "total": [ + 12000000000, + 120000000000 + ] + }, + "sample0d1": { + "active": false, + "address": "10.0.0.11", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": false, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample0d1", + "keepalive": { + "$null": true + }, + "keepalive_used": 0, + "kind": "computer", + "lan_bypass": true, + "link": { + "$null": true + }, + "month": [ + 2500000000, + 23000000000 + ], + "mtu": 0, + "mtu_used": 1380, + "name": "Device", + "online": false, + "setup": { + "$null": true + }, + "spark": [ + [ + 89000000, + 1400000000 + ], + [ + 310000000, + 3200000000 + ], + [ + 400000000, + 3200000000 + ], + [ + 460000000, + 3600000000 + ], + [ + 560000000, + 5200000000 + ], + [ + 0, + 0 + ], + [ + 360000000, + 2900000000 + ] + ], + "total": [ + 21000000000, + 220000000000 + ] + } + }, + "order": [ + "sample0d0", + "sample0d1" + ] + }, + "dns_mode": "device", + "expires": "", + "has_link": false, + "home_nets": [], + "id": "sample0", + "last_seen": 1800000000, + "month": [ + 4600000000, + 43000000000 + ], + "month_days": [ + [ + 880000000, + 8300000000 + ], + [ + 410000000, + 4300000000 + ], + [ + 640000000, + 6600000000 + ], + [ + 690000000, + 5400000000 + ], + [ + 590000000, + 5200000000 + ], + [ + 710000000, + 6700000000 + ], + [ + 210000000, + 1700000000 + ], + [ + 500000000, + 4400000000 + ] + ], + "name": "First person", + "note": "", + "online": 1, + "paused": false, + "quota_gb": 0, + "quota_limit": 0, + "quota_month": [ + 4600000000, + 43000000000 + ], + "quota_period": "month", + "quota_reset_day": "2026-11-20", + "quota_resets": 1800000000, + "quota_used": 47000000000, + "rate": [ + [ + 1800000000, + 341942, + 3800000 + ], + [ + 1800000000, + 37738, + 419311 + ], + [ + 1800000000, + 101093, + 1100000 + ], + [ + 1800000000, + 45619, + 506878 + ], + [ + 1800000000, + 102383, + 1100000 + ], + [ + 1800000000, + 60710, + 674558 + ], + [ + 1800000000, + 88785, + 986500 + ], + [ + 1800000000, + 49414, + 549044 + ], + [ + 1800000000, + 70331, + 781453 + ], + [ + 1800000000, + 48453, + 538372 + ], + [ + 1800000000, + 342452, + 3800000 + ], + [ + 1800000000, + 50077, + 556412 + ], + [ + 1800000000, + 64947, + 721636 + ], + [ + 1800000000, + 201883, + 2200000 + ], + [ + 1800000000, + 106357, + 1200000 + ] + ], + "server": "sample", + "services": [], + "state": "active", + "total": [ + 36000000000, + 350000000000 + ] + }, + "sample1": { + "access": "both", + "bonus_gb": 0, + "circle": "", + "code_set": 1800000000, + "created": 1800000000, + "device_limit": 3, + "devices": { + "items": { + "sample1d0": { + "active": false, + "address": "10.0.0.12", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": false, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample1d0", + "keepalive": { + "$null": true + }, + "keepalive_used": 0, + "kind": "computer", + "lan_bypass": true, + "link": { + "$null": true + }, + "month": [ + 1500000000, + 13000000000 + ], + "mtu": 0, + "mtu_used": 1380, + "name": "Device", + "online": false, + "setup": { + "$null": true + }, + "spark": [ + [ + 360000000, + 3200000000 + ], + [ + 260000000, + 2100000000 + ], + [ + 230000000, + 2700000000 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "total": [ + 10000000000, + 110000000000 + ] + }, + "sample1d1": { + "active": true, + "address": "10.0.0.13", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": false, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample1d1", + "keepalive": { + "$null": true + }, + "keepalive_used": 0, + "kind": "phone", + "lan_bypass": true, + "link": { + "$null": true + }, + "month": [ + 720000000, + 7400000000 + ], + "mtu": 0, + "mtu_used": 1280, + "name": "Device", + "online": true, + "setup": { + "$null": true + }, + "spark": [ + [ + 44000000, + 600000000 + ], + [ + 32000000, + 490000000 + ], + [ + 71000000, + 1200000000 + ], + [ + 88000000, + 1100000000 + ], + [ + 28000000, + 320000000 + ], + [ + 79000000, + 980000000 + ], + [ + 120000000, + 880000000 + ] + ], + "total": [ + 4000000000, + 39000000000 + ] + } + }, + "order": [ + "sample1d0", + "sample1d1" + ] + }, + "dns_mode": "device", + "expires": "", + "has_link": false, + "home_nets": [], + "id": "sample1", + "last_seen": 1800000000, + "month": [ + 2200000000, + 21000000000 + ], + "month_days": [ + [ + 890000000, + 7100000000 + ], + [ + 400000000, + 3800000000 + ], + [ + 290000000, + 2600000000 + ], + [ + 300000000, + 3800000000 + ], + [ + 88000000, + 1100000000 + ], + [ + 28000000, + 320000000 + ], + [ + 79000000, + 980000000 + ], + [ + 120000000, + 880000000 + ] + ], + "name": "Second one", + "note": "", + "online": 1, + "paused": false, + "quota_gb": 300, + "quota_limit": 320000000000, + "quota_month": [ + 2200000000, + 21000000000 + ], + "quota_period": "total", + "quota_reset_day": "", + "quota_resets": 0, + "quota_used": 160000000000, + "rate": [ + [ + 1800000000, + 132984, + 1500000 + ], + [ + 1800000000, + 134361, + 1500000 + ], + [ + 1800000000, + 136487, + 1500000 + ], + [ + 1800000000, + 134904, + 1500000 + ], + [ + 1800000000, + 115365, + 1300000 + ], + [ + 1800000000, + 113341, + 1300000 + ], + [ + 1800000000, + 86774, + 964159 + ], + [ + 1800000000, + 127959, + 1400000 + ], + [ + 1800000000, + 425615, + 4700000 + ], + [ + 1800000000, + 134439, + 1500000 + ], + [ + 1800000000, + 127749, + 1400000 + ], + [ + 1800000000, + 70012, + 777908 + ], + [ + 1800000000, + 50512, + 561242 + ], + [ + 1800000000, + 66701, + 741127 + ], + [ + 1800000000, + 48008, + 533424 + ] + ], + "server": "sample", + "services": [], + "state": "active", + "total": [ + 14000000000, + 150000000000 + ] + }, + "sample2": { + "access": "lan", + "bonus_gb": 0, + "circle": "", + "code_set": 1800000000, + "created": 1800000000, + "device_limit": 2, + "devices": { + "items": { + "sample2d0": { + "active": true, + "address": "10.0.0.14", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": false, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample2d0", + "keepalive": 25, + "keepalive_used": 25, + "kind": "router", + "lan_bypass": false, + "link": { + "$null": true + }, + "month": [ + 4500000000, + 46000000000 + ], + "mtu": 0, + "mtu_used": 1380, + "name": "Device", + "online": true, + "setup": { + "$null": true + }, + "spark": [ + [ + 1000000000, + 9400000000 + ], + [ + 790000000, + 7300000000 + ], + [ + 0, + 0 + ], + [ + 580000000, + 5300000000 + ], + [ + 520000000, + 6000000000 + ], + [ + 360000000, + 5000000000 + ], + [ + 360000000, + 3800000000 + ] + ], + "total": [ + 36000000000, + 380000000000 + ] + }, + "sample2d1": { + "active": false, + "address": "10.0.0.15", + "browser_key": false, + "config_issued": 1800000000, + "config_stale": false, + "created": 1800000000, + "created_by": "admin", + "disabled": true, + "endpoint": "192.0.2.1", + "handshake": 1800000000, + "hostname": "", + "id": "sample2d1", + "keepalive": { + "$null": true + }, + "keepalive_used": 0, + "kind": "other", + "lan_bypass": true, + "link": { + "$null": true + }, + "month": [ + 0, + 0 + ], + "mtu": 0, + "mtu_used": 1380, + "name": "Device", + "online": false, + "setup": { + "$null": true + }, + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "total": [ + 0, + 0 + ] + } + }, + "order": [ + "sample2d0", + "sample2d1" + ] + }, + "dns_mode": "device", + "expires": "", + "has_link": false, + "home_nets": [], + "id": "sample2", + "last_seen": 1800000000, + "month": [ + 4500000000, + 46000000000 + ], + "month_days": [ + [ + 900000000, + 9200000000 + ], + [ + 1000000000, + 9400000000 + ], + [ + 790000000, + 7300000000 + ], + [ + 0, + 0 + ], + [ + 580000000, + 5300000000 + ], + [ + 520000000, + 6000000000 + ], + [ + 360000000, + 5000000000 + ], + [ + 360000000, + 3800000000 + ] + ], + "name": "Third person", + "note": "", + "online": 1, + "paused": false, + "quota_gb": 0, + "quota_limit": 0, + "quota_month": [ + 4500000000, + 46000000000 + ], + "quota_period": "month", + "quota_reset_day": "2026-11-20", + "quota_resets": 1800000000, + "quota_used": 51000000000, + "rate": [ + [ + 1800000000, + 57644, + 640485 + ], + [ + 1800000000, + 70777, + 786407 + ], + [ + 1800000000, + 70595, + 784390 + ], + [ + 1800000000, + 54608, + 606752 + ], + [ + 1800000000, + 61016, + 677961 + ], + [ + 1800000000, + 39339, + 437100 + ], + [ + 1800000000, + 25723, + 285806 + ], + [ + 1800000000, + 45866, + 509624 + ], + [ + 1800000000, + 37693, + 418809 + ], + [ + 1800000000, + 53645, + 596061 + ], + [ + 1800000000, + 159863, + 1800000 + ], + [ + 1800000000, + 53430, + 593665 + ], + [ + 1800000000, + 64011, + 711233 + ], + [ + 1800000000, + 57272, + 636353 + ], + [ + 1800000000, + 67556, + 750626 + ] + ], + "server": "sample", + "services": [], + "state": "active", + "total": [ + 36000000000, + 380000000000 + ] + } + }, + "order": [ + "sample0", + "sample1", + "sample2" + ] + }, + "places": { + "enabled": true, + "home": { + "$null": true + }, + "points": [], + "provider": "ipwho.is" + }, + "recent": [], + "router": { + "awg": { + "v2": true, + "v3": true + }, + "awg_state": { + "handler": true, + "kmod": true, + "loaded": true, + "missing": [], + "ok": true, + "tools": true + }, + "hostname": "router", + "like_home": { + "active": false + }, + "settings": { + "default_device_limit": 3, + "domain": "lan", + "geo_enabled": true, + "home_dns_fallback": "", + "hostnames": true, + "portal_enabled": true, + "portal_host": "vpn.example.net", + "portal_port": 8443 + }, + "version": "0.18.0", + "wan": "91.203.14.7" + }, + "servers": { + "items": { + "sample": { + "address": "10.0.0.1", + "device_mesh": true, + "dns": [], + "enabled": true, + "endpoint": "vpn.example.net", + "home": [], + "hpk": false, + "id": "sample", + "ifname": "dawn0", + "keepalive": 0, + "lan_like": false, + "mesh": "circles", + "mtu": 0, + "mtus": { + "computer": 1380, + "phone": 1280 + }, + "name": "Server name", + "obf": {}, + "online": 10, + "peers": 40, + "port": 4500, + "preset": "balanced", + "public_key": "", + "rate": [ + [ + 1800000000, + 300000, + 2900000 + ], + [ + 1800000000, + 340000, + 3600000 + ] + ], + "series": { + "items": { + "2026-08-26": { + "day": "2026-08-26", + "rx": 39000000, + "tx": 360000000 + }, + "2026-08-27": { + "day": "2026-08-27", + "rx": 26000000, + "tx": 340000000 + }, + "2026-08-28": { + "day": "2026-08-28", + "rx": 66000000, + "tx": 630000000 + }, + "2026-08-29": { + "day": "2026-08-29", + "rx": 47000000, + "tx": 350000000 + }, + "2026-08-30": { + "day": "2026-08-30", + "rx": 160000000, + "tx": 1400000000 + }, + "2026-08-31": { + "day": "2026-08-31", + "rx": 73000000, + "tx": 570000000 + }, + "2026-09-01": { + "day": "2026-09-01", + "rx": 140000000, + "tx": 1700000000 + }, + "2026-09-02": { + "day": "2026-09-02", + "rx": 100000000, + "tx": 1500000000 + }, + "2026-09-03": { + "day": "2026-09-03", + "rx": 240000000, + "tx": 2300000000 + }, + "2026-09-04": { + "day": "2026-09-04", + "rx": 690000000, + "tx": 5900000000 + }, + "2026-09-05": { + "day": "2026-09-05", + "rx": 1900000000, + "tx": 16000000000 + }, + "2026-09-06": { + "day": "2026-09-06", + "rx": 1400000000, + "tx": 19000000000 + }, + "2026-09-07": { + "day": "2026-09-07", + "rx": 810000000, + "tx": 10000000000 + }, + "2026-09-08": { + "day": "2026-09-08", + "rx": 870000000, + "tx": 9900000000 + }, + "2026-09-09": { + "day": "2026-09-09", + "rx": 1300000000, + "tx": 16000000000 + }, + "2026-09-10": { + "day": "2026-09-10", + "rx": 1200000000, + "tx": 11000000000 + }, + "2026-09-11": { + "day": "2026-09-11", + "rx": 2000000000, + "tx": 20000000000 + }, + "2026-09-12": { + "day": "2026-09-12", + "rx": 2800000000, + "tx": 29000000000 + }, + "2026-09-13": { + "day": "2026-09-13", + "rx": 1700000000, + "tx": 23000000000 + }, + "2026-09-14": { + "day": "2026-09-14", + "rx": 2300000000, + "tx": 25000000000 + }, + "2026-09-15": { + "day": "2026-09-15", + "rx": 2200000000, + "tx": 21000000000 + }, + "2026-09-16": { + "day": "2026-09-16", + "rx": 2100000000, + "tx": 25000000000 + }, + "2026-09-17": { + "day": "2026-09-17", + "rx": 2800000000, + "tx": 29000000000 + }, + "2026-09-18": { + "day": "2026-09-18", + "rx": 2700000000, + "tx": 29000000000 + }, + "2026-09-19": { + "day": "2026-09-19", + "rx": 3800000000, + "tx": 38000000000 + }, + "2026-09-20": { + "day": "2026-09-20", + "rx": 2500000000, + "tx": 25000000000 + }, + "2026-09-21": { + "day": "2026-09-21", + "rx": 2400000000, + "tx": 25000000000 + }, + "2026-09-22": { + "day": "2026-09-22", + "rx": 2500000000, + "tx": 27000000000 + }, + "2026-09-23": { + "day": "2026-09-23", + "rx": 3100000000, + "tx": 32000000000 + }, + "2026-09-24": { + "day": "2026-09-24", + "rx": 3000000000, + "tx": 29000000000 + }, + "2026-09-25": { + "day": "2026-09-25", + "rx": 3100000000, + "tx": 28000000000 + }, + "2026-09-26": { + "day": "2026-09-26", + "rx": 2400000000, + "tx": 23000000000 + }, + "2026-09-27": { + "day": "2026-09-27", + "rx": 3600000000, + "tx": 37000000000 + }, + "2026-09-28": { + "day": "2026-09-28", + "rx": 2700000000, + "tx": 29000000000 + }, + "2026-09-29": { + "day": "2026-09-29", + "rx": 3600000000, + "tx": 32000000000 + }, + "2026-09-30": { + "day": "2026-09-30", + "rx": 4600000000, + "tx": 44000000000 + }, + "2026-10-01": { + "day": "2026-10-01", + "rx": 3700000000, + "tx": 40000000000 + }, + "2026-10-02": { + "day": "2026-10-02", + "rx": 3400000000, + "tx": 35000000000 + }, + "2026-10-03": { + "day": "2026-10-03", + "rx": 5300000000, + "tx": 53000000000 + }, + "2026-10-04": { + "day": "2026-10-04", + "rx": 5000000000, + "tx": 46000000000 + }, + "2026-10-05": { + "day": "2026-10-05", + "rx": 3200000000, + "tx": 33000000000 + }, + "2026-10-06": { + "day": "2026-10-06", + "rx": 4600000000, + "tx": 44000000000 + }, + "2026-10-07": { + "day": "2026-10-07", + "rx": 4200000000, + "tx": 39000000000 + }, + "2026-10-08": { + "day": "2026-10-08", + "rx": 3400000000, + "tx": 32000000000 + }, + "2026-10-09": { + "day": "2026-10-09", + "rx": 3700000000, + "tx": 39000000000 + }, + "2026-10-10": { + "day": "2026-10-10", + "rx": 4800000000, + "tx": 48000000000 + }, + "2026-10-11": { + "day": "2026-10-11", + "rx": 6100000000, + "tx": 58000000000 + }, + "2026-10-12": { + "day": "2026-10-12", + "rx": 3500000000, + "tx": 38000000000 + }, + "2026-10-13": { + "day": "2026-10-13", + "rx": 4500000000, + "tx": 46000000000 + }, + "2026-10-14": { + "day": "2026-10-14", + "rx": 4600000000, + "tx": 44000000000 + }, + "2026-10-15": { + "day": "2026-10-15", + "rx": 3500000000, + "tx": 38000000000 + }, + "2026-10-16": { + "day": "2026-10-16", + "rx": 5700000000, + "tx": 60000000000 + }, + "2026-10-17": { + "day": "2026-10-17", + "rx": 5000000000, + "tx": 56000000000 + }, + "2026-10-18": { + "day": "2026-10-18", + "rx": 5900000000, + "tx": 53000000000 + }, + "2026-10-19": { + "day": "2026-10-19", + "rx": 3600000000, + "tx": 42000000000 + }, + "2026-10-20": { + "day": "2026-10-20", + "rx": 4700000000, + "tx": 47000000000 + }, + "2026-10-21": { + "day": "2026-10-21", + "rx": 4400000000, + "tx": 42000000000 + }, + "2026-10-22": { + "day": "2026-10-22", + "rx": 5200000000, + "tx": 50000000000 + }, + "2026-10-23": { + "day": "2026-10-23", + "rx": 5300000000, + "tx": 53000000000 + }, + "2026-10-24": { + "day": "2026-10-24", + "rx": 7900000000, + "tx": 82000000000 + }, + "2026-10-25": { + "day": "2026-10-25", + "rx": 5900000000, + "tx": 60000000000 + }, + "2026-10-26": { + "day": "2026-10-26", + "rx": 4400000000, + "tx": 45000000000 + }, + "2026-10-27": { + "day": "2026-10-27", + "rx": 5100000000, + "tx": 47000000000 + }, + "2026-10-28": { + "day": "2026-10-28", + "rx": 6300000000, + "tx": 60000000000 + }, + "2026-10-29": { + "day": "2026-10-29", + "rx": 5300000000, + "tx": 54000000000 + }, + "2026-10-30": { + "day": "2026-10-30", + "rx": 4900000000, + "tx": 48000000000 + }, + "2026-10-31": { + "day": "2026-10-31", + "rx": 5100000000, + "tx": 50000000000 + }, + "2026-11-01": { + "day": "2026-11-01", + "rx": 7300000000, + "tx": 73000000000 + }, + "2026-11-02": { + "day": "2026-11-02", + "rx": 5200000000, + "tx": 53000000000 + }, + "2026-11-03": { + "day": "2026-11-03", + "rx": 5200000000, + "tx": 49000000000 + }, + "2026-11-04": { + "day": "2026-11-04", + "rx": 4700000000, + "tx": 43000000000 + }, + "2026-11-05": { + "day": "2026-11-05", + "rx": 4800000000, + "tx": 50000000000 + }, + "2026-11-06": { + "day": "2026-11-06", + "rx": 3300000000, + "tx": 37000000000 + }, + "2026-11-07": { + "day": "2026-11-07", + "rx": 5000000000, + "tx": 53000000000 + }, + "2026-11-08": { + "day": "2026-11-08", + "rx": 2900000000, + "tx": 27000000000 + } + }, + "order": [ + "2026-08-26", + "2026-08-27", + "2026-08-28", + "2026-08-29", + "2026-08-30", + "2026-08-31", + "2026-09-01", + "2026-09-02", + "2026-09-03", + "2026-09-04", + "2026-09-05", + "2026-09-06", + "2026-09-07", + "2026-09-08", + "2026-09-09", + "2026-09-10", + "2026-09-11", + "2026-09-12", + "2026-09-13", + "2026-09-14", + "2026-09-15", + "2026-09-16", + "2026-09-17", + "2026-09-18", + "2026-09-19", + "2026-09-20", + "2026-09-21", + "2026-09-22", + "2026-09-23", + "2026-09-24", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-09-28", + "2026-09-29", + "2026-09-30", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07", + "2026-10-08", + "2026-10-09", + "2026-10-10", + "2026-10-11", + "2026-10-12", + "2026-10-13", + "2026-10-14", + "2026-10-15", + "2026-10-16", + "2026-10-17", + "2026-10-18", + "2026-10-19", + "2026-10-20", + "2026-10-21", + "2026-10-22", + "2026-10-23", + "2026-10-24", + "2026-10-25", + "2026-10-26", + "2026-10-27", + "2026-10-28", + "2026-10-29", + "2026-10-30", + "2026-10-31", + "2026-11-01", + "2026-11-02", + "2026-11-03", + "2026-11-04", + "2026-11-05", + "2026-11-06", + "2026-11-07", + "2026-11-08" + ] + }, + "subnet": "10.0.0.0/24", + "up": true, + "uptime": 1400000 + } + }, + "order": [ + "sample" + ] + }, + "services": { + "items": {}, + "order": [] + }, + "traffic": { + "hours": [ + [ + 64000000, + 610000000 + ], + [ + 120000000, + 1100000000 + ], + [ + 180000000, + 1700000000 + ], + [ + 140000000, + 1400000000 + ], + [ + 210000000, + 2000000000 + ], + [ + 180000000, + 1700000000 + ], + [ + 240000000, + 2300000000 + ], + [ + 300000000, + 2900000000 + ], + [ + 260000000, + 2500000000 + ], + [ + 310000000, + 2900000000 + ], + [ + 250000000, + 2400000000 + ], + [ + 290000000, + 2800000000 + ], + [ + 320000000, + 3000000000 + ] + ], + "series": { + "items": { + "2026-09-10": { + "day": "2026-09-10", + "rx": 1200000000, + "tx": 11000000000 + }, + "2026-09-11": { + "day": "2026-09-11", + "rx": 2000000000, + "tx": 20000000000 + }, + "2026-09-12": { + "day": "2026-09-12", + "rx": 2800000000, + "tx": 29000000000 + }, + "2026-09-13": { + "day": "2026-09-13", + "rx": 1700000000, + "tx": 23000000000 + }, + "2026-09-14": { + "day": "2026-09-14", + "rx": 2400000000, + "tx": 26000000000 + }, + "2026-09-15": { + "day": "2026-09-15", + "rx": 2300000000, + "tx": 21000000000 + }, + "2026-09-16": { + "day": "2026-09-16", + "rx": 2100000000, + "tx": 25000000000 + }, + "2026-09-17": { + "day": "2026-09-17", + "rx": 2800000000, + "tx": 30000000000 + }, + "2026-09-18": { + "day": "2026-09-18", + "rx": 2800000000, + "tx": 30000000000 + }, + "2026-09-19": { + "day": "2026-09-19", + "rx": 3800000000, + "tx": 40000000000 + }, + "2026-09-20": { + "day": "2026-09-20", + "rx": 2500000000, + "tx": 25000000000 + }, + "2026-09-21": { + "day": "2026-09-21", + "rx": 2500000000, + "tx": 26000000000 + }, + "2026-09-22": { + "day": "2026-09-22", + "rx": 2600000000, + "tx": 28000000000 + }, + "2026-09-23": { + "day": "2026-09-23", + "rx": 3200000000, + "tx": 32000000000 + }, + "2026-09-24": { + "day": "2026-09-24", + "rx": 3100000000, + "tx": 30000000000 + }, + "2026-09-25": { + "day": "2026-09-25", + "rx": 3200000000, + "tx": 29000000000 + }, + "2026-09-26": { + "day": "2026-09-26", + "rx": 2400000000, + "tx": 23000000000 + }, + "2026-09-27": { + "day": "2026-09-27", + "rx": 3700000000, + "tx": 37000000000 + }, + "2026-09-28": { + "day": "2026-09-28", + "rx": 2700000000, + "tx": 30000000000 + }, + "2026-09-29": { + "day": "2026-09-29", + "rx": 3700000000, + "tx": 32000000000 + }, + "2026-09-30": { + "day": "2026-09-30", + "rx": 4600000000, + "tx": 44000000000 + }, + "2026-10-01": { + "day": "2026-10-01", + "rx": 3800000000, + "tx": 40000000000 + }, + "2026-10-02": { + "day": "2026-10-02", + "rx": 3500000000, + "tx": 35000000000 + }, + "2026-10-03": { + "day": "2026-10-03", + "rx": 5400000000, + "tx": 54000000000 + }, + "2026-10-04": { + "day": "2026-10-04", + "rx": 5000000000, + "tx": 46000000000 + }, + "2026-10-05": { + "day": "2026-10-05", + "rx": 3200000000, + "tx": 34000000000 + }, + "2026-10-06": { + "day": "2026-10-06", + "rx": 4600000000, + "tx": 45000000000 + }, + "2026-10-07": { + "day": "2026-10-07", + "rx": 4200000000, + "tx": 39000000000 + }, + "2026-10-08": { + "day": "2026-10-08", + "rx": 3400000000, + "tx": 32000000000 + }, + "2026-10-09": { + "day": "2026-10-09", + "rx": 3800000000, + "tx": 40000000000 + }, + "2026-10-10": { + "day": "2026-10-10", + "rx": 4900000000, + "tx": 49000000000 + }, + "2026-10-11": { + "day": "2026-10-11", + "rx": 6100000000, + "tx": 59000000000 + }, + "2026-10-12": { + "day": "2026-10-12", + "rx": 3500000000, + "tx": 38000000000 + }, + "2026-10-13": { + "day": "2026-10-13", + "rx": 4600000000, + "tx": 47000000000 + }, + "2026-10-14": { + "day": "2026-10-14", + "rx": 4600000000, + "tx": 45000000000 + }, + "2026-10-15": { + "day": "2026-10-15", + "rx": 3500000000, + "tx": 39000000000 + }, + "2026-10-16": { + "day": "2026-10-16", + "rx": 5800000000, + "tx": 61000000000 + }, + "2026-10-17": { + "day": "2026-10-17", + "rx": 5100000000, + "tx": 57000000000 + }, + "2026-10-18": { + "day": "2026-10-18", + "rx": 6000000000, + "tx": 54000000000 + }, + "2026-10-19": { + "day": "2026-10-19", + "rx": 3600000000, + "tx": 42000000000 + }, + "2026-10-20": { + "day": "2026-10-20", + "rx": 4800000000, + "tx": 48000000000 + }, + "2026-10-21": { + "day": "2026-10-21", + "rx": 4500000000, + "tx": 43000000000 + }, + "2026-10-22": { + "day": "2026-10-22", + "rx": 5300000000, + "tx": 51000000000 + }, + "2026-10-23": { + "day": "2026-10-23", + "rx": 5500000000, + "tx": 54000000000 + }, + "2026-10-24": { + "day": "2026-10-24", + "rx": 8000000000, + "tx": 83000000000 + }, + "2026-10-25": { + "day": "2026-10-25", + "rx": 6000000000, + "tx": 61000000000 + }, + "2026-10-26": { + "day": "2026-10-26", + "rx": 4500000000, + "tx": 46000000000 + }, + "2026-10-27": { + "day": "2026-10-27", + "rx": 5200000000, + "tx": 48000000000 + }, + "2026-10-28": { + "day": "2026-10-28", + "rx": 6400000000, + "tx": 60000000000 + }, + "2026-10-29": { + "day": "2026-10-29", + "rx": 5300000000, + "tx": 54000000000 + }, + "2026-10-30": { + "day": "2026-10-30", + "rx": 5000000000, + "tx": 49000000000 + }, + "2026-10-31": { + "day": "2026-10-31", + "rx": 5100000000, + "tx": 50000000000 + }, + "2026-11-01": { + "day": "2026-11-01", + "rx": 7300000000, + "tx": 73000000000 + }, + "2026-11-02": { + "day": "2026-11-02", + "rx": 5300000000, + "tx": 54000000000 + }, + "2026-11-03": { + "day": "2026-11-03", + "rx": 5200000000, + "tx": 49000000000 + }, + "2026-11-04": { + "day": "2026-11-04", + "rx": 4700000000, + "tx": 43000000000 + }, + "2026-11-05": { + "day": "2026-11-05", + "rx": 4800000000, + "tx": 50000000000 + }, + "2026-11-06": { + "day": "2026-11-06", + "rx": 3300000000, + "tx": 37000000000 + }, + "2026-11-07": { + "day": "2026-11-07", + "rx": 5000000000, + "tx": 53000000000 + }, + "2026-11-08": { + "day": "2026-11-08", + "rx": 2900000000, + "tx": 27000000000 + } + }, + "order": [ + "2026-09-10", + "2026-09-11", + "2026-09-12", + "2026-09-13", + "2026-09-14", + "2026-09-15", + "2026-09-16", + "2026-09-17", + "2026-09-18", + "2026-09-19", + "2026-09-20", + "2026-09-21", + "2026-09-22", + "2026-09-23", + "2026-09-24", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-09-28", + "2026-09-29", + "2026-09-30", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07", + "2026-10-08", + "2026-10-09", + "2026-10-10", + "2026-10-11", + "2026-10-12", + "2026-10-13", + "2026-10-14", + "2026-10-15", + "2026-10-16", + "2026-10-17", + "2026-10-18", + "2026-10-19", + "2026-10-20", + "2026-10-21", + "2026-10-22", + "2026-10-23", + "2026-10-24", + "2026-10-25", + "2026-10-26", + "2026-10-27", + "2026-10-28", + "2026-10-29", + "2026-10-30", + "2026-10-31", + "2026-11-01", + "2026-11-02", + "2026-11-03", + "2026-11-04", + "2026-11-05", + "2026-11-06", + "2026-11-07", + "2026-11-08" + ] + }, + "totals": { + "active": 0, + "devices": 6, + "month": [ + 41000000000, + 400000000000 + ], + "online": 3, + "people": 3, + "today": [ + 2900000000, + 27000000000 + ] + } + } +} diff --git a/backend/bridge/topics.go b/backend/bridge/topics.go new file mode 100644 index 0000000..6bb0b31 --- /dev/null +++ b/backend/bridge/topics.go @@ -0,0 +1,142 @@ +// The ucode backend's `status` answer cut into the topics pages follow. +// +// `status` is one large document that every admin page used to fetch whole. +// As topics, a change in one place (a device came online) is a patch of a few +// bytes to one of them, and a page follows only those it shows. Lists of +// things that have an id (people, devices, servers) become keyed lists, so a +// change to one entry does not resend the list. +// +// Pure: a document in, documents out. bridge.go fetches and publishes. +package bridge + +// A keyed list is how a list of things with ids is published: +// +// { "order": ["p1", "p2"], "items": { "p1": {…}, "p2": {…} } } +// +// A merge patch replaces an array whole, but reaches into an object: with +// the entries under their ids, one that changed is all that is sent, and +// `order` only when something came, went or moved. A daily series (traffic +// by the day) is keyed by its `day` the same way: every minute moves today's +// entry, and on the router that alone was most of what a refresh resent. +func keyed(list []any) (map[string]any, bool) { + for _, key := range []string{"id", "day"} { + if k, ok := keyedBy(list, key); ok { + return k, true + } + } + return nil, false +} + +// keyedBy keys a list by one field, when every entry has it, as a string of +// its own. +func keyedBy(list []any, key string) (map[string]any, bool) { + order := make([]any, 0, len(list)) + items := make(map[string]any, len(list)) + for _, e := range list { + m, ok := e.(map[string]any) + if !ok { + return nil, false + } + id, ok := m[key].(string) + if !ok || id == "" { + return nil, false + } + if _, twice := items[id]; twice { + return nil, false + } + order = append(order, id) + items[id] = m + } + return map[string]any{"order": order, "items": items}, true +} + +// Null stands for a null of the ucode answer: a topic holds none (a merge patch reads null as "remove this"), +// and the pages' code tells "no link trouble" (null) from "not told" (absent). A field that was null is +// published as { "$null": true } and read back as null (web/src/admin/state/join.ts). Only this bridge +// needs it: a producer written for the stream leaves out what it has nothing to say about. +const Null = "$null" + +// rekey turns every list of things with ids (or days) inside v into a keyed +// list, at any depth (a person's devices inside the list of people). A list of +// anything else stays a list. An empty list stays one too: it cannot be told +// what it would hold. +func rekey(v any) any { + switch x := v.(type) { + case nil: + return map[string]any{Null: true} + case map[string]any: + for k, e := range x { + x[k] = rekey(e) + } + case []any: + for i, e := range x { + x[i] = rekey(e) + } + if len(x) > 0 { + if k, ok := keyed(x); ok { + return k + } + } + } + return v +} + +// Where each field of `status` goes. A field not named here goes to "router", +// so one a later version adds is still published. +var topicOf = map[string]string{ + "servers": "servers", + "people": "people", + "circles": "circles", + "services": "services", + "totals": "traffic", + "series": "traffic", + "hours": "traffic", + "geo": "places", + "events": "recent", + "now": "clock", + "tz": "clock", +} + +// Topics lists the topics Split fills, for hello and the tests. +var Topics = []string{"router", "servers", "people", "circles", "services", "traffic", "places", "recent", "clock"} + +// whole names the topics that are one field of `status` as it is; the others +// are objects of several fields. +var whole = map[string]bool{"servers": true, "people": true, "circles": true, "services": true, "places": true, "recent": true} + +// lists names the topics that are a keyed list even while empty, so a page +// reads one shape whether or not there is anyone yet. +var lists = map[string]bool{"servers": true, "people": true, "circles": true, "services": true} + +// Split cuts a `status` answer into topics. The answer is taken apart, not +// copied: the caller gives it up. +func Split(status map[string]any) map[string]any { + out := map[string]any{} + for _, t := range Topics { + if !whole[t] { + out[t] = map[string]any{} + } + } + for field, v := range status { + topic, ok := topicOf[field] + if !ok { + topic = "router" + } + if whole[topic] { + // The recent events have no ids and come as a window that moves: + // they stay a list. + if topic != "recent" { + v = rekey(v) + } + if list, isList := v.([]any); isList && lists[topic] { + if k, ok := keyed(list); ok { + v = k + } + } + out[topic] = v + continue + } + out[topic].(map[string]any)[field] = rekey(v) + } + return out +} diff --git a/backend/bridge/topics_test.go b/backend/bridge/topics_test.go new file mode 100644 index 0000000..2da1adc --- /dev/null +++ b/backend/bridge/topics_test.go @@ -0,0 +1,89 @@ +package bridge + +import ( + "encoding/json" + "os" + "reflect" + "testing" +) + +func doc(s string) map[string]any { + var v map[string]any + if err := json.Unmarshal([]byte(s), &v); err != nil { + panic(err) + } + return v +} + +// Lists of things with ids become keyed lists, at any depth; the rest stays. +func TestSplit(t *testing.T) { + got := Split(doc(`{ + "version": "0.18.0", "now": 1700000000, "tz": "MSK-3", "hostname": "Outline", + "servers": [{"id": "s1", "name": "Home", "series": [1, 2]}], + "people": [ + {"id": "p1", "name": "Myata", "devices": [{"id": "d1", "online": true}, {"id": "d2", "online": false}]}, + {"id": "p2", "name": "Guest", "devices": []} + ], + "circles": [], "services": [], + "totals": {"rx": 1}, "series": [{"day": "2026-11-11", "rx": 1, "tx": 2}], + "geo": {"enabled": true, "home": null, "points": [{"ip": "203.0.113.7"}]}, + "events": [{"ts": 1, "type": "connect"}] + }`)) + want := doc(`{ + "router": {"version": "0.18.0", "hostname": "Outline"}, + "clock": {"now": 1700000000, "tz": "MSK-3"}, + "servers": {"order": ["s1"], "items": {"s1": {"id": "s1", "name": "Home", "series": [1, 2]}}}, + "people": {"order": ["p1", "p2"], "items": { + "p1": {"id": "p1", "name": "Myata", "devices": {"order": ["d1", "d2"], "items": {"d1": {"id": "d1", "online": true}, "d2": {"id": "d2", "online": false}}}}, + "p2": {"id": "p2", "name": "Guest", "devices": []} + }}, + "circles": {"order": [], "items": {}}, "services": {"order": [], "items": {}}, + "traffic": {"totals": {"rx": 1}, "series": {"order": ["2026-11-11"], "items": {"2026-11-11": {"day": "2026-11-11", "rx": 1, "tx": 2}}}}, + "places": {"enabled": true, "home": {"$null": true}, "points": [{"ip": "203.0.113.7"}]}, + "recent": [{"ts": 1, "type": "connect"}] + }`) + if !reflect.DeepEqual(got, map[string]any(want)) { + g, _ := json.MarshalIndent(got, "", " ") + t.Fatalf("got %s", g) + } +} + +// Two entries with one id, or one without: the list is left as it came. +func TestKeyedRefuses(t *testing.T) { + for _, s := range []string{`{"l":[{"id":"a"},{"id":"a"}]}`, `{"l":[{"id":"a"},{"name":"b"}]}`, `{"l":[{"id":1}]}`, `{"l":[1,2]}`} { + in := doc(s) + if _, isList := rekey(in).(map[string]any)["l"].([]any); !isList { + t.Fatalf("%s was keyed", s) + } + } +} + +// The fixture the page's side reads too (web/tests/stream.test.ts joins testdata/topics.json back into +// testdata/status.json): what Split makes of a whole status answer. Run with UPDATE=1 to write it anew +// after Split changed, and look at the difference. +func TestSplitFixture(t *testing.T) { + raw, err := os.ReadFile("testdata/status.json") + if err != nil { + t.Fatal(err) + } + var status map[string]any + if err := json.Unmarshal(raw, &status); err != nil { + t.Fatal(err) + } + got, err := json.MarshalIndent(Split(status), "", " ") + if err != nil { + t.Fatal(err) + } + if os.Getenv("UPDATE") != "" { + if err := os.WriteFile("testdata/topics.json", append(got, '\n'), 0o644); err != nil { + t.Fatal(err) + } + } + want, err := os.ReadFile("testdata/topics.json") + if err != nil { + t.Fatal(err) + } + if string(got)+"\n" != string(want) { + t.Fatal("Split no longer makes testdata/topics.json of testdata/status.json: UPDATE=1 writes it anew, and web/src/admin/state/join.ts must still join it back") + } +} diff --git a/backend/chores/chores.go b/backend/chores/chores.go new file mode 100644 index 0000000..a683dbc --- /dev/null +++ b/backend/chores/chores.go @@ -0,0 +1,375 @@ +// Package chores is what Dawnline does on its own once a minute besides keeping the router to the +// settings (the ucode agent's steps "People", "Personal portal", "Router", "Backup" and "updates"): +// people's states that change on their own go to the activity log, an end date is announced when its last +// days begin, a renewed or expiring certificate and a changed public address are told in the service log, +// the settings are backed up at night, and an automatic update is started when one is due. +package chores + +import ( + "crypto/md5" + "crypto/x509" + "encoding/hex" + "encoding/pem" + "fmt" + "os" + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// ExpireWarn is how many days before an end date it is announced. +const ExpireWarn = 3 + +// Chores does one router's. What it remembers between ticks starts as "nothing seen yet". +type Chores struct { + RunDir, DataDir, Config string + Log *servicelog.Log + // PortalCert is the certificate the portal uses and whether it is Dawnline's own self-signed one. + PortalCert func(s model.Settings) (path string, selfSigned bool) + // WanAddress is the router's public IPv4 as a server sees it ("": none). + WanAddress func(srv *model.Server) string + // Backup saves the settings (a kind of backup: "auto"); Reload has the service read its settings again. + Backup func(kind string) (string, error) + Reload func() + // Updating tells whether an update job runs; Update starts the updater on its own. + Updating func() bool + Update func() + // FlushPlaces puts the places' cache on flash (nil: there is none to keep). + FlushPlaces func() + // Now is the moment (nil: the clock). + Now func() time.Time + + states map[string]string + certTime int64 + certSeen bool + certCheck int64 + backupDay int + notes map[string]any + + rateAt int64 + rateServers map[string]usage.Pair + ratePeople map[string]usage.Pair + flushed, logFlushed int64 + failed map[string]string +} + +func (c *Chores) now() time.Time { + if c.Now != nil { + return c.Now() + } + return time.Now() +} + +func (c *Chores) slog(src, level, msg, detail, who string) { + if c.Log != nil { + c.Log.Write(src, level, msg, detail, who, servicelog.Extra{}) + } +} + +// What the service log was already told. On flash: the public address often changes with a reboot +// (PPPoE), and that is when it matters. Written rarely. +func (c *Chores) note(k string, v any) { + c.notes[k] = v + os.MkdirAll(c.DataDir, 0o700) + files.WriteJSON(c.DataDir+"/notes.json", c.notes, 0o600) +} + +var stateReason = map[string]string{"paused": "paused by admin", "expired": "end date reached", "quota": "data limit reached", + "no_server": "no server", "server_off": "server turned off", "active": "active"} + +// StateEvent is the event for a person's state moving on its own from prev to st, or nil. The admin's own +// pauses and a server turned off or on are logged when they happen, so nothing here; nothing either +// without a state before. The data limit has its own events; everything else is paused or resumed with +// the reason. +func StateEvent(person, prev, st string) journal.Event { + byAdmin := func(x string) bool { return x == "paused" || x == "server_off" } + if prev == "" || prev == st || byAdmin(prev) || byAdmin(st) { + return nil + } + if st == "quota" { + return journal.Event{"type": "quota_reached", "person": person} + } + if prev == "quota" && st == "active" { + return journal.Event{"type": "quota_restored", "person": person} + } + kind := "paused" + if st == "active" { + kind = "resumed" + } + reason := stateReason[st] + if reason == "" { + reason = st + } + return journal.Event{"type": kind, "person": person, "detail": reason} +} + +// people is the states that changed on their own, and the end dates whose last days begin (once an end +// date; not on a clock that is not set). +func (c *Chores) people(m *model.Model, u *usage.Usage) []journal.Event { + now := c.now() + ts := now.Unix() + var events []journal.Event + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = state.Of(m, m.People[id], u, ts) + if e := StateEvent(id, c.states[id], states[id]); e != nil && c.states != nil { + events = append(events, e) + } + } + c.states = states + if now.In(zone.Local()).Year() < 2025 { + return events + } + for _, id := range m.PersonIDs() { + p := m.People[id] + end, ok := state.DateEnd(p.Expires) + if p.Expires == "" || !ok || end <= ts { + continue + } + left := (end-ts)/86400 + 1 + if left <= ExpireWarn && c.notes["warned:"+id] != p.Expires { + c.note("warned:"+id, p.Expires) + days := "days" + if left == 1 { + days = "day" + } + events = append(events, journal.Event{"type": "expiring", "person": id, "detail": fmt.Sprintf("%d %s", left, days)}) + } + } + return events +} + +// certEnd is when a certificate ends ("Jan 1 2027", and the moment), from its file. +func certEnd(path string) (string, time.Time, bool) { + raw, err := os.ReadFile(path) + if err != nil { + return "", time.Time{}, false + } + block, _ := pem.Decode(raw) + if block == nil { + return "", time.Time{}, false + } + cert, err := x509.ParseCertificate(block.Bytes) + if err != nil { + return "", time.Time{}, false + } + end := cert.NotAfter.UTC() + return fmt.Sprintf("%s %d %d", end.Format("Jan"), end.Day(), end.Year()), end, true +} + +// cert tells a renewed certificate (and has the service take it), and one that runs out within a week +// (ACME did not renew it): once a certificate, looked at hourly. +func (c *Chores) cert(m *model.Model) { + if !m.Settings.PortalEnabled || c.PortalCert == nil { + return + } + path, self := c.PortalCert(m.Settings) + st, err := os.Stat(path) + var mt int64 + if err == nil { + mt = st.ModTime().Unix() + } + if c.certSeen && c.certTime != 0 && mt != 0 && mt != c.certTime { + until := "?" + if s, _, ok := certEnd(path); ok { + until = s + } + c.slog("portal", "up", "certificate renewed · valid until "+until, "", "Personal portal") + if c.Reload != nil { + c.Reload() + } + } + c.certTime, c.certSeen = mt, true + now := c.now().Unix() + if mt == 0 || self || now-c.certCheck < 3600 { + return + } + c.certCheck = now + warned, _ := c.notes["cert_warned"].(float64) + s, end, ok := certEnd(path) + if int64(warned) != mt && (!ok || end.Unix()-now < 604800) { + msg := "certificate expires within 7 days" + if ok { + msg = "certificate expires " + s + } + c.slog("portal", "error", msg, "Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings.", "Personal portal") + c.note("cert_warned", float64(mt)) + } +} + +// wan tells that the router's public IPv4 changed. Devices whose configuration holds the address itself +// (a server's public address is an IP) cannot connect until they get a new one; with a hostname only the +// DNS record must follow. +func (c *Chores) wan(m *model.Model) { + if c.WanAddress == nil { + return + } + ip := "" + for _, id := range m.ServerIDs() { + if srv := m.Servers[id]; srv.Enabled && srv.PrivateKey != "" { + ip = c.WanAddress(srv) + break + } + } + was, _ := c.notes["wan"].(string) + if ip == "" || ip == was { + return + } + c.note("wan", ip) + if was == "" { + return + } + var stuck []string + for _, id := range m.ServerIDs() { + if srv := m.Servers[id]; m.EndpointHost(srv) == was { + stuck = append(stuck, srv.Name) + } + } + msg := fmt.Sprintf("public address changed · %s → %s", was, ip) + switch len(stuck) { + case 0: + c.slog("dawnline", "info", msg, "", "Router") + case 1: + c.slog("dawnline", "error", msg, stuck[0]+" still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.", "Router") + default: + c.slog("dawnline", "error", msg, strings.Join(stuck, ", ")+" still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.", "Router") + } +} + +// backup saves the settings in the night's third hour, once a day, when they changed since the last one. +func (c *Chores) backup() { + t := c.now().In(zone.Local()) + if t.Hour() != 3 || c.backupDay == t.Day() || c.Backup == nil { + return + } + c.backupDay = t.Day() + raw, err := os.ReadFile(c.Config) + if err != nil { + return + } + sum := md5.Sum(raw) + now := hex.EncodeToString(sum[:]) + var st struct { + Auto string `json:"auto"` + } + files.ReadJSON(c.DataDir+"/backup-state.json", &st) + if now == st.Auto { + return + } + name, err := c.Backup("auto") + if err != nil { + // tried again tomorrow; meanwhile the admin should know (a full flash, mostly) + c.slog("dawnline", "error", "nightly backup failed: "+err.Error(), "", "Backup") + return + } + files.WriteJSON(c.DataDir+"/backup-state.json", map[string]any{"auto": now}, 0o600) + if c.Log != nil { + if name != "" { + name = ": " + name + } + c.Log.Say("info", "backup", "nightly backup saved"+name) + } +} + +var intervals = map[string]int64{"6h": 6 * 3600, "12h": 12 * 3600, "1d": 86400, "7d": 7 * 86400} +var clock = regexp.MustCompile(`^([0-9]{1,2}):([0-9]{2})$`) + +// slot is the scheduled slot now is in (up to an hour after the set time, also across midnight). +func slot(pol model.Updates, now time.Time) (time.Time, bool) { + hm := clock.FindStringSubmatch(pol.Time) + if hm == nil { + return time.Time{}, false + } + h, _ := strconv.Atoi(hm[1]) + mi, _ := strconv.Atoi(hm[2]) + for _, day := range []time.Time{now, now.Add(-24 * time.Hour)} { + d := day.In(zone.Local()) + // as ucode's: the day's midnight by the clock's own reading, then the set time + at := time.Unix(day.Unix()-int64(d.Hour()*3600+d.Minute()*60+d.Second())+int64(h*3600+mi*60), 0) + if !now.Before(at) && now.Sub(at) < time.Hour { + return at, true + } + } + return time.Time{}, false +} + +// Due is what an automatic run should do now (dawnline.updates due): "install" (the scheduled window, at +// most an hour after the set time, once a slot), "check" (the interval has passed), or "". +func Due(pol model.Updates, installDay string, lastCheck int64, now time.Time) string { + if pol.Auto && pol.Mode == "scheduled" && len(pol.Targets) > 0 { + if at, in := slot(pol, now); in && installDay != at.In(zone.Local()).Format("2006-01-02") { + return "install" + } + } + every := intervals[pol.Interval] + if every == 0 { + every = 86400 + } + if pol.Check && now.Unix()-lastCheck >= every { + return "check" + } + return "" +} + +// updates starts an automatic check or update when one is due. The updater does the work in its own +// process; this only decides when. +func (c *Chores) updates(m *model.Model) { + if c.Update == nil { + return + } + var st struct { + InstallDay string `json:"install_day"` + Check float64 `json:"check"` + } + files.ReadJSON(c.DataDir+"/update-auto.json", &st) + if Due(m.Settings.Updates, st.InstallDay, int64(st.Check), c.now()) != "" && !(c.Updating != nil && c.Updating()) { + c.Update() + } +} + +func (c *Chores) step(who string, quiet bool, fn func()) { + defer func() { + e := recover() + if e == nil { + delete(c.failed, who) + return + } + msg := fmt.Sprint(e) + // a new failure in the service log, a repeat or a quiet step's in syslog alone + if !quiet && c.failed[who] != msg { + c.slog("dawnline", "error", "failed: "+msg, "", who) + } else if c.Log != nil { + c.Log.Say("error", "chores", who+": "+msg) + } + c.failed[who] = msg + }() + fn() +} + +// Tick is one minute's chores: the events for the activity log (the caller writes them and tells the +// pages), and everything else done. Each step on its own: a failing one is logged and the others still run. +func (c *Chores) Tick(m *model.Model, u *usage.Usage) []journal.Event { + if c.notes == nil { + c.notes = map[string]any{} + files.ReadJSON(c.DataDir+"/notes.json", &c.notes) + c.failed = map[string]string{} + } + var events []journal.Event + c.step("Speed", true, func() { c.rate(m, u) }) + c.step("People", false, func() { events = c.people(m, u) }) + c.step("Personal portal", false, func() { c.cert(m) }) + c.step("Router", true, func() { c.wan(m) }) + c.step("Backup", false, c.backup) + c.step("updates", true, func() { c.updates(m) }) + c.step("Logs", true, func() { c.keepLogs(m) }) + return events +} diff --git a/backend/chores/chores_test.go b/backend/chores/chores_test.go new file mode 100644 index 0000000..3b856b5 --- /dev/null +++ b/backend/chores/chores_test.go @@ -0,0 +1,216 @@ +package chores + +import ( + "encoding/json" + "errors" + "os" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +func TestStateEvent(t *testing.T) { + for _, c := range []struct{ prev, st, kind, detail string }{ + {"", "expired", "", ""}, {"active", "active", "", ""}, {"active", "paused", "", ""}, {"paused", "active", "", ""}, {"server_off", "active", "", ""}, + {"active", "quota", "quota_reached", ""}, {"quota", "active", "quota_restored", ""}, {"quota", "expired", "paused", "end date reached"}, + {"active", "odd", "paused", "odd"}, + } { + e := StateEvent("p", c.prev, c.st) + kind, _ := e["type"].(string) + detail, _ := e["detail"].(string) + if kind != c.kind || detail != c.detail { + t.Errorf("%s → %s: %v", c.prev, c.st, e) + } + } +} + +// The schedule of automatic updates: the hour after the set time, once a slot, also across midnight; a +// check when its interval passed. +func TestDue(t *testing.T) { + loc := zone.Local() + at := func(s string) time.Time { + x, err := time.ParseInLocation("2006-01-02 15:04", s, loc) + if err != nil { + t.Fatal(err) + } + return x + } + pol := model.Updates{Check: true, Interval: "1d", Auto: true, Mode: "scheduled", Time: "23:30", Targets: []string{"app"}} + fresh := at("2026-11-12 23:00").Unix() + for _, c := range []struct { + now, day string + check int64 + want string + }{ + {"2026-11-12 23:29", "", fresh, ""}, {"2026-11-12 23:30", "", fresh, "install"}, {"2026-11-13 00:29", "", fresh, "install"}, + {"2026-11-13 00:30", "", fresh, ""}, {"2026-11-13 00:10", "2026-11-12", fresh, ""}, {"2026-11-13 23:40", "2026-11-12", at("2026-11-13 23:00").Unix(), "install"}, + {"2026-11-12 12:00", "", at("2026-11-11 12:00").Unix(), "check"}, {"2026-11-12 12:00", "", at("2026-11-11 12:01").Unix(), ""}, + } { + if got := Due(pol, c.day, c.check, at(c.now)); got != c.want { + t.Errorf("at %s (installed %q): %q, not %q", c.now, c.day, got, c.want) + } + } + off := pol + off.Auto, off.Check = false, false + if Due(off, "", 0, at("2026-11-12 23:40")) != "" { + t.Error("due with everything off") + } + now := pol + now.Mode = "immediate" + if Due(now, "", fresh, at("2026-11-12 23:40")) != "" { + t.Error("a scheduled install without a schedule") + } +} + +func TestTick(t *testing.T) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + os.WriteFile(dir+"/dawnline", text, 0o600) + os.WriteFile(dir+"/cert", []byte("not a certificate"), 0o644) + clock := time.Date(2026, 11, 12, 2, 59, 0, 0, zone.Local()) + wan := "203.0.113.7" + var said []string + backups, reloads, updates := 0, 0, 0 + failing := false + ch := &Chores{RunDir: dir + "/run", DataDir: dir + "/data", Config: dir + "/dawnline", Now: func() time.Time { return clock }, + Log: &servicelog.Log{RunDir: dir + "/run", Level: func() string { return "info" }, Syslog: func(_, line string) { said = append(said, line) }}, + PortalCert: func(model.Settings) (string, bool) { return dir + "/cert", false }, + WanAddress: func(*model.Server) string { return wan }, + Backup: func(kind string) (string, error) { + if failing { + return "", errors.New("the flash is full") + } + backups++ + return kind + "-1.tar.gz", nil + }, + Reload: func() { reloads++ }, Update: func() { updates++ }, Updating: func() bool { return false }} + people := c.OfType("person") + if len(people) == 0 { + t.Fatal("the household has nobody") + } + who := people[0].Name + u := usage.Empty() + load := func() *model.Model { return model.Load(c, nil) } + told := func(part string) bool { + for _, l := range said { + if strings.Contains(l, part) { + return true + } + } + return false + } + // the first tick: nothing to compare with, the address noted, the certificate seen; an update check is due + if ev := ch.Tick(load(), u); len(ev) != 0 || backups != 0 || reloads != 0 || updates != 1 { + t.Fatalf("the first tick: %v, %d backups, %d reloads, %d updates", ev, backups, reloads, updates) + } + if !told("certificate expires within 7 days") { + t.Errorf("a certificate that cannot be read is not told: %v", said) + } + // an end date three days off: announced once; passed: a pause for that reason + c.Set(who, "expires", "2026-11-14") + ev := ch.Tick(load(), u) + if len(ev) != 1 || ev[0]["type"] != "expiring" || ev[0]["detail"] != "3 days" || ev[0]["person"] != who { + t.Errorf("the end date's last days: %v", ev) + } + if ev := ch.Tick(load(), u); len(ev) != 0 { + t.Errorf("announced again: %v", ev) + } + c.Set(who, "expires", "2026-11-11") + ev = ch.Tick(load(), u) + if len(ev) != 1 || ev[0]["type"] != "paused" || ev[0]["detail"] != "end date reached" { + t.Errorf("the end date passed: %v", ev) + } + c.Delete(who, "expires") + if ev := ch.Tick(load(), u); len(ev) != 1 || ev[0]["type"] != "resumed" { + t.Errorf("the end date taken away: %v", ev) + } + // the night's third hour: one backup a day, and only of settings that changed + clock = time.Date(2026, 11, 12, 3, 1, 0, 0, zone.Local()) + failing = true + ch.Tick(load(), u) + if !told("nightly backup failed: the flash is full") || backups != 0 { + t.Errorf("a failed backup is not told: %v", said) + } + failing = false + clock = clock.Add(24 * time.Hour) + ch.Tick(load(), u) + ch.Tick(load(), u) + clock = clock.Add(24 * time.Hour) + ch.Tick(load(), u) + if backups != 1 || !told("nightly backup saved: auto-1.tar.gz") { + t.Errorf("%d backups: %v", backups, said) + } + // the certificate's file replaced: told, and the service takes it + os.Chtimes(dir+"/cert", clock, clock.Add(-time.Hour)) + ch.Tick(load(), u) + if reloads != 1 || !told("certificate renewed") { + t.Errorf("a renewed certificate: %d reloads, %v", reloads, said) + } + // the public address moved, and a server hands out the old one itself + c.Set("home", "endpoint", "203.0.113.7") + wan = "198.51.100.9" + said = nil + ch.Tick(load(), u) + if !told("public address changed · 203.0.113.7 → 198.51.100.9") { + t.Errorf("a moved address is not told: %v", said) + } + notes, _ := os.ReadFile(dir + "/data/notes.json") + if !strings.Contains(string(notes), `"wan":"198.51.100.9"`) || !strings.Contains(string(notes), "warned:"+who) { + t.Errorf("what was told is not kept: %s", notes) + } + if st, _ := os.Stat(dir + "/data/notes.json"); st.Mode().Perm() != 0o600 { + t.Error("the notes are not private") + } +} + +// The speed record: a point a minute from the totals, the last thirty a server and fifteen a person; who +// is gone goes from the files. +func TestRate(t *testing.T) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + m := model.Load(c, nil) + who := m.PersonIDs()[0] + srv := m.People[who].Server + clock := time.Unix(1_800_000_000, 0) + ch := &Chores{RunDir: dir, DataDir: dir + "/data", Now: func() time.Time { return clock }} + u := usage.Empty() + u.People[who] = &usage.Record{Total: &usage.Pair{1000, 500}} + os.WriteFile(dir+"/rate.json", []byte(`{"gone":[[1,2,3]]}`), 0o644) + ch.rate(m, u) + for i := 1; i <= 40; i++ { + clock = clock.Add(time.Minute) + u.People[who].Total = &usage.Pair{1000 + float64(i)*6000, 500 + float64(i)*600} + ch.rate(m, u) + } + var hist, people map[string][][3]int64 + raw, _ := os.ReadFile(dir + "/rate.json") + json.Unmarshal(raw, &hist) + raw, _ = os.ReadFile(dir + "/rate_people.json") + json.Unmarshal(raw, &people) + last := [3]int64{clock.Unix(), 100, 10} + if len(hist[srv]) != 30 || hist[srv][29] != last || len(people[who]) != 15 || people[who][14] != last || hist["gone"] != nil { + t.Errorf("the record: %d points a server, %d a person, the last %v", len(hist[srv]), len(people[who]), hist[srv]) + } + // a counter that went back (a reset) is no negative speed; a long gap is no point + clock = clock.Add(time.Minute) + u.People[who].Total = &usage.Pair{0, 0} + ch.rate(m, u) + clock = clock.Add(time.Hour) + ch.rate(m, u) + raw, _ = os.ReadFile(dir + "/rate.json") + json.Unmarshal(raw, &hist) + if n := len(hist[srv]); n != 30 || hist[srv][n-1] != [3]int64{clock.Add(-time.Hour).Unix(), 0, 0} { + t.Errorf("after a reset and a gap: %v", hist[srv][len(hist[srv])-2:]) + } +} diff --git a/backend/chores/rate.go b/backend/chores/rate.go new file mode 100644 index 0000000..8fdde40 --- /dev/null +++ b/backend/chores/rate.go @@ -0,0 +1,108 @@ +package chores + +import ( + "os" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// point is a minute's speed: the moment, bytes a second down and up. +type point [3]int64 + +// rate keeps the last half hour of each server's speed (rate.json) and the last quarter of each person's +// (rate_people.json), a point a minute, from the counters' totals. +func (c *Chores) rate(m *model.Model, u *usage.Usage) { + ts := c.now().Unix() + servers := map[string]usage.Pair{} + totals := map[string]usage.Pair{} + for _, id := range m.PersonIDs() { + rec := u.People[id] + if rec == nil || rec.Total == nil { + continue + } + totals[id] = *rec.Total + s := servers[m.People[id].Server] + s[0] += rec.Total[0] + s[1] += rec.Total[1] + servers[m.People[id].Server] = s + } + hist := map[string][]point{} + people := map[string][]point{} + files.ReadJSON(c.RunDir+"/rate.json", &hist) + files.ReadJSON(c.RunDir+"/rate_people.json", &people) + per := func(now, was float64, dt int64) int64 { + if now < was { + return 0 + } + return int64((now - was) / float64(dt)) + } + if dt := ts - c.rateAt; c.rateAt != 0 && dt > 0 && dt < 600 { + for s, v := range servers { + p, had := c.rateServers[s] + if !had { + p = v + } + hist[s] = append(hist[s], point{ts, per(v[0], p[0], dt), per(v[1], p[1], dt)}) + if n := len(hist[s]); n > 30 { + hist[s] = hist[s][n-30:] + } + } + for _, id := range m.PersonIDs() { + t, has := totals[id] + p, had := c.ratePeople[id] + if !has || !had { + continue + } + people[id] = append(people[id], point{ts, per(t[0], p[0], dt), per(t[1], p[1], dt)}) + if n := len(people[id]); n > 15 { + people[id] = people[id][n-15:] + } + } + } + for s := range hist { + if m.Servers[s] == nil { + delete(hist, s) + } + } + for id := range people { + if m.People[id] == nil { + delete(people, id) + } + } + c.rateAt, c.rateServers, c.ratePeople = ts, servers, totals + os.MkdirAll(c.RunDir, 0o755) + files.WriteJSON(c.RunDir+"/rate.json", hist, 0o644) + files.WriteJSON(c.RunDir+"/rate_people.json", people, 0o644) +} + +// flushEvery is how often what lives in memory is put on flash. +const flushEvery = 3600 + +var logFlush = map[string]int64{"10min": 600, "hourly": 3600} + +// keepLogs trims the service log, and puts it, the places and the activity log on flash as often as each +// is meant to be: flash is written rarely. +func (c *Chores) keepLogs(m *model.Model) { + now := c.now().Unix() + if c.flushed == 0 { + c.flushed, c.logFlushed = now, now + } + persist := now-c.flushed >= flushEvery + if persist { + c.flushed = now + if c.FlushPlaces != nil { + c.FlushPlaces() + } + } + if c.Log != nil { + c.Log.Trim(c.DataDir, persist) + } + pol := journal.PolicyOf(m.Settings.Retention) + if pol.Persist == "off" || now-c.logFlushed >= logFlush[pol.Persist] { + journal.Log{Run: c.RunDir, Data: c.DataDir}.Persist(pol, now) + c.logFlushed = now + } +} diff --git a/backend/cli/cli.go b/backend/cli/cli.go new file mode 100644 index 0000000..78f2b14 --- /dev/null +++ b/backend/cli/cli.go @@ -0,0 +1,845 @@ +// Package cli is the `dawnline` command (dawnlined run as `dawnlined cli …`; /usr/bin/dawnline hands its +// words over). What the service itself needs works with no backend running: the apply when it starts, the +// sync and the log's lines when a tunnel comes up or goes down, the portal's certificate. What an admin +// types about people and devices goes through the running backend, the same door the pages use. +package cli + +import ( + "encoding/json" + "fmt" + "io" + "os" + "os/exec" + "regexp" + "sort" + "strconv" + "strings" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/apply" + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/methods" + "github.com/tickcount/luci-app-dawnline/backend/migrate" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/pkgmgr" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/updater" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// Env is where the command works. +type Env struct { + RunDir, DataDir, Config string + Out, Err io.Writer + // Run runs a command: what it said (both streams) and its exit code. + Run func(name string, args ...string) (string, int) + // Call asks the running backend (ubus object dawnline): its answer, or why there is none. + Call func(method string, args map[string]any) (map[string]any, error) + Now func() time.Time +} + +// System is the router's own. +func System() *Env { + run := func(name string, args ...string) (string, int) { + out, err := exec.Command(name, args...).CombinedOutput() + if err == nil { + return string(out), 0 + } + if ee, isExit := err.(*exec.ExitError); isExit { + return string(out), ee.ExitCode() + } + return string(out), 127 + } + return &Env{RunDir: "/var/run/dawnline", DataDir: "/etc/dawnline", Config: "/etc/config/dawnline", Out: os.Stdout, Err: os.Stderr, Run: run, Now: time.Now, + Call: func(method string, args map[string]any) (map[string]any, error) { + if args == nil { + args = map[string]any{} + } + raw, _ := json.Marshal(args) + out, err := exec.Command("ubus", "-t", "90", "call", "dawnline", method, string(raw)).Output() + if err != nil { + return nil, fmt.Errorf("Dawnline's backend does not answer (is the service running? /etc/init.d/dawnline start)") + } + var res map[string]any + if json.Unmarshal(out, &res) != nil { + res = map[string]any{} + } + return res, nil + }} +} + +type refusal struct{ msg string } + +func die(format string, args ...any) { panic(refusal{fmt.Sprintf(format, args...)}) } + +func (e *Env) store() store.Store { return store.Store{Config: e.Config, RunDir: e.RunDir} } + +func (e *Env) log() *servicelog.Log { + return &servicelog.Log{RunDir: e.RunDir, Level: func() string { + if _, m, err := e.store().Read(); err == nil { + return m.Settings.LogLevel + } + return "info" + }} +} + +// logical is the netifd interface on each device, as netifd says it. +func (e *Env) logical() map[string]netview.Logical { + out := map[string]netview.Logical{} + said, code := e.Run("ubus", "call", "network.interface", "dump") + var res struct { + Interface []struct { + L3 string `json:"l3_device"` + Device string `json:"device"` + Name string `json:"interface"` + Proto string `json:"proto"` + } `json:"interface"` + } + if code != 0 || json.Unmarshal([]byte(said), &res) != nil { + return out + } + for _, i := range res.Interface { + dev := i.L3 + if dev == "" { + dev = i.Device + } + if _, seen := out[dev]; dev == "" || seen { + continue + } + out[dev] = netview.Logical{Name: i.Name, Proto: i.Proto} + } + return out +} + +// router is the router an apply works on. +func (e *Env) router() *apply.Router { + return &apply.Router{RunDir: e.RunDir, HostsFile: "/tmp/hosts/dawnline", DHCP: "/etc/config/dhcp", Log: e.log(), + Network: "/etc/config/network", Firewall: "/etc/config/firewall", Exec: e.Run, + Snapshot: func() *netview.Snapshot { return netview.Take(netview.System(e.logical)) }, + Remember: func(address string) { + e.store().Transact(func(c *uci.Config, _ *model.Model) error { + if c.Section("settings") == nil { + c.Add("settings", "settings") + } + c.Set("settings", "lan_address", address) + return nil + }) + }} +} + +func (e *Env) load() (*model.Model, string, error) { + c, m, err := e.store().Read() + if err != nil { + return nil, "", err + } + saved := "" + if s := c.Section("settings"); s != nil { + saved, _ = s.Get("lan_address") + } + return m, saved, nil +} + +func (e *Env) out(v any) { + if s, is := v.(string); is { + fmt.Fprintln(e.Out, s) + return + } + raw, _ := json.MarshalIndent(v, "", "\t") + fmt.Fprintln(e.Out, string(raw)) +} + +// table prints fixed-width columns: a header, then a line a row. +func (e *Env) table(cols []string, rows [][]string) { + w := make([]int, len(cols)) + for i, c := range cols { + w[i] = len([]rune(c)) + } + for _, r := range rows { + for i, v := range r { + if n := len([]rune(v)); n > w[i] { + w[i] = n + } + } + } + line := func(r []string) { + var parts []string + for i, v := range r { + parts = append(parts, v+strings.Repeat(" ", w[i]-len([]rune(v)))) + } + e.out(strings.TrimRight(strings.Join(parts, " "), " ")) + } + line(cols) + for _, r := range rows { + line(r) + } +} + +func ago(secs int64) string { + switch { + case secs < 3600: + return fmt.Sprintf("%dm", secs/60) + case secs < 86400: + return fmt.Sprintf("%dh", secs/3600) + } + return fmt.Sprintf("%dd", secs/86400) +} + +const help = ` +Usage: dawnline + + apply Reconcile router configuration and runtime state + sync Push devices and access rules to the tunnels + status People and devices with live state (JSON) + health Run health checks (JSON) + person ls [--json] Everyone: id, name, access, state, devices, last seen + person add [--slug s] [--access lan|internet|both] [--devices n] + [--expires YYYY-MM-DD] [--quota GB] [--server id] + person link Print the personal portal link + person rm [--yes] Remove a person and their devices (--yes when they have any) + device ls [person] [--json] + device add [--kind phone|computer|tablet|router] [--conf] + device conf Print a device configuration (.conf) + device rm Remove a device + backup Create a backup in /etc/dawnline/backups + portal-cert Print the certificate and key the portal uses + portal-http-port Print the plain-HTTP port when an IP is among the portal addresses + log [-n N] [--since 2h|3d|date] [--level error|down|repair|up|info] [--src awg|dawnline|portal] [--json] + Service log: tunnel and service starts, stops, repairs (newest first) + teardown Remove everything Dawnline created on the router + version + +Exit codes: 0 done, 1 refused or failed, 2 unknown command. health exits 1 when a check fails.` + +var flags = map[string]bool{"json": true, "yes": true, "conf": true} + +// Main runs one command and returns its exit code. +func (e *Env) Main(argv []string) (code int) { + opts := map[string]string{} + var args []string + for i := 0; i < len(argv); i++ { + a := argv[i] + if a == "-n" { + a = "--n" + } + if name, is := strings.CutPrefix(a, "--"); is { + if flags[name] { + opts[name] = "1" + } else if i++; i < len(argv) { + opts[name] = argv[i] + } else { + opts[name] = "" + } + continue + } + args = append(args, a) + } + for len(args) < 4 { + args = append(args, "") + } + cmd := args[0] + if cmd == "" { + cmd = "help" + } + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprint(r) + if ref, is := r.(refusal); is { + msg = ref.msg + } + fmt.Fprintf(e.Err, "dawnline: %s\n", msg) + // run from the init script or cron, stderr goes nowhere: syslog keeps why + e.log().Say("error", "cli", "dawnline "+cmd+" failed: "+msg) + code = 1 + } + }() + // what the backend answers, or its refusal as this command's + ask := func(method string, a map[string]any) map[string]any { + res, err := e.Call(method, a) + if err != nil { + die("%s", err.Error()) + } + if msg, _ := res["error"].(string); msg != "" { + die("%s", msg) + } + return res + } + warned := func(res map[string]any) { + if w, _ := res["warning"].(string); w != "" { + fmt.Fprintf(e.Err, "dawnline: %s\n", w) + } + } + people := func() []map[string]any { + // The stream's own topic, as the pages read it: made once somebody looks, so the first question + // may come before it is there. + var doc map[string]any + for try := 0; try < 8 && doc == nil; try++ { + if try > 0 { + time.Sleep(400 * time.Millisecond) + } + res := ask("sync", map[string]any{"topics": []string{"people"}}) + docs, _ := res["docs"].(map[string]any) + doc, _ = docs["people"].(map[string]any) + } + if doc == nil { + die("Dawnline's backend has not looked at the tunnels yet: try again in a moment.") + } + items, _ := doc["items"].(map[string]any) + var ids []string + order, _ := doc["order"].([]any) + for _, id := range order { + if s, is := id.(string); is && items[s] != nil { + ids = append(ids, s) + } + } + if len(ids) != len(items) { + ids = ids[:0] + for id := range items { + ids = append(ids, id) + } + sort.Strings(ids) + } + var out []map[string]any + for _, id := range ids { + if m, is := items[id].(map[string]any); is { + m["id"] = id + // a person's devices are kept the same way: by id, with their order + if devs, keyed := m["devices"].(map[string]any); keyed { + byID, _ := devs["items"].(map[string]any) + list := []any{} + order, _ := devs["order"].([]any) + for _, did := range order { + if d, is := byID[fmt.Sprint(did)].(map[string]any); is { + d["id"] = did + list = append(list, d) + } + } + m["devices"] = list + } + out = append(out, m) + } + } + return out + } + str := func(v any) string { + switch x := v.(type) { + case string: + return x + case float64: + return strconv.FormatFloat(x, 'f', -1, 64) + } + return "" + } + thePerson := func(id string) map[string]any { + if id == "" { + die("Which person? Give their id (dawnline person ls).") + } + for _, p := range people() { + if p["id"] == id { + return p + } + } + die("Unknown person: %s.", id) + return nil + } + now := e.Now().Unix() + switch { + case cmd == "apply": + st := e.store() + migrate.Router{Store: st, NewCode: methods.NewCode, Uhttpd: "/etc/config/uhttpd", CGI: "/www/cgi-bin/dawnline-portal", Log: e.log(), + ReloadUhttpd: func() { e.Run("/etc/init.d/uhttpd", "reload") }}.Run() + _, tool := os.Stat("/usr/bin/awg") + _, proto := os.Stat("/lib/netifd/proto/amneziawg.sh") + full := e.router().Apply(e.load, usage.Load(e.RunDir, e.DataDir, false), nil, tool == nil && proto == nil, awg.SystemCaps(e.DataDir)) + res := map[string]any{"network": full.Network, "firewall": full.Firewall, "like_home": full.LikeHome, "peers": full.Peers, "warning": nil} + if full.Warning != "" { + res["warning"] = full.Warning + } + e.out(res) + case cmd == "sync": + m, _, err := e.load() + if err != nil { + die("%s", err.Error()) + } + r := e.router().Sync(m, usage.Load(e.RunDir, e.DataDir, false), now, false, nil) + res := map[string]any{"peers": r.Peers, "states": r.States, "table": nil, "warning": nil} + if r.Table != "" { + res["table"] = r.Table + } + if r.Warning != "" { + res["warning"] = r.Warning + } + e.out(res) + case cmd == "status": + e.out(people()) + case cmd == "health": + res := ask("health", nil) + checks, _ := res["checks"].([]any) + e.out(checks) + for _, c := range checks { + if m, _ := c.(map[string]any); m["status"] == "error" { + return 1 + } + } + case cmd == "person" && args[1] == "ls": + list := people() + sort.SliceStable(list, func(i, j int) bool { return str(list[i]["name"]) < str(list[j]["name"]) }) + if opts["json"] != "" { + e.out(list) + break + } + var rows [][]string + for _, p := range list { + devs, _ := p["devices"].([]any) + online, _ := p["online"].(float64) + count := strconv.Itoa(len(devs)) + seen := "never" + if online > 0 { + count += fmt.Sprintf(" (%d online)", int(online)) + seen = "now" + } else if last, _ := p["last_seen"].(float64); last > 0 { + seen = ago(now-int64(last)) + " ago" + } + rows = append(rows, []string{str(p["id"]), str(p["name"]), str(p["server"]), str(p["access"]), str(p["state"]), count, seen}) + } + e.table([]string{"ID", "NAME", "SERVER", "ACCESS", "STATE", "DEVICES", "LAST SEEN"}, rows) + case cmd == "person" && args[1] == "add": + a := map[string]any{"name": args[2], "slug": opts["slug"], "server": opts["server"], "access": opts["access"], "device_limit": opts["devices"], + "expires": opts["expires"], "quota_gb": opts["quota"]} + if opts["access"] == "" { + a["access"] = "internet" + } + res := ask("person_create", a) + id := str(res["id"]) + e.out(fmt.Sprintf("Added %s (%s)", args[2], id)) + links := ask("person_links", map[string]any{"id": id}) + if url := str(links["url"]); url != "" { + e.out(url) + } else { + e.out("No personal link: the portal is off.") + } + warned(res) + case cmd == "person" && args[1] == "link": + p := thePerson(args[2]) + if url := str(ask("person_links", map[string]any{"id": p["id"]})["url"]); url != "" { + e.out(url) + } else { + e.out("No personal link: the portal is off.") + } + case cmd == "person" && args[1] == "rm": + p := thePerson(args[2]) + devs, _ := p["devices"].([]any) + n := len(devs) + s := "s" + if n == 1 { + s = "" + } + if n > 0 && opts["yes"] == "" { + die("%s has %d device%s: add --yes to remove them too.", str(p["name"]), n, s) + } + res := ask("person_delete", map[string]any{"id": p["id"]}) + if n > 0 { + e.out(fmt.Sprintf("Removed %s and %d device%s.", str(p["name"]), n, s)) + } else { + e.out(fmt.Sprintf("Removed %s.", str(p["name"]))) + } + warned(res) + case cmd == "device" && args[1] == "ls": + type row struct { + m map[string]any + person string + } + var rows []row + for _, p := range people() { + if args[2] != "" && p["id"] != args[2] { + continue + } + devs, _ := p["devices"].([]any) + for _, d := range devs { + if m, is := d.(map[string]any); is { + rows = append(rows, row{m, str(p["id"])}) + } + } + } + if args[2] != "" && len(rows) == 0 { + thePerson(args[2]) + } + sort.SliceStable(rows, func(i, j int) bool { + if rows[i].person != rows[j].person { + return rows[i].person < rows[j].person + } + return str(rows[i].m["name"]) < str(rows[j].m["name"]) + }) + if opts["json"] != "" { + out := []map[string]any{} + for _, r := range rows { + hs, _ := r.m["handshake"].(float64) + out = append(out, map[string]any{"id": r.m["id"], "person": r.person, "name": r.m["name"], "kind": r.m["kind"], "address": r.m["address"], + "disabled": r.m["disabled"] == true, "online": r.m["online"] == true, "handshake": hs}) + } + e.out(out) + break + } + var lines [][]string + for _, r := range rows { + st := "never connected" + hs, _ := r.m["handshake"].(float64) + switch { + case r.m["disabled"] == true: + st = "off" + case r.m["online"] == true: + st = "online" + case hs > 0: + st = "seen " + ago(now-int64(hs)) + " ago" + } + lines = append(lines, []string{str(r.m["id"]), r.person, str(r.m["name"]), str(r.m["kind"]), str(r.m["address"]), st}) + } + e.table([]string{"ID", "PERSON", "NAME", "KIND", "ADDRESS", "STATE"}, lines) + case cmd == "device" && args[1] == "add": + p := thePerson(args[2]) + if args[3] == "" { + die("Which name? dawnline device add .") + } + kind := opts["kind"] + if kind == "" { + kind = "phone" + } + res := ask("device_create", map[string]any{"person": p["id"], "name": args[3], "kind": kind}) + id := str(res["id"]) + if opts["conf"] != "" { + conf, _ := res["config"].(map[string]any) + fmt.Fprint(e.Out, str(conf["conf"])) + } else { + e.out(fmt.Sprintf("%s (dawnline device conf %s prints its configuration)", id, id)) + } + warned(res) + case cmd == "device" && args[1] == "conf": + res := ask("device_config", map[string]any{"id": args[2]}) + fmt.Fprint(e.Out, str(res["conf"])) + case cmd == "device" && args[1] == "rm": + name, owner := "", "" + for _, p := range people() { + devs, _ := p["devices"].([]any) + for _, d := range devs { + if m, _ := d.(map[string]any); m["id"] == args[2] && args[2] != "" { + name, owner = str(m["name"]), str(p["name"]) + } + } + } + if name == "" { + die("Unknown device.") + } + res := ask("device_delete", map[string]any{"id": args[2]}) + e.out(fmt.Sprintf("Removed %s (%s).", name, owner)) + warned(res) + case cmd == "backup": + // with no backend needed: the updater makes one before it replaces Dawnline itself + st := e.store() + name, err := methods.BackupCreate(methods.Deps{Store: &st, RunDir: e.RunDir, DataDir: e.DataDir, Config: e.Config}, opts["reason"]) + if err != nil { + die("%s", err.Error()) + } + e.out(name) + case cmd == "portal-cert": + _, m, err := e.store().Read() + if err != nil { + die("%s", err.Error()) + } + cert, key := methods.PortalCertAndKey(m.Settings, e.DataDir, e.Run) + e.out(cert + " " + key) + case cmd == "portal-http-port": + _, m, err := e.store().Read() + if err != nil { + die("%s", err.Error()) + } + for _, h := range view.PortalHosts(m) { + if _, is := ipnet.IP(h); is { + e.out(strconv.Itoa(m.Settings.PortalPort + 1)) + break + } + } + case cmd == "log": + return e.showLog(opts) + case cmd == "iface-event": + e.ifaceEvent(args[1], args[2]) + case cmd == "teardown": + _, m, err := e.store().Read() + if err != nil { + die("%s", err.Error()) + } + e.router().Teardown(m) + migrate.Router{Store: e.store(), Uhttpd: "/etc/config/uhttpd", CGI: "/www/cgi-bin/dawnline-portal", Log: e.log(), + ReloadUhttpd: func() { e.Run("/etc/init.d/uhttpd", "reload") }}.UhttpdOnly() + e.Run("sh", "-c", "grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root && { sed -i '\\#/usr/libexec/dawnline/heartbeat#d' /etc/crontabs/root; /etc/init.d/cron restart >/dev/null 2>&1; }") + case cmd == "version": + e.out(backend.Version) + case cmd == "help" || cmd == "-h": + e.out("Dawnline " + backend.Version + "\n" + help) + default: + fmt.Fprintf(e.Err, "dawnline: unknown command \"%s\" (dawnline help)\n", strings.TrimSpace(args[0]+" "+args[1])) + return 2 + } + return 0 +} + +var ( + sinceRel = regexp.MustCompile(`^([0-9]+)([mhd])$`) + sinceDate = regexp.MustCompile(`^([0-9]{4})-([0-9]{2})-([0-9]{2})$`) +) + +// showLog prints the service log, newest first. +func (e *Env) showLog(opts map[string]string) int { + n, _ := strconv.Atoi(opts["n"]) + var since int64 + if s := opts["since"]; s != "" { + if m := sinceRel.FindStringSubmatch(s); m != nil { + k, _ := strconv.ParseInt(m[1], 10, 64) + since = e.Now().Unix() - k*map[string]int64{"m": 60, "h": 3600, "d": 86400}[m[2]] + } else if m := sinceDate.FindStringSubmatch(s); m != nil { + y, _ := strconv.Atoi(m[1]) + mo, _ := strconv.Atoi(m[2]) + d, _ := strconv.Atoi(m[3]) + since = time.Date(y, time.Month(mo), d, 0, 0, 0, 0, zone.Local()).Unix() + } else { + die("--since takes 30m, 2h, 3d or a date like 2026-10-18.") + } + } + level, src := opts["level"], opts["src"] + if level != "" && !strings.Contains(" info up down repair error ", " "+level+" ") { + die("--level takes error, down, repair, up or info.") + } + if src != "" && !strings.Contains(" awg dawnline portal ", " "+src+" ") { + die("--src takes awg, dawnline or portal.") + } + raw, err := os.ReadFile(e.RunDir + "/service.log") + if err != nil { + raw, _ = os.ReadFile(e.DataDir + "/service.log") + } + lines := strings.Split(string(raw), "\n") + log := []map[string]any{} + for i := len(lines) - 1; i >= 0 && (n == 0 || len(log) < n); i-- { + var ent map[string]any + if lines[i] == "" || json.Unmarshal([]byte(lines[i]), &ent) != nil { + continue + } + ts, _ := ent["ts"].(float64) + if (since != 0 && int64(ts) < since) || (level != "" && ent["level"] != level) || (src != "" && ent["src"] != src) { + continue + } + log = append(log, ent) + } + if opts["json"] != "" { + e.out(log) + return 0 + } + str := func(v any) string { s, _ := v.(string); return s } + for _, ent := range log { + ts, _ := ent["ts"].(float64) + t := time.Unix(int64(ts), 0).In(zone.Local()) + text := str(ent["msg"]) + if who := str(ent["who"]); ent["by"] == "admin" { + parts := []string{"You", str(ent["msg"]), str(ent["kind"]), who} + if note := str(ent["note"]); note != "" { + parts = append(parts, "· "+note) + } + var kept []string + for _, p := range parts { + if p != "" { + kept = append(kept, p) + } + } + text = strings.Join(kept, " ") + } else if who != "" { + text = who + " " + text + } + e.out(fmt.Sprintf("%02d-%02d %02d:%02d %-8s %-6s %s", int(t.Month()), t.Day(), t.Hour(), t.Minute(), str(ent["src"]), str(ent["level"]), text)) + if d := str(ent["detail"]); d != "" { + e.out(" " + strings.ReplaceAll(d, "\n", "\n ")) + } + } + return 0 +} + +var ifaceName = regexp.MustCompile(`^[a-z][a-z0-9_]{0,15}$`) + +// ifaceErrors is why a tunnel is down, from netifd and the last related syslog lines. +func (e *Env) ifaceErrors(ifname string) string { + var parts []string + said, _ := e.Run("ubus", "call", "network.interface."+ifname, "status") + var st struct { + Errors []struct { + Code string `json:"code"` + Data []string `json:"data"` + } `json:"errors"` + } + json.Unmarshal([]byte(said), &st) + var errs []string + for _, x := range st.Errors { + one := x.Code + if len(x.Data) > 0 { + one += " (" + strings.Join(x.Data, " ") + ")" + } + errs = append(errs, one) + } + if len(errs) > 0 { + parts = append(parts, "netifd: "+strings.Join(errs, ", ")) + } + lines, _ := e.Run("sh", "-c", "logread -l 400 2>/dev/null | grep -E '"+ifname+"|amneziawg' | grep -iE 'error|fail|invalid|unrecogni|cannot|unable|not found|refused|denied' | tail -n 6") + if l := strings.Trim(lines, " \t\r\n\v\f"); l != "" { + parts = append(parts, l) + } + return strings.Join(parts, "\n") +} + +// ifaceEvent is the iface hotplug script's word: a tunnel started, stopped or failed to start. +func (e *Env) ifaceEvent(action, ifname string) { + if !ifaceName.MatchString(ifname) { + die("Bad interface.") + } + log := e.log() + now := e.Now().Unix() + // Dawnline leaves a note before it takes a tunnel down itself; anything else is unexpected. + var intent map[string]any + if action == "ifdown" { + path := e.RunDir + "/iface-intent.json" + all := map[string]map[string]any{} + files.ReadJSON(path, &all) + if it := all[ifname]; it != nil { + ts, _ := it["ts"].(float64) + used, wasUsed := it["used"].(float64) + if float64(now)-ts < 120 && !(wasUsed && used != 0 && float64(now)-used >= 15) { + intent = it + if !wasUsed || used == 0 { + it["used"] = float64(now) + files.WriteJSON(path, all, 0o600) + } + } + } + } + who := ifname + if name, _ := intent["name"].(string); name != "" { + who = name + } + if _, m, err := e.store().Read(); err == nil { + for _, srv := range m.Servers { + if srv.Ifname == ifname { + who = srv.Name + } + } + } + fails := e.RunDir + "/ifup-failed.json" + type fail struct { + Logged int64 `json:"logged"` + Count int `json:"count"` + Since int64 `json:"since"` + Last int64 `json:"last"` + } + switch action { + case "ifup": + func() { + defer files.Lock(e.RunDir, "ifup-failed")() + all := map[string]*fail{} + files.ReadJSON(fails, &all) + if all[ifname] != nil { + delete(all, ifname) + files.WriteJSON(fails, all, 0o600) + } + }() + msg := "started" + if port, code := e.Run("awg", "show", ifname, "listen-port"); code == 0 && strings.TrimSpace(port) != "" { + msg = "started · accepting connections on port " + strings.TrimSpace(port) + } + log.Write("awg", "up", msg, "", who, servicelog.Extra{}) + case "ifdown": + // stops Dawnline made itself are explained by the admin's own line; only an AmneziaWG update gets one here + if intent != nil { + if intent["reason"] == "update" { + log.Write("awg", "info", "restarting for the AmneziaWG update", "", who, servicelog.Extra{}) + } + return + } + detail := "Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed." + if more := e.ifaceErrors(ifname); more != "" { + detail += "\n" + more + } + log.Write("awg", "down", "stopped unexpectedly", detail, who, servicelog.Extra{}) + case "ifup-failed": + // netifd retries a tunnel that fails to start every few seconds: one line an interface every ten + // minutes, with how many attempts failed meanwhile + var n int + var mins int64 + func() { + defer files.Lock(e.RunDir, "ifup-failed")() + all := map[string]*fail{} + files.ReadJSON(fails, &all) + f := all[ifname] + if f == nil || now-f.Last > 600 { + f = &fail{Since: now} + all[ifname] = f + } + f.Count++ + f.Last = now + if now-f.Logged >= 600 { + n, mins = f.Count, (now-f.Since)/60 + f.Logged, f.Since, f.Count = now, now, 0 + } + os.MkdirAll(e.RunDir, 0o755) + files.WriteJSON(fails, all, 0o600) + }() + if n > 0 { + msg := "couldn't start" + if n > 1 { + msg = fmt.Sprintf("couldn't start · %d failed attempts in %d min", n, mins) + } + log.Write("awg", "error", msg, e.ifaceErrors(ifname), who, servicelog.Extra{}) + } + } +} + +var catalogFile = regexp.MustCompile(`^dawnline\.([A-Za-z_-]+)\.lmo$`) + +// Updater runs the update worker's command line on this router and returns its exit code. +func Updater(args []string) int { + e := System() + sh := func(cmd string) (string, int) { return e.Run("sh", "-c", cmd) } + _, m, err := e.store().Read() + if err != nil { + fmt.Fprintf(os.Stderr, "updater: %s\n", err.Error()) + return 1 + } + t := i18n.Use(i18n.Dir, os.Getenv("DAWNLINE_LANG")) + pkg := pkgmgr.System(sh) + pkg.T = t.T + return updater.Main(&updater.Env{RunDir: e.RunDir, DataDir: e.DataDir, Version: backend.Version, Policy: m.Settings.Updates, Pkg: pkg, T: t, + GH: &github.Client{RunDir: e.RunDir}, Fetch: github.HTTPFetch, Run: sh, Log: e.log(), Pid: os.Getpid(), + Board: func() (string, string, string) { + said, _ := e.Run("ubus", "call", "system", "board") + var b struct { + Release struct { + Version, Target, Arch string + } `json:"release"` + } + json.Unmarshal([]byte(said), &b) + return b.Release.Version, b.Release.Target, b.Release.Arch + }, + Langs: func() []string { + var out []string + entries, _ := os.ReadDir(i18n.Dir) + for _, f := range entries { + if m := catalogFile.FindStringSubmatch(f.Name()); m != nil { + out = append(out, m[1]) + } + } + sort.Strings(out) + return out + }}, args, os.Stdout, os.Stderr) +} diff --git a/backend/cli/cli_test.go b/backend/cli/cli_test.go new file mode 100644 index 0000000..a152cdd --- /dev/null +++ b/backend/cli/cli_test.go @@ -0,0 +1,145 @@ +package cli + +import ( + "bytes" + "encoding/json" + "errors" + "os" + "strings" + "testing" + "time" +) + +func env(t *testing.T) (*Env, *bytes.Buffer, *bytes.Buffer, string) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + os.WriteFile(dir+"/dawnline", text, 0o600) + out, errs := &bytes.Buffer{}, &bytes.Buffer{} + e := &Env{RunDir: dir + "/run", DataDir: dir + "/data", Config: dir + "/dawnline", Out: out, Err: errs, + Now: func() time.Time { return time.Unix(1_800_000_000, 0) }, + Run: func(name string, args ...string) (string, int) { + if name == "awg" { + return "4500\n", 0 + } + return "", 1 + }} + os.MkdirAll(e.RunDir, 0o755) + return e, out, errs, dir +} + +func entries(t *testing.T, e *Env) []map[string]any { + raw, _ := os.ReadFile(e.RunDir + "/service.log") + var out []map[string]any + for _, l := range strings.Split(string(raw), "\n") { + if l != "" { + var m map[string]any + json.Unmarshal([]byte(l), &m) + out = append(out, m) + } + } + return out +} + +// The hotplug script's words: a start, a stop Dawnline did not make, one it did, and starts that keep failing. +func TestIfaceEvents(t *testing.T) { + e, _, errs, _ := env(t) + if e.Main([]string{"iface-event", "ifup", "dawn0"}) != 0 || e.Main([]string{"iface-event", "ifdown", "dawn0"}) != 0 { + t.Fatal(errs.String()) + } + // a stop Dawnline made itself is explained by the admin's own line: nothing here + os.WriteFile(e.RunDir+"/iface-intent.json", []byte(`{"dawn1":{"reason":"settings","name":"Cabin","ts":1799999990},"dawn2":{"reason":"update","name":"Open","ts":1799999990}}`), 0o600) + e.Main([]string{"iface-event", "ifdown", "dawn1"}) + e.Main([]string{"iface-event", "ifdown", "dawn2"}) + for i := 0; i < 3; i++ { + e.Main([]string{"iface-event", "ifup-failed", "dawn0"}) + } + log := entries(t, e) + var got []string + for _, l := range log { + got = append(got, l["who"].(string)+" · "+l["level"].(string)+" · "+l["msg"].(string)) + } + want := []string{"Home · up · started · accepting connections on port 4500", "Home · down · stopped unexpectedly", "Open · info · restarting for the AmneziaWG update", "Home · error · couldn't start"} + if strings.Join(got, "\n") != strings.Join(want, "\n") { + t.Errorf("the log:\n%s", strings.Join(got, "\n")) + } + if e.Main([]string{"iface-event", "ifup", "../etc"}) != 1 || !strings.Contains(errs.String(), "Bad interface.") { + t.Errorf("a name that is no interface: %s", errs.String()) + } + // the log as the admin reads it, newest first, by level + e2, out, _, _ := env(t) + e2.RunDir = e.RunDir + if e2.Main([]string{"log", "--level", "down"}) != 0 || !strings.Contains(out.String(), "awg down Home stopped unexpectedly") || strings.Contains(out.String(), "accepting connections") { + t.Errorf("the log's lines:\n%s", out.String()) + } + out.Reset() + e2.Main([]string{"log", "-n", "1", "--json"}) + var list []map[string]any + if json.Unmarshal(out.Bytes(), &list) != nil || len(list) != 1 || list[0]["msg"] != "couldn't start" { + t.Errorf("the newest entry: %s", out.String()) + } + if e2.Main([]string{"log", "--since", "soon"}) != 1 { + t.Error("a since that is no time was taken") + } +} + +func TestPeopleAndDevices(t *testing.T) { + e, out, errs, _ := env(t) + var asked []string + e.Call = func(method string, args map[string]any) (map[string]any, error) { + raw, _ := json.Marshal(args) + asked = append(asked, method+" "+string(raw)) + switch method { + case "sync": + return map[string]any{"docs": map[string]any{"people": map[string]any{"order": []any{"zed", "amy"}, "items": map[string]any{ + "zed": map[string]any{"name": "Zed", "server": "home", "access": "both", "state": "active", "online": 1.0, "devices": map[string]any{"order": []any{"d_2", "d_1"}, "items": map[string]any{ + "d_2": map[string]any{"name": "Tablet", "kind": "tablet", "address": "10.77.0.3", "handshake": 1799990000.0}, + "d_1": map[string]any{"name": "Phone", "kind": "phone", "address": "10.77.0.2", "online": true}}}}, + "amy": map[string]any{"name": "Amy", "server": "home", "access": "lan", "state": "paused", "last_seen": 1799900000.0, "devices": map[string]any{"order": []any{}, "items": map[string]any{}}}}}}}, nil + case "person_delete": + return map[string]any{"ok": true, "warning": "Couldn't load devices into Home: busy."}, nil + case "device_config": + if args["id"] != "d_1" { + return map[string]any{"error": "Unknown device."}, nil + } + return map[string]any{"conf": "[Interface]\n"}, nil + case "person_links": + return map[string]any{"url": "https://vpn.example.org:4500/aaaaaa-bbbbbb-cccccc"}, nil + } + return nil, errors.New("no backend") + } + e.Main([]string{"person", "ls"}) + want := "ID NAME SERVER ACCESS STATE DEVICES LAST SEEN\namy Amy home lan paused 0 1d ago\nzed Zed home both active 2 (1 online) now\n" + if out.String() != want { + t.Errorf("person ls:\n%s", out.String()) + } + out.Reset() + e.Main([]string{"device", "ls", "zed"}) + want = "ID PERSON NAME KIND ADDRESS STATE\nd_1 zed Phone phone 10.77.0.2 online\nd_2 zed Tablet tablet 10.77.0.3 seen 2h ago\n" + if out.String() != want { + t.Errorf("device ls:\n%s", out.String()) + } + out.Reset() + if e.Main([]string{"person", "rm", "zed"}) != 1 || !strings.Contains(errs.String(), "Zed has 2 devices: add --yes to remove them too.") { + t.Errorf("a person with devices goes without a yes: %s", errs.String()) + } + errs.Reset() + if e.Main([]string{"person", "rm", "zed", "--yes"}) != 0 || out.String() != "Removed Zed and 2 devices.\n" || !strings.Contains(errs.String(), "Couldn't load devices into Home: busy.") { + t.Errorf("person rm: %s / %s", out.String(), errs.String()) + } + out.Reset() + if e.Main([]string{"device", "conf", "d_1"}) != 0 || out.String() != "[Interface]\n" || e.Main([]string{"device", "conf", "nope"}) != 1 { + t.Errorf("device conf: %q", out.String()) + } + out.Reset() + if e.Main([]string{"person", "link", "amy"}) != 0 || !strings.HasPrefix(out.String(), "https://vpn.example.org:4500/") || e.Main([]string{"person", "link", "who"}) != 1 { + t.Errorf("person link: %q", out.String()) + } + // what needs no backend: the plain-HTTP port (an IP is among the portal's addresses), the version, help + out.Reset() + if e.Main([]string{"portal-http-port"}) != 0 || out.String() != "4501\n" { + t.Errorf("portal-http-port: %q", out.String()) + } + if e.Main([]string{"backup", "--reason", "pre-update"}) != 0 || e.Main([]string{"dance", "now"}) != 2 || e.Main(nil) != 0 { + t.Error("the exit codes") + } +} diff --git a/backend/cmd/dawnlined/main.go b/backend/cmd/dawnlined/main.go new file mode 100644 index 0000000..6eca645 --- /dev/null +++ b/backend/cmd/dawnlined/main.go @@ -0,0 +1,81 @@ +// dawnlined is Dawnline's backend in Go: one long-running program that holds +// the live state and serves it to the pages. procd runs it (the `backend` +// instance of /etc/init.d/dawnline). +// +// It looks at the tunnels, keeps the router to the settings, answers the pages (the object `dawnline` on +// ubus, with the stream of live state) and serves the personal portal. The same binary is the `dawnline` +// command (dawnlined cli …) and the update worker (dawnlined updater …). +package main + +import ( + "context" + "flag" + "fmt" + "log/syslog" + "os" + "os/signal" + "syscall" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/cli" + "github.com/tickcount/luci-app-dawnline/backend/daemon" + "github.com/tickcount/luci-app-dawnline/backend/ubus" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +func main() { + // `dawnlined updater …` is the background update worker (/usr/libexec/dawnline/updater hands its words over) + if len(os.Args) > 1 && os.Args[1] == "updater" { + zone.Load(zone.File) + os.Exit(cli.Updater(os.Args[2:])) + } + // `dawnlined cli …` is the dawnline command (/usr/bin/dawnline hands its words over) + if len(os.Args) > 1 && os.Args[1] == "cli" { + zone.Load(zone.File) + os.Exit(cli.System().Main(os.Args[2:])) + } + socket := flag.String("ubus", ubus.Socket, "ubusd's socket") + run := flag.String("run", "/var/run/dawnline", "the directory of runtime state (tmpfs)") + data := flag.String("data", "/etc/dawnline", "the directory of kept state (flash)") + config := flag.String("config", "/etc/config/dawnline", "the settings file") + stream := flag.String("stream", "poll", "how pages follow: sse (the web server can hold an event stream) or poll") + // taken and ignored: the init script of a version before this one passes it + flag.Bool("watch", true, "(always on)") + portalPort := flag.Int("portal-port", 0, "serve the personal portal on this HTTPS port (0: its own web server does)") + portalHTTP := flag.Int("portal-http", 0, "and plain HTTP on this port, for links with an IP address (0: none)") + portalCert := flag.String("portal-cert", "", "the portal's certificate") + portalKey := flag.String("portal-key", "", "and its key") + portalProcs := flag.Int("portal-procs", 2, "(taken and ignored: the portal answers in this process)") + version := flag.Bool("version", false, "print the version and exit") + flag.Parse() + if *version { + fmt.Println(backend.Version) + return + } + if *stream != "sse" && *stream != "poll" { + fmt.Fprintln(os.Stderr, "dawnlined: -stream is sse or poll") + os.Exit(2) + } + + say := logger() + ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT) + defer stop() + + say("dawnlined %s started · pages follow by %s", backend.Version, *stream) + o := daemon.Options{Socket: *socket, RunDir: *run, DataDir: *data, Config: *config, Stream: *stream, Watch: true, Log: say} + if *portalPort > 0 { + o.Portal = &daemon.Portal{Port: *portalPort, HTTP: *portalHTTP, Cert: *portalCert, Key: *portalKey, Procs: *portalProcs} + } + daemon.Run(ctx, o) + say("dawnlined stopped") +} + +// logger writes to syslog as the ucode backend does (tag dawnline), or to +// stderr where there is none (a test stand). +func logger() func(format string, args ...any) { + w, err := syslog.New(syslog.LOG_DAEMON|syslog.LOG_INFO, "dawnline") + if err != nil { + return func(format string, args ...any) { fmt.Fprintf(os.Stderr, format+"\n", args...) } + } + return func(format string, args ...any) { w.Info(fmt.Sprintf(format, args...)) } +} diff --git a/backend/daemon/daemon.go b/backend/daemon/daemon.go new file mode 100644 index 0000000..086a353 --- /dev/null +++ b/backend/daemon/daemon.go @@ -0,0 +1,708 @@ +// Package daemon is the running backend: it joins the parts and keeps them +// going until it is told to stop. cmd/dawnlined gives it the router's paths; +// a test gives it a stand's. +package daemon + +import ( + "context" + "fmt" + "net/http" + "os" + "os/exec" + "sync" + "syscall" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/api" + "github.com/tickcount/luci-app-dawnline/backend/apply" + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/bridge" + minute "github.com/tickcount/luci-app-dawnline/backend/chores" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/geo" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/methods" + "github.com/tickcount/luci-app-dawnline/backend/migrate" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/portal" + "github.com/tickcount/luci-app-dawnline/backend/resolve" + "github.com/tickcount/luci-app-dawnline/backend/roster" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/ubus" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/watch" + "github.com/tickcount/luci-app-dawnline/backend/watchdog" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// Options is where the backend finds the router. +type Options struct { + // Socket is ubusd's. + Socket string + // RunDir holds runtime state (tmpfs), DataDir kept state (flash), Config the settings file. + RunDir, DataDir, Config string + // Stream is how pages follow: "sse" or "poll" (api.Info). + Stream string + // Watch: the backend looks at the tunnels and keeps the router to the settings (always, on a router; a + // test stand that only wants the bus and the stream leaves it off). + Watch bool + // Tunnels reads the tunnels the watcher looks at; nil: the router's own (awg.System). A test stand's are + // in its hands. + Tunnels *awg.Reader + // Portal: the backend serves the personal portal itself (package portal); nil: its own web server does. + Portal *Portal + // Log gets the lines for the system log. + Log func(format string, args ...any) +} + +// Portal is what the portal's web server runs with (the init script works it out). +type Portal struct { + // Port is the HTTPS port, HTTP the plain one beside it (0: none); Cert and Key the certificate's files. + Port, HTTP int + Cert, Key string + // Procs is how many of the ucode portal run at once. + Procs int +} + +// Run works until ctx ends, then waits for its parts. +func Run(ctx context.Context, o Options) { + // The router's zone, before anything counts a day in it (OpenWrt keeps it where Go does not look). + zone.Load(zone.File) + h := hub.New() + audience := api.NewAudience() + var b *bridge.Bridge + // The watcher, when this backend runs it: what the methods it answers itself read. + var w *watch.Watcher + var more []ubus.Method + nets := &homes{} + // the portal's own answers, where this backend keeps the router (set with the watcher) + var native http.Handler + // set when the watcher runs: the topics Go makes itself, told again as the router is at that moment + // (after a change of the settings) + var publish func() + if o.Watch { + tunnels := awg.System() + if o.Tunnels != nil { + tunnels = *o.Tunnels + } + w = &watch.Watcher{ + Config: o.Config, RunDir: o.RunDir, DataDir: o.DataDir, + DHCP: "/etc/config/dhcp", Leases: "/tmp/dhcp.leases", Zone: zone.File, + Tunnels: tunnels, Hub: h, Audience: audience, Log: o.Log, + } + names := &resolve.Resolver{} + // The router is this backend's to keep: its own apply, sync, keeper, chores and watchdog. One file gives + // all of it back to the ucode backend, for as long as that one is still shipped: /etc/dawnline/backend-off + // (the init script then starts this process without its watcher, and the agent does the work). + mine := func() bool { + _, err := os.Stat(o.DataDir + "/backend-off") + return err != nil + } + logs := &servicelog.Log{RunDir: o.RunDir, Level: func() string { + if world := w.World(); world != nil { + return world.M.Settings.LogLevel + } + return "info" + }} + started(o, logs) + defer ended(o, logs) + syncer := &apply.Router{RunDir: o.RunDir, HostsFile: "/tmp/hosts/dawnline", DHCP: "/etc/config/dhcp", Log: logs, + Network: "/etc/config/network", Firewall: "/etc/config/firewall", + Remember: func(address string) { + (store.Store{Config: o.Config, RunDir: o.RunDir}).Transact(func(c *uci.Config, _ *model.Model) error { + if c.Section("settings") == nil { + c.Add("settings", "settings") + } + c.Set("settings", "lan_address", address) + return nil + }) + }, + Snapshot: func() *netview.Snapshot { return netview.Take(netview.System(nets.logical)) }, + Exec: func(name string, args ...string) (string, int) { + out, err := exec.Command(name, args...).CombinedOutput() + if err == nil { + return string(out), 0 + } + if ee, isExit := err.(*exec.ExitError); isExit { + return string(out), ee.ExitCode() + } + return string(out), 127 + }} + // The keeper: once a minute, unless the router is given back to the ucode backend (mine), the runtime + // sync, the home-like path's upkeep and the watch on the router's networks. The ucode agent leaves + // those steps alone while this process is alive (its beat). + keeper := &apply.Keeper{R: syncer, Config: o.Config, Words: i18n.Use(i18n.Dir, ""), + Load: func() (*model.Model, string, error) { + c, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read() + if err != nil { + return nil, "", err + } + saved := "" + if s := c.Section("settings"); s != nil { + saved, _ = s.Get("lan_address") + } + return m, saved, nil + }, + Usage: func() *usage.Usage { + if world := w.World(); world != nil { + return world.Usage + } + return nil + }, + Dump: func() (map[string]awg.Peer, map[string]string) { + if world := w.World(); world != nil { + return world.Peers, world.Reads + } + return nil, nil + }, + Tools: func() bool { + _, tool := os.Stat("/usr/bin/awg") + _, proto := os.Stat("/lib/netifd/proto/amneziawg.sh") + return tool == nil && proto == nil + }, + Caps: func() awg.Caps { return awg.SystemCaps(o.DataDir) }} + // The other things done once a minute (package chores), with the same marker: what happens to people on + // its own goes to the activity log, and their pages are told. + var chores struct { + deps methods.Deps + run *minute.Chores + } + chores.run = &minute.Chores{RunDir: o.RunDir, DataDir: o.DataDir, Config: o.Config, Log: logs, + PortalCert: func(s model.Settings) (string, bool) { return methods.PortalCert(s, o.DataDir) }, + WanAddress: func(srv *model.Server) string { return netview.Take(netview.System(nets.logical)).WanAddress(srv) }, + Backup: func(kind string) (string, error) { return methods.BackupCreate(chores.deps, kind) }, + Reload: func() { + cmd := exec.Command("sh", "-c", "/etc/init.d/dawnline reload >/dev/null 2>&1") + cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + cmd.Start() + }, + Updating: func() bool { return methods.Updating(o.RunDir) }, + Update: func() { + exec.Command("start-stop-daemon", "-S", "-b", "-x", "/usr/libexec/dawnline/updater", "--", "auto").Run() + }} + // The places for the map: lookups run by themselves, a few at a time; what they find goes onto the + // connections logged before it was known, and those people's pages are told. + poke := func(people []string) { + if len(people) == 0 { + return + } + var waiting []string + files.ReadJSON(o.RunDir+"/presence.poke", &waiting) + files.WriteJSON(o.RunDir+"/presence.poke", append(waiting, people...), 0o600) + } + places := &geo.Locator{Store: geo.Store{Run: o.RunDir, Data: o.DataDir}, Get: geo.HTTP, + Usage: func() *usage.Usage { + if world := w.World(); world != nil { + return world.Usage + } + return nil + }, + Found: func(where map[string]string, devices []string) { + journal.Log{Run: o.RunDir, Data: o.DataDir}.SetPlaces(where, time.Now().Unix()-3600) + world := w.World() + if world == nil { + return + } + var people []string + for _, id := range devices { + if d := world.M.Devices[id]; d != nil { + people = append(people, d.Person) + } + } + poke(people) + }} + chores.run.FlushPlaces = func() { places.Store.Flush() } + go func() { + // the addresses the watcher saw connect or move: located at once + for { + time.Sleep(time.Second) + if !mine() { + continue + } + var ips []string + if !files.ReadJSON(o.RunDir+"/geo.poke", &ips) { + continue + } + os.Remove(o.RunDir + "/geo.poke") + if world := w.World(); world != nil && world.M.Settings.GeoEnabled { + places.Ask(world.M.Settings.GeoProvider, ips, nil) + } + } + }() + others := func() { + world := w.World() + if world == nil { + return + } + _, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read() + if err != nil { + return + } + events := chores.run.Tick(m, world.Usage) + wan := "" + if st := chores.deps.Bus; st != nil { + list, _ := st("network.interface.wan", "status", nil)["ipv4-address"].([]any) + if len(list) > 0 { + first, _ := list[0].(map[string]any) + wan, _ = first["address"].(string) + } + } + places.Minute(m.Settings.GeoEnabled, m.Settings.GeoProvider, wan) + if len(events) == 0 { + return + } + log := journal.Log{Run: o.RunDir, Data: o.DataDir} + if err := log.Add(events, journal.PolicyOf(m.Settings.Retention), journal.NamesOf(m), time.Now().Unix()); err != nil { + logs.Say("error", "chores", "the activity log was not written · "+err.Error()) + } + // the watcher moves these people's revisions with its next look, so their pages follow + var people []string + for _, e := range events { + if p, _ := e["person"].(string); p != "" { + people = append(people, p) + } + } + poke(people) + } + go func() { + // the first look once the watcher has its own, then every minute + for wait := 15 * time.Second; ; wait = time.Minute { + time.Sleep(wait) + if mine() { + beatNow(o) + keeper.Tick() + others() + // the watchdog: what keeps people connected, looked at and repaired + func() { + defer func() { + if e := recover(); e != nil { + logs.Say("error", "watchdog", fmt.Sprint(e)) + } + }() + m, _, err := keeper.Load() + if err != nil { + return + } + facts := methods.WatchdogFacts(chores.deps, m, syncer, func() { + if world := w.World(); world != nil { + syncer.Apply(keeper.Load, world.Usage, keeper.Words, keeper.Tools(), keeper.Caps()) + } + }) + watchdog.Pass(o.RunDir+"/watchdog.json", watchdog.Probes(m, facts), m.Settings.Watchdog, methods.Updating(o.RunDir), time.Now().Unix(), logs) + }() + } + } + }() + deps := methods.Deps{World: func() *view.World { return roster.Complete(w.World(), nets.of, o.DataDir) }, Events: func() []map[string]any { return w.Recent(0) }, Catalogs: i18n.Dir, + Home: func(srv *model.Server, p *model.Person) []string { return nets.of(srv, p) }, HostIP: names.HostIP, RunDir: o.RunDir, DataDir: o.DataDir, Config: o.Config, Addresses: nets.addresses, + Snapshot: func() *netview.Snapshot { return netview.Take(netview.System(nets.logical)) }, + Handler: nets.handler, + Resolve: names.Addresses, + ResetUsage: w.ResetUsage, + Teardown: func(m *model.Model) { + syncer.Teardown(m) + migrate.Router{Store: store.Store{Config: o.Config, RunDir: o.RunDir}, Uhttpd: "/etc/config/uhttpd", CGI: "/www/cgi-bin/dawnline-portal", Log: logs, + ReloadUhttpd: func() { exec.Command("/etc/init.d/uhttpd", "reload").Run() }}.UhttpdOnly() + // the agent's heartbeat check + exec.Command("sh", "-c", "grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root && { sed -i '\\#/usr/libexec/dawnline/heartbeat#d' /etc/crontabs/root; /etc/init.d/cron restart >/dev/null 2>&1; }").Run() + }, + // after the answer is out: this process is one of the service's own + Stop: func() { + cmd := exec.Command("sh", "-c", "sleep 1; /etc/init.d/dawnline stop >/dev/null 2>&1; /etc/init.d/dawnline disable >/dev/null 2>&1") + cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + cmd.Start() + }, + ApplyPlan: func() any { + c, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read() + if err != nil { + return nil + } + saved := "" + if s := c.Section("settings"); s != nil { + saved, _ = s.Get("lan_address") + } + _, tool := os.Stat("/usr/bin/awg") + _, proto := os.Stat("/lib/netifd/proto/amneziawg.sh") + return syncer.ApplyPlan(m, saved, tool == nil && proto == nil, awg.SystemCaps(o.DataDir)) + }, + SyncPlan: func() any { + world := w.World() + _, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read() + if world == nil || err != nil { + return nil + } + return syncer.Plan(m, world.Usage, time.Now().Unix()) + }, + Background: func(script string) { + cmd := exec.Command("sh", "-c", "( "+script+" ) >/dev/null 2>&1 /dev/null 2>&1") + cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + cmd.Start() + }, + // the full apply + Apply: func(lang string) map[string]any { + // Go's own full apply (unless the router is given back to ucode): the one-time steps, + // then network, firewall, the home-like path, the resolver, the reply table and the sync + if mine() { + if world := w.World(); world != nil { + st := store.Store{Config: o.Config, RunDir: o.RunDir} + migrate.Router{Store: st, NewCode: methods.NewCode, Uhttpd: "/etc/config/uhttpd", CGI: "/www/cgi-bin/dawnline-portal", Log: logs, + ReloadUhttpd: func() { exec.Command("/etc/init.d/uhttpd", "reload").Run() }}.Run() + _, tool := os.Stat("/usr/bin/awg") + _, proto := os.Stat("/lib/netifd/proto/amneziawg.sh") + full := syncer.Apply(func() (*model.Model, string, error) { + c, m, err := st.Read() + if err != nil { + return nil, "", err + } + saved := "" + if s := c.Section("settings"); s != nil { + saved, _ = s.Get("lan_address") + } + return m, saved, nil + }, world.Usage, i18n.Use(i18n.Dir, lang), tool == nil && proto == nil, awg.SystemCaps(o.DataDir)) + out := map[string]any{"network": full.Network, "firewall": full.Firewall, "like_home": full.LikeHome, "peers": full.Peers, "warning": nil} + if full.Warning != "" { + out["warning"] = full.Warning + } + return out + } + } + // switched off while it runs (/etc/dawnline/backend-off without a restart): the ucode backend's + // own service applies when it starts + return map[string]any{"warning": "The change is saved. Dawnline's backend is switched off: restart the service to put it into effect (/etc/init.d/dawnline restart)."} + }, + // after the answer is out: the reload may restart this very process (its portal's port is in its arguments) + Reload: func() { + cmd := exec.Command("sh", "-c", "sleep 1; /etc/init.d/dawnline reload >/dev/null 2>&1") + cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + cmd.Start() + }, + AWG: func() map[string]any { return roster.AwgState(nets.handler) }, + Store: &store.Store{Config: o.Config, RunDir: o.RunDir}, + Told: func() { + if publish != nil { + publish() + } + }, + // the runtime sync, and its warning for the admin + Sync: func(lang string) any { + // Go's own sync (unless the router is given back to ucode): the access sets, the devices + // into the tunnels and the hostnames, with no call to ucode + if mine() { + if world := w.World(); world != nil { + if _, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read(); err == nil { + res := syncer.Sync(m, world.Usage, time.Now().Unix(), false, i18n.Use(i18n.Dir, lang)) + if res.Warning == "" { + return nil + } + return res.Warning + } + } + } + return "The change is saved. Dawnline's backend is switched off: restart the service to put it into effect (/etc/init.d/dawnline restart)." + }, + Log: &servicelog.Log{RunDir: o.RunDir, Level: func() string { + if world := w.World(); world != nil { + return world.M.Settings.LogLevel + } + return "info" + }}, + RouterWAN: nets.routerWAN, + Bus: func(object, method string, args map[string]any) map[string]any { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := nets.bus.Call(ctx, object, method, args) + if err != nil { + return nil + } + return res + }, + WANOf: nets.wanOf, + GitHub: &github.Client{RunDir: o.RunDir}, + Board: func() map[string]any { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, _ := nets.bus.Call(ctx, "system", "board", nil) + return res + }} + more = methods.List(deps) + chores.deps = deps + native = methods.PortalHandler(deps, true) + } + object := api.Object(h, audience, api.Info{Version: backend.Version, Stream: o.Stream, Refresh: func(ctx context.Context) { b.Look(ctx) }, More: more}) + bus := ubus.NewBus(o.Socket, object) + bus.Log = o.Log + b = bridge.New(bridge.Bridge{ + Hub: h, Audience: audience, Log: o.Log, + // what the topics are made of besides what the watcher tells of itself: the settings, the + // configurations handed out, the servers kept down, the places found + Watch: []string{o.Config, o.DataDir + "/issued.json", o.RunDir + "/netifd-blocked.json", o.RunDir + "/geo.json"}, + }) + run := []func(){ + func() { bus.Run(ctx) }, + func() { api.Broadcast(ctx, h, bus, object) }, + func() { b.Run(ctx) }, + } + if o.Watch { + run = append(run, func() { w.Run(ctx) }) + // The people as Go makes them, held against each status ucode answers (package roster). + nets.bus = bus + ro := &roster.Roster{World: w.World, Home: nets.of, DataDir: o.DataDir, RunDir: o.RunDir, Hub: h, Log: o.Log, Keyed: bridge.Split, Recent: w.Recent, Own: nets.own, Iface: nets.ifaceState, Homes: nets.serverHomes, Handler: nets.handler, WAN: nets.routerWAN} + // The topics as the router is now: the watcher looks first, so what is told is never what it knew a + // second ago. Without that look a page that asked in the backend's first second was told nothing + // until Refresh (the watcher had no world yet), and settings changed on disk were told as they were + // before (the bridge's second comes before the watcher's). + tell := func() bool { + w.Look() + return ro.Publish() + } + publish = func() { tell() } + // told again when the settings change, when somebody starts to look, and with the minute + b.Tell = tell + // the moment the watcher saw someone come, go or move, the pages have Go's own people + w.Changed = func() { go ro.Publish() } + } + if p := o.Portal; p != nil { + bell := &portal.Bell{} + srv := &portal.Server{ + TLS: []string{fmt.Sprintf(":%d", p.Port)}, Cert: p.Cert, Key: p.Key, + People: &portal.Settings{Path: o.Config}, Bell: bell, Log: o.Log, + // the portal's answers (methods.Portal) + Native: native, + } + if p.HTTP > 0 { + srv.Plain = []string{fmt.Sprintf(":%d", p.HTTP)} + } + run = append(run, func() { srv.Run(ctx) }, func() { portal.Watch(ctx, bell, o.RunDir, o.DataDir, o.Config) }) + } + var parts sync.WaitGroup + for _, part := range run { + parts.Add(1) + go func() { + defer parts.Done() + part() + }() + } + parts.Wait() +} + +// homes answers which home networks a person reaches, from a look at the router's interfaces that is kept +// for a few seconds (every person of a status asks). +type homes struct { + bus *ubus.Bus + mu sync.Mutex + snap *netview.Snapshot + at time.Time +} + +func (h *homes) of(srv *model.Server, p *model.Person) []string { + h.mu.Lock() + defer h.mu.Unlock() + if h.snap == nil || time.Since(h.at) > 5*time.Second { + h.snap = netview.Take(netview.System(h.logical)) + h.at = time.Now() + } + return h.snap.PersonHome(srv, p) +} + +// own is the router's own public-side addresses: each server's WAN address, and the wan interface's. +func (h *homes) own(m *model.Model) map[string]bool { + h.mu.Lock() + if h.snap == nil || time.Since(h.at) > 5*time.Second { + h.snap = netview.Take(netview.System(h.logical)) + h.at = time.Now() + } + snap := h.snap + h.mu.Unlock() + out := map[string]bool{} + for _, srv := range m.Servers { + a := snap.WanAddress(srv) + if a == "" { + a = h.ifaceAddr(srv.WanZone) + } + if a != "" { + out[a] = true + } + } + if a := h.ifaceAddr("wan"); a != "" { + out[a] = true + } + return out +} + +// addresses is every IPv4 address of netifd's interfaces, in its order. +func (h *homes) addresses() []methods.Address { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := h.bus.Call(ctx, "network.interface", "dump", nil) + if err != nil { + return nil + } + var out []methods.Address + list, _ := res["interface"].([]any) + for _, i := range list { + m, _ := i.(map[string]any) + name, _ := m["interface"].(string) + addrs, _ := m["ipv4-address"].([]any) + for _, a := range addrs { + am, _ := a.(map[string]any) + out = append(out, methods.Address{Iface: name, CIDR: fmt.Sprintf("%v/%v", am["address"], am["mask"])}) + } + } + return out +} + +// wanOf is the IPv4 address of a server's WAN (its interface's, else its zone's netifd interface's); of +// netifd's wan for no server. +func (h *homes) wanOf(srv *model.Server) string { + if srv == nil { + return h.ifaceAddr("wan") + } + if a := netview.Take(netview.System(h.logical)).WanAddress(srv); a != "" { + return a + } + return h.ifaceAddr(srv.WanZone) +} + +// handler tells whether netifd lists the amneziawg protocol. +func (h *homes) handler() bool { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := h.bus.Call(ctx, "network", "get_proto_handlers", nil) + _, has := res["amneziawg"] + return err == nil && has +} + +// routerWAN is the router's WAN address: the first server's with keys, else its zone's interface's. +func (h *homes) routerWAN(m *model.Model) string { + h.mu.Lock() + if h.snap == nil || time.Since(h.at) > 5*time.Second { + h.snap = netview.Take(netview.System(h.logical)) + h.at = time.Now() + } + snap := h.snap + h.mu.Unlock() + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + if srv.PrivateKey == "" { + continue + } + if a := snap.WanAddress(srv); a != "" { + return a + } + if a := h.ifaceAddr(srv.WanZone); a != "" { + return a + } + } + return h.ifaceAddr("wan") +} + +// ifaceState is whether a netifd interface is up, and for how long. +func (h *homes) ifaceState(name string) (bool, int64) { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := h.bus.Call(ctx, "network.interface."+name, "status", nil) + if err != nil { + return false, 0 + } + up, _ := res["up"].(bool) + var uptime int64 + switch n := res["uptime"].(type) { + case int64: + uptime = n + case int32: + uptime = int64(n) + case float64: + uptime = int64(n) + case int: + uptime = int64(n) + } + return up, uptime +} + +// serverHomes is a server's home interfaces with what each reaches. +func (h *homes) serverHomes(srv *model.Server) []view.HomeNet { + h.mu.Lock() + defer h.mu.Unlock() + if h.snap == nil || time.Since(h.at) > 5*time.Second { + h.snap = netview.Take(netview.System(h.logical)) + h.at = time.Now() + } + home, _ := h.snap.ServerHome(srv) + out := []view.HomeNet{} + for _, x := range home { + out = append(out, view.HomeNet{Dev: x.Dev, Nets: x.Nets}) + } + return out +} + +// ifaceAddr is a netifd interface's first IPv4 address, or "". +func (h *homes) ifaceAddr(name string) string { + if name == "" { + return "" + } + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := h.bus.Call(ctx, "network.interface."+name, "status", nil) + if err != nil { + return "" + } + list, _ := res["ipv4-address"].([]any) + if len(list) == 0 { + return "" + } + first, _ := list[0].(map[string]any) + a, _ := first["address"].(string) + return a +} + +// logical asks netifd which interface stands on which device. +func (h *homes) logical() map[string]netview.Logical { + out := map[string]netview.Logical{} + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + res, err := h.bus.Call(ctx, "network.interface", "dump", nil) + if err != nil { + return out + } + list, _ := res["interface"].([]any) + for _, i := range list { + m, _ := i.(map[string]any) + dev, _ := m["l3_device"].(string) + if dev == "" { + dev, _ = m["device"].(string) + } + if _, seen := out[dev]; dev == "" || seen { + continue + } + name, _ := m["interface"].(string) + proto, _ := m["proto"].(string) + out[dev] = netview.Logical{Name: name, Proto: proto} + } + return out +} diff --git a/backend/daemon/e2e_test.go b/backend/daemon/e2e_test.go new file mode 100644 index 0000000..defa5f6 --- /dev/null +++ b/backend/daemon/e2e_test.go @@ -0,0 +1,368 @@ +//go:build e2e + +// The whole path a page takes, on a real OpenWrt userland: uhttpd's /ubus, +// rpcd's sessions and access lists (the package's own ACL file), ubusd and the +// backend with its own watcher and topics, over a stand's settings and tunnel. +// scripts/backend-container.sh starts the daemons and runs this. +package daemon + +import ( + "bufio" + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + "os" + "os/exec" + "path/filepath" + "reflect" + "strings" + "sync" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/ubus" +) + +const web = "http://127.0.0.1:8099/ubus" + +// rpc is a JSON-RPC call through uhttpd, as LuCI's rpc.js makes it. It +// returns ubus's status and the answer. +func rpc(t *testing.T, sid, object, method string, args map[string]any) (int, map[string]any) { + t.Helper() + body, _ := json.Marshal(map[string]any{"jsonrpc": "2.0", "id": 1, "method": "call", "params": []any{sid, object, method, args}}) + res, err := http.Post(web, "application/json", bytes.NewReader(body)) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + var out struct { + Result []json.RawMessage + Error *struct { + Code int + Message string + } + } + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Fatal(err) + } + if out.Error != nil { + return out.Error.Code, nil + } + var code int + json.Unmarshal(out.Result[0], &code) + var data map[string]any + if len(out.Result) > 1 { + json.Unmarshal(out.Result[1], &data) + } + return code, data +} + +func at(v any, path ...string) any { + for _, k := range path { + m, _ := v.(map[string]any) + v = m[k] + } + return v +} + +// The stand's settings: one server, one person, one device. +const ( + standServerKey = "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=" + standServerPub = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=" + standDeviceKey = "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" +) + +func standSettings(person string) string { + return ` +config settings 'settings' +config server 's1' + option name 'Home' + option ifname 'dawn0' + option subnet '10.77.0.0/24' + option private_key '` + standServerKey + `' + option public_key '` + standServerPub + `' +config person 'p1' + option server 's1' + option name '` + person + `' +config device 'd1' + option person 'p1' + option name 'Phone' + option kind 'phone' + option address '10.77.0.2' + option public_key '` + standDeviceKey + `' +` +} + +// tunnel is the stand's one tunnel: its device is there, with the handshake the test gave it. +type tunnel struct { + mu sync.Mutex + handshake int64 +} + +func (tn *tunnel) reader() *awg.Reader { + return &awg.Reader{ + // as `awg show dump` prints: the interface's line, then a peer a line + Show: func(string) (string, bool) { + tn.mu.Lock() + defer tn.mu.Unlock() + return standServerKey + "\t" + standServerPub + "\t4500\toff\n" + + fmt.Sprintf("%s\t(none)\t203.0.113.7:41821\t10.77.0.2/32\t%d\t0\t0\toff\n", standDeviceKey, tn.handshake), true + }, + Index: func(string) (int, bool) { return 7, true }, + } +} + +func (tn *tunnel) shake(at int64) { + tn.mu.Lock() + tn.handshake = at + tn.mu.Unlock() +} + +// follow asks with wait until the documents satisfy `done`, taking the events into them, and returns the +// number the page is at and the events of the last answer. The topics are the page's whole snapshot. +func follow(t *testing.T, sid, epoch string, seq float64, docs map[string]any, topics []any, what string, done func() bool) (float64, []any) { + t.Helper() + deadline := time.Now().Add(25 * time.Second) + for { + args := map[string]any{"epoch": epoch, "seq": seq, "timeout": 10} + if topics != nil { + args["topics"] = topics + } + code, got := rpc(t, sid, "dawnline", "wait", args) + events, _ := got["events"].([]any) + if code != 0 || got["docs"] != nil || (len(events) == 0 && time.Now().After(deadline)) { + t.Fatalf("wait for %s: %d %v", what, code, got) + } + take(docs, events) + seq = got["seq"].(float64) + if done() { + return seq, events + } + } +} + +// take applies events to a page's documents, as a page does. +func take(docs map[string]any, events []any) { + for _, e := range events { + topic, _ := at(e, "topic").(string) + switch at(e, "op") { + case "put": + docs[topic] = at(e, "data") + case "patch": + docs[topic] = hub.Merge(docs[topic], at(e, "data")) + } + } +} + +func TestThroughUhttpd(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + dir := t.TempDir() + config := filepath.Join(dir, "config") + settings := func(person string) { + if err := os.WriteFile(config, []byte(standSettings(person)), 0o600); err != nil { + t.Fatal(err) + } + } + settings("Myata") + // The stand is no router to keep: the minute's work (the access rules, the watchdog) stays away, the + // watcher and the topics are the backend's own. + if err := os.WriteFile(filepath.Join(dir, "backend-off"), nil, 0o600); err != nil { + t.Fatal(err) + } + // A backend that was restarted: its earlier run left who was online, and nobody came or went since, so + // the watcher's first look finds nothing to tell of by itself. + run := filepath.Join(dir, "run") + os.MkdirAll(run, 0o755) + if err := os.WriteFile(filepath.Join(run, "presence.json"), []byte(`{"online":{"d1":false},"endpoint":{"d1":"203.0.113.7"},"rev":1,"people":{"p1":1}}`), 0o600); err != nil { + t.Fatal(err) + } + tn := &tunnel{} + began := time.Now() + // The backend is stopped, and has stopped, before the test ends: it writes into the stand's folders (its beat, + // its presence) and logs through t, and a test that ended under it failed at removing a folder still written to. + stopped := make(chan struct{}) + go func() { + defer close(stopped) + Run(ctx, Options{Socket: ubus.Socket, RunDir: run, DataDir: dir, Config: config, Stream: "sse", Watch: true, Tunnels: tn.reader(), Log: t.Logf}) + }() + defer func() { + cancel() + select { + case <-stopped: + case <-time.After(10 * time.Second): + t.Error("the backend did not stop") + } + }() + for exec.CommandContext(ctx, "ubus", "list", "dawnline").Run() != nil { + if ctx.Err() != nil { + t.Fatal("the object never appeared on the bus") + } + time.Sleep(20 * time.Millisecond) + } + + // Without a session rpcd refuses; with one, the read ACL lets the page in. + if code, _ := rpc(t, "00000000000000000000000000000000", "dawnline", "hello", nil); code == 0 { + t.Fatal("answered without a session") + } + code, login := rpc(t, "00000000000000000000000000000000", "session", "login", map[string]any{"username": "root", "password": ""}) + if code != 0 { + t.Fatalf("login: %d", code) + } + sid := login["ubus_rpc_session"].(string) + + code, hello := rpc(t, sid, "dawnline", "hello", map[string]any{}) + if code != 0 || hello["stream"] != "sse" || hello["epoch"] == "" { + t.Fatalf("hello: %d %v", code, hello) + } + + // A page that was open while the backend restarted asks at once, before the watcher's first look: its + // first question starts the bridge, and the documents come with the bridge's next second. (They once + // came only with the next Refresh, half a minute later: the bridge took topics nobody could make yet + // for told.) + asked := time.Now() + code, snap := rpc(t, sid, "dawnline", "sync", map[string]any{}) + if code != 0 { + t.Fatalf("sync: %d", code) + } + epoch, seq := snap["epoch"].(string), snap["seq"].(float64) + docs, _ := snap["docs"].(map[string]any) + if docs == nil { + docs = map[string]any{} + } + whole := func() bool { + return at(docs, "people", "items", "p1", "name") == "Myata" && at(docs, "servers", "items", "s1") != nil && at(docs, "backend", "ok") == true + } + if !whole() { + seq, _ = follow(t, sid, epoch, seq, docs, nil, "the first documents", whole) + } + took := time.Since(asked) + t.Logf("the page asked %v after the backend started and had its first documents %v later", asked.Sub(began).Round(time.Millisecond), took.Round(time.Millisecond)) + if took > 3*time.Second { + t.Fatalf("the first documents took %v", took) + } + if at(docs, "people", "items", "p1", "devices", "items", "d1", "online") != false || at(docs, "servers", "order").([]any)[0] != "s1" { + t.Fatalf("documents: %v", docs) + } + + // An event stream, as a page opens it; on a web server that cannot hold one this part is skipped. + stream, lines := openStream(t, ctx, sid) + + // A device comes online: the long poll returns with a patch that says so, and not the people whole. + online := func() bool { return at(docs, "people", "items", "p1", "devices", "items", "d1", "online") == true } + type result struct { + seq float64 + events []any + } + waited := make(chan result, 1) + go func() { + s, events := follow(t, sid, epoch, seq, docs, []any{"people"}, "the device to come online", online) + waited <- result{s, events} + }() + time.Sleep(300 * time.Millisecond) + changed := time.Now() + tn.shake(time.Now().Unix()) + var r result + select { + case r = <-waited: + case <-time.After(40 * time.Second): + t.Fatal("the device never came online for the page") + } + var patch any + for _, e := range r.events { + if at(e, "op") == "patch" && at(e, "data", "items", "p1", "devices", "items", "d1", "online") == true { + patch = e + } + } + if patch == nil || at(patch, "data", "items", "p1", "name") != nil || at(patch, "data", "order") != nil { + t.Fatalf("patch: %v", r.events) + } + t.Logf("a device that came online reached the page %v later, as %d bytes", time.Since(changed).Round(time.Millisecond), len(fmt.Sprint(at(patch, "data")))) + + if stream { + // The same event came down the stream, with the same number. + deadline := time.After(10 * time.Second) + for found := false; !found; { + select { + case l := <-lines: + var e map[string]any + if strings.HasPrefix(l, "data: ") && json.Unmarshal([]byte(l[6:]), &e) == nil && e["seq"] == at(patch, "seq") { + if e["topic"] != "people" || e["op"] != "patch" || e["epoch"] != epoch || !reflect.DeepEqual(e["data"], at(patch, "data")) { + t.Fatalf("the stream's event differs: %v", e) + } + found = true + } + case <-deadline: + t.Fatal("the event never came down the stream") + } + } + } + + // The meter's points come as they are made, to a page that names it. + if code, _ := rpc(t, sid, "dawnline", "watch", map[string]any{"topics": []any{"meter"}}); code != 0 { + t.Fatalf("watch: %d", code) + } + code, got := rpc(t, sid, "dawnline", "wait", map[string]any{"epoch": epoch, "seq": r.seq, "topics": []any{"meter"}, "timeout": 10}) + events, _ := got["events"].([]any) + appended := false + for _, e := range events { + appended = appended || at(e, "op") == "append" + } + if code != 0 || !appended { + t.Fatalf("meter: %d %v", code, got) + } + + // A page reads its own edit: once refresh answers, the stream holds what is on disk, with no waiting + // for the watcher's second. + settings("Mint") + code, stands := rpc(t, sid, "dawnline", "refresh", map[string]any{}) + if code != 0 || stands["epoch"] != epoch { + t.Fatalf("refresh: %d %v", code, stands) + } + code, got = rpc(t, sid, "dawnline", "sync", map[string]any{"epoch": epoch, "seq": r.seq, "topics": []any{"people"}}) + events, _ = got["events"].([]any) + take(docs, events) + if code != 0 || at(docs, "people", "items", "p1", "name") != "Mint" || got["seq"].(float64) < stands["seq"].(float64) { + t.Fatalf("after refresh: %d %v (the stream stands at %v)", code, got, stands["seq"]) + } + + // Arguments are checked at the door. + if code, _ := rpc(t, sid, "dawnline", "sync", map[string]any{"seq": -1}); code != int(ubus.StatusInvalidArgument) { + t.Fatalf("a negative number was accepted: %d", code) + } + if code, _ := rpc(t, sid, "dawnline", "sync", map[string]any{"topics": "people"}); code != int(ubus.StatusInvalidArgument) { + t.Fatalf("topics that are no list were accepted: %d", code) + } +} + +// openStream subscribes through uhttpd and returns the stream's lines. +func openStream(t *testing.T, ctx context.Context, sid string) (bool, <-chan string) { + req, _ := http.NewRequestWithContext(ctx, "GET", web+"/subscribe/dawnline", nil) + req.Header.Set("Authorization", "Bearer "+sid) + res, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatal(err) + } + if ct := res.Header.Get("Content-Type"); !strings.HasPrefix(ct, "text/event-stream") { + t.Logf("no event stream from this web server (%s): %s", res.Status, ct) + res.Body.Close() + return false, nil + } + lines := make(chan string, 64) + go func() { + defer res.Body.Close() + sc := bufio.NewScanner(res.Body) + sc.Buffer(make([]byte, 0, 64<<10), 2<<20) + for sc.Scan() { + select { + case lines <- sc.Text(): + default: + } + } + }() + return true, lines +} diff --git a/backend/daemon/life.go b/backend/daemon/life.go new file mode 100644 index 0000000..2d36610 --- /dev/null +++ b/backend/daemon/life.go @@ -0,0 +1,93 @@ +package daemon + +import ( + "fmt" + "os" + "os/exec" + "strconv" + "strings" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/geo" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/updater" +) + +// The beat is the time of the backend's last minute: the Health page calls it fine while it is fresh, and +// a beat left behind by a backend that is gone tells the next start that the last one did not end well. +const beatFile = "/agent.beat" + +func readTrim(path string) string { + raw, _ := os.ReadFile(path) + return strings.Trim(string(raw), " \t\r\n\v\f") +} + +// started says in the service log why this start: an update that was rolled back, a new version, a crash +// (the beat outlives a backend that died), a restart (the init script notes a stop), a boot, or a plain +// start. It also puts back the service log a reboot took from memory, and remembers the kernel an +// AmneziaWG module Dawnline did not install is for. +func started(o Options, logs *servicelog.Log) { + os.MkdirAll(o.RunDir, 0o755) + _, beat := os.Stat(o.RunDir + beatFile) + crashed := beat == nil + stopped, _ := strconv.ParseInt(readTrim(o.RunDir+"/agent.stopped"), 10, 64) + os.Remove(o.RunDir + "/agent.stopped") + was := readTrim(o.DataDir + "/version") + v := backend.Version + if was != v { + os.MkdirAll(o.DataDir, 0o700) + os.WriteFile(o.DataDir+"/version", []byte(v), 0o644) + } + // the service log lives in memory: after a reboot, what flash kept of it + if _, err := os.Stat(o.RunDir + "/service.log"); err != nil { + if raw, err := os.ReadFile(o.DataDir + "/service.log"); err == nil { + os.WriteFile(o.RunDir+"/service.log", raw, 0o600) + } + } + say := func(level, msg, detail string) { + logs.Write("dawnline", level, msg, detail, "Dawnline", servicelog.Extra{}) + } + rolled := readTrim(o.RunDir + "/update-rolled-back") + os.Remove(o.RunDir + "/update-rolled-back") + uptime := 0.0 + fmt.Sscan(readTrim("/proc/uptime"), &uptime) + switch { + // postupdate put this (kept) version back because the new one did not come up + case rolled != "": + say("error", fmt.Sprintf("update to %s failed its check - rolled back to %s", rolled, v), + "The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why.") + case was != "" && was != v: + say("up", fmt.Sprintf("updated · %s → %s", was, v), "") + case crashed: + // why, when syslog knows: procd, the kernel (out of memory, a fault) + why, _ := exec.Command("sh", "-c", `logread -l 400 2>/dev/null | grep -iE "kernel:.*(out of memory|killed process|oom-kill|segfault)|procd:.*dawnline|dawnlined" | tail -n 6`).Output() + say("repair", "stopped unexpectedly - started again", strings.Trim(string(why), " \t\r\n\v\f")) + case stopped != 0 && time.Now().Unix()-stopped < 300: + say("info", "restarted · version "+v, "") + case uptime < 600: + say("info", "started with the router · version "+v, "") + default: + say("info", "started · version "+v, "") + } + updater.Adopt(o.DataDir) + beatNow(o) +} + +func beatNow(o Options) { + os.WriteFile(o.RunDir+beatFile, []byte(strconv.FormatInt(time.Now().Unix(), 10)), 0o644) +} + +// ended is a clean stop: what lives in memory goes to flash (the activity log, the service log, the places +// found), and the beat goes, so the next start is not taken for a crash. The counters are the watcher's. +func ended(o Options, logs *servicelog.Log) { + now := time.Now().Unix() + if _, m, err := (store.Store{Config: o.Config, RunDir: o.RunDir}).Read(); err == nil { + journal.Log{Run: o.RunDir, Data: o.DataDir}.Persist(journal.PolicyOf(m.Settings.Retention), now) + } + logs.Trim(o.DataDir, true) + geo.Store{Run: o.RunDir, Data: o.DataDir}.Flush() + os.Remove(o.RunDir + beatFile) +} diff --git a/backend/disguise/disguise.go b/backend/disguise/disguise.go new file mode 100644 index 0000000..b601a62 --- /dev/null +++ b/backend/disguise/disguise.go @@ -0,0 +1,197 @@ +// Package disguise checks a server's disguise values (AmneziaWG's obfuscation) as dawnline.awg does. +// +// Unsafe is obf_unsafe: what AmneziaWG would refuse, crash on or break devices with. Its sentences are in +// English, as ucode writes them for a reader with no language; held to ucode's own output on made-up values +// (testdata/trace.uc, scripts/ucode-golden.sh). +package disguise + +import ( + "fmt" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" +) + +// Conf names a value as .conf files do (dawnline.awg OBF_CONF). +var Conf = map[string]string{ + "jc": "Jc", "jmin": "Jmin", "jmax": "Jmax", "s1": "S1", "s2": "S2", "s3": "S3", "s4": "S4", + "h1": "H1", "h2": "H2", "h3": "H3", "h4": "H4", "i1": "I1", "i2": "I2", "i3": "I3", "i4": "I4", "i5": "I5", + "header_protection_key": "HeaderProtectionKey", "content_padding_addition": "ContentPaddingAddition", + "rekey_after_time": "RekeyAfterTime", "rekey_timeout": "RekeyTimeout", "reject_after_time": "RejectAfterTime", + "keepalive_timeout": "KeepaliveTimeout", "max_handshake_attempts": "MaxHandshakeAttempts", + "random_trailers": "RandomTrailers", "disable_cookies": "DisableCookies", +} + +const space = " \t\r\n\v\f" + +// uint is a whole number in digits up to top; ok false for anything else. +func uint(s string, top int64) (int64, bool) { + if s == "" || len(s) > 10 { + return 0, false + } + var n int64 + for i := 0; i < len(s); i++ { + if s[i] < '0' || s[i] > '9' { + return 0, false + } + n = n*10 + int64(s[i]-'0') + } + return n, n <= top +} + +// span is a number or a range as AmneziaWG writes them ("5", "5-15"), each end up to top. +func span(v string, top int64) (lo, hi int64, ok bool) { + p := strings.Split(strings.Trim(v, space), "-") + if len(p) > 2 { + return 0, 0, false + } + if lo, ok = uint(p[0], top); !ok { + return 0, 0, false + } + hi = lo + if len(p) == 2 { + if hi, ok = uint(p[1], top); !ok { + return 0, 0, false + } + } + return lo, hi, lo <= hi +} + +// tagOK tells one tag of a signature packet both the kernel and amneziawg-go read. +func tagOK(tag string) bool { + if tag == "t" { + return true + } + key, val, found := strings.Cut(tag, " ") + if !found { + return false + } + switch key { + case "b": + return len(val) > 2 && len(val)%2 == 0 && val[:2] == "0x" && strings.TrimLeft(val[2:], "0123456789abcdefABCDEF") == "" + case "r", "rc", "rd": + n, ok := uint(val, 1000) + return ok && n >= 1 + } + return false +} + +// tagError is what is wrong with signature packet name holding s, or "". +func tagError(name, s string) string { + if strings.ContainsAny(s, "#\n\r") { + return name + " may not contain # or a line break." + } + for a := strings.Index(s, "<"); a >= 0; a = strings.Index(s, "<") { + b := strings.Index(s[a:], ">") + if b < 0 { + return name + " has a tag that is not closed with >." + } + tag := s[a+1 : a+b] + if !tagOK(tag) { + if len(tag) > 24 { + tag = tag[:24] + "…" + } + return fmt.Sprintf("%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", name, tag) + } + s = s[a+b+1:] + } + return "" +} + +// Unsafe lists what in disguise values o must never be handed to the kernel; empty when they are safe. +func Unsafe(o map[string]string) []string { + errs := []string{} + given := func(k string) bool { return o[k] != "" } + // a value not given counts as 0 + num := func(k string) (int64, bool) { + if !given(k) { + return 0, true + } + return uint(strings.Trim(o[k], space), 65535) + } + for _, k := range []string{"jc", "jmin", "jmax", "s1", "s2", "s3", "s4"} { + if _, ok := num(k); !ok { + errs = append(errs, Conf[k]+" must be a whole number from 0 to 65535.") + } + } + if given("jmin") && given("jmax") { + lo, ok1 := num("jmin") + hi, ok2 := num("jmax") + if ok1 && ok2 && lo > hi { + errs = append(errs, "Jmin must not be larger than Jmax.") + } + } + // packet types: a number or a range each, apart from the others; one not given keeps WireGuard's own + type rng struct { + lo, hi int64 + ok bool + } + var hs [4]rng + for i := 0; i < 4; i++ { + k := fmt.Sprintf("h%d", i+1) + hs[i] = rng{int64(i + 1), int64(i + 1), true} + if given(k) { + lo, hi, ok := span(o[k], 4294967295) + hs[i] = rng{lo, hi, ok} + if !ok { + errs = append(errs, Conf[k]+" must be a number or a range like 100-200, up to 4294967295.") + } + } + } + for i := 0; i < 4; i++ { + for j := i + 1; j < 4; j++ { + if hs[i].ok && hs[j].ok && hs[i].lo <= hs[j].hi && hs[j].lo <= hs[i].hi { + errs = append(errs, fmt.Sprintf("%s and %s overlap: each packet type needs values of its own.", Conf[fmt.Sprintf("h%d", i+1)], Conf[fmt.Sprintf("h%d", j+1)])) + } + } + } + // header protection: a 32-byte key, and every padding at least the 12 bytes of its nonce + if given("header_protection_key") { + if !awg.ValidKey(o["header_protection_key"]) { + errs = append(errs, "The header protection key is not a key.") + } + for _, k := range []string{"s1", "s2", "s3", "s4"} { + if n, ok := num(k); ok && n < 12 { + errs = append(errs, Conf[k]+" must be at least 12 with header protection.") + } + } + } + // 3.1 timers and counts: 0 alone is the kernel's default, a 0 in a range would fire at once + for _, k := range []string{"rekey_after_time", "rekey_timeout", "reject_after_time", "keepalive_timeout", "max_handshake_attempts"} { + var lo, hi int64 + ok := true + if given(k) { + lo, hi, ok = span(o[k], 65535) + } + if !ok || (lo == 0 && hi > 0) { + errs = append(errs, Conf[k]+" must be a number or a range like 5-15, from 1 to 65535.") + } else if k == "reject_after_time" && hi > 180 { + errs = append(errs, "RejectAfterTime must be at most 180 seconds.") + } + } + if given("content_padding_addition") { + if _, _, ok := span(o["content_padding_addition"], 65535); !ok { + errs = append(errs, Conf["content_padding_addition"]+" must be a number or a range like 10-100, up to 65535.") + } + } + for _, k := range []string{"random_trailers", "disable_cookies"} { + if v := o[k]; given(k) && v != "on" && v != "off" && v != "1" && v != "0" { + errs = append(errs, Conf[k]+" must be on or off.") + } + } + // signature packets: their tags, and all of them in one device's configuration (one QR code) + total := 0 + for _, k := range []string{"i1", "i2", "i3", "i4", "i5"} { + if !given(k) { + continue + } + total += len(o[k]) + if e := tagError(Conf[k], o[k]); e != "" { + errs = append(errs, e) + } + } + if total > 2000 { + errs = append(errs, fmt.Sprintf("I1-I5 together must be at most 2000 characters, not %d.", total)) + } + return errs +} diff --git a/backend/disguise/disguise_test.go b/backend/disguise/disguise_test.go new file mode 100644 index 0000000..b5e8149 --- /dev/null +++ b/backend/disguise/disguise_test.go @@ -0,0 +1,107 @@ +package disguise + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "regexp" + "strings" + "testing" +) + +// Each made-up set of values gets the sentences ucode gives it (testdata/trace.uc, scripts/ucode-golden.sh). +func TestUnsafeAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Sets []struct { + O map[string]string `json:"o"` + Errs []string `json:"errs"` + All []string `json:"all"` + } `json:"sets"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + rows := golden.Sets + if len(rows) < 30 { + t.Fatalf("only %d rows", len(rows)) + } + said := 0 + for i, r := range rows { + got := Unsafe(r.O) + said += len(got) + if !reflect.DeepEqual(got, r.Errs) { + t.Errorf("row %d %v:\n go: %q\n ucode: %q", i, r.O, got, r.Errs) + } + if all := Errors(r.O); !reflect.DeepEqual(all, r.All) { + t.Errorf("row %d %v, with Dawnline's own bounds:\n go: %q\n ucode: %q", i, r.O, all, r.All) + } + } + if said < 40 { + t.Fatalf("the rows exercise too little: %d sentences", said) + } +} + +// shape is a value with what the dice decide taken out: digits as 9, hex bytes of a tag as x. +func shape(key, v string) string { + if key == "header_protection_key" { + return fmt.Sprint("key of ", len(v)) + } + v = regexp.MustCompile(`0x[0-9a-f]+`).ReplaceAllStringFunc(v, func(s string) string { return "0x" + strings.Repeat("x", len(s)-2) }) + // how many digits a drawn number has is the dice's too + return regexp.MustCompile(`[0-9]+`).ReplaceAllString(v, "9") +} + +// A preset made here has the names, the order and the shapes of the ones ucode makes, passes its own check, +// and ucode's presets pass it too. +func TestPresets(t *testing.T) { + raw, _ := os.ReadFile("testdata/presets.json") + var golden struct { + Presets map[string][]map[string]string `json:"presets"` + } + json.Unmarshal(raw, &golden) + for _, name := range Methods { + theirs := golden.Presets[name] + if len(theirs) == 0 { + t.Fatalf("the golden has no %s preset", name) + } + shapes := map[string]map[string]bool{} + for _, o := range theirs { + if errs := Errors(o); len(errs) != 0 { + t.Errorf("ucode's own %s preset is refused: %q", name, errs) + } + for k, v := range o { + if shapes[k] == nil { + shapes[k] = map[string]bool{} + } + shapes[k][shape(k, v)] = true + } + } + for i := 0; i < 200; i++ { + mine := Preset(name) + o := map[string]string{} + for _, p := range mine { + if _, twice := o[p.Key]; twice { + t.Fatalf("%s: %s twice", name, p.Key) + } + o[p.Key] = p.Value + if !shapes[p.Key][shape(p.Key, p.Value)] { + t.Fatalf("%s: %s = %q has a shape ucode never makes (%v)", name, p.Key, p.Value, shapes[p.Key]) + } + } + if len(o) != len(theirs[0]) { + t.Fatalf("%s: %d values, ucode makes %d", name, len(o), len(theirs[0])) + } + if errs := Errors(o); len(errs) != 0 { + t.Fatalf("%s: a preset its own check refuses: %q\n%v", name, errs, o) + } + } + } + if !reflect.DeepEqual(Preset("off"), []Pair{{"jc", "0"}, {"jmin", "0"}, {"jmax", "0"}, {"s1", "0"}, {"s2", "0"}, {"h1", "1"}, {"h2", "2"}, {"h3", "3"}, {"h4", "4"}}) { + t.Fatal("no disguise is not what it was") + } +} diff --git a/backend/disguise/preset.go b/backend/disguise/preset.go new file mode 100644 index 0000000..b2bcad5 --- /dev/null +++ b/backend/disguise/preset.go @@ -0,0 +1,132 @@ +package disguise + +import ( + crand "crypto/rand" + "encoding/base64" + "encoding/binary" + "encoding/hex" + "fmt" + "strconv" + "strings" +) + +// Pair is one disguise value by its name; a preset is a row of them, in the order they are written. +type Pair struct{ Key, Value string } + +// randInt is a whole number from lo to hi, both in, as dawnline.util rand_int draws it. +func randInt(lo, hi int) int { + var b [4]byte + crand.Read(b[:]) + n := int(binary.BigEndian.Uint32(b[:]) & 0x7fffffff) + return lo + n%(hi-lo+1) +} + +// A name of the server's own for its signature packets, as tags: random bytes, random +// letters, fixed bytes. +func dnsName() string { + tld := []string{"com", "net", "org", "io"}[randInt(0, 3)] + n := randInt(5, 9) + return fmt.Sprintf("", n, n, len(tld), hex.EncodeToString([]byte(tld))) +} + +// Signature packets shaped like DNS, made fresh for each server: a query and an answer about a name of +// its own, with its own TTL and address. The same fixed bytes on every router would be one rule to match. +func dnsQuery() string { + // id, flags (standard query, recursion desired), 1 question, name, type A, class IN + return "" + dnsName() + "" +} + +func dnsAnswer() string { + // id, flags (answer, authoritative, recursion), 1 question, 1 answer, name, A IN, pointer, A IN, ttl, 4 bytes + return "" + dnsName() + fmt.Sprintf("", randInt(300, 86400)) +} + +// Methods are the disguises a server may be given: none, AmneziaWG 2.0's, AmneziaWG 3.1's. +var Methods = []string{"off", "balanced", "max"} + +// Preset makes the disguise values of a method (dawnline.awg obf_preset): +// +// off plain WireGuard-compatible packets +// balanced AmneziaWG 2.0: junk packets, random headers, padded cookie and data packets, DNS-shaped +// signature packets +// max AmneziaWG 3.1: protected headers, random trailers, padding, jittered timers and a DNS-like +// first packet, the values AmneziaVPN itself uses for 3.1 servers +func Preset(name string) []Pair { + i := strconv.Itoa + switch name { + case "max": + // 32 random bytes, as `awg genkey` makes them + key := make([]byte, 32) + crand.Read(key) + return []Pair{ + {"jc", i(randInt(4, 6))}, {"jmin", "10"}, {"jmax", "50"}, + {"s1", "12"}, {"s2", "12"}, {"s3", "12"}, {"s4", "12"}, + {"h1", "1"}, {"h2", "2"}, {"h3", "3"}, {"h4", "4"}, + {"i1", dnsQuery()}, {"i2", dnsAnswer()}, + {"header_protection_key", base64.StdEncoding.EncodeToString(key)}, + {"content_padding_addition", "10-100"}, + {"rekey_after_time", "100-120"}, {"rekey_timeout", "3-7"}, {"reject_after_time", "150-180"}, + {"keepalive_timeout", "5-15"}, {"max_handshake_attempts", "15-20"}, + {"random_trailers", "on"}, {"disable_cookies", "on"}, + } + case "off": + return []Pair{{"jc", "0"}, {"jmin", "0"}, {"jmax", "0"}, {"s1", "0"}, {"s2", "0"}, {"h1", "1"}, {"h2", "2"}, {"h3", "3"}, {"h4", "4"}} + } + jmin := randInt(64, 128) + s1, s2 := randInt(15, 64), randInt(15, 64) + // a handshake initiation and response never share a size + for s1+56 == s2 { + s2 = randInt(15, 64) + } + o := []Pair{{"jc", i(randInt(4, 8))}, {"jmin", i(jmin)}, {"jmax", i(jmin + randInt(150, 400))}, {"s1", i(s1)}, {"s2", i(s2)}} + used := map[int]bool{} + for _, k := range []string{"h1", "h2", "h3", "h4"} { + v := randInt(5, 2147483647) + for used[v] { + v = randInt(5, 2147483647) + } + used[v] = true + o = append(o, Pair{k, i(v)}) + } + // AmneziaWG 2.0: padded cookie and data packets (S4 costs MTU, kept small) and DNS-shaped signature + // packets before each handshake: what 1.0 traffic lacks and gets recognised by + return append(o, Pair{"s3", i(randInt(8, 48))}, Pair{"s4", i(randInt(4, 16))}, Pair{"i1", dnsQuery()}, Pair{"i2", dnsAnswer()}) +} + +// Junk packets may be tiny; the ceiling keeps them under the path MTU. +var bounds = []struct { + key string + lo, hi int64 +}{{"jc", 0, 10}, {"jmin", 0, 1024}, {"jmax", 0, 1024}, {"s1", 0, 64}, {"s2", 0, 64}, {"s3", 0, 64}, {"s4", 0, 32}} + +// plus is a value as ucode's unary plus reads it, for the one check that adds two of them. +func plus(s string) (float64, bool) { + s = strings.Trim(s, space) + if n, err := strconv.ParseInt(s, 0, 64); err == nil { + return float64(n), true + } + n, err := strconv.ParseFloat(s, 64) + return n, err == nil +} + +// Errors is what is wrong with the disguise values of a server Dawnline sets up: what AmneziaWG refuses +// (Unsafe), and Dawnline's own bounds on top. Its presets pass it. dawnline.awg obf_errors. +func Errors(o map[string]string) []string { + errs := Unsafe(o) + for _, b := range bounds { + if o[b.key] == "" { + continue + } + if n, ok := uint(strings.Trim(o[b.key], space), 65535); ok && (n < b.lo || n > b.hi) { + errs = append(errs, fmt.Sprintf("%s must be from %d to %d.", Conf[b.key], b.lo, b.hi)) + } + } + _, has1 := o["s1"] + _, has2 := o["s2"] + if a, ok1 := plus(o["s1"]); has1 && has2 && ok1 { + if b, ok2 := plus(o["s2"]); ok2 && a+56 == b { + errs = append(errs, "S2 must not be S1 + 56: the handshake initiation and response would have the same size.") + } + } + return errs +} diff --git a/backend/disguise/testdata/presets.json b/backend/disguise/testdata/presets.json new file mode 100644 index 0000000..103155f --- /dev/null +++ b/backend/disguise/testdata/presets.json @@ -0,0 +1,1581 @@ +{ + "presets": { + "off": [ + { + "jc": "0", + "jmin": "0", + "jmax": "0", + "s1": "0", + "s2": "0", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4" + } + ], + "balanced": [ + { + "jc": "8", + "jmin": "70", + "jmax": "375", + "s1": "44", + "s2": "33", + "h1": "736891884", + "h2": "836056889", + "h3": "431946816", + "h4": "707507057", + "s3": "15", + "s4": "8", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "67", + "jmax": "370", + "s1": "62", + "s2": "21", + "h1": "273143590", + "h2": "1556535696", + "h3": "879779358", + "h4": "1010151422", + "s3": "38", + "s4": "9", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "121", + "jmax": "407", + "s1": "22", + "s2": "17", + "h1": "847653094", + "h2": "1272226814", + "h3": "1807396648", + "h4": "969467162", + "s3": "34", + "s4": "15", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "124", + "jmax": "402", + "s1": "34", + "s2": "59", + "h1": "2123373677", + "h2": "2082662280", + "h3": "1961900909", + "h4": "672737525", + "s3": "16", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "114", + "jmax": "494", + "s1": "21", + "s2": "32", + "h1": "255627049", + "h2": "685832438", + "h3": "961880878", + "h4": "1057014743", + "s3": "28", + "s4": "4", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "115", + "jmax": "364", + "s1": "37", + "s2": "33", + "h1": "171641514", + "h2": "375307400", + "h3": "1086819559", + "h4": "463920175", + "s3": "26", + "s4": "15", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "65", + "jmax": "452", + "s1": "55", + "s2": "60", + "h1": "1917694349", + "h2": "394780465", + "h3": "1704465680", + "h4": "1272641999", + "s3": "42", + "s4": "15", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "67", + "jmax": "384", + "s1": "16", + "s2": "15", + "h1": "561089206", + "h2": "55661566", + "h3": "1928410019", + "h4": "622516418", + "s3": "17", + "s4": "6", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "114", + "jmax": "429", + "s1": "28", + "s2": "33", + "h1": "1851695997", + "h2": "137976447", + "h3": "789894986", + "h4": "704434741", + "s3": "42", + "s4": "4", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "84", + "jmax": "344", + "s1": "27", + "s2": "55", + "h1": "1373880379", + "h2": "802281785", + "h3": "2139155717", + "h4": "1873468026", + "s3": "32", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "81", + "jmax": "290", + "s1": "35", + "s2": "44", + "h1": "754750143", + "h2": "1819940659", + "h3": "1684132989", + "h4": "66309467", + "s3": "14", + "s4": "14", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "80", + "jmax": "267", + "s1": "21", + "s2": "64", + "h1": "37388213", + "h2": "157857151", + "h3": "1989933834", + "h4": "2108497162", + "s3": "26", + "s4": "7", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "95", + "jmax": "421", + "s1": "50", + "s2": "19", + "h1": "1103427771", + "h2": "1588762911", + "h3": "604534996", + "h4": "617669478", + "s3": "28", + "s4": "12", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "127", + "jmax": "382", + "s1": "25", + "s2": "17", + "h1": "1865302642", + "h2": "951694706", + "h3": "1322886266", + "h4": "931529137", + "s3": "26", + "s4": "13", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "93", + "jmax": "405", + "s1": "20", + "s2": "48", + "h1": "1575005704", + "h2": "373184376", + "h3": "1275792482", + "h4": "1125069160", + "s3": "47", + "s4": "13", + "i1": "", + "i2": "" + }, + { + "jc": "6", + "jmin": "101", + "jmax": "330", + "s1": "50", + "s2": "64", + "h1": "1667642667", + "h2": "2095014618", + "h3": "1440330588", + "h4": "1353439604", + "s3": "34", + "s4": "8", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "116", + "jmax": "394", + "s1": "58", + "s2": "54", + "h1": "150639028", + "h2": "1604651271", + "h3": "888974888", + "h4": "1063024907", + "s3": "16", + "s4": "15", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "84", + "jmax": "452", + "s1": "25", + "s2": "25", + "h1": "805105762", + "h2": "678592549", + "h3": "1901884410", + "h4": "961661501", + "s3": "16", + "s4": "9", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "93", + "jmax": "431", + "s1": "26", + "s2": "28", + "h1": "573339372", + "h2": "1972503929", + "h3": "2033726295", + "h4": "1756244764", + "s3": "22", + "s4": "10", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "93", + "jmax": "244", + "s1": "51", + "s2": "20", + "h1": "1009456001", + "h2": "972050083", + "h3": "519669306", + "h4": "2016342987", + "s3": "37", + "s4": "16", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "89", + "jmax": "402", + "s1": "23", + "s2": "39", + "h1": "1133724335", + "h2": "1892432406", + "h3": "1722748349", + "h4": "301347041", + "s3": "15", + "s4": "9", + "i1": "", + "i2": "" + }, + { + "jc": "6", + "jmin": "101", + "jmax": "275", + "s1": "38", + "s2": "43", + "h1": "1636306014", + "h2": "393531672", + "h3": "1031233420", + "h4": "1542842825", + "s3": "11", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "87", + "jmax": "354", + "s1": "29", + "s2": "44", + "h1": "1453115673", + "h2": "374355049", + "h3": "1571840818", + "h4": "1691007773", + "s3": "13", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "88", + "jmax": "395", + "s1": "33", + "s2": "58", + "h1": "79905485", + "h2": "17487716", + "h3": "999894313", + "h4": "804019343", + "s3": "11", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "66", + "jmax": "335", + "s1": "53", + "s2": "57", + "h1": "907140200", + "h2": "2143058598", + "h3": "326885514", + "h4": "593559933", + "s3": "20", + "s4": "16", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "104", + "jmax": "327", + "s1": "15", + "s2": "32", + "h1": "1757153703", + "h2": "1042583221", + "h3": "522104509", + "h4": "798392467", + "s3": "15", + "s4": "11", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "73", + "jmax": "422", + "s1": "35", + "s2": "27", + "h1": "375734252", + "h2": "2118106813", + "h3": "1232826381", + "h4": "894754888", + "s3": "13", + "s4": "5", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "90", + "jmax": "405", + "s1": "51", + "s2": "62", + "h1": "21337773", + "h2": "1427275745", + "h3": "1235597520", + "h4": "801872982", + "s3": "23", + "s4": "7", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "74", + "jmax": "251", + "s1": "42", + "s2": "48", + "h1": "1508782522", + "h2": "5873717", + "h3": "1001951517", + "h4": "332619782", + "s3": "48", + "s4": "10", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "76", + "jmax": "416", + "s1": "21", + "s2": "37", + "h1": "1806910906", + "h2": "1288215847", + "h3": "1806951231", + "h4": "342796938", + "s3": "37", + "s4": "12", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "114", + "jmax": "291", + "s1": "35", + "s2": "64", + "h1": "420885295", + "h2": "1809219916", + "h3": "24422300", + "h4": "1339753951", + "s3": "21", + "s4": "6", + "i1": "", + "i2": "" + }, + { + "jc": "7", + "jmin": "95", + "jmax": "359", + "s1": "42", + "s2": "23", + "h1": "13915057", + "h2": "1399701742", + "h3": "1439047433", + "h4": "1430442508", + "s3": "20", + "s4": "16", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "118", + "jmax": "377", + "s1": "43", + "s2": "37", + "h1": "713055508", + "h2": "1494606379", + "h3": "617898637", + "h4": "399836703", + "s3": "46", + "s4": "5", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "113", + "jmax": "358", + "s1": "59", + "s2": "36", + "h1": "1572832282", + "h2": "759852640", + "h3": "874020835", + "h4": "1701193957", + "s3": "33", + "s4": "13", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "103", + "jmax": "460", + "s1": "61", + "s2": "25", + "h1": "671129696", + "h2": "1736037648", + "h3": "1753276099", + "h4": "2094235758", + "s3": "9", + "s4": "5", + "i1": "", + "i2": "" + }, + { + "jc": "6", + "jmin": "86", + "jmax": "279", + "s1": "47", + "s2": "36", + "h1": "247228567", + "h2": "535988352", + "h3": "447612588", + "h4": "475127446", + "s3": "10", + "s4": "8", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "96", + "jmax": "367", + "s1": "53", + "s2": "45", + "h1": "1746630631", + "h2": "457596977", + "h3": "253563319", + "h4": "1148655663", + "s3": "42", + "s4": "12", + "i1": "", + "i2": "" + }, + { + "jc": "8", + "jmin": "106", + "jmax": "447", + "s1": "60", + "s2": "64", + "h1": "1002962745", + "h2": "374732526", + "h3": "30317284", + "h4": "571684548", + "s3": "9", + "s4": "15", + "i1": "", + "i2": "" + }, + { + "jc": "4", + "jmin": "111", + "jmax": "359", + "s1": "17", + "s2": "30", + "h1": "1935306404", + "h2": "857078510", + "h3": "1949174402", + "h4": "1998082631", + "s3": "31", + "s4": "14", + "i1": "", + "i2": "" + }, + { + "jc": "5", + "jmin": "107", + "jmax": "486", + "s1": "35", + "s2": "42", + "h1": "440129596", + "h2": "1833516261", + "h3": "1494427773", + "h4": "972976689", + "s3": "32", + "s4": "15", + "i1": "", + "i2": "" + } + ], + "max": [ + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "nwacGqNSp9MMXi9be+Ip0x/wMfmNsDVnlno0o0xTKj4=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "id88srCCNtedG+Dckw3AUqzXXt46ufUwbYziuZtvFWM=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "qRnNFCpVE1OFPVY1arnKlRtgEYxELEpzlX5VY50kdpU=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "KJTDnUn4kARAjX0YeAtIN8GOXgXXCzufak0yZgy444o=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "srZsFiXhUagO8lftyFGAV/rMa+6OMfdZFnNRTjhawdY=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "vs7ijTqq0AozVOp5GYpVD2oQvrYfQ2d6iUR8SxE/Lxg=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "Ljh/HiRp4y5/v6O/D3FckQjXiuBlmMgRdcduzFFc+Ug=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "+gN855qXNEoaK9hXSMEqAbILjy++P5QvxzR2uGzUjAY=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "c+qp0VJjmaV2YXUAbRAiLZj2pCL1qGNpe4qnkd5LWno=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "mmb1vZyLEkqxCpuJMjtIvynosFibmJsOkrcIdSBHGg8=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "b3DCcJGXQMll+rBI8Mvysl9gE4jbG2gq35/dxm+2usk=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "t69Xo7SLAAgYNsVBxhmQvKhspsbdQp3bbAYEIXOMgJQ=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "9IIgkfRfhB0FD6GMB6vojjqVZwg+gTu5zdIRPQZKB9k=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "Sc7lrcdv4rAkDDCB5/SYAvgdDju7C+4/EjETENXZ4Ak=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "dJ23ZBT1m8xNojLOI7UQ+TYfTuIbCwxAuZubuV2UtKI=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "v1BFqScHNqOpwDGvih0Jmy1YOP/Qdy6gD7iEQsCKgWc=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "7jeeTUeelP92w0e3vnWtQWKn/sIsE9WlMgGfWQs+tFM=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "I7mbSTEflvwhLV++Ktl7dEJxCbTq92tcP9T2VrSnRkw=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "BcBFCo/sg0bxvkx1FjnhJ+RHFOP75lbvg7VXd+LEiac=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "T22hvTDk4NX4k1DZeGvrVg7TlzmjyF6NqLN32U/Ahuw=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "j+/3esYic74Hadr0vpjzU4iiIlTFCGTt15CGCkyXNA0=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "6Yy8T7MPNXtNvQsi/ROOpSE/nS6raWvfNGRcEj7bYsM=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "rQkp5zASzvtZ6bHivogMtt+Vbd1Fx48Ms9qWO9LcLtI=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "95c+RE8O4CdRuB/Pdmqv+VwP2PwyMx25BVYZ7ARTQ2A=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "fq3P3lgExc92fgZn1BQR310JMUi/SQTJKYpbG0RRrzw=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "0jaIsix7/fs7sbpXxJZe9x0YKa2ZQkNzlJCb01vG49I=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "B1AC9ZnkHrrJwcnRmrLmBtz9+VDUDUzYN4+q01+Us2A=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "F5VQ1/5pGqw71d4s+9l+4ZT/3jkBo2DtuNv2aWkck4A=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "BhX6eAovdfxgq9dq4BtrzmzOSOkWeKwFY1b+FTasZ/w=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "OM8q7Xp4GyoolMfPscGmGwcrmSlHhr9eciokLknUGd8=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "w0SEtEVh39thXkZHN5aYl1jHQZSEJVfRlvS1fkWT9Oc=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "vQnJTpJzq84OQweN2TBEILIiPoP0IXHu5kzTrCzqpsw=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "FRPclOuOgueqPLnP9GbFIqXso1uc5EgFJxbGbypp9s0=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "59NWiYyM/4+ze58uCr4PD3fVVs4MtMcbmjclDgYdmQU=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "CXng8dNQatarIwsaX1GhccxZt6uhHKy6IxJyLeMb42g=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "k5QDj7JrNHYtZHqfwHHe1TJMJPvKiS6EVgORuMuQCBM=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "BdVkd8XENMFjY+ZuoRmWkctrXEDqxMV9pZ2E8P8ugUg=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "gYr6EyNE1W5PE+lgJZdYbwY9k79D233I0QWVmXiYzWs=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "5", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "oLaGDeqDpUfZtQDASMPxSd7OLe3eFN9cmLQYjXU0nz4=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + }, + { + "jc": "6", + "jmin": "10", + "jmax": "50", + "s1": "12", + "s2": "12", + "s3": "12", + "s4": "12", + "h1": "1", + "h2": "2", + "h3": "3", + "h4": "4", + "i1": "", + "i2": "", + "header_protection_key": "LN2e792UT0+7Y6GFZCYZgKGru6juPxVC//n3Bjq2dk4=", + "content_padding_addition": "10-100", + "rekey_after_time": "100-120", + "rekey_timeout": "3-7", + "reject_after_time": "150-180", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "15-20", + "random_trailers": "on", + "disable_cookies": "on" + } + ] + } +} diff --git a/backend/disguise/testdata/trace.json b/backend/disguise/testdata/trace.json new file mode 100644 index 0000000..5bb450d --- /dev/null +++ b/backend/disguise/testdata/trace.json @@ -0,0 +1,576 @@ +{ + "sets": [ + { + "o": { + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "jc": "4", + "jmin": "10", + "jmax": "50", + "s1": "20", + "s2": "30", + "h1": "100", + "h2": "200", + "h3": "300", + "h4": "400" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "jc": "70000", + "jmin": "x", + "jmax": "", + "s1": " 12 ", + "s2": "1 2", + "s3": "-1", + "s4": "00000000012" + }, + "errs": [ + "Jc must be a whole number from 0 to 65535.", + "Jmin must be a whole number from 0 to 65535.", + "S2 must be a whole number from 0 to 65535.", + "S3 must be a whole number from 0 to 65535.", + "S4 must be a whole number from 0 to 65535." + ], + "all": [ + "Jc must be a whole number from 0 to 65535.", + "Jmin must be a whole number from 0 to 65535.", + "S2 must be a whole number from 0 to 65535.", + "S3 must be a whole number from 0 to 65535.", + "S4 must be a whole number from 0 to 65535." + ] + }, + { + "o": { + "jmin": "60", + "jmax": "50" + }, + "errs": [ + "Jmin must not be larger than Jmax." + ], + "all": [ + "Jmin must not be larger than Jmax." + ] + }, + { + "o": { + "jmin": "60" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "h1": "100-200", + "h2": "150-300", + "h3": "5", + "h4": "4294967295" + }, + "errs": [ + "H1 and H2 overlap: each packet type needs values of its own." + ], + "all": [ + "H1 and H2 overlap: each packet type needs values of its own." + ] + }, + { + "o": { + "h1": "1", + "h2": "1" + }, + "errs": [ + "H1 and H2 overlap: each packet type needs values of its own." + ], + "all": [ + "H1 and H2 overlap: each packet type needs values of its own." + ] + }, + { + "o": { + "h1": "3" + }, + "errs": [ + "H1 and H3 overlap: each packet type needs values of its own." + ], + "all": [ + "H1 and H3 overlap: each packet type needs values of its own." + ] + }, + { + "o": { + "h1": "200-100", + "h2": "5-", + "h3": "-5", + "h4": "1-2-3" + }, + "errs": [ + "H1 must be a number or a range like 100-200, up to 4294967295.", + "H2 must be a number or a range like 100-200, up to 4294967295.", + "H3 must be a number or a range like 100-200, up to 4294967295.", + "H4 must be a number or a range like 100-200, up to 4294967295." + ], + "all": [ + "H1 must be a number or a range like 100-200, up to 4294967295.", + "H2 must be a number or a range like 100-200, up to 4294967295.", + "H3 must be a number or a range like 100-200, up to 4294967295.", + "H4 must be a number or a range like 100-200, up to 4294967295." + ] + }, + { + "o": { + "h1": "4294967296", + "h2": " 77 " + }, + "errs": [ + "H1 must be a number or a range like 100-200, up to 4294967295." + ], + "all": [ + "H1 must be a number or a range like 100-200, up to 4294967295." + ] + }, + { + "o": { + "header_protection_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "s1": "12", + "s2": "11", + "s3": "64", + "s4": "0" + }, + "errs": [ + "S2 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ], + "all": [ + "S2 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ] + }, + { + "o": { + "header_protection_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=" + }, + "errs": [ + "S1 must be at least 12 with header protection.", + "S2 must be at least 12 with header protection.", + "S3 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ], + "all": [ + "S1 must be at least 12 with header protection.", + "S2 must be at least 12 with header protection.", + "S3 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ] + }, + { + "o": { + "header_protection_key": "not a key", + "s1": "20", + "s2": "20", + "s3": "20", + "s4": "20" + }, + "errs": [ + "The header protection key is not a key." + ], + "all": [ + "The header protection key is not a key." + ] + }, + { + "o": { + "header_protection_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBml=", + "s1": "99999" + }, + "errs": [ + "S1 must be a whole number from 0 to 65535.", + "The header protection key is not a key.", + "S2 must be at least 12 with header protection.", + "S3 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ], + "all": [ + "S1 must be a whole number from 0 to 65535.", + "The header protection key is not a key.", + "S2 must be at least 12 with header protection.", + "S3 must be at least 12 with header protection.", + "S4 must be at least 12 with header protection." + ] + }, + { + "o": { + "rekey_after_time": "0", + "rekey_timeout": "0-5", + "reject_after_time": "181", + "keepalive_timeout": "5-15", + "max_handshake_attempts": "many" + }, + "errs": [ + "RekeyTimeout must be a number or a range like 5-15, from 1 to 65535.", + "RejectAfterTime must be at most 180 seconds.", + "MaxHandshakeAttempts must be a number or a range like 5-15, from 1 to 65535." + ], + "all": [ + "RekeyTimeout must be a number or a range like 5-15, from 1 to 65535.", + "RejectAfterTime must be at most 180 seconds.", + "MaxHandshakeAttempts must be a number or a range like 5-15, from 1 to 65535." + ] + }, + { + "o": { + "rekey_after_time": "120", + "rekey_timeout": "5", + "reject_after_time": "100-180", + "keepalive_timeout": "65536", + "max_handshake_attempts": "0-0" + }, + "errs": [ + "KeepaliveTimeout must be a number or a range like 5-15, from 1 to 65535." + ], + "all": [ + "KeepaliveTimeout must be a number or a range like 5-15, from 1 to 65535." + ] + }, + { + "o": { + "reject_after_time": "10-999" + }, + "errs": [ + "RejectAfterTime must be at most 180 seconds." + ], + "all": [ + "RejectAfterTime must be at most 180 seconds." + ] + }, + { + "o": { + "content_padding_addition": "10-100" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "content_padding_addition": "100-10" + }, + "errs": [ + "ContentPaddingAddition must be a number or a range like 10-100, up to 65535." + ], + "all": [ + "ContentPaddingAddition must be a number or a range like 10-100, up to 65535." + ] + }, + { + "o": { + "content_padding_addition": "0" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "content_padding_addition": "lots" + }, + "errs": [ + "ContentPaddingAddition must be a number or a range like 10-100, up to 65535." + ], + "all": [ + "ContentPaddingAddition must be a number or a range like 10-100, up to 65535." + ] + }, + { + "o": { + "random_trailers": "on", + "disable_cookies": "0" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "random_trailers": "yes", + "disable_cookies": "true" + }, + "errs": [ + "RandomTrailers must be on or off.", + "DisableCookies must be on or off." + ], + "all": [ + "RandomTrailers must be on or off.", + "DisableCookies must be on or off." + ] + }, + { + "o": { + "i1": "", + "i2": "text between ", + "i3": "" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "i1": "", + "i2": "", + "i3": "", + "i4": "", + "i5": "" + }, + "errs": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I5: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ], + "all": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I5: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ] + }, + { + "o": { + "i1": "", + "i2": "", + "i3": "", + "i4": "", + "i5": "" + }, + "errs": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I5: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ], + "all": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I5: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ] + }, + { + "o": { + "i1": "", + "i2": "", + "i3": "", + "i4": " is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4 has a tag that is not closed with >." + ], + "all": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I3: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I4 has a tag that is not closed with >." + ] + }, + { + "o": { + "i1": " # a comment", + "i2": "\n", + "i3": "\r" + }, + "errs": [ + "I1 may not contain # or a line break.", + "I2 may not contain # or a line break.", + "I3 may not contain # or a line break." + ], + "all": [ + "I1 may not contain # or a line break.", + "I2 may not contain # or a line break.", + "I3 may not contain # or a line break." + ] + }, + { + "o": { + "i1": "", + "i2": "" + }, + "errs": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ], + "all": [ + "I1: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .", + "I2: is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ] + }, + { + "o": { + "i1": "", + "i2": "" + }, + "errs": [ + "I1-I5 together must be at most 2000 characters, not 2073." + ], + "all": [ + "I1-I5 together must be at most 2000 characters, not 2073." + ] + }, + { + "o": { + "i1": ">", + "i2": ">", + "i3": "<" + }, + "errs": [ + "I3: < is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ], + "all": [ + "I3: < is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." + ] + }, + { + "o": { + "jc": "5", + "jmin": "50", + "jmax": "1000", + "s1": "15", + "s2": "20", + "s3": "25", + "s4": "30", + "h1": "1000-2000", + "h2": "3000-4000", + "h3": "5000-6000", + "h4": "7000-8000", + "i1": "", + "header_protection_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "content_padding_addition": "5-50", + "rekey_after_time": "100-120", + "rekey_timeout": "4-6", + "reject_after_time": "150-180", + "keepalive_timeout": "8-12", + "max_handshake_attempts": "15-20", + "random_trailers": "off", + "disable_cookies": "1" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "s1": "8", + "s2": "64" + }, + "errs": [ + ], + "all": [ + "S2 must not be S1 + 56: the handshake initiation and response would have the same size." + ] + }, + { + "o": { + "s1": "8", + "s2": " 64 " + }, + "errs": [ + ], + "all": [ + "S2 must not be S1 + 56: the handshake initiation and response would have the same size." + ] + }, + { + "o": { + "s1": "0", + "s2": "56" + }, + "errs": [ + ], + "all": [ + "S2 must not be S1 + 56: the handshake initiation and response would have the same size." + ] + }, + { + "o": { + "jc": "11", + "jmin": "1025", + "jmax": "2000", + "s1": "65", + "s2": "70", + "s3": "65", + "s4": "33" + }, + "errs": [ + ], + "all": [ + "Jc must be from 0 to 10.", + "Jmin must be from 0 to 1024.", + "Jmax must be from 0 to 1024.", + "S1 must be from 0 to 64.", + "S2 must be from 0 to 64.", + "S3 must be from 0 to 64.", + "S4 must be from 0 to 32." + ] + }, + { + "o": { + "jc": "10", + "jmin": "1024", + "jmax": "1024", + "s1": "64", + "s2": "64", + "s3": "64", + "s4": "32" + }, + "errs": [ + ], + "all": [ + ] + }, + { + "o": { + "s1": "x", + "s2": "56" + }, + "errs": [ + "S1 must be a whole number from 0 to 65535." + ], + "all": [ + "S1 must be a whole number from 0 to 65535." + ] + }, + { + "o": { + "s2": "56" + }, + "errs": [ + ], + "all": [ + ] + } + ] +} diff --git a/backend/endpoint/endpoint.go b/backend/endpoint/endpoint.go new file mode 100644 index 0000000..9e4f0be --- /dev/null +++ b/backend/endpoint/endpoint.go @@ -0,0 +1,281 @@ +// Package endpoint tells what a public address points at and whether that reaches this router, as +// dawnline.health does for Health and for the "as you type" check on a server's page: the facts +// (endpoint_facts) and the facts in words in the reader's language (endpoint_words). Held to ucode's own +// output on made-up reads (testdata/trace.uc, scripts/ucode-golden.sh). +package endpoint + +import ( + "fmt" + "regexp" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" +) + +// Reads is what the facts are made from, read on the router: the name's addresses, the WAN's IPv4 ("" none) +// and the router's public IPv6 addresses (Known6 false: not read, or `ip` could not tell). +type Reads struct { + IPs []string + WAN string + Router6 []string + Known6 bool +} + +// Facts is what a public address points at. +type Facts struct { + Host string `json:"host"` + IPs []string `json:"ips"` + IPs4 []string `json:"ips4"` + IPs6 []string `json:"ips6"` + WAN *string `json:"wan"` + Kind string `json:"kind"` + Cloudflare bool `json:"cloudflare"` + Here bool `json:"here"` + V6Only bool `json:"v6_only"` + Router6 []string `json:"router6"` + Foreign6 []string `json:"foreign6"` + Here6 bool `json:"here6"` +} + +// Cloudflare's published ranges (https://www.cloudflare.com/ips/). +var ( + cf4 = []string{"173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", + "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/13", "104.24.0.0/14", "172.64.0.0/13", "131.0.72.0/22"} + cf6 = regexp.MustCompile(`(?i)^(2400:cb00:|2606:4700:|2803:f800:|2405:b500:|2405:8100:|2a06:98c[0-7]:|2c0f:f248:)`) +) + +// Cloudflare tells an address in Cloudflare's network (its proxies and edge). +func Cloudflare(a string) bool { + n, ok := ipnet.IP(a) + if !ok { + return cf6.MatchString(a) + } + for _, r := range cf4 { + if c, _ := ipnet.Any(r); c.Holds(n) { + return true + } + } + return false +} + +// Kind is what kind of IPv4 the WAN has: public, cgnat (100.64/10), private (behind another router), none. +func Kind(wan string) string { + n, ok := ipnet.IP(wan) + if !ok { + return "none" + } + for i, p := range []string{"100.64.0.0/10", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"} { + if r, _ := ipnet.Any(p); r.Holds(n) { + if i == 0 { + return "cgnat" + } + return "private" + } + } + return "public" +} + +// Full6 is an IPv6 address as its 32 hex digits, so two spellings of one address compare equal; "" when it is none. +func Full6(s string) string { + halves := strings.Split(strings.ToLower(s), "::") + if len(halves) > 2 { + return "" + } + var head, tail []string + if halves[0] != "" { + head = strings.Split(halves[0], ":") + } + if len(halves) == 2 && halves[1] != "" { + tail = strings.Split(halves[1], ":") + } + gap := 8 - len(head) - len(tail) + if (len(halves) == 2 && gap < 1) || (len(halves) != 2 && gap != 0) { + return "" + } + groups := append([]string{}, head...) + for i := 0; i < gap; i++ { + groups = append(groups, "0") + } + groups = append(groups, tail...) + out := "" + for _, g := range groups { + if len(g) < 1 || len(g) > 4 || strings.Trim(g, "0123456789abcdef") != "" { + return "" + } + out += "0000"[len(g):] + g + } + return out +} + +// Own6 is the router's public IPv6 addresses among those `ip -6 -j addr show scope global` lists: unique +// local ones (fc00::/7) and failed duplicates do not count, nothing reaches them from outside. +func Own6(links []struct { + Info []struct { + Family string `json:"family"` + Local string `json:"local"` + DADFailed bool `json:"dadfailed"` + } `json:"addr_info"` +}) []string { + out := []string{} + for _, l := range links { + for _, a := range l.Info { + if k := Full6(a.Local); k != "" && a.Family == "inet6" && !a.DADFailed && !strings.HasPrefix(k, "fc") && !strings.HasPrefix(k, "fd") { + out = append(out, a.Local) + } + } + } + return out +} + +// Of makes the facts of what was read. +func Of(host string, r Reads) Facts { + f := Facts{Host: host, IPs: r.IPs, IPs4: []string{}, IPs6: []string{}, Kind: Kind(r.WAN)} + if f.IPs == nil { + f.IPs = []string{} + } + if r.WAN != "" { + f.WAN = &r.WAN + } + for _, a := range f.IPs { + if _, v4 := ipnet.IP(a); v4 { + f.IPs4 = append(f.IPs4, a) + f.Here = f.Here || (r.WAN != "" && a == r.WAN) + } else { + f.IPs6 = append(f.IPs6, a) + } + f.Cloudflare = f.Cloudflare || Cloudflare(a) + } + f.V6Only = len(f.IPs4) == 0 && len(f.IPs6) > 0 + if r.Known6 { + f.Router6 = r.Router6 + if f.Router6 == nil { + f.Router6 = []string{} + } + own := map[string]bool{} + for _, a := range r.Router6 { + own[Full6(a)] = true + } + f.Foreign6 = []string{} + for _, a := range f.IPs6 { + if !own[Full6(a)] { + f.Foreign6 = append(f.Foreign6, a) + } + } + f.Here6 = len(f.IPs6) > 0 && len(f.Foreign6) == 0 + } + return f +} + +// aaaa is the name's IPv6 addresses that do not reach this router from outside, in words, or "". +func aaaa(f Facts, t *i18n.Catalog) string { + n := int64(len(f.Foreign6)) + if n == 0 { + return "" + } + bad := strings.Join(f.Foreign6, ", ") + if len(f.Router6) == 0 { + return fmt.Sprintf(t.N(n, "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router.", + "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router."), f.Host, bad) + } + return fmt.Sprintf(t.N(n, "%s AAAA → %s is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.", + "%s AAAA → %s are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records."), f.Host, bad) +} + +// unreached6 is an IPv6-only name none of whose addresses is a public one of the router, in words, or "". +func unreached6(f Facts, t *i18n.Catalog) string { + n := len(f.Foreign6) + if n == 0 || n < len(f.IPs6) { + return "" + } + all := strings.Join(f.IPs6, ", ") + if len(f.Router6) == 0 { + return fmt.Sprintf(t.T("%s → %s: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router."), f.Host, all) + } + return fmt.Sprintf(t.N(int64(n), "%s → %s: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS.", + "%s → %s: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS."), f.Host, all) +} + +// Words is the facts as a status (ok, warn, error) and a whole sentence in t's language. note names what +// must get through ("UDP 4500"). +func Words(f Facts, note string, t *i18n.Catalog) (status, text string) { + wan := "" + if f.WAN != nil { + wan = *f.WAN + } + if f.Host == "" { + return "error", t.T("No public address: devices will not know where to connect.") + } + if len(f.IPs) == 0 { + return "error", fmt.Sprintf(t.T("%s does not resolve."), f.Host) + } + if f.Cloudflare { + return "error", fmt.Sprintf(t.T("%s → %s (Cloudflare). %s reaches the router only if this name is DNS-only there, or use the router's IP."), f.Host, strings.Join(f.IPs, ", "), note) + } + v6 := aaaa(f, t) + if f.V6Only { + if none := unreached6(f, t); none != "" { + return "warn", none + } + if v6 != "" { + return "warn", v6 + } + if f.Kind == "public" { + return "warn", fmt.Sprintf(t.T("%s → %s: IPv6 only, so only devices with IPv6 connect (the router's IPv4 %s has no name)."), f.Host, strings.Join(f.IPs6, ", "), wan) + } + return "ok", fmt.Sprintf(t.T("%s → %s: IPv6 only, so only devices with IPv6 connect."), f.Host, strings.Join(f.IPs6, ", ")) + } + v4 := "" + switch { + case f.Kind == "cgnat": + v4 = fmt.Sprintf(t.T("The WAN address %s is CGNAT (shared by the ISP): %s cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6."), wan, note) + case f.Kind == "private": + v4 = fmt.Sprintf(t.T("The WAN address %s is private: this router is behind another one. Forward %s on it, or devices cannot connect."), wan, note) + case wan != "" && !f.Here: + v4 = fmt.Sprintf(t.T("%s points at %s, not this router (WAN %s). Check your DNS / DDNS."), f.Host, strings.Join(f.IPs4, ", "), wan) + } + // two separate facts, each a sentence of its own: the IPv4 one first + switch { + case v4 != "" && v6 != "": + return "warn", v4 + " " + v6 + case v4 != "" || v6 != "": + return "warn", v4 + v6 + } + // without the router's WAN address only the facts: names and addresses, no words + if f.Here { + at := []string{wan} + if f.Here6 { + at = append(at, f.IPs6...) + } + return "ok", fmt.Sprintf(t.T("%s points at this router (%s)."), f.Host, strings.Join(at, ", ")) + } + return "ok", f.Host + " → " + strings.Join(f.IPs, ", ") +} + +var label = regexp.MustCompile(`^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?$`) +var v6 = regexp.MustCompile(`^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$`) + +// ValidHost tells a host name or an IP address, as a public address or the portal's name may be given. +func ValidHost(s string) bool { + if len(s) > 253 { + return false + } + if _, ok := ipnet.IP(s); ok || (v6.MatchString(s) && !strings.Contains(s, ":::")) { + return true + } + for _, l := range strings.Split(s, ".") { + if len(l) > 63 || !label.MatchString(l) { + return false + } + } + return true +} + +// Covers tells a certificate name that covers host: the same name, or a wildcard one level up. +func Covers(name, host string) bool { + if name == host { + return true + } + dot := strings.Index(host, ".") + return strings.HasPrefix(name, "*.") && dot > 0 && host[dot:] == name[1:] +} diff --git a/backend/endpoint/endpoint_test.go b/backend/endpoint/endpoint_test.go new file mode 100644 index 0000000..317fc7f --- /dev/null +++ b/backend/endpoint/endpoint_test.go @@ -0,0 +1,70 @@ +package endpoint + +import ( + "encoding/json" + "os" + "testing" +) + +// The facts and their words for made-up reads, as ucode makes them (testdata/trace.uc, scripts/ucode-golden.sh). +func TestAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + Rows []struct { + Host string `json:"host"` + Reads struct { + IPs []string `json:"ips"` + WAN *string `json:"wan"` + Router6 *[]string `json:"router6"` + } `json:"reads"` + Facts json.RawMessage `json:"facts"` + Words struct { + Status string `json:"status"` + Text string `json:"text"` + } `json:"words"` + } `json:"rows"` + Hosts map[string]bool `json:"hosts"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Rows) < 25 || len(trace.Hosts) < 12 { + t.Fatalf("too little: %d rows, %d hosts", len(trace.Rows), len(trace.Hosts)) + } + statuses := map[string]int{} + for i, row := range trace.Rows { + r := Reads{IPs: row.Reads.IPs} + if row.Reads.WAN != nil { + r.WAN = *row.Reads.WAN + } + if row.Reads.Router6 != nil { + r.Router6, r.Known6 = *row.Reads.Router6, true + } + f := Of(row.Host, r) + got, _ := json.Marshal(f) + var a, b any + json.Unmarshal(got, &a) + json.Unmarshal(row.Facts, &b) + ga, _ := json.Marshal(a) + gb, _ := json.Marshal(b) + if string(ga) != string(gb) { + t.Errorf("row %d facts\n go: %s\n ucode: %s", i, ga, gb) + } + status, text := Words(f, "UDP 4500", nil) + statuses[status]++ + if status != row.Words.Status || text != row.Words.Text { + t.Errorf("row %d words\n go: %s %s\n ucode: %s %s", i, status, text, row.Words.Status, row.Words.Text) + } + } + if statuses["ok"] < 3 || statuses["warn"] < 8 || statuses["error"] < 3 { + t.Fatalf("the rows exercise too little: %v", statuses) + } + for h, want := range trace.Hosts { + if got := ValidHost(h); got != want { + t.Errorf("ValidHost(%q) = %v, ucode %v", h, got, want) + } + } +} diff --git a/backend/endpoint/testdata/trace.json b/backend/endpoint/testdata/trace.json new file mode 100644 index 0000000..9cc2fba --- /dev/null +++ b/backend/endpoint/testdata/trace.json @@ -0,0 +1,985 @@ +{ + "rows": [ + { + "host": "", + "reads": { + "ips": [ + ], + "wan": "203.0.113.7" + }, + "facts": { + "host": "", + "ips": [ + ], + "ips4": [ + ], + "ips6": [ + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "error", + "text": "No public address: devices will not know where to connect." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + ], + "wan": "203.0.113.7" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + ], + "ips4": [ + ], + "ips6": [ + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "error", + "text": "vpn.example.org does not resolve." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7" + ], + "wan": "203.0.113.7" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "ok", + "text": "vpn.example.org points at this router (203.0.113.7)." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "198.51.100.4" + ], + "wan": "203.0.113.7" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "198.51.100.4" + ], + "ips4": [ + "198.51.100.4" + ], + "ips6": [ + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org points at 198.51.100.4, not this router (WAN 203.0.113.7). Check your DNS / DDNS." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "198.51.100.4", + "198.51.100.5" + ], + "wan": null + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "198.51.100.4", + "198.51.100.5" + ], + "ips4": [ + "198.51.100.4", + "198.51.100.5" + ], + "ips6": [ + ], + "wan": null, + "kind": "none", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "ok", + "text": "vpn.example.org → 198.51.100.4, 198.51.100.5" + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "104.16.1.1" + ], + "wan": "203.0.113.7" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "104.16.1.1" + ], + "ips4": [ + "104.16.1.1" + ], + "ips6": [ + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": true, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "error", + "text": "vpn.example.org → 104.16.1.1 (Cloudflare). UDP 4500 reaches the router only if this name is DNS-only there, or use the router's IP." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "2606:4700::1" + ], + "wan": "203.0.113.7", + "router6": [ + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "2606:4700::1" + ], + "ips4": [ + ], + "ips6": [ + "2606:4700::1" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": true, + "here": false, + "v6_only": true, + "router6": [ + ], + "foreign6": [ + "2606:4700::1" + ], + "here6": false + }, + "words": { + "status": "error", + "text": "vpn.example.org → 2606:4700::1 (Cloudflare). UDP 4500 reaches the router only if this name is DNS-only there, or use the router's IP." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7" + ], + "wan": "100.70.1.2" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + ], + "wan": "100.70.1.2", + "kind": "cgnat", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "warn", + "text": "The WAN address 100.70.1.2 is CGNAT (shared by the ISP): UDP 4500 cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7" + ], + "wan": "192.168.1.2" + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + ], + "wan": "192.168.1.2", + "kind": "private", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "warn", + "text": "The WAN address 192.168.1.2 is private: this router is behind another one. Forward UDP 4500 on it, or devices cannot connect." + } + }, + { + "host": "203.0.113.7", + "reads": { + "ips": [ + "203.0.113.7" + ], + "wan": "10.0.0.2" + }, + "facts": { + "host": "203.0.113.7", + "ips": [ + "203.0.113.7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + ], + "wan": "10.0.0.2", + "kind": "private", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "warn", + "text": "The WAN address 10.0.0.2 is private: this router is behind another one. Forward UDP 4500 on it, or devices cannot connect." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:DB8:0::7" + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": [ + "2001:DB8:0::7" + ], + "foreign6": [ + ], + "here6": true + }, + "words": { + "status": "ok", + "text": "vpn.example.org points at this router (203.0.113.7, 2001:db8::7)." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": [ + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org AAAA → 2001:db8::7, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "router6": [ + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7", + "2001:db8::8" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": [ + ], + "foreign6": [ + "2001:db8::7", + "2001:db8::8" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org AAAA → 2001:db8::7, 2001:db8::8, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::99" + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": [ + "2001:db8::99" + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org AAAA → 2001:db8::7 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::99", + "2001:db8::7" + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7", + "2001:db8::8" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": [ + "2001:db8::99", + "2001:db8::7" + ], + "foreign6": [ + "2001:db8::8" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org AAAA → 2001:db8::8 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": null + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "203.0.113.7", + "2001:db8::7" + ], + "ips4": [ + "203.0.113.7" + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": true, + "v6_only": false, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "ok", + "text": "vpn.example.org points at this router (203.0.113.7)." + } + }, + { + "host": "vpn.example.org", + "reads": { + "ips": [ + "198.51.100.4", + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::99" + ] + }, + "facts": { + "host": "vpn.example.org", + "ips": [ + "198.51.100.4", + "2001:db8::7" + ], + "ips4": [ + "198.51.100.4" + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": false, + "router6": [ + "2001:db8::99" + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "vpn.example.org points at 198.51.100.4, not this router (WAN 203.0.113.7). Check your DNS / DDNS. vpn.example.org AAAA → 2001:db8::7 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::7" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::7" + ], + "foreign6": [ + ], + "here6": true + }, + "words": { + "status": "warn", + "text": "six.example.org → 2001:db8::7: IPv6 only, so only devices with IPv6 connect (the router's IPv4 203.0.113.7 has no name)." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": null, + "router6": [ + "2001:db8::7" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": null, + "kind": "none", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::7" + ], + "foreign6": [ + ], + "here6": true + }, + "words": { + "status": "ok", + "text": "six.example.org → 2001:db8::7: IPv6 only, so only devices with IPv6 connect." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": "192.168.1.2", + "router6": [ + "2001:db8::7" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "192.168.1.2", + "kind": "private", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::7" + ], + "foreign6": [ + ], + "here6": true + }, + "words": { + "status": "ok", + "text": "six.example.org → 2001:db8::7: IPv6 only, so only devices with IPv6 connect." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "six.example.org → 2001:db8::7: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::99" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7", + "2001:db8::8" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::99" + ], + "foreign6": [ + "2001:db8::7", + "2001:db8::8" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "six.example.org → 2001:db8::7, 2001:db8::8: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::99" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::99" + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "six.example.org → 2001:db8::7: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::8" + ] + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7", + "2001:db8::8" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7", + "2001:db8::8" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::8" + ], + "foreign6": [ + "2001:db8::7" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "six.example.org AAAA → 2001:db8::7 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." + } + }, + { + "host": "six.example.org", + "reads": { + "ips": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "router6": null + }, + "facts": { + "host": "six.example.org", + "ips": [ + "2001:db8::7" + ], + "ips4": [ + ], + "ips6": [ + "2001:db8::7" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": null, + "foreign6": null, + "here6": false + }, + "words": { + "status": "warn", + "text": "six.example.org → 2001:db8::7: IPv6 only, so only devices with IPv6 connect (the router's IPv4 203.0.113.7 has no name)." + } + }, + { + "host": "odd.example.org", + "reads": { + "ips": [ + "not:an:address", + "2001:db8::1::2" + ], + "wan": "203.0.113.7", + "router6": [ + "2001:db8::7" + ] + }, + "facts": { + "host": "odd.example.org", + "ips": [ + "not:an:address", + "2001:db8::1::2" + ], + "ips4": [ + ], + "ips6": [ + "not:an:address", + "2001:db8::1::2" + ], + "wan": "203.0.113.7", + "kind": "public", + "cloudflare": false, + "here": false, + "v6_only": true, + "router6": [ + "2001:db8::7" + ], + "foreign6": [ + "not:an:address", + "2001:db8::1::2" + ], + "here6": false + }, + "words": { + "status": "warn", + "text": "odd.example.org → not:an:address, 2001:db8::1::2: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS." + } + } + ], + "hosts": { + "vpn.example.org": true, + "a": true, + "a-b.c": true, + "-a.example": false, + "a-.example": false, + "a..b": false, + "a_b.example": false, + "203.0.113.7": true, + "2001:db8::1": true, + ":::1": false, + "exa mple": false, + "": false, + "xn--80a.example": true, + "a.": false + } +} diff --git a/backend/files/files.go b/backend/files/files.go new file mode 100644 index 0000000..d1b391a --- /dev/null +++ b/backend/files/files.go @@ -0,0 +1,71 @@ +// Package files is how the backend shares state on disk with the ucode that still runs: the same locks +// (flock on /.lock, dawnline.util lock()) and the same way of writing (a temporary file beside +// the real one, then a rename, so a reader never sees half a file and a full flash leaves the old one). +package files + +import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "os" + "path/filepath" + "syscall" +) + +// Lock takes the named lock of a state directory and returns its release. It waits for whoever holds it +// (the ucode holds these for the length of one read-change-write). A lock that cannot be taken at all (the +// directory is gone) is not an error to stop for: the release then does nothing. +func Lock(dir, name string) (unlock func()) { + os.MkdirAll(dir, 0o755) + f, err := os.OpenFile(filepath.Join(dir, name+".lock"), os.O_WRONLY|os.O_CREATE, 0o644) + if err != nil { + return func() {} + } + if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX); err != nil { + f.Close() + return func() {} + } + return func() { + syscall.Flock(int(f.Fd()), syscall.LOCK_UN) + f.Close() + } +} + +// Write puts data at path all at once: written beside it and renamed over it. +func Write(path string, data []byte, mode os.FileMode) error { + var r [3]byte + rand.Read(r[:]) + tmp := path + ".tmp" + hex.EncodeToString(r[:]) + if err := os.WriteFile(tmp, data, mode); err != nil { + os.Remove(tmp) + return err + } + // WriteFile's mode is cut by the umask: the mode asked for is the one a reader finds. + if err := os.Chmod(tmp, mode); err != nil { + os.Remove(tmp) + return err + } + if err := os.Rename(tmp, path); err != nil { + os.Remove(tmp) + return err + } + return nil +} + +// WriteJSON writes a value as JSON, all at once. +func WriteJSON(path string, v any, mode os.FileMode) error { + data, err := json.Marshal(v) + if err != nil { + return err + } + return Write(path, data, mode) +} + +// ReadJSON reads a file into v; false when it is not there, empty or not JSON (v is then as it was). +func ReadJSON(path string, v any) bool { + data, err := os.ReadFile(path) + if err != nil || len(data) == 0 { + return false + } + return json.Unmarshal(data, v) == nil +} diff --git a/backend/geo/geo.go b/backend/geo/geo.go new file mode 100644 index 0000000..02da154 --- /dev/null +++ b/backend/geo/geo.go @@ -0,0 +1,341 @@ +// Package geo is the city-level places for the admin's map (dawnline.geo). Client addresses are looked up +// once with a third-party service (ipwho.is, ipapi.co as the other) and kept: the live copy in the run +// directory (tmpfs), put on flash about hourly, like the traffic counters. The pages read the cache. +package geo + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "regexp" + "sort" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" +) + +const ( + ttl = 30 * 86400 + retry = 86400 + // limit is the entries kept at least; addresses still shown are never pushed out. + limit = 500 +) + +// Place is what is kept of an address, as the cache's file has it (lat, lon, city, country, cc, asn, org, +// ts; or fail alone: the moment a lookup found nothing). +type Place = map[string]any + +// Cache is the file: the places by address, and the router's own. +type Cache struct { + IPs map[string]Place `json:"ips"` + Home Place `json:"home"` +} + +// Store is where the cache lives. +type Store struct { + Run, Data string +} + +func (s Store) Load() *Cache { + c := &Cache{} + if !files.ReadJSON(s.Run+"/geo.json", c) { + *c = Cache{} + files.ReadJSON(s.Data+"/geo.json", c) + } + if c.IPs == nil { + c.IPs = map[string]Place{} + } + return c +} + +// Save writes the live copy; Flush puts it on flash. +func (s Store) Save(c *Cache) { + os.MkdirAll(s.Run, 0o755) + files.WriteJSON(s.Run+"/geo.json", c, 0o600) +} + +// Flush copies the live cache to flash when it is newer; whether it did. +func (s Store) Flush() bool { + live, err := os.Stat(s.Run + "/geo.json") + if err != nil { + return false + } + if kept, err := os.Stat(s.Data + "/geo.json"); err == nil && !live.ModTime().After(kept.ModTime()) { + return false + } + var c Cache + if !files.ReadJSON(s.Run+"/geo.json", &c) { + return false + } + os.MkdirAll(s.Data, 0o700) + return files.WriteJSON(s.Data+"/geo.json", c, 0o600) == nil +} + +var private4 = []ipnet.Net{} + +func init() { + for _, n := range []string{"0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "198.18.0.0/15", "224.0.0.0/3"} { + if c, ok := ipnet.Any(n); ok { + private4 = append(private4, c) + } + } +} + +var ( + v6 = regexp.MustCompile(`^[0-9a-f:]+$`) + localV6 = regexp.MustCompile(`^(fe[89ab]|f[cd]|::1$|::$)`) +) + +// IsPublic tells an address a location service can say something about. +func IsPublic(ip string) bool { + if ip == "" { + return false + } + if n, ok := ipnet.IP(ip); ok { + for _, c := range private4 { + if c.Holds(n) { + return false + } + } + return true + } + l := strings.ToLower(ip) + return v6.MatchString(l) && !localV6.MatchString(l) +} + +func num(v any) (float64, bool) { + switch x := v.(type) { + case float64: + return x, true + case string: + f, err := strconv.ParseFloat(x, 64) + return f, err == nil + } + return 0, false +} + +func str(v any) string { + s, _ := v.(string) + return s +} + +// Stale is the public addresses of ips the cache does not know or knows from too long ago (a failed lookup +// is tried again after a day), once each and in order. +func Stale(c *Cache, ips []string, now int64) []string { + out := []string{} + seen := map[string]bool{} + for _, ip := range ips { + if seen[ip] || !IsPublic(ip) { + continue + } + seen[ip] = true + if p := c.IPs[ip]; p != nil { + if fail, failed := num(p["fail"]); failed && fail != 0 { + if float64(now)-fail < retry { + continue + } + } else if ts, _ := num(p["ts"]); p["asn"] != nil && float64(now)-ts < ttl { + continue + } + } + out = append(out, ip) + } + return out +} + +// Fetch gets a URL's JSON (nil: not there, or not JSON). +type Fetch func(url string) map[string]any + +// HTTP is Fetch over the network, five seconds at most. +func HTTP(url string) map[string]any { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil + } + res, err := (&http.Client{Timeout: 5 * time.Second}).Do(req) + if err != nil { + return nil + } + defer res.Body.Close() + body, err := io.ReadAll(io.LimitReader(res.Body, 1<<20)) + if err != nil || res.StatusCode != 200 { + return nil + } + var out map[string]any + if json.Unmarshal(body, &out) != nil { + return nil + } + return out +} + +func ipwho(get Fetch, ip string) Place { + j := get("https://ipwho.is/" + ip + "?fields=success,ip,latitude,longitude,city,country,country_code,connection") + if j == nil || j["success"] != true || j["latitude"] == nil { + return nil + } + lat, _ := num(j["latitude"]) + lon, _ := num(j["longitude"]) + cn, _ := j["connection"].(map[string]any) + asn, _ := num(cn["asn"]) + org := str(cn["isp"]) + if org == "" { + org = str(cn["org"]) + } + return Place{"lat": lat, "lon": lon, "city": str(j["city"]), "country": str(j["country"]), "cc": str(j["country_code"]), "ip": j["ip"], "asn": asn, "org": org} +} + +var asPrefix = regexp.MustCompile(`(?i)^AS`) + +func ipapi(get Fetch, ip string) Place { + url := "https://ipapi.co/json/" + if ip != "" { + url = "https://ipapi.co/" + ip + "/json/" + } + j := get(url) + if j == nil || (j["error"] != nil && j["error"] != false) || j["latitude"] == nil { + return nil + } + lat, _ := num(j["latitude"]) + lon, _ := num(j["longitude"]) + asn, _ := strconv.ParseFloat(asPrefix.ReplaceAllString(fmt.Sprint(j["asn"]), ""), 64) + return Place{"lat": lat, "lon": lon, "city": str(j["city"]), "country": str(j["country_name"]), "cc": str(j["country_code"]), "ip": j["ip"], "asn": asn, "org": str(j["org"])} +} + +// Lookup is one lookup with the chosen provider and the other as fallback (ip "": whoever asks). +func Lookup(get Fetch, provider, ip string) Place { + order := []func(Fetch, string) Place{ipwho, ipapi} + if provider == "ipapi.co" { + order = []func(Fetch, string) Place{ipapi, ipwho} + } + for _, fn := range order { + if p := fn(get, ip); p != nil { + return p + } + } + return nil +} + +// LookupAll looks up at most max of ips, within budget seconds (each lookup may wait on the network): a +// place, or nil where the services had nothing, for the ones tried. Network only, no cache. +func LookupAll(get Fetch, provider string, ips []string, max int, budget time.Duration) map[string]Place { + started := time.Now() + out := map[string]Place{} + for _, ip := range ips { + if len(out) >= max || time.Since(started) >= budget { + break + } + p := Lookup(get, provider, ip) + if p != nil { + delete(p, "ip") + } + out[ip] = p + } + return out +} + +func when(p Place) float64 { + if ts, ok := num(p["ts"]); ok { + return ts + } + fail, _ := num(p["fail"]) + return fail +} + +// Merge puts LookupAll's results into the cache; true when it changed. shown is what is still on the map: +// the cache is kept bounded by dropping other entries only, oldest first, so a lookup is never repeated +// for an address that is still on the map. +func Merge(c *Cache, found map[string]Place, shown []string, now int64) bool { + changed := false + for ip, p := range found { + if !IsPublic(ip) { + continue + } + if p != nil { + kept := Place{} + for k, v := range p { + kept[k] = v + } + kept["ts"] = float64(now) + c.IPs[ip] = kept + } else { + c.IPs[ip] = Place{"fail": float64(now)} + } + changed = true + } + if over := len(c.IPs) - limit; over > 0 { + keep := map[string]bool{} + for _, ip := range shown { + keep[ip] = true + } + var other []string + for ip := range c.IPs { + if !keep[ip] { + other = append(other, ip) + } + } + sort.Slice(other, func(i, j int) bool { + a, b := when(c.IPs[other[i]]), when(c.IPs[other[j]]) + if a != b { + return a < b + } + return other[i] < other[j] + }) + for i := 0; i < over && i < len(other); i++ { + delete(c.IPs, other[i]) + changed = true + } + } + return changed +} + +// ResolveHome locates the router itself (the arcs' origin), at most every six hours; true when the cache changed. +func ResolveHome(get Fetch, provider string, c *Cache, wan string, now int64) bool { + h := c.Home + if h != nil && h["asn"] != nil { + if ts, _ := num(h["ts"]); float64(now)-ts < 6*3600 && (wan == "" || !IsPublic(wan) || h["wan"] == wan) { + return false + } + } + // behind NAT, the service is asked for our public address instead + ask := "" + if IsPublic(wan) { + ask = wan + } + next := Place{} + if p := Lookup(get, provider, ask); p != nil { + next = p + next["wan"] = wan + if wan == "" { + next["wan"] = nil + } + } else { + for k, v := range h { + next[k] = v + } + } + next["ts"] = float64(now) + c.Home = next + return true +} + +// Label is "City · ISP" for the activity log; "" for no place (none known, or a failed lookup). +func Label(p Place) string { + if p == nil { + return "" + } + if fail, failed := num(p["fail"]); failed && fail != 0 { + return "" + } + var parts []string + for _, x := range []string{str(p["city"]), str(p["org"])} { + if x != "" { + parts = append(parts, x) + } + } + return strings.Join(parts, " · ") +} diff --git a/backend/geo/geo_test.go b/backend/geo/geo_test.go new file mode 100644 index 0000000..3cf4f28 --- /dev/null +++ b/backend/geo/geo_test.go @@ -0,0 +1,155 @@ +package geo + +import ( + "fmt" + "strings" + "sync" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +const now = 1790000000 + +func place() Place { + return Place{"lat": 45.04, "lon": 38.98, "city": "Krasnodar", "country": "Russia", "cc": "RU", "asn": 12389.0, "org": "Rostelecom"} +} + +func stamped(ts float64) Place { p := place(); p["ts"] = ts; return p } + +// As tests/ucode/geo.test.uc holds the ucode module to. +func TestStaleAndMerge(t *testing.T) { + c := &Cache{IPs: map[string]Place{"37.78.36.76": stamped(now - 86400), "212.233.85.1": stamped(now - 31*86400), "185.135.150.35": {"fail": float64(now - 3600)}, + "185.135.150.28": {"fail": float64(now - 2*86400)}, "83.239.111.148": {"lat": 1.0, "lon": 2.0, "city": "Old", "ts": float64(now)}}} + for _, k := range []struct { + ips []string + want string + }{{[]string{"37.78.36.76"}, ""}, {[]string{"212.233.85.1"}, "212.233.85.1"}, {[]string{"185.135.150.35"}, ""}, {[]string{"185.135.150.28"}, "185.135.150.28"}, + {[]string{"83.239.111.148"}, "83.239.111.148"}, {[]string{"10.0.1.164", "100.64.1.1", "", "fe80::1"}, ""}, {[]string{"1.1.1.1", "8.8.8.8", "1.1.1.1"}, "1.1.1.1 8.8.8.8"}} { + if got := strings.Join(Stale(c, k.ips, now), " "); got != k.want { + t.Errorf("stale of %v: %q, not %q", k.ips, got, k.want) + } + } + c = &Cache{IPs: map[string]Place{}} + if !Merge(c, map[string]Place{"1.1.1.1": place(), "8.8.8.8": nil}, nil, now) { + t.Error("results changed nothing") + } + if c.IPs["1.1.1.1"]["ts"] != float64(now) || c.IPs["1.1.1.1"]["city"] != "Krasnodar" || len(c.IPs["8.8.8.8"]) != 1 || c.IPs["8.8.8.8"]["fail"] != float64(now) { + t.Errorf("after the merge: %v", c.IPs) + } + if Merge(c, nil, nil, now) || Merge(c, map[string]Place{"10.0.0.1": place()}, nil, now) || c.IPs["10.0.0.1"] != nil { + t.Error("nothing, or a local address, changed the cache") + } + if Label(c.IPs["1.1.1.1"]) != "Krasnodar · Rostelecom" || Label(c.IPs["8.8.8.8"]) != "" || Label(nil) != "" || Label(Place{"city": "X"}) != "X" { + t.Error("the labels") + } + // bounded: the oldest go, never what is still shown + c = &Cache{IPs: map[string]Place{}} + for i := 0; i < 500; i++ { + c.IPs[fmt.Sprintf("1.0.%d.%d", i/250, i%250+1)] = stamped(float64(now - 1000 + i)) + } + Merge(c, map[string]Place{"9.9.9.9": place(), "9.9.9.10": place()}, []string{"1.0.0.1"}, now) + if len(c.IPs) != 500 || c.IPs["1.0.0.1"] == nil || c.IPs["1.0.0.2"] != nil || c.IPs["1.0.0.3"] != nil || c.IPs["1.0.0.4"] == nil || c.IPs["9.9.9.9"] == nil { + t.Errorf("the bound: %d entries", len(c.IPs)) + } + for _, ip := range []string{"8.8.8.8", "2a00:1450::1"} { + if !IsPublic(ip) { + t.Errorf("%s is not public", ip) + } + } + for _, ip := range []string{"", "192.168.1.1", "172.20.0.1", "224.0.0.1", "fe80::1", "fd00::1", "::1", "nonsense"} { + if IsPublic(ip) { + t.Errorf("%s is public", ip) + } + } +} + +func TestLookups(t *testing.T) { + var asked []string + get := func(url string) map[string]any { + asked = append(asked, url) + switch { + case strings.HasPrefix(url, "https://ipwho.is/1.1.1.1?"): + return map[string]any{"success": true, "ip": "1.1.1.1", "latitude": 45.04, "longitude": 38.98, "city": "Krasnodar", "country": "Russia", "country_code": "RU", + "connection": map[string]any{"asn": 12389.0, "isp": "Rostelecom", "org": "Other"}} + case url == "https://ipapi.co/8.8.8.8/json/": + return map[string]any{"ip": "8.8.8.8", "latitude": 37.4, "longitude": -122.0, "city": "Mountain View", "country_name": "United States", "country_code": "US", "asn": "AS15169", "org": "GOOGLE"} + case url == "https://ipapi.co/json/": + return map[string]any{"ip": "203.0.113.7", "latitude": 55.7, "longitude": 37.6, "city": "Moscow", "country_name": "Russia", "country_code": "RU", "asn": "AS1", "org": "ISP"} + case strings.HasPrefix(url, "https://ipwho.is/"): + return map[string]any{"success": false} + } + return nil + } + found := LookupAll(get, "ipwho.is", []string{"1.1.1.1", "8.8.8.8", "4.4.4.4", "5.5.5.5"}, 3, time.Minute) + if len(found) != 3 || found["1.1.1.1"]["org"] != "Rostelecom" || found["1.1.1.1"]["ip"] != nil || found["8.8.8.8"]["asn"] != 15169.0 || found["8.8.8.8"]["country"] != "United States" || found["4.4.4.4"] != nil { + t.Errorf("the lookups: %v", found) + } + asked = nil + Lookup(get, "ipapi.co", "1.1.1.1") + if len(asked) != 2 || !strings.HasPrefix(asked[0], "https://ipapi.co/") { + t.Errorf("the chosen provider is not asked first: %v", asked) + } + // the router's own place: behind NAT the service is asked who we are; kept six hours, or until the address moves + c := &Cache{IPs: map[string]Place{}} + if !ResolveHome(get, "ipwho.is", c, "192.168.1.2", now) || c.Home["city"] != "Moscow" || c.Home["wan"] != "192.168.1.2" { + t.Errorf("home: %v", c.Home) + } + if ResolveHome(get, "ipwho.is", c, "192.168.1.2", now+3600) || !ResolveHome(get, "ipwho.is", c, "192.168.1.2", now+7*3600) { + t.Error("home is asked too often, or never again") + } + c.Home["wan"] = "1.1.1.1" + if ResolveHome(get, "ipwho.is", c, "1.1.1.1", now+7*3600+60) || !ResolveHome(get, "ipwho.is", c, "8.8.8.8", now+7*3600+120) || c.Home["city"] != "Mountain View" { + t.Errorf("home after the address moved: %v", c.Home) + } +} + +func TestLocator(t *testing.T) { + dir := t.TempDir() + u := usage.Empty() + u.Devices["d1"] = &usage.Record{IPs: map[string]float64{"1.1.1.1": 1, "10.0.0.9": 1}} + u.Devices["d2"] = &usage.Record{IPs: map[string]float64{"2.2.2.2": 1, "3.3.3.3": 1, "4.4.4.4": 1}} + var mu sync.Mutex + asked := 0 + var where map[string]string + var devices []string + done := make(chan bool, 8) + l := &Locator{Store: Store{Run: dir + "/run", Data: dir + "/data"}, Usage: func() *usage.Usage { return u }, + Get: func(url string) map[string]any { + mu.Lock() + asked++ + mu.Unlock() + if strings.Contains(url, "1.1.1.1") { + return map[string]any{"success": true, "latitude": 1.0, "longitude": 2.0, "city": "Krasnodar", "connection": map[string]any{"asn": 1.0, "isp": "ISP"}} + } + return nil + }, + Found: func(w map[string]string, d []string) { where, devices = w, d; done <- true }} + l.Ask("ipwho.is", []string{"1.1.1.1"}, nil) + select { + case <-done: + case <-time.After(5 * time.Second): + t.Fatal("nothing was found") + } + if where["1.1.1.1"] != "Krasnodar · ISP" || len(devices) != 1 || devices[0] != "d1" { + t.Errorf("found %v for %v", where, devices) + } + if c := l.Store.Load(); c.IPs["1.1.1.1"]["city"] != "Krasnodar" { + t.Errorf("the cache: %v", c.IPs) + } + // the minute: what is shown and unknown, three a run; what is known is not asked again + mu.Lock() + asked = 0 + mu.Unlock() + l.Minute(true, "ipwho.is", "") + time.Sleep(300 * time.Millisecond) + c := l.Store.Load() + if c.IPs["1.1.1.1"]["city"] != "Krasnodar" || c.IPs["2.2.2.2"]["fail"] == nil || c.IPs["3.3.3.3"]["fail"] == nil || c.IPs["4.4.4.4"]["fail"] == nil || c.IPs["10.0.0.9"] != nil { + t.Errorf("after the minute: %v", c.IPs) + } + if !l.Store.Flush() || l.Store.Flush() { + t.Error("the cache is not put on flash once") + } + l.Minute(false, "ipwho.is", "") +} diff --git a/backend/geo/locator.go b/backend/geo/locator.go new file mode 100644 index 0000000..022a081 --- /dev/null +++ b/backend/geo/locator.go @@ -0,0 +1,160 @@ +package geo + +import ( + "sync" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// A lookup run: this many addresses at most, within this long. +const ( + perRun = 3 + budget = 12 * time.Second +) + +// Locator finds the places of addresses for the map, a few at a time and never in the way of who asks: a +// lookup waits on the network for seconds. Addresses that just connected go first; the minute adds +// anything still shown that is missing or stale. One run at a time; what did not fit waits for the next. +type Locator struct { + Store Store + Get Fetch + // Usage is the counters now: they tell which addresses are still shown, and whose they are. + Usage func() *usage.Usage + // Found is told the places found ("City · ISP" by address) and the devices seen from those addresses. + Found func(where map[string]string, devices []string) + + mu sync.Mutex + pending []string + running bool + lastHome int64 +} + +func (l *Locator) shown(u *usage.Usage) []string { + var ips []string + seen := map[string]bool{} + if u == nil { + return ips + } + for _, rec := range u.Devices { + for ip := range rec.IPs { + if !seen[ip] { + seen[ip] = true + ips = append(ips, ip) + } + } + } + return ips +} + +// Ask has these addresses located now (provider: the settings' choice), and with them whatever of more is +// missing or stale. It returns at once; the run goes on by itself. +func (l *Locator) Ask(provider string, ips, more []string) { + l.mu.Lock() + for _, ip := range ips { + known := false + for _, q := range l.pending { + known = known || q == ip + } + if !known { + l.pending = append(l.pending, ip) + } + } + if l.running { + l.mu.Unlock() + return + } + todo := Stale(l.Store.Load(), append(append([]string{}, l.pending...), more...), time.Now().Unix()) + want := todo + if len(want) > perRun { + want = want[:perRun] + } + // what just connected and did not fit waits for the next run + var rest []string + for _, ip := range todo[len(want):] { + for _, q := range l.pending { + if q == ip { + rest = append(rest, ip) + } + } + } + l.pending = rest + if len(want) == 0 { + l.mu.Unlock() + return + } + l.running = true + l.mu.Unlock() + go func() { + found := LookupAll(l.Get, provider, want, perRun, budget) + l.done(found) + l.mu.Lock() + l.running = false + again := len(l.pending) > 0 + l.mu.Unlock() + if again { + l.Ask(provider, nil, nil) + } + }() +} + +// done puts a run's results into the cache and tells who waits for them. +func (l *Locator) done(found map[string]Place) { + u := l.Usage() + c := l.Store.Load() + if !Merge(c, found, l.shown(u), time.Now().Unix()) { + return + } + l.Store.Save(c) + where := map[string]string{} + for ip, p := range found { + if s := Label(p); s != "" { + where[ip] = s + } + } + if len(where) == 0 || l.Found == nil { + return + } + var devices []string + if u != nil { + for id, rec := range u.Devices { + for ip := range where { + if _, has := rec.IPs[ip]; has { + devices = append(devices, id) + break + } + } + } + } + l.Found(where, devices) +} + +// Minute is the minute's part: addresses still shown that are missing or stale get a run, and the router's +// own place is looked at about hourly (wan: its public address as the router has it, "" when unknown). +func (l *Locator) Minute(enabled bool, provider, wan string) { + if !enabled { + l.mu.Lock() + l.pending = nil + l.mu.Unlock() + return + } + l.Ask(provider, nil, l.shown(l.Usage())) + now := time.Now().Unix() + l.mu.Lock() + due := now-l.lastHome > 3600 + if due { + l.lastHome = now + } + l.mu.Unlock() + if due { + go func() { + c := l.Store.Load() + if ResolveHome(l.Get, provider, c, wan, time.Now().Unix()) { + // the places found meanwhile are the file's: only the router's own is put in + fresh := l.Store.Load() + fresh.Home = c.Home + l.Store.Save(fresh) + } + }() + } +} diff --git a/backend/github/github.go b/backend/github/github.go new file mode 100644 index 0000000..81822bf --- /dev/null +++ b/backend/github/github.go @@ -0,0 +1,422 @@ +// Package github is GitHub for the Components tab, as dawnline.github: releases (with each file's sha256), +// one release by tag, and the changes between two tags, each kept ten minutes in the run directory under +// the name the ucode backend keeps its own (gh-.json: whichever asked first, the other reads it, and +// the two share GitHub's hourly allowance). +// +// Trust: the API is only ever asked directly (TLS to api.github.com). +package github + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "regexp" + "strings" + "time" + + "crypto/sha256" + "encoding/hex" + "github.com/tickcount/luci-app-dawnline/backend/files" + "os" +) + +// Failure is why GitHub could not be asked, as a sentence to translate (Msg) and what goes into it (Args). +type Failure struct { + Msg string + Args []any +} + +func (f Failure) Error() string { return fmt.Sprintf(f.Msg, f.Args...) } + +// Client asks GitHub. Get fetches a URL (status 0: no answer); nil is the real one. +type Client struct { + RunDir string + Get func(url string) (status int, body []byte) + Now func() time.Time +} + +func get(url string) (int, []byte) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return 0, nil + } + req.Header.Set("Accept", "application/vnd.github+json") + req.Header.Set("User-Agent", "Dawnline") + res, err := (&http.Client{Timeout: 12 * time.Second}).Do(req) + if err != nil { + return 0, nil + } + defer res.Body.Close() + body, err := io.ReadAll(io.LimitReader(res.Body, 8<<20)) + if err != nil { + return 0, nil + } + return res.StatusCode, body +} + +func (c *Client) now() int64 { + if c.Now != nil { + return c.Now().Unix() + } + return time.Now().Unix() +} + +var rateLimit = regexp.MustCompile(`(?i)rate limit`) + +// api is JSON from the API, or nil when GitHub did not answer or has no such thing; a Failure on a rate +// limit or another API error. +func (c *Client) api(url string) (any, error) { + fetch := c.Get + if fetch == nil { + fetch = get + } + status, body := fetch(url) + if status == 0 { + return nil, nil + } + var j any + if json.Unmarshal(body, &j) != nil { + return nil, nil + } + msg := "" + if m, ok := j.(map[string]any); ok { + msg, _ = m["message"].(string) + } + if status == 403 || status == 429 || rateLimit.MatchString(msg) { + return nil, Failure{Msg: "GitHub API rate limit reached: try again in an hour."} + } + if status == 404 { + return nil, nil + } + if status >= 400 { + if msg == "" { + msg = fmt.Sprintf("HTTP %d", status) + } + return nil, Failure{Msg: "GitHub: %s", Args: []any{msg}} + } + return j, nil +} + +var unsafe = regexp.MustCompile(`[^A-Za-z0-9_.-]`) + +// cached answers from the file while it is fresh, else asks; what could not be asked anew is the old answer. +func (c *Client) cached(key string, ttl int64, fn func() (any, error)) (any, error) { + path := c.RunDir + "/gh-" + unsafe.ReplaceAllString(key, "_") + ".json" + var kept struct { + At float64 `json:"at"` + Data any `json:"data"` + } + has := files.ReadJSON(path, &kept) + if has && float64(c.now())-kept.At < float64(ttl) { + return kept.Data, nil + } + data, err := fn() + if err != nil { + return nil, err + } + if data != nil { + files.WriteJSON(path, map[string]any{"at": c.now(), "data": data}, 0o644) + return data, nil + } + return kept.Data, nil +} + +var digest = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`) + +// slim is what is kept of a release. +func slim(x map[string]any) map[string]any { + digests, ids := map[string]any{}, map[string]any{} + names := []any{} + list, _ := x["assets"].([]any) + for _, a := range list { + m, _ := a.(map[string]any) + name, _ := m["name"].(string) + names = append(names, m["name"]) + if d, _ := m["digest"].(string); digest.MatchString(d) { + digests[name] = d[7:] + } + if id, ok := m["id"].(float64); ok && id > 0 && id == float64(int64(id)) { + ids[name] = id + } + } + or := func(v, dflt any) any { + if v == nil { + return dflt + } + return v + } + body, _ := x["body"].(string) + if len(body) > 12000 { + body = body[:12000] + } + pre, _ := x["prerelease"].(bool) + return map[string]any{ + "tag": x["tag_name"], "name": or(x["name"], x["tag_name"]), "published": x["published_at"], "prerelease": pre, "url": x["html_url"], + "body": body, "assets": names, "digests": digests, "ids": ids, + } +} + +// Releases is a repository's releases, newest first, five a page (drafts skipped). +func (c *Client) Releases(repo string, page int) ([]any, error) { + data, err := c.cached(fmt.Sprintf("rel-%s-%d", repo, page), 600, func() (any, error) { + j, err := c.api(fmt.Sprintf("https://api.github.com/repos/%s/releases?per_page=5&page=%d", repo, page)) + list, ok := j.([]any) + if err != nil || !ok { + return nil, err + } + out := []any{} + for _, x := range list { + if m, ok := x.(map[string]any); ok && m["draft"] != true { + out = append(out, slim(m)) + } + } + return out, nil + }) + list, _ := data.([]any) + if list == nil { + list = []any{} + } + return list, err +} + +// Release is one release by tag (its notes, its files and their sha256), or nil. +func (c *Client) Release(repo, tag string) (map[string]any, error) { + data, err := c.cached("tag-"+repo+"-"+tag, 600, func() (any, error) { + j, err := c.api("https://api.github.com/repos/" + repo + "/releases/tags/" + tag) + if m, ok := j.(map[string]any); ok && m["tag_name"] != nil && m["tag_name"] != "" { + return slim(m), err + } + return nil, err + }) + m, _ := data.(map[string]any) + return m, err +} + +var ( + point = regexp.MustCompile(`^\s*[-*]\s+(.*)$`) + wrapped = regexp.MustCompile(`^\s+\S`) + version = regexp.MustCompile(`^(Dawnline )?v?[0-9]+\.[0-9]+(\.[0-9]+)?$`) +) + +const space = " \t\r\n\v\f" + +// Points is what changed in a commit message: a release commit lists its changes as "- " lines in the +// body, any other commit is its title. Wrapped points are joined back into one line. +func Points(msg string) []string { + lines := strings.Split(msg, "\n") + title := strings.Trim(lines[0], space) + out := []string{} + if strings.HasPrefix(title, "Merge ") { + return out + } + cur, open := "", false + for _, line := range lines[1:] { + if m := point.FindStringSubmatch(line); m != nil { + if open { + out = append(out, cur) + } + cur, open = strings.Trim(m[1], space), true + } else if open && wrapped.MatchString(line) { + cur += " " + strings.Trim(line, space) + } else if open { + out = append(out, cur) + open = false + } + } + if open { + out = append(out, cur) + } + if len(out) == 0 && title != "" && !version.MatchString(title) { + out = append(out, title) + } + return out +} + +func message(commit any) string { + m, _ := commit.(map[string]any) + c, _ := m["commit"].(map[string]any) + s, _ := c["message"].(string) + return s +} + +// Changes is what changed from one tag to another, newest first, twenty points at most: commit by commit, +// or the release's own commit when there is no base to compare with. +func (c *Client) Changes(repo, base, head string) ([]any, error) { + key := base + if base == "" { + key = "null" + } + data, err := c.cached("changes-"+repo+"-"+key+"-"+head, 600, func() (any, error) { + cut := func(points []any) any { + if len(points) > 20 { + points = points[:20] + } + return points + } + if base != "" { + j, err := c.api("https://api.github.com/repos/" + repo + "/compare/" + base + "..." + head) + if err != nil { + return nil, err + } + m, _ := j.(map[string]any) + if commits, ok := m["commits"].([]any); ok { + out := []any{} + for i := len(commits) - 1; i >= 0; i-- { + for _, p := range Points(message(commits[i])) { + out = append(out, p) + } + } + return cut(out), nil + } + } + j, err := c.api("https://api.github.com/repos/" + repo + "/commits/" + head) + if err != nil { + return nil, err + } + if m, _ := j.(map[string]any); m["commit"] != nil { + out := []any{} + for _, p := range Points(message(j)) { + out = append(out, p) + } + return cut(out), nil + } + return nil, nil + }) + list, _ := data.([]any) + if list == nil { + list = []any{} + } + return list, err +} + +// Mirrors are prefixes that fetch github.com files when GitHub itself is unreachable. A file may come +// through one only when its sha256 is known from the API, and is kept only if it matches. +var Mirrors = []string{"https://ghfast.top/", "https://gh-proxy.com/", "https://ghproxy.net/"} + +// Latest is a repository's latest stable release, or nil when GitHub does not answer. +func (c *Client) Latest(repo string) map[string]any { + data, _ := c.cached("latest-"+repo, 300, func() (any, error) { + j, err := c.api("https://api.github.com/repos/" + repo + "/releases/latest") + if m, ok := j.(map[string]any); ok && m["tag_name"] != nil && m["tag_name"] != "" { + return slim(m), err + } + return nil, err + }) + m, _ := data.(map[string]any) + return m +} + +// AssetSHA256 is the sha256 GitHub publishes for a release's file, or "". +func (c *Client) AssetSHA256(repo, tag, name string) string { + r, _ := c.Release(repo, tag) + digests, _ := r["digests"].(map[string]any) + s, _ := digests[name].(string) + return s +} + +// Assets is the names of a release's files (nil: no such release, or GitHub does not answer). +func (c *Client) Assets(repo, tag string) []string { + r, _ := c.Release(repo, tag) + if r == nil { + return nil + } + list, _ := r["assets"].([]any) + out := []string{} + for _, a := range list { + if s, is := a.(string); is { + out = append(out, s) + } + } + return out +} + +// Fetch downloads a URL into a file; false when it did not come whole. +type Fetch func(url, dest string) bool + +// HTTPFetch is Fetch over the network: five minutes at most, redirects followed. +func HTTPFetch(url, dest string) bool { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return false + } + req.Header.Set("User-Agent", "Dawnline") + res, err := (&http.Client{Timeout: 300 * time.Second}).Do(req) + if err != nil { + return false + } + defer res.Body.Close() + if res.StatusCode != 200 { + return false + } + f, err := os.OpenFile(dest, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600) + if err != nil { + return false + } + n, err := io.Copy(f, res.Body) + if cerr := f.Close(); err != nil || cerr != nil || n == 0 { + os.Remove(dest) + return false + } + return true +} + +// SHA256 is a file's sha256 in hex, or "". +func SHA256(path string) string { + f, err := os.Open(path) + if err != nil { + return "" + } + defer f.Close() + h := sha256.New() + if _, err := io.Copy(h, f); err != nil { + return "" + } + return hex.EncodeToString(h.Sum(nil)) +} + +var fromGitHub = regexp.MustCompile(`^https://(github\.com|raw\.githubusercontent\.com)/`) + +// Download gets a file: GitHub itself first; a mirror only when the sha256 is known (from the API) and +// mirrors are allowed. A file that does not match the sha256 is thrown away and the next source is tried. +// It returns the URL that worked, or "". log is told of mirrors (words in t's language; nil: English). +func Download(fetch Fetch, url, dest, want string, mirrors bool, log func(string), t func(string) string) string { + if t == nil { + t = func(s string) string { return s } + } + say := func(format string, args ...any) { + if log != nil { + log(fmt.Sprintf(t(format), args...)) + } + } + want = strings.ToLower(want) + type try struct { + url string + mirror bool + } + tries := []try{{url, false}} + if want != "" && mirrors && fromGitHub.MatchString(url) { + for _, m := range Mirrors { + tries = append(tries, try{m + url, true}) + } + } + for i, x := range tries { + host := strings.SplitN(strings.TrimPrefix(x.url, "https://"), "/", 2)[0] + if x.mirror { + say("Trying mirror %s", host) + } + if fetch(x.url, dest) { + if st, err := os.Stat(dest); err == nil && st.Size() > 0 { + if want == "" || SHA256(dest) == want { + return x.url + } + say("Warning: %s sent a file that does not match GitHub's sha256, discarded", host) + } + } + os.Remove(dest) + if i == 0 && len(tries) > 1 { + say("GitHub did not answer, trying mirrors") + } + } + return "" +} diff --git a/backend/github/github_test.go b/backend/github/github_test.go new file mode 100644 index 0000000..4851810 --- /dev/null +++ b/backend/github/github_test.go @@ -0,0 +1,84 @@ +package github + +import ( + "reflect" + "strings" + "testing" + "time" +) + +func TestPoints(t *testing.T) { + for msg, want := range map[string][]string{ + "Dawnline 0.3.1\n\n- one thing\n- another,\n wrapped onto a line\n\n* a third\ntrailing words": {"one thing", "another, wrapped onto a line", "a third"}, + "Fix the portal's port": {"Fix the portal's port"}, + "Merge branch 'main' into x\n\n- a": {}, + "v0.4.0": {}, + "Dawnline 0.3": {}, + "": {}, + "A title\n\nwords, no points": {"A title"}, + } { + if got := Points(msg); !reflect.DeepEqual(got, want) { + t.Errorf("%q: %q", msg, got) + } + } +} + +func TestReleasesAndTheCache(t *testing.T) { + now := time.Unix(1_800_000_000, 0) + asked := 0 + answers := map[string]struct { + status int + body string + }{ + "https://api.github.com/repos/o/r/releases?per_page=5&page=1": {200, `[{"tag_name":"v2","name":null,"prerelease":true,"html_url":"u","body":"notes","published_at":"2027-01-01T00:00:00Z", + "assets":[{"name":"a.apk","id":77,"digest":"sha256:` + strings.Repeat("ab", 32) + `"},{"name":"b.txt","id":78,"digest":"md5:x"}]},{"tag_name":"draft","draft":true},{"tag_name":"v1"}]`}, + "https://api.github.com/repos/o/r/releases/tags/v2": {200, `{"tag_name":"v2","body":"` + strings.Repeat("x", 13000) + `"}`}, + "https://api.github.com/repos/o/r/releases/tags/v9": {404, `{"message":"Not Found"}`}, + "https://api.github.com/repos/o/r/releases/tags/limited": {403, `{"message":"API rate limit exceeded"}`}, + "https://api.github.com/repos/o/r/releases/tags/broken": {500, `{"message":"Server Error"}`}, + "https://api.github.com/repos/o/r/compare/v1...v2": {200, `{"commits":[{"commit":{"message":"older"}},{"commit":{"message":"Dawnline 2\n\n- newer a\n- newer b"}}]}`}, + "https://api.github.com/repos/o/r/commits/v2": {200, `{"commit":{"message":"Dawnline 2\n\n- its own"}}`}, + } + c := &Client{RunDir: t.TempDir(), Now: func() time.Time { return now }, Get: func(url string) (int, []byte) { + asked++ + a := answers[url] + return a.status, []byte(a.body) + }} + rel, err := c.Releases("o/r", 1) + if err != nil || len(rel) != 2 { + t.Fatalf("releases: %v %v", rel, err) + } + first := rel[0].(map[string]any) + if first["tag"] != "v2" || first["name"] != "v2" || first["prerelease"] != true || !reflect.DeepEqual(first["assets"], []any{"a.apk", "b.txt"}) || + !reflect.DeepEqual(first["digests"], map[string]any{"a.apk": strings.Repeat("ab", 32)}) || len(first["ids"].(map[string]any)) != 2 { + t.Fatalf("a release: %v", first) + } + // kept ten minutes, then asked again; with no answer the second time, the old one stands + c.Releases("o/r", 1) + if asked != 1 { + t.Fatal("asked again within ten minutes") + } + now = now.Add(11 * time.Minute) + delete(answers, "https://api.github.com/repos/o/r/releases?per_page=5&page=1") + if rel, _ := c.Releases("o/r", 1); asked != 2 || len(rel) != 2 { + t.Fatalf("with GitHub out of reach: asked %d, %d releases", asked, len(rel)) + } + if r, _ := c.Release("o/r", "v2"); len(r["body"].(string)) != 12000 { + t.Fatal("the notes are not cut") + } + if r, err := c.Release("o/r", "v9"); r != nil || err != nil { + t.Fatalf("no such release: %v %v", r, err) + } + if _, err := c.Release("o/r", "limited"); err == nil || err.Error() != "GitHub API rate limit reached: try again in an hour." { + t.Fatalf("a rate limit: %v", err) + } + if _, err := c.Release("o/r", "broken"); err == nil || err.Error() != "GitHub: Server Error" { + t.Fatalf("an API error: %v", err) + } + if ch, _ := c.Changes("o/r", "v1", "v2"); !reflect.DeepEqual(ch, []any{"newer a", "newer b", "older"}) { + t.Fatalf("changes between tags: %v", ch) + } + if ch, _ := c.Changes("o/r", "", "v2"); !reflect.DeepEqual(ch, []any{"its own"}) { + t.Fatalf("a release's own changes: %v", ch) + } +} diff --git a/backend/go.mod b/backend/go.mod new file mode 100644 index 0000000..17d9725 --- /dev/null +++ b/backend/go.mod @@ -0,0 +1,3 @@ +module github.com/tickcount/luci-app-dawnline/backend + +go 1.24 diff --git a/backend/handout/behind_test.go b/backend/handout/behind_test.go new file mode 100644 index 0000000..47ff1d5 --- /dev/null +++ b/backend/handout/behind_test.go @@ -0,0 +1,74 @@ +package handout + +import ( + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// A device that sends only some networks into the tunnel is given what is behind the routers it reaches; +// one that sends everything needs no word of them, and a router is never given its own. +func TestNetworksBehindRoutersInAConfiguration(t *testing.T) { + text, err := os.ReadFile("../access/testdata/access.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + home := []string{"192.168.77.0/24"} + allowed := func(id string) string { + m := model.Load(c, nil) + cfg := ClientConfig(m, m.Devices[id], home) + if cfg == nil { + t.Fatalf("%s has no configuration", id) + } + return strings.Join(cfg.Amnezia.AllowedIPs, ", ") + } + print := func(id string) string { + m := model.Load(c, nil) + return Fingerprint(m, m.Devices[id], home) + } + // Anna's laptop keeps its own local network outside; her phone sends everything; Fedor is in another circle + before := map[string]string{} + for _, id := range []string{"laptop", "phone", "bphone", "fphone", "dphone", "lphone"} { + before[id] = print(id) + } + c.Set("bphone", "kind", "router") + c.SetList("bphone", "behind_net", []string{"192.168.2.0/24"}) + c.Set("kphone", "kind", "router") + c.SetList("kphone", "behind_net", []string{"192.168.3.0/24"}) + c.Set("fphone", "lan_bypass", "1") + c.Set("lphone", "lan_bypass", "1") + if got := allowed("laptop"); !strings.Contains(got, "192.168.2.0/24") || strings.Contains(got, "192.168.3.0/24") { + t.Errorf("Anna's laptop, in Boris's circle: %s", got) + } + if got := allowed("phone"); got != "0.0.0.0/0, ::/0" { + t.Errorf("Anna's phone sends everything: %s", got) + } + if got := allowed("fphone"); strings.Contains(got, "192.168.2.0/24") { + t.Errorf("Fedor's phone, in another circle: %s", got) + } + // where everyone reaches everyone: the other server's network, and only that server's + if got := allowed("lphone"); !strings.Contains(got, "192.168.3.0/24") || strings.Contains(got, "192.168.2.0/24") { + t.Errorf("Lev's phone: %s", got) + } + // a router is not told to send its own network into the tunnel + c.Set("bphone", "lan_bypass", "1") + if got := allowed("bphone"); strings.Contains(got, "192.168.2.0/24") { + t.Errorf("Boris's router: %s", got) + } + // who was given a new network must import again; who was not keeps what they hold + if print("laptop") == before["laptop"] { + t.Error("Anna's laptop holds a configuration without the network, and is not told") + } + for _, id := range []string{"phone", "dphone"} { + if print(id) != before[id] { + t.Errorf("%s is told to import again for a network that is not in its configuration", id) + } + } +} diff --git a/backend/handout/handout.go b/backend/handout/handout.go new file mode 100644 index 0000000..cde2c32 --- /dev/null +++ b/backend/handout/handout.go @@ -0,0 +1,349 @@ +// Package handout is what a device is given: its configuration (the .conf and what the AmneziaVPN key is +// made of) and the fingerprint that tells whether the one it holds is still the one it would get. As +// dawnline.awg client_config, allowed_ips and config_fingerprint make them, character for character: a +// fingerprint that differed between the two backends would tell every device to import again. +// +// Pure: the settings and the home networks in, text out. The home networks are the router's own (which +// interfaces are home, and what they reach): the caller reads them and hands them in. +package handout + +import ( + "fmt" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// ObfKeys is the disguise's settings in the order a configuration lists them (dawnline.core OBF_KEYS). +var ObfKeys = []string{"jc", "jmin", "jmax", "s1", "s2", "s3", "s4", "h1", "h2", "h3", "h4", "i1", "i2", "i3", "i4", "i5", + "header_protection_key", "content_padding_addition", "rekey_after_time", "rekey_timeout", "reject_after_time", + "keepalive_timeout", "max_handshake_attempts", "random_trailers", "disable_cookies"} + +// What each is called in a .conf (dawnline.awg OBF_CONF). +var obfConf = map[string]string{ + "jc": "Jc", "jmin": "Jmin", "jmax": "Jmax", "s1": "S1", "s2": "S2", "s3": "S3", "s4": "S4", + "h1": "H1", "h2": "H2", "h3": "H3", "h4": "H4", "i1": "I1", "i2": "I2", "i3": "I3", "i4": "I4", "i5": "I5", + "header_protection_key": "HeaderProtectionKey", "content_padding_addition": "ContentPaddingAddition", + "rekey_after_time": "RekeyAfterTime", "rekey_timeout": "RekeyTimeout", "reject_after_time": "RejectAfterTime", + "keepalive_timeout": "KeepaliveTimeout", "max_handshake_attempts": "MaxHandshakeAttempts", + "random_trailers": "RandomTrailers", "disable_cookies": "DisableCookies", +} + +// Bypass4 is every IPv4 address but the private ranges, and Bypass6 every IPv6 one outside fc00::/7, +// fe80::/10 and ff00::/8: what a device with its own local network kept outside sends into the tunnel +// (tests/ucode/awg.test.uc proves each is exactly that complement). +var Bypass4 = []string{ + "0.0.0.0/5", "8.0.0.0/7", "11.0.0.0/8", "12.0.0.0/6", "16.0.0.0/4", "32.0.0.0/3", "64.0.0.0/3", "96.0.0.0/6", + "100.0.0.0/10", "100.128.0.0/9", "101.0.0.0/8", "102.0.0.0/7", "104.0.0.0/5", "112.0.0.0/4", "128.0.0.0/3", "160.0.0.0/5", + "168.0.0.0/8", "169.0.0.0/9", "169.128.0.0/10", "169.192.0.0/11", "169.224.0.0/12", "169.240.0.0/13", "169.248.0.0/14", + "169.252.0.0/15", "169.255.0.0/16", "170.0.0.0/7", "172.0.0.0/12", "172.32.0.0/11", "172.64.0.0/10", "172.128.0.0/9", + "173.0.0.0/8", "174.0.0.0/7", "176.0.0.0/4", "192.0.0.0/9", "192.128.0.0/11", "192.160.0.0/13", "192.169.0.0/16", + "192.170.0.0/15", "192.172.0.0/14", "192.176.0.0/12", "192.192.0.0/10", "193.0.0.0/8", "194.0.0.0/7", "196.0.0.0/6", + "200.0.0.0/5", "208.0.0.0/4", +} +var Bypass6 = []string{"::/1", "8000::/2", "c000::/3", "e000::/4", "f000::/5", "f800::/6", "fe00::/9", "fec0::/10"} + +// AllowedIPs is what a device sends into the tunnel. Home only: the person's home networks, the tunnel +// network or the router's address, and the DNS. Internet: everything, or with the device's own local +// network kept outside everything but that, every DNS server it is given and for home access what Home +// only gets. `home` is the home networks the person reaches; dev may be nil. +// +// What is behind other people's routers is part of what a device reaches: a device that sends only some +// networks into the tunnel gets those too (as the settings have them: which of them the router has taken +// is the router's to know, and a network it has not is dropped there). +func AllowedIPs(m *model.Model, srv *model.Server, p *model.Person, dev *model.Device, home []string) []string { + if p.Access != "lan" && (dev == nil || !dev.LanBypass) { + return []string{"0.0.0.0/0", "::/0"} + } + reach := func() []string { + nets := append([]string{}, home...) + // With devices reaching each other, the whole tunnel network (the router's address is in it); + // otherwise only the router's own address. + if srv.DeviceMesh && srv.Subnet != "" { + nets = append(nets, srv.Subnet) + } else if a := model.ServerAddress(srv); a != "" { + nets = append(nets, a+"/32") + } + id := "" + if dev != nil { + id = dev.ID + } + return append(nets, m.BehindReach(p, id, m.BehindOf(nil))...) + } + dns := m.ClientDNS(srv, p) + if p.Access == "lan" { + nets := reach() + if len(dns) > 0 && dns[0] != "" { + nets = append(nets, dns[0]+"/32") + } + return ipnet.Collapse(nets) + } + // Every DNS server stays in the tunnel: a private one left out would be asked on whatever network + // the device is on (a public one is in the rest). + nets := append([]string{}, Bypass4...) + var nets6 []string + seen6 := map[string]bool{} + for _, a := range dns { + if _, ok := ipnet.IP(a); ok { + nets = append(nets, a+"/32") + } else if ipnet.Private6(a) && !seen6[a] { + seen6[a] = true + nets6 = append(nets6, a+"/128") + } + } + if p.Access == "both" { + nets = append(nets, reach()...) + } + out := append(ipnet.Collapse(nets), Bypass6...) + return append(out, nets6...) +} + +// ObfNeutral tells whether the disguise's settings change nothing on the wire (plain WireGuard). +func ObfNeutral(o map[string]string) bool { + for _, k := range ObfKeys { + v := o[k] + if v == "" { + continue + } + want := "0" + switch k { + case "h1": + want = "1" + case "h2": + want = "2" + case "h3": + want = "3" + case "h4": + want = "4" + } + if v != want { + return false + } + } + return true +} + +// clientObf is the disguise a device's configuration carries. The junk a device sends is its own: within +// the preset's ranges the count and sizes are shifted a little by the device (the same way every time, so +// the configuration keeps its fingerprint), so two phones of one family do not share one profile. What +// the server must agree on stays the server's. +func clientObf(srv *model.Server, dev *model.Device) map[string]string { + o := map[string]string{} + for k, v := range srv.Obf { + o[k] = v + } + num := func(s string) (int64, bool) { + f, ok := model.Number(s) + return int64(f), ok && s != "" + } + jc, ok := num(o["jc"]) + if ObfNeutral(o) || !ok || jc <= 0 { + return o + } + key := srv.ID + "/" + dev.ID + "/" + srv.Obf["h1"] + seed := int64(2166136261) + for i := 0; i < len(key); i++ { + seed = ((seed ^ int64(key[i])) * 16777619) & 0x7fffffff + } + pick := func(n int64) int64 { + seed = (seed*1103515245 + 12345) & 0x7fffffff + return seed % n + } + jmin, _ := num(o["jmin"]) + jmax, _ := num(o["jmax"]) + o["jc"] = strconv.FormatInt(max(1, min(10, jc+pick(3)-1)), 10) + if jmax > jmin+32 { + lo := jmin + pick(17) + hi := jmax - pick(17) + if hi <= lo { + hi = lo + 32 + } + o["jmin"], o["jmax"] = strconv.FormatInt(lo, 10), strconv.FormatInt(hi, 10) + } + return o +} + +// Amnezia is what the AmneziaVPN key is made of. +type Amnezia struct { + Host string `json:"host"` + Port int `json:"port"` + MTU string `json:"mtu"` + DNS []string `json:"dns"` + AllowedIPs []string `json:"allowed_ips"` + ClientIP string `json:"client_ip"` + ClientPrivKey string `json:"client_priv_key"` + ClientPubKey string `json:"client_pub_key"` + PSKKey string `json:"psk_key"` + ServerPubKey string `json:"server_pub_key"` + PersistentKeepAlive string `json:"persistent_keep_alive"` + Obfuscation map[string]string `json:"obfuscation"` +} + +// Config is a device's configuration. +type Config struct { + Name string `json:"name"` + Person string `json:"person"` + Server string `json:"server"` + Filename string `json:"filename"` + Conf string `json:"conf"` + HasPrivateKey bool `json:"has_private_key"` + Amnezia Amnezia `json:"amnezia"` +} + +// ClientConfig is the configuration a device gets now, or nil when it has no server. +func ClientConfig(m *model.Model, dev *model.Device, home []string) *Config { + p := m.People[dev.Person] + if p == nil { + return nil + } + srv := m.Servers[p.Server] + if srv == nil { + return nil + } + host := m.EndpointHost(srv) + ep := host + if strings.Contains(host, ":") && !strings.HasPrefix(host, "[") { + ep = "[" + host + "]" + } + allowed := AllowedIPs(m, srv, p, dev, home) + dns := m.ClientDNS(srv, p) + mtu := model.DeviceMTU(srv, dev) + priv := dev.PrivateKey + if priv == "" { + priv = "" + } + lines := []string{"[Interface]", "PrivateKey = " + priv, "Address = " + dev.Address + "/32"} + if len(dns) > 0 { + lines = append(lines, "DNS = "+strings.Join(dns, ", ")) + } + lines = append(lines, fmt.Sprintf("MTU = %d", mtu)) + // "Off" is plain WireGuard: neutral values are left out, so any WireGuard app accepts the file. + obf := clientObf(srv, dev) + if !ObfNeutral(obf) { + for _, k := range ObfKeys { + if obf[k] != "" { + lines = append(lines, obfConf[k]+" = "+obf[k]) + } + } + } + lines = append(lines, "", "[Peer]", "PublicKey = "+srv.PublicKey) + if dev.PresharedKey != "" { + lines = append(lines, "PresharedKey = "+dev.PresharedKey) + } + lines = append(lines, "AllowedIPs = "+strings.Join(allowed, ", "), fmt.Sprintf("Endpoint = %s:%d", ep, srv.Port)) + keepalive := "" + if lo, hi, on := model.KeepaliveRange(srv, dev); on { + keepalive = strconv.Itoa(lo) + if hi != lo { + keepalive = fmt.Sprintf("%d-%d", lo, hi) + } + lines = append(lines, "PersistentKeepalive = "+keepalive) + } + alive := keepalive + if alive == "" { + alive = "0" + } + return &Config{ + Name: dev.Name, Person: p.Name, Server: srv.Name, + // The file name is the tunnel's name in WireGuard apps: the server's. + Filename: TunnelName(srv.Name) + ".conf", + Conf: strings.Join(lines, "\n") + "\n", + HasPrivateKey: dev.PrivateKey != "", + Amnezia: Amnezia{ + Host: host, Port: srv.Port, MTU: strconv.Itoa(mtu), DNS: dns, AllowedIPs: allowed, + ClientIP: dev.Address, ClientPrivKey: dev.PrivateKey, ClientPubKey: dev.PublicKey, + PSKKey: dev.PresharedKey, ServerPubKey: srv.PublicKey, PersistentKeepAlive: alive, Obfuscation: obf, + }, + } +} + +// Fingerprint is what a device holds, minus what is its own alone (its private key, its junk's count and +// sizes): it changes when the device must import again. "" for a device with no server. +func Fingerprint(m *model.Model, dev *model.Device, home []string) string { + c := ClientConfig(m, dev, home) + if c == nil { + return "" + } + var keep []string + for _, l := range strings.Split(c.Conf, "\n") { + own := false + for _, k := range []string{"PrivateKey ", "Jc ", "Jmin ", "Jmax "} { + own = own || strings.HasPrefix(l, k) + } + if !own { + keep = append(keep, l) + } + } + h := uint32(2166136261) + for _, b := range []byte(strings.Join(keep, "\n")) { + h = (h ^ uint32(b)) * 16777619 + } + return fmt.Sprintf("%08x", h) +} + +// Cyrillic letters written in Latin, from а (dawnline.util translit). +var cyrillic = []string{"a", "b", "v", "g", "d", "e", "zh", "z", "i", "y", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", + "f", "kh", "ts", "ch", "sh", "shch", "", "y", "", "e", "yu", "ya"} +var cyrillicMore = map[rune]string{0x451: "yo", 0x456: "i", 0x457: "yi", 0x454: "ye", 0x491: "g"} + +// Translit writes Cyrillic letters in Latin ("Мама" → "mama"); other characters are left alone. +func Translit(s string) string { + var b strings.Builder + for _, r := range s { + switch { + case r >= 0x410 && r <= 0x42f: + r += 0x20 + case r == 0x401: + r = 0x451 + case r == 0x406: + r = 0x456 + case r == 0x407: + r = 0x457 + case r == 0x404: + r = 0x454 + case r == 0x490: + r = 0x491 + } + if r >= 0x430 && int(r-0x430) < len(cyrillic) { + b.WriteString(cyrillic[r-0x430]) + } else if t, ok := cyrillicMore[r]; ok { + b.WriteString(t) + } else { + b.WriteRune(r) + } + } + return b.String() +} + +// Names Windows keeps for devices: no file may be called that. +var winDevices = map[string]bool{"con": true, "prn": true, "aux": true, "nul": true} + +// TunnelName is a server's name as a tunnel's (a file's) name: Latin letters and digits, at most 15. +func TunnelName(name string) string { + var b strings.Builder + gap := false + for _, c := range []byte(Translit(name)) { + if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' { + if gap { + b.WriteByte('-') + } + gap = false + b.WriteByte(c) + } else { + gap = true + } + } + // a gap at either end is trimmed: one before the first letter was written as a dash above + l := strings.Trim(b.String(), "-") + if len(l) > 15 { + l = l[:15] + } + l = strings.TrimRight(l, "-") + low := strings.ToLower(l) + if l == "" || winDevices[low] || (len(low) == 4 && (strings.HasPrefix(low, "com") || strings.HasPrefix(low, "lpt")) && low[3] >= '1' && low[3] <= '9') { + return "dawnline" + } + return l +} diff --git a/backend/handout/handout_test.go b/backend/handout/handout_test.go new file mode 100644 index 0000000..43d197d --- /dev/null +++ b/backend/handout/handout_test.go @@ -0,0 +1,81 @@ +package handout + +import ( + "encoding/json" + "os" + "reflect" + "sort" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Every device of testdata/conf.uci gets the configuration and the fingerprint ucode gives it +// (scripts/ucode-golden.sh writes trace.json from dawnline.awg), from the home networks ucode found. +func TestHeldToUcode(t *testing.T) { + text, err := os.ReadFile("testdata/conf.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Names map[string]string `json:"names"` + Devices map[string]struct { + Home []string `json:"home"` + Config any `json:"config"` + FP *string `json:"fp"` + } `json:"devices"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + if len(golden.Devices) != len(m.Devices) || len(m.Devices) < 20 { + t.Fatalf("ucode knows %d devices, Go %d", len(golden.Devices), len(m.Devices)) + } + ids := make([]string, 0, len(golden.Devices)) + for id := range golden.Devices { + ids = append(ids, id) + } + sort.Strings(ids) + homes := 0 + for _, id := range ids { + want := golden.Devices[id] + dev := m.Devices[id] + if dev == nil { + t.Fatalf("%s: not in the Go model", id) + } + homes += len(want.Home) + got := ClientConfig(m, dev, want.Home) + var plain any + if got != nil { + b, _ := json.Marshal(got) + json.Unmarshal(b, &plain) + } + if !reflect.DeepEqual(plain, want.Config) { + g, _ := json.MarshalIndent(plain, "", " ") + w, _ := json.MarshalIndent(want.Config, "", " ") + t.Fatalf("%s: the configuration differs\nGo: %s\nucode: %s", id, g, w) + } + fp := Fingerprint(m, dev, want.Home) + if (want.FP == nil) != (fp == "") || (want.FP != nil && *want.FP != fp) { + t.Fatalf("%s: fingerprint %q, ucode has %v", id, fp, want.FP) + } + } + if homes == 0 { + t.Fatal("no device of the trace reaches a home network: the trace was made without its interfaces") + } + for name, want := range golden.Names { + if got := TunnelName(name); got != want { + t.Errorf("the tunnel's name of %q: %q, ucode has %q", name, got, want) + } + } +} diff --git a/backend/handout/testdata/conf.uci b/backend/handout/testdata/conf.uci new file mode 100644 index 0000000..57eebb2 --- /dev/null +++ b/backend/handout/testdata/conf.uci @@ -0,0 +1,311 @@ +# Configurations to hold to ucode: plain WireGuard, the junk-only disguise, the 3.1 one; home-only people with +# and without home names, internet, both; a device with its own local network outside; names in Cyrillic. +config settings 'settings' + option portal_host 'vpn.example.com' + option home_dns_fallback '9.9.9.9' + +config server 'plain' + option name 'Дом на море' + option ifname 'awgplain' + option port '51820' + option subnet '10.9.0.0/24' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' + option auto_lan '0' + list lan_device 'dlhome' + list lan_device 'dlguest' + +config server 'junk' + option name 'con' + option ifname 'awgjunk' + option port '443' + option subnet '10.10.0.0/29' + option endpoint '2001:db8::7' + option public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=' + option mesh 'off' + option keepalive '25' + option jc '4' + option jmin '40' + option jmax '200' + option s1 '15' + option s2 '68' + option h1 '1407' + option h2 '2' + option h3 '3' + option h4 '4' + list dns '10.10.0.1' + list dns 'fd00::53' + list dns '2606:4700::1111' + list dns '192.168.50.2' + option auto_lan '0' + list lan_device 'dlhome' + +config server 'max' + option name 'A very long server name indeed' + option ifname 'awgmax' + option port '8443' + option subnet '172.20.0.0/16' + option public_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + option keepalive '30' + option mtu '1420' + option jc '10' + option jmin '64' + option jmax '90' + option s4 '24' + option h1 '100-200' + option h2 '300-400' + option h3 '500-600' + option h4 '700-800' + option i1 '' + option header_protection_key 'yvVKA41To0000000000000000000IUdcl4Zi0000000=' + option rekey_after_time '100-140' + option auto_lan '0' + +config person 'p_net' + option server 'plain' + option name 'Internet' + option access 'wan' + +config person 'p_both' + option server 'plain' + option name 'Both' + option access 'both' + +config person 'p_lan' + option server 'plain' + option name 'Home' + option access 'lan' + +config person 'p_lanhome' + option server 'plain' + option name 'Home names' + option access 'lan' + option dns_mode 'home' + list home_nets 'dlguest' + +config person 'j_both' + option server 'junk' + option name 'Junk both' + option access 'both' + +config person 'j_lan' + option server 'junk' + option name 'Junk home' + option access 'lan' + option dns_mode 'home' + +config person 'm_net' + option server 'max' + option name 'Max' + option access 'wan' + +config person 'lost' + option server 'gone' + option name 'Lost' + +config device 'd_p_net_0' + option person 'p_net' + option name 'Device 0' + option kind 'phone' + option address '10.9.0.4' + option public_key 'k00' + +config device 'd_p_net_1' + option person 'p_net' + option name 'Device 1' + option kind 'computer' + option address '10.9.0.5' + option public_key 'k01' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_p_net_2' + option person 'p_net' + option name 'Device 2' + option kind 'router' + option address '10.9.0.6' + option public_key 'k02' + option mtu '1300' + option keepalive '0' + +config device 'd_p_both_0' + option person 'p_both' + option name 'Device 0' + option kind 'phone' + option address '10.9.0.7' + option public_key 'k10' + +config device 'd_p_both_1' + option person 'p_both' + option name 'Device 1' + option kind 'computer' + option address '10.9.0.8' + option public_key 'k11' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_p_both_2' + option person 'p_both' + option name 'Device 2' + option kind 'router' + option address '10.9.0.9' + option public_key 'k12' + option mtu '1300' + option keepalive '0' + +config device 'd_p_lan_0' + option person 'p_lan' + option name 'Device 0' + option kind 'phone' + option address '10.9.0.10' + option public_key 'k20' + +config device 'd_p_lan_1' + option person 'p_lan' + option name 'Device 1' + option kind 'computer' + option address '10.9.0.11' + option public_key 'k21' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_p_lan_2' + option person 'p_lan' + option name 'Device 2' + option kind 'router' + option address '10.9.0.12' + option public_key 'k22' + option mtu '1300' + option keepalive '0' + +config device 'd_p_lanhome_0' + option person 'p_lanhome' + option name 'Device 0' + option kind 'phone' + option address '10.9.0.13' + option public_key 'k30' + +config device 'd_p_lanhome_1' + option person 'p_lanhome' + option name 'Device 1' + option kind 'computer' + option address '10.9.0.14' + option public_key 'k31' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_p_lanhome_2' + option person 'p_lanhome' + option name 'Device 2' + option kind 'router' + option address '10.9.0.15' + option public_key 'k32' + option mtu '1300' + option keepalive '0' + +config device 'd_j_both_0' + option person 'j_both' + option name 'Device 0' + option kind 'phone' + option address '10.10.0.16' + option public_key 'k40' + +config device 'd_j_both_1' + option person 'j_both' + option name 'Device 1' + option kind 'computer' + option address '10.10.0.17' + option public_key 'k41' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_j_both_2' + option person 'j_both' + option name 'Device 2' + option kind 'router' + option address '10.10.0.18' + option public_key 'k42' + option mtu '1300' + option keepalive '0' + +config device 'd_j_lan_0' + option person 'j_lan' + option name 'Device 0' + option kind 'phone' + option address '10.10.0.19' + option public_key 'k50' + +config device 'd_j_lan_1' + option person 'j_lan' + option name 'Device 1' + option kind 'computer' + option address '10.10.0.20' + option public_key 'k51' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_j_lan_2' + option person 'j_lan' + option name 'Device 2' + option kind 'router' + option address '10.10.0.21' + option public_key 'k52' + option mtu '1300' + option keepalive '0' + +config device 'd_m_net_0' + option person 'm_net' + option name 'Device 0' + option kind 'phone' + option address '172.20.0.22' + option public_key 'k60' + +config device 'd_m_net_1' + option person 'm_net' + option name 'Device 1' + option kind 'computer' + option address '172.20.0.23' + option public_key 'k61' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_m_net_2' + option person 'm_net' + option name 'Device 2' + option kind 'router' + option address '172.20.0.24' + option public_key 'k62' + option mtu '1300' + option keepalive '0' + +config device 'd_lost_0' + option person 'lost' + option name 'Device 0' + option kind 'phone' + option address '10.99.0.25' + option public_key 'k70' + +config device 'd_lost_1' + option person 'lost' + option name 'Device 1' + option kind 'computer' + option address '10.99.0.26' + option public_key 'k71' + option lan_bypass '1' + option private_key 'cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=' + option preshared_key 'cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=' + +config device 'd_lost_2' + option person 'lost' + option name 'Device 2' + option kind 'router' + option address '10.99.0.27' + option public_key 'k72' + option mtu '1300' + option keepalive '0' diff --git a/backend/handout/testdata/trace.json b/backend/handout/testdata/trace.json new file mode 100644 index 0000000..6a8ece5 --- /dev/null +++ b/backend/handout/testdata/trace.json @@ -0,0 +1,1077 @@ +{ + "names": { + "Дом на море": "dom-na-more", + "con": "dawnline", + "A very long server name indeed": "A-very-long-ser", + " --x-- ": "x", + "LPT1": "dawnline", + "Юля Ёж": "yulya-yozh", + "": "dawnline", + "Їжак-Ґанок": "yizhak-ganok", + "a_b.c": "a-b-c" + }, + "devices": { + "d_j_both_0": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Junk both", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.10.0.16/32\nDNS = 10.10.0.1, fd00::53, 2606:4700::1111, 192.168.50.2\nMTU = 1280\nJc = 4\nJmin = 45\nJmax = 194\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = [2001:db8::7]:443\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1280", + "dns": [ + "10.10.0.1", + "fd00::53", + "2606:4700::1111", + "192.168.50.2" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.10.0.16", + "client_priv_key": "", + "client_pub_key": "k40", + "psk_key": "", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "25", + "obfuscation": { + "jc": "4", + "jmin": "45", + "jmax": "194", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "40f4d569" + }, + "d_j_both_1": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Junk both", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.10.0.17/32\nDNS = 10.10.0.1, fd00::53, 2606:4700::1111, 192.168.50.2\nMTU = 1380\nJc = 4\nJmin = 55\nJmax = 200\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 10.10.0.1/32, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fe00::/9, fec0::/10, fd00::53/128\nEndpoint = [2001:db8::7]:443\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1380", + "dns": [ + "10.10.0.1", + "fd00::53", + "2606:4700::1111", + "192.168.50.2" + ], + "allowed_ips": [ + "0.0.0.0/5", + "8.0.0.0/7", + "10.10.0.1/32", + "11.0.0.0/8", + "12.0.0.0/6", + "16.0.0.0/4", + "32.0.0.0/3", + "64.0.0.0/3", + "96.0.0.0/6", + "100.0.0.0/10", + "100.128.0.0/9", + "101.0.0.0/8", + "102.0.0.0/7", + "104.0.0.0/5", + "112.0.0.0/4", + "128.0.0.0/3", + "160.0.0.0/5", + "168.0.0.0/8", + "169.0.0.0/9", + "169.128.0.0/10", + "169.192.0.0/11", + "169.224.0.0/12", + "169.240.0.0/13", + "169.248.0.0/14", + "169.252.0.0/15", + "169.255.0.0/16", + "170.0.0.0/7", + "172.0.0.0/12", + "172.32.0.0/11", + "172.64.0.0/10", + "172.128.0.0/9", + "173.0.0.0/8", + "174.0.0.0/7", + "176.0.0.0/4", + "192.0.0.0/9", + "192.128.0.0/11", + "192.160.0.0/13", + "192.168.50.0/24", + "192.169.0.0/16", + "192.170.0.0/15", + "192.172.0.0/14", + "192.176.0.0/12", + "192.192.0.0/10", + "193.0.0.0/8", + "194.0.0.0/7", + "196.0.0.0/6", + "200.0.0.0/5", + "208.0.0.0/4", + "::/1", + "8000::/2", + "c000::/3", + "e000::/4", + "f000::/5", + "f800::/6", + "fe00::/9", + "fec0::/10", + "fd00::53/128" + ], + "client_ip": "10.10.0.17", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k41", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "25", + "obfuscation": { + "jc": "4", + "jmin": "55", + "jmax": "200", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "41736131" + }, + "d_j_both_2": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Junk both", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.10.0.18/32\nDNS = 10.10.0.1, fd00::53, 2606:4700::1111, 192.168.50.2\nMTU = 1300\nJc = 3\nJmin = 56\nJmax = 186\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = [2001:db8::7]:443\n", + "has_private_key": false, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1300", + "dns": [ + "10.10.0.1", + "fd00::53", + "2606:4700::1111", + "192.168.50.2" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.10.0.18", + "client_priv_key": "", + "client_pub_key": "k42", + "psk_key": "", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "0", + "obfuscation": { + "jc": "3", + "jmin": "56", + "jmax": "186", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "a48b8b85" + }, + "d_j_lan_0": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Junk home", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.10.0.19/32\nDNS = 10.10.0.1, 9.9.9.9\nMTU = 1280\nJc = 5\nJmin = 48\nJmax = 188\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nAllowedIPs = 10.10.0.1/32, 192.168.50.0/24\nEndpoint = [2001:db8::7]:443\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1280", + "dns": [ + "10.10.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.10.0.1/32", + "192.168.50.0/24" + ], + "client_ip": "10.10.0.19", + "client_priv_key": "", + "client_pub_key": "k50", + "psk_key": "", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "25", + "obfuscation": { + "jc": "5", + "jmin": "48", + "jmax": "188", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "bf05e885" + }, + "d_j_lan_1": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Junk home", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.10.0.20/32\nDNS = 10.10.0.1, 9.9.9.9\nMTU = 1380\nJc = 3\nJmin = 49\nJmax = 186\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 10.10.0.1/32, 192.168.50.0/24\nEndpoint = [2001:db8::7]:443\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1380", + "dns": [ + "10.10.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.10.0.1/32", + "192.168.50.0/24" + ], + "client_ip": "10.10.0.20", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k51", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "25", + "obfuscation": { + "jc": "3", + "jmin": "49", + "jmax": "186", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "8dc74d69" + }, + "d_j_lan_2": { + "home": [ + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Junk home", + "server": "con", + "filename": "dawnline.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.10.0.21/32\nDNS = 10.10.0.1, 9.9.9.9\nMTU = 1300\nJc = 3\nJmin = 54\nJmax = 200\nS1 = 15\nS2 = 68\nH1 = 1407\nH2 = 2\nH3 = 3\nH4 = 4\n\n[Peer]\nPublicKey = AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=\nAllowedIPs = 10.10.0.1/32, 192.168.50.0/24\nEndpoint = [2001:db8::7]:443\n", + "has_private_key": false, + "amnezia": { + "host": "2001:db8::7", + "port": 443, + "mtu": "1300", + "dns": [ + "10.10.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.10.0.1/32", + "192.168.50.0/24" + ], + "client_ip": "10.10.0.21", + "client_priv_key": "", + "client_pub_key": "k52", + "psk_key": "", + "server_pub_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "persistent_keep_alive": "0", + "obfuscation": { + "jc": "3", + "jmin": "54", + "jmax": "200", + "s1": "15", + "s2": "68", + "h1": "1407", + "h2": "2", + "h3": "3", + "h4": "4" + } + } + }, + "fp": "77e90b48" + }, + "d_lost_0": { + "home": [ + ], + "config": null, + "fp": null + }, + "d_lost_1": { + "home": [ + ], + "config": null, + "fp": null + }, + "d_lost_2": { + "home": [ + ], + "config": null, + "fp": null + }, + "d_m_net_0": { + "home": [ + ], + "config": { + "name": "Device 0", + "person": "Max", + "server": "A very long server name indeed", + "filename": "A-very-long-ser.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 172.20.0.22/32\nDNS = 172.20.0.1\nMTU = 1280\nJc = 10\nJmin = 64\nJmax = 90\nS4 = 24\nH1 = 100-200\nH2 = 300-400\nH3 = 500-600\nH4 = 700-800\nI1 = \nHeaderProtectionKey = yvVKA41To0000000000000000000IUdcl4Zi0000000=\nRekeyAfterTime = 100-140\n\n[Peer]\nPublicKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:8443\nPersistentKeepalive = 30-40\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 8443, + "mtu": "1280", + "dns": [ + "172.20.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "172.20.0.22", + "client_priv_key": "", + "client_pub_key": "k60", + "psk_key": "", + "server_pub_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "persistent_keep_alive": "30-40", + "obfuscation": { + "jc": "10", + "jmin": "64", + "jmax": "90", + "s4": "24", + "h1": "100-200", + "h2": "300-400", + "h3": "500-600", + "h4": "700-800", + "i1": "", + "header_protection_key": "yvVKA41To0000000000000000000IUdcl4Zi0000000=", + "rekey_after_time": "100-140" + } + } + }, + "fp": "e79e68c0" + }, + "d_m_net_1": { + "home": [ + ], + "config": { + "name": "Device 1", + "person": "Max", + "server": "A very long server name indeed", + "filename": "A-very-long-ser.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 172.20.0.23/32\nDNS = 172.20.0.1\nMTU = 1420\nJc = 9\nJmin = 64\nJmax = 90\nS4 = 24\nH1 = 100-200\nH2 = 300-400\nH3 = 500-600\nH4 = 700-800\nI1 = \nHeaderProtectionKey = yvVKA41To0000000000000000000IUdcl4Zi0000000=\nRekeyAfterTime = 100-140\n\n[Peer]\nPublicKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.20.0.1/32, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fe00::/9, fec0::/10\nEndpoint = vpn.example.com:8443\nPersistentKeepalive = 30-40\n", + "has_private_key": true, + "amnezia": { + "host": "vpn.example.com", + "port": 8443, + "mtu": "1420", + "dns": [ + "172.20.0.1" + ], + "allowed_ips": [ + "0.0.0.0/5", + "8.0.0.0/7", + "11.0.0.0/8", + "12.0.0.0/6", + "16.0.0.0/4", + "32.0.0.0/3", + "64.0.0.0/3", + "96.0.0.0/6", + "100.0.0.0/10", + "100.128.0.0/9", + "101.0.0.0/8", + "102.0.0.0/7", + "104.0.0.0/5", + "112.0.0.0/4", + "128.0.0.0/3", + "160.0.0.0/5", + "168.0.0.0/8", + "169.0.0.0/9", + "169.128.0.0/10", + "169.192.0.0/11", + "169.224.0.0/12", + "169.240.0.0/13", + "169.248.0.0/14", + "169.252.0.0/15", + "169.255.0.0/16", + "170.0.0.0/7", + "172.0.0.0/12", + "172.20.0.1/32", + "172.32.0.0/11", + "172.64.0.0/10", + "172.128.0.0/9", + "173.0.0.0/8", + "174.0.0.0/7", + "176.0.0.0/4", + "192.0.0.0/9", + "192.128.0.0/11", + "192.160.0.0/13", + "192.169.0.0/16", + "192.170.0.0/15", + "192.172.0.0/14", + "192.176.0.0/12", + "192.192.0.0/10", + "193.0.0.0/8", + "194.0.0.0/7", + "196.0.0.0/6", + "200.0.0.0/5", + "208.0.0.0/4", + "::/1", + "8000::/2", + "c000::/3", + "e000::/4", + "f000::/5", + "f800::/6", + "fe00::/9", + "fec0::/10" + ], + "client_ip": "172.20.0.23", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k61", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "persistent_keep_alive": "30-40", + "obfuscation": { + "jc": "9", + "jmin": "64", + "jmax": "90", + "s4": "24", + "h1": "100-200", + "h2": "300-400", + "h3": "500-600", + "h4": "700-800", + "i1": "", + "header_protection_key": "yvVKA41To0000000000000000000IUdcl4Zi0000000=", + "rekey_after_time": "100-140" + } + } + }, + "fp": "b6a6f114" + }, + "d_m_net_2": { + "home": [ + ], + "config": { + "name": "Device 2", + "person": "Max", + "server": "A very long server name indeed", + "filename": "A-very-long-ser.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 172.20.0.24/32\nDNS = 172.20.0.1\nMTU = 1300\nJc = 10\nJmin = 64\nJmax = 90\nS4 = 24\nH1 = 100-200\nH2 = 300-400\nH3 = 500-600\nH4 = 700-800\nI1 = \nHeaderProtectionKey = yvVKA41To0000000000000000000IUdcl4Zi0000000=\nRekeyAfterTime = 100-140\n\n[Peer]\nPublicKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:8443\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 8443, + "mtu": "1300", + "dns": [ + "172.20.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "172.20.0.24", + "client_priv_key": "", + "client_pub_key": "k62", + "psk_key": "", + "server_pub_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "persistent_keep_alive": "0", + "obfuscation": { + "jc": "10", + "jmin": "64", + "jmax": "90", + "s4": "24", + "h1": "100-200", + "h2": "300-400", + "h3": "500-600", + "h4": "700-800", + "i1": "", + "header_protection_key": "yvVKA41To0000000000000000000IUdcl4Zi0000000=", + "rekey_after_time": "100-140" + } + } + }, + "fp": "593d12f1" + }, + "d_p_both_0": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Both", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.7/32\nDNS = 10.9.0.1\nMTU = 1280\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1280", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.9.0.7", + "client_priv_key": "", + "client_pub_key": "k10", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "f4f5790e" + }, + "d_p_both_1": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Both", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.9.0.8/32\nDNS = 10.9.0.1\nMTU = 1380\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 10.9.0.0/24, 10.20.4.0/22, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.50.0/24, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fe00::/9, fec0::/10\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1380", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/5", + "8.0.0.0/7", + "10.9.0.0/24", + "10.20.4.0/22", + "11.0.0.0/8", + "12.0.0.0/6", + "16.0.0.0/4", + "32.0.0.0/3", + "64.0.0.0/3", + "96.0.0.0/6", + "100.0.0.0/10", + "100.128.0.0/9", + "101.0.0.0/8", + "102.0.0.0/7", + "104.0.0.0/5", + "112.0.0.0/4", + "128.0.0.0/3", + "160.0.0.0/5", + "168.0.0.0/8", + "169.0.0.0/9", + "169.128.0.0/10", + "169.192.0.0/11", + "169.224.0.0/12", + "169.240.0.0/13", + "169.248.0.0/14", + "169.252.0.0/15", + "169.255.0.0/16", + "170.0.0.0/7", + "172.0.0.0/12", + "172.32.0.0/11", + "172.64.0.0/10", + "172.128.0.0/9", + "173.0.0.0/8", + "174.0.0.0/7", + "176.0.0.0/4", + "192.0.0.0/9", + "192.128.0.0/11", + "192.160.0.0/13", + "192.168.50.0/24", + "192.169.0.0/16", + "192.170.0.0/15", + "192.172.0.0/14", + "192.176.0.0/12", + "192.192.0.0/10", + "193.0.0.0/8", + "194.0.0.0/7", + "196.0.0.0/6", + "200.0.0.0/5", + "208.0.0.0/4", + "::/1", + "8000::/2", + "c000::/3", + "e000::/4", + "f000::/5", + "f800::/6", + "fe00::/9", + "fec0::/10" + ], + "client_ip": "10.9.0.8", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k11", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "fc08cab6" + }, + "d_p_both_2": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Both", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.9/32\nDNS = 10.9.0.1\nMTU = 1300\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:51820\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1300", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.9.0.9", + "client_priv_key": "", + "client_pub_key": "k12", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "0", + "obfuscation": { + } + } + }, + "fp": "85bdb4c2" + }, + "d_p_lan_0": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Home", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.10/32\nMTU = 1280\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1280", + "dns": [ + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.10", + "client_priv_key": "", + "client_pub_key": "k20", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "2d8f7b1b" + }, + "d_p_lan_1": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Home", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.9.0.11/32\nMTU = 1380\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1380", + "dns": [ + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.11", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k21", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "95dd2ca2" + }, + "d_p_lan_2": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Home", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.12/32\nMTU = 1300\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1300", + "dns": [ + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.12", + "client_priv_key": "", + "client_pub_key": "k22", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "0", + "obfuscation": { + } + } + }, + "fp": "5cb618bf" + }, + "d_p_lanhome_0": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Home names", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.13/32\nDNS = 10.9.0.1, 9.9.9.9\nMTU = 1280\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1280", + "dns": [ + "10.9.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.13", + "client_priv_key": "", + "client_pub_key": "k30", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "fd821941" + }, + "d_p_lanhome_1": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Home names", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.9.0.14/32\nDNS = 10.9.0.1, 9.9.9.9\nMTU = 1380\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1380", + "dns": [ + "10.9.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.14", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k31", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "0cd3309a" + }, + "d_p_lanhome_2": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Home names", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.15/32\nDNS = 10.9.0.1, 9.9.9.9\nMTU = 1300\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 10.9.0.0/24, 10.20.4.0/22, 192.168.50.0/24\nEndpoint = vpn.example.com:51820\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1300", + "dns": [ + "10.9.0.1", + "9.9.9.9" + ], + "allowed_ips": [ + "10.9.0.0/24", + "10.20.4.0/22", + "192.168.50.0/24" + ], + "client_ip": "10.9.0.15", + "client_priv_key": "", + "client_pub_key": "k32", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "0", + "obfuscation": { + } + } + }, + "fp": "dd101345" + }, + "d_p_net_0": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 0", + "person": "Internet", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.4/32\nDNS = 10.9.0.1\nMTU = 1280\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1280", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.9.0.4", + "client_priv_key": "", + "client_pub_key": "k00", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "e56bee63" + }, + "d_p_net_1": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 1", + "person": "Internet", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=\nAddress = 10.9.0.5/32\nDNS = 10.9.0.1\nMTU = 1380\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nPresharedKey = cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=\nAllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 10.9.0.1/32, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fe00::/9, fec0::/10\nEndpoint = vpn.example.com:51820\nPersistentKeepalive = 25\n", + "has_private_key": true, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1380", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/5", + "8.0.0.0/7", + "10.9.0.1/32", + "11.0.0.0/8", + "12.0.0.0/6", + "16.0.0.0/4", + "32.0.0.0/3", + "64.0.0.0/3", + "96.0.0.0/6", + "100.0.0.0/10", + "100.128.0.0/9", + "101.0.0.0/8", + "102.0.0.0/7", + "104.0.0.0/5", + "112.0.0.0/4", + "128.0.0.0/3", + "160.0.0.0/5", + "168.0.0.0/8", + "169.0.0.0/9", + "169.128.0.0/10", + "169.192.0.0/11", + "169.224.0.0/12", + "169.240.0.0/13", + "169.248.0.0/14", + "169.252.0.0/15", + "169.255.0.0/16", + "170.0.0.0/7", + "172.0.0.0/12", + "172.32.0.0/11", + "172.64.0.0/10", + "172.128.0.0/9", + "173.0.0.0/8", + "174.0.0.0/7", + "176.0.0.0/4", + "192.0.0.0/9", + "192.128.0.0/11", + "192.160.0.0/13", + "192.169.0.0/16", + "192.170.0.0/15", + "192.172.0.0/14", + "192.176.0.0/12", + "192.192.0.0/10", + "193.0.0.0/8", + "194.0.0.0/7", + "196.0.0.0/6", + "200.0.0.0/5", + "208.0.0.0/4", + "::/1", + "8000::/2", + "c000::/3", + "e000::/4", + "f000::/5", + "f800::/6", + "fe00::/9", + "fec0::/10" + ], + "client_ip": "10.9.0.5", + "client_priv_key": "cHJpdmF0ZXByaXZhdGVwcml2YXRlcHJpdmF0ZXByaXY=", + "client_pub_key": "k01", + "psk_key": "cHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHNrcHM=", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "25", + "obfuscation": { + } + } + }, + "fp": "e45e89f4" + }, + "d_p_net_2": { + "home": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "config": { + "name": "Device 2", + "person": "Internet", + "server": "Дом на море", + "filename": "dom-na-more.conf", + "conf": "[Interface]\nPrivateKey = \nAddress = 10.9.0.6/32\nDNS = 10.9.0.1\nMTU = 1300\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nAllowedIPs = 0.0.0.0/0, ::/0\nEndpoint = vpn.example.com:51820\n", + "has_private_key": false, + "amnezia": { + "host": "vpn.example.com", + "port": 51820, + "mtu": "1300", + "dns": [ + "10.9.0.1" + ], + "allowed_ips": [ + "0.0.0.0/0", + "::/0" + ], + "client_ip": "10.9.0.6", + "client_priv_key": "", + "client_pub_key": "k02", + "psk_key": "", + "server_pub_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "persistent_keep_alive": "0", + "obfuscation": { + } + } + }, + "fp": "45052bb9" + } + } +} diff --git a/backend/health/data.go b/backend/health/data.go new file mode 100644 index 0000000..4c73efe --- /dev/null +++ b/backend/health/data.go @@ -0,0 +1,334 @@ +package health + +import ( + "fmt" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/disguise" + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// ModelErrors is what is wrong with people and devices, as sentences in t's language (dawnline.core +// model_errors): what the sync would have to leave out, or what points at something that does not exist. +// Empty when the settings are consistent. +func ModelErrors(m *model.Model, t *i18n.Catalog) []string { + errs := []string{} + codes := map[string]string{} + for _, id := range m.PersonIDs() { + p := m.People[id] + if p.Server != "" && m.Servers[p.Server] == nil { + errs = append(errs, fmt.Sprintf(t.T("Person %s: server %s does not exist."), p.Name, p.Server)) + } + if p.Circle != "" && m.Circles[p.Circle] == nil { + errs = append(errs, fmt.Sprintf(t.T("Person %s: circle %s does not exist."), p.Name, p.Circle)) + } + for _, sid := range p.Services { + if m.Services[sid] == nil { + errs = append(errs, fmt.Sprintf(t.T("Person %s: home service %s does not exist."), p.Name, sid)) + } + } + if p.Code != "" { + if other, twice := codes[p.Code]; twice { + errs = append(errs, fmt.Sprintf(t.T("Person %s: has the same personal link as %s."), p.Name, other)) + } + codes[p.Code] = p.Name + } + } + type holder struct{ device, person string } + addrs := map[string]holder{} + for _, id := range m.DeviceIDs() { + d := m.Devices[id] + p := m.People[d.Person] + if p == nil { + errs = append(errs, fmt.Sprintf(t.T("Device %s: person %s does not exist."), d.Name, d.Person)) + continue + } + say := func(msg string, args ...any) { + errs = append(errs, fmt.Sprintf(t.T(msg), append([]any{d.Name, p.Name}, args...)...)) + } + if !awg.ValidKey(d.PublicKey) { + say("Device %s of %s: the public key is not a key.") + } + if d.PrivateKey != "" && !awg.ValidKey(d.PrivateKey) { + say("Device %s of %s: the private key is not a key.") + } + if d.PresharedKey != "" && !awg.ValidKey(d.PresharedKey) { + say("Device %s of %s: the preshared key is not a key.") + } + // its own link values (0 / nil: the server's); one out of range is never used + if d.MTU != 0 && (d.MTU < 1280 || d.MTU > 1500) { + say("Device %s of %s: MTU %d is not between 1280 and 1500.", d.MTU) + } + if d.Keepalive != nil && (*d.Keepalive < 0 || *d.Keepalive > 600) { + say("Device %s of %s: keep-alive %d is not between 0 and 600 seconds.", *d.Keepalive) + } + n, ok := ipnet.IP(d.Address) + if !ok { + if d.Address != "" { + say("Device %s of %s: address %s is not a plain IPv4 address.", d.Address) + } else { + say("Device %s of %s: address (none) is not a plain IPv4 address.") + } + continue + } + srv := m.Servers[p.Server] + // AmneziaWG ignores a peer with the interface's own key + if srv != nil && srv.PublicKey != "" && d.PublicKey == srv.PublicKey { + say("Device %s of %s: the public key is the server's own.") + } + if srv != nil { + if net, ok := ipnet.Subnet(srv.Subnet); ok { + last := uint64(net.Base) + net.Size() - 2 + if n < net.First() || uint64(n) > last { + say("Device %s of %s: address %s is outside %s's tunnel %s.", d.Address, srv.Name, srv.Subnet) + } else if n == net.First() { + say("Device %s of %s: address %s is the router's own address on %s.", d.Address, srv.Name) + } + } + } + key := p.Server + " " + d.Address + if o, taken := addrs[key]; taken { + say("Device %s of %s: address %s is also used by device %s of %s.", d.Address, o.device, o.person) + } + addrs[key] = holder{d.Name, p.Name} + } + for _, id := range m.CircleIDs() { + if c := m.Circles[id]; m.Servers[c.Server] == nil { + errs = append(errs, fmt.Sprintf(t.T("Circle %s: server %s does not exist."), c.Name, c.Server)) + } + } + return errs +} + +// TunnelDevices is the devices the sync loads into a server's tunnel, in the settings' order +// (dawnline.awg tunnel_devices): those of people who are active or held only by a limit the portal +// explains, that are on, with a key and an address, and not the server's own key. states is each person's +// state (package state). +func TunnelDevices(m *model.Model, sid string, states map[string]string) []*model.Device { + out := []*model.Device{} + own := "" + if srv := m.Servers[sid]; srv != nil { + own = srv.PublicKey + } + for _, id := range m.DeviceIDs() { + d := m.Devices[id] + p := m.People[d.Person] + // turned off, or a router its owner asked for that the admin has not taken + if p == nil || p.Server != sid || d.Disabled || d.Waiting { + continue + } + if s := states[p.ID]; s != "active" && s != "quota" { + continue + } + if _, ok := ipnet.IP(d.Address); !ok || !awg.ValidKey(d.PublicKey) || (own != "" && d.PublicKey == own) { + continue + } + out = append(out, d) + } + return out +} + +// PeerDiff is how the peers read on a tunnel differ from the devices that belong there, counted by key. +func PeerDiff(devs []*model.Device, peers map[string]awg.Peer, ifname string) Peers { + want := map[string]bool{} + for _, d := range devs { + want[d.PublicKey] = true + } + p := Peers{Expected: len(devs)} + found := 0 + for k, peer := range peers { + if peer.Ifname != ifname { + continue + } + p.Loaded++ + if want[k] { + found++ + } else { + p.Extra++ + } + } + p.Missing = len(want) - found + return p +} + +// Divert is a policy rule that sends marked traffic into a table with `local default`, the way transparent +// proxies capture the router's own traffic. +type Divert struct { + Pref int + Mark, Mask uint32 + Table string +} + +const markAll = 0xffffffff + +var ( + markRule = regexp.MustCompile(`^(\d+):.*fwmark 0x([0-9a-f]+)(/0x([0-9a-f]+))?.* lookup (\S+)`) + localDefault = regexp.MustCompile(`(^|\n)local default`) +) + +// ProxyDiverts finds the diverts, one a mark and mask (dawnline.fw proxy_diverts). rules is `ip +// rule show` and table `ip route show table `, for "-4" and "-6". +func ProxyDiverts(rules func(family string) string, table func(family, name string) string) []Divert { + out := []Divert{} + seen := map[string]bool{} + for _, fam := range []string{"-4", "-6"} { + for _, line := range strings.Split(rules(fam), "\n") { + m := markRule.FindStringSubmatch(line) + if m == nil { + continue + } + pref, _ := strconv.Atoi(m[1]) + if pref >= 32766 { + continue + } + mark, _ := strconv.ParseUint(m[2], 16, 32) + mask := uint64(markAll) + if m[4] != "" { + mask, _ = strconv.ParseUint(m[4], 16, 32) + } + key := fmt.Sprintf("%d/%d", mark, mask) + if seen[key] || !localDefault.MatchString(table(fam, m[5])) { + continue + } + seen[key] = true + out = append(out, Divert{pref, uint32(mark), uint32(mask), m[5]}) + } + } + return out +} + +// String is a divert as `ip rule` shows it, for people: "pref 1000 fwmark 0x1 → table 100". +func (d Divert) String() string { + mask := "" + if d.Mask != markAll { + mask = fmt.Sprintf("/0x%x", d.Mask) + } + return fmt.Sprintf("pref %d fwmark 0x%x%s → table %s", d.Pref, d.Mark, mask, d.Table) +} + +// ReplyScript is the table that keeps answers from Dawnline's ports out of the diverts, as dawnline.fw +// writes it, or "" when there is nothing to keep out of them. +func ReplyScript(m *model.Model, diverts []Divert) string { + var tcp, udp []int + add := func(list []int, n int) []int { + for _, x := range list { + if x == n { + return list + } + } + if n < 1 || n > 65535 { + return list + } + return append(list, n) + } + if s := m.Settings; s.PortalEnabled { + tcp = add(tcp, s.PortalPort) + for _, h := range append([]string{s.PortalHost}, s.PortalAlt...) { + if _, ip := ipnet.IP(h); ip { + tcp = add(tcp, s.PortalPort+1) + break + } + } + } + for _, id := range m.ServerIDs() { + if srv := m.Servers[id]; srv.PrivateKey != "" && srv.Enabled { + udp = add(udp, srv.Port) + } + } + if len(diverts) == 0 || (len(tcp) == 0 && len(udp) == 0) { + return "" + } + t := []string{"table inet dawnline_reply {", "\tchain out {", "\t\ttype route hook output priority filter + 10; policy accept;"} + for _, proto := range []struct { + name string + ports []int + }{{"tcp", tcp}, {"udp", udp}} { + if len(proto.ports) == 0 { + continue + } + var ports []string + for _, p := range proto.ports { + ports = append(ports, strconv.Itoa(p)) + } + for _, d := range diverts { + // only the divert's bits: other marks on the packet (multi-WAN) stay + rule := fmt.Sprintf("meta mark 0x%x meta mark set 0x0", d.Mark) + if d.Mask != markAll { + rule = fmt.Sprintf("meta mark & 0x%x == 0x%x meta mark set meta mark & 0x%x", d.Mask, d.Mark, ^d.Mask) + } + t = append(t, "\t\t"+proto.name+" sport { "+strings.Join(ports, ", ")+" } "+rule) + } + } + return strings.Join(append(t, "\t}", "}"), "\n") + "\n" +} + +// ServerErrors is what is wrong with a server's definition against the rest of the router +// (dawnline.core server_errors): its interface name, port, tunnel network against `others`, public address. +func ServerErrors(srv *model.Server, others []string, t *i18n.Catalog) []string { + errs := []string{} + if !model.ValidIfname(srv.Ifname) { + errs = append(errs, t.T("Interface name: 1-12 lowercase letters, digits or _.")) + } + if srv.Port < 1 || srv.Port > 65535 { + errs = append(errs, t.T("Port must be 1-65535.")) + } + if c, ok := ipnet.Subnet(srv.Subnet); !ok { + errs = append(errs, t.T("Subnet must look like 10.77.0.0/24.")) + } else { + for _, o := range others { + if oc, ok := ipnet.Subnet(o); ok && overlap(c, oc) { + errs = append(errs, fmt.Sprintf(t.T("Subnet overlaps %s."), o)) + } + } + } + if srv.Endpoint != "" && !endpoint.ValidHost(srv.Endpoint) { + errs = append(errs, t.T("Endpoint must be a hostname or IP address.")) + } + return errs +} + +// ConfigErrors is what is wrong with settings about to replace the current ones (a restore, an import): +// people and devices consistent (ModelErrors), and each server with a valid interface name that is its +// own and not one of the router's (`network`: the router's network configuration), a tunnel network that +// overlaps neither the router's (`foreign`) nor an earlier server's, a port of its own and disguise values +// AmneziaWG takes. Empty when they can be used. dawnline.backup config_errors. +func ConfigErrors(m *model.Model, t *i18n.Catalog, network *uci.Config, foreign []string) []string { + errs := ModelErrors(m, t) + ifnames, ports := map[string]string{}, map[int]string{} + var subnets []string + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + for _, e := range append(ServerErrors(srv, append(append([]string{}, foreign...), subnets...), t), disguise.Unsafe(srv.Obf)...) { + errs = append(errs, fmt.Sprintf(t.T("Server %s: %s"), srv.Name, e)) + } + if other, used := ifnames[srv.Ifname]; used { + errs = append(errs, fmt.Sprintf(t.T("Server %s: interface %s is also used by %s."), srv.Name, srv.Ifname, other)) + } + ifnames[srv.Ifname] = srv.Name + own := srv.Ifname == "dlx0" || srv.Ifname == "dll0" + if network != nil { + if s := network.Section(srv.Ifname); s != nil { + _, ours := s.Values["_dawnline"] + own = own || s.Type != "interface" || !ours + } + } + if own { + errs = append(errs, fmt.Sprintf(t.T("Server %s: %s is one of the router's own network interfaces."), srv.Name, srv.Ifname)) + } + if other, used := ports[srv.Port]; used { + errs = append(errs, fmt.Sprintf(t.T("Server %s: UDP %d is also used by %s."), srv.Name, srv.Port, other)) + } + ports[srv.Port] = srv.Name + if srv.Subnet != "" { + subnets = append(subnets, srv.Subnet) + } + } + return errs +} diff --git a/backend/health/data_test.go b/backend/health/data_test.go new file mode 100644 index 0000000..d889ec9 --- /dev/null +++ b/backend/health/data_test.go @@ -0,0 +1,132 @@ +package health + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" +) + +// What is wrong with testdata/broken.uci, who is loaded into each tunnel and how made-up tunnels stand +// against that, as ucode says (testdata/trace.uc, scripts/ucode-golden.sh). +func TestBrokenSettingsAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + TS int64 `json:"ts"` + Errors []string `json:"errors"` + States map[string]string `json:"states"` + Tunnels map[string][]string `json:"tunnels"` + Diffs []struct { + Server string `json:"server"` + Loaded []string `json:"loaded"` + Diff struct{ Loaded, Missing, Extra int } + } `json:"diffs"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + text, _ := os.ReadFile("testdata/broken.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + if got := ModelErrors(m, nil); !reflect.DeepEqual(got, trace.Errors) || len(got) < 12 { + t.Errorf("what is wrong\n go:\n %s\n ucode:\n %s", strings.Join(got, "\n "), strings.Join(trace.Errors, "\n ")) + } + states := map[string]string{} + for id, p := range m.People { + states[id] = state.Of(m, p, usage.Empty(), trace.TS) + } + if !reflect.DeepEqual(states, trace.States) { + t.Fatalf("states %v, ucode %v", states, trace.States) + } + loaded := 0 + for sid, want := range trace.Tunnels { + got := []string{} + for _, d := range TunnelDevices(m, sid, states) { + got = append(got, d.ID) + } + loaded += len(got) + if !reflect.DeepEqual(got, want) { + t.Errorf("tunnel %s holds %v, ucode %v", sid, got, want) + } + } + if loaded == 0 || len(trace.Diffs) < 8 { + t.Fatal("the golden loads nobody") + } + for i, d := range trace.Diffs { + srv := m.Servers[d.Server] + peers := map[string]awg.Peer{"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYA=": {Ifname: "another"}} + for _, k := range d.Loaded { + peers[k] = awg.Peer{Ifname: srv.Ifname} + } + got := PeerDiff(TunnelDevices(m, d.Server, states), peers, srv.Ifname) + if got.Loaded != d.Diff.Loaded || got.Missing != d.Diff.Missing || got.Extra != d.Diff.Extra { + t.Errorf("diff %d: %+v, ucode %+v", i, got, d.Diff) + } + } +} + +func TestProxiesAndTheReplyTable(t *testing.T) { + rules := map[string]string{ + "-4": "0:\tfrom all lookup local\n1000:\tfrom all fwmark 0x1 lookup 100\n1001:\tfrom all fwmark 0x1 lookup 100\n2000:\tfrom all fwmark 0x200/0xff00 lookup 200\n3000:\tfrom all fwmark 0x7 lookup 300\n32766:\tfrom all fwmark 0x9 lookup main\n", + "-6": "1000:\tfrom all fwmark 0x1 lookup 100\n", + } + tables := map[string]string{"100": "local default dev lo scope host\n", "200": "10.0.0.0/8 dev x\nlocal default dev lo\n", "300": "default via 10.0.0.1 dev wan\n"} + d := ProxyDiverts(func(f string) string { return rules[f] }, func(_, name string) string { return tables[name] }) + var said []string + for _, x := range d { + said = append(said, x.String()) + } + if strings.Join(said, "; ") != "pref 1000 fwmark 0x1 → table 100; pref 2000 fwmark 0x200/0xff00 → table 200" { + t.Fatalf("diverts: %v", said) + } + c, _ := uci.Parse("config settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\tlist portal_alt '203.0.113.7'\n" + + "config server 'home'\n\toption port '4500'\n\toption private_key 'k'\nconfig server 'cabin'\n\toption port '4600'\n\toption private_key 'k'\n\toption enabled '0'\n") + m := model.Load(c, nil) + want := "table inet dawnline_reply {\n\tchain out {\n\t\ttype route hook output priority filter + 10; policy accept;\n" + + "\t\ttcp sport { 4500, 4501 } meta mark 0x1 meta mark set 0x0\n\t\ttcp sport { 4500, 4501 } meta mark & 0xff00 == 0x200 meta mark set meta mark & 0xffff00ff\n" + + "\t\tudp sport { 4500 } meta mark 0x1 meta mark set 0x0\n\t\tudp sport { 4500 } meta mark & 0xff00 == 0x200 meta mark set meta mark & 0xffff00ff\n\t}\n}\n" + if got := ReplyScript(m, d); got != want { + t.Fatalf("the reply table:\n%s", got) + } + if ReplyScript(m, nil) != "" { + t.Fatal("a reply table with no proxy to keep out of") + } +} + +// Settings whose servers are wrong in every way: what a restore says of them, as ucode says it. +func TestConfigErrorsAsUcode(t *testing.T) { + raw, _ := os.ReadFile("testdata/trace.json") + var trace struct { + Network string `json:"network"` + Errors []string `json:"config_errors"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + text, _ := os.ReadFile("testdata/servers.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + network, err := uci.Parse(trace.Network) + if err != nil { + t.Fatal(err) + } + got := ConfigErrors(model.Load(c, nil), nil, network, nil) + if !reflect.DeepEqual(got, trace.Errors) || len(got) < 12 { + t.Errorf("what a restore says\n go:\n %s\n ucode:\n %s", strings.Join(got, "\n "), strings.Join(trace.Errors, "\n ")) + } +} diff --git a/backend/health/health.go b/backend/health/health.go new file mode 100644 index 0000000..32d6fb3 --- /dev/null +++ b/backend/health/health.go @@ -0,0 +1,576 @@ +// Package health is Health's checks, as dawnline.health health() makes them: each named for the healthy +// state ("Clock is set"), a failed one also with the problem in words for notices, in the reader's +// language. Pure: Inputs is everything read on the router, gathered by the caller, so every check can be +// made up in a test. A check whose input is not given yet (nil) is left out. +package health + +import ( + "fmt" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Check is one result. Fix names an action (apply, sync, restart, netrestart, ifup:, install:, +// updates) or is nil; Problem is the failed check in words, nil for one that passed. +type Check struct { + ID string `json:"id"` + Title string `json:"title"` + Status string `json:"status"` + Detail string `json:"detail"` + Fix *string `json:"fix"` + Problem *string `json:"problem"` +} + +func check(id, title, status, detail, fix, problem string) Check { + c := Check{ID: id, Title: title, Status: status, Detail: detail} + if fix != "" { + c.Fix = &fix + } + if status == "warn" || status == "error" { + if problem == "" { + problem = title + } + c.Problem = &problem + } + return c +} + +// Iface is what netifd says of an interface. +type Iface struct { + Exists, Up bool + // Errors is its error codes (INVALID_PROTO). + Errors []string +} + +// Peers is how a tunnel's loaded devices stand against those it should hold. +type Peers struct { + Expected, Missing, Extra, Loaded int +} + +// Replies: whether answers from our ports go straight out, and the proxies' diverts that would swallow them. +type Replies struct { + OK bool + Diverts []string +} + +// Subnet is an IPv4 network of a netifd interface. +type Subnet struct { + Iface, CIDR string +} + +// Portal is what was read for the portal's checks. +type Portal struct { + Owners []string + Listening bool + // IPs is where its address points; WAN the router's. + IPs []string + WAN string + // Cert is the certificate in use; Valid: for more than 14 days; Names: the DNS names it covers. + Cert string + SelfSigned bool + Valid bool + Names []string +} + +// Inputs is everything the checks are made from. +type Inputs struct { + M *model.Model + T *i18n.Catalog + // AmneziaWG: its state after trying to load the module (missing packages, loaded, handler), the firmware + // the installed build was for when that is not this one, why the module does not load, an update that + // waits for a reboot. + Missing []string + Loaded, Handler bool + KernelWas, KernelIs string + WhyNotLoaded string + WaitsForReboot bool + Year int + AgentRunning bool + // FreeKB is the overlay's free space (nil: unknown). + FreeKB *int64 + NftLoaded bool + PolicyRouting []string + // ModelErrors is what is wrong with people and devices (nil: not checked yet). + ModelErrors func() []string + Firewall, Network *uci.Config + Iface func(ifname string) Iface + // Unread tells a tunnel that could not be read; Peers how its devices stand (nil: not checked yet). + Unread func(ifname string) bool + Peers func(srv *model.Server) Peers + Replies *Replies + // Subnets is the router's networks; HomeNets a server's home networks; Endpoint what its public address reads as. + Subnets []Subnet + HomeNets func(srv *model.Server) []string + Endpoint func(srv *model.Server, host string) endpoint.Reads + // LikeHome is the home-like path's state (dawnline.loop status); Needs the packages each feature misses. + LikeHome map[string]any + Needs map[string][]string + // The resolver for Home-only devices: its configuration's age in seconds (nil: none), whether it runs. + ResolverConfAge *int64 + ResolverRunning bool + Portal func() Portal + // The networks behind people's routers: Behind, those in effect on this router by device (nil: not + // checked); Own, the router's own networks, to name what a network shares addresses with; RouteError, + // what the last sync said of a route that would not go in ("": none). + Behind map[string][]string + Own []string + RouteError string +} + +// The /24s home routers come with out of the box: a home network on one of them is very likely the same as +// the network a person connects from. +var commonHome = []string{"192.168.0.0/24", "192.168.1.0/24", "192.168.2.0/24", "192.168.3.0/24", "192.168.8.0/24", "192.168.10.0/24", "192.168.31.0/24", + "192.168.50.0/24", "192.168.88.0/24", "192.168.100.0/24", "192.168.178.0/24", "10.0.0.0/24", "10.1.1.0/24"} + +func overlap(a, b ipnet.Net) bool { + return uint64(a.Base) < uint64(b.Base)+b.Size() && uint64(b.Base) < uint64(a.Base)+a.Size() +} + +// CommonHome is the home networks that overlap a common out-of-the-box subnet. +func CommonHome(nets []string) []string { + out := []string{} + for _, n := range nets { + a, ok := ipnet.Subnet(n) + if !ok { + continue + } + for _, c := range commonHome { + if b, _ := ipnet.Subnet(c); overlap(a, b) { + out = append(out, n) + break + } + } + } + return out +} + +func has(list []string, v string) bool { + for _, x := range list { + if x == v { + return true + } + } + return false +} + +func (in *Inputs) noProto() string { + return in.T.T("netifd doesn't know the amneziawg protocol (AmneziaWG missing, or the network wasn't restarted after installing it).") +} + +func (in *Inputs) awg() Check { + t := in.T + title := t.T("AmneziaWG installed") + if n := len(in.Missing); n > 0 { + // the module was built for the kernel of the firmware it was installed on + if in.KernelWas != "" && has(in.Missing, "kmod-amneziawg") { + return check("awg", title, "error", + fmt.Sprintf(t.T("The firmware changed (kernel %s → %s): the AmneziaWG build installed for it is gone. Install the build for this firmware."), in.KernelWas, in.KernelIs), + "install:awg", t.T("AmneziaWG needs a build for the new firmware")) + } + return check("awg", title, "error", fmt.Sprintf(t.N(int64(n), "%s is missing.", "%s are missing."), strings.Join(in.Missing, ", ")), "install:awg", t.T("AmneziaWG isn’t installed")) + } + if !in.Loaded { + detail := t.T("The kernel module doesn't load. Reinstall a build for this kernel in Components.") + if in.WhyNotLoaded != "" { + detail = fmt.Sprintf(t.T("The kernel module doesn't load: %s Reinstall a build for this kernel in Components."), in.WhyNotLoaded) + } + return check("awg", title, "error", detail, "updates", t.T("AmneziaWG’s kernel module doesn’t load")) + } + if !in.Handler { + return check("awg", title, "error", in.noProto(), "netrestart", t.T("The network doesn’t know AmneziaWG yet")) + } + if in.WaitsForReboot { + return check("awg", title, "warn", t.T("The AmneziaWG update is installed and starts after a reboot."), "", t.T("The AmneziaWG update waits for a reboot")) + } + return check("awg", title, "ok", t.T("Kernel module, awg tool and the netifd protocol are present."), "", "") +} + +func (in *Inputs) reply(id, title, problem, proto string, port int) (Check, bool) { + r := in.Replies + if r == nil { + return Check{}, false + } + t := in.T + via, from := strings.Join(r.Diverts, ", "), strings.ToUpper(proto)+" "+strconv.Itoa(port) + switch { + case !r.OK: + return check(id, title, "error", fmt.Sprintf(t.T("Answers from %s are swallowed by a proxy on the router (%s): clients get no reply."), from, via), "apply", problem), true + case len(r.Diverts) > 0: + return check(id, title, "ok", fmt.Sprintf(t.T("Answers from %s go straight out. A proxy on the router diverts its own traffic (%s); these answers skip it."), from, via), "", problem), true + } + return check(id, title, "ok", fmt.Sprintf(t.T("Answers from %s go straight out."), from), "", problem), true +} + +func sectionIs(c *uci.Config, name, kind string) bool { + if c == nil { + return false + } + s := c.Section(name) + return s != nil && s.Type == kind +} + +// server is the checks of one server's tunnel. +func (in *Inputs) server(id string, srv *model.Server, label string) []Check { + t, m := in.T, in.M + out := []Check{} + st := in.Iface(srv.Ifname) + running, down := t.T("Tunnel running")+label, t.T("AmneziaWG is down")+label + switch { + case !st.Up && has(st.Errors, "INVALID_PROTO"): + out = append(out, check("up_"+id, running, "error", in.noProto(), "netrestart", down)) + case st.Up: + out = append(out, check("up_"+id, running, "ok", fmt.Sprintf(t.T("%s is up, listening on UDP %d."), srv.Ifname, srv.Port), "", down)) + case !st.Exists: + out = append(out, check("up_"+id, running, "error", fmt.Sprintf(t.T("%s does not exist."), srv.Ifname), "apply", down)) + case len(st.Errors) > 0: + out = append(out, check("up_"+id, running, "error", fmt.Sprintf(t.T("%s is down: %s."), srv.Ifname, strings.Join(st.Errors, ", ")), "ifup:"+srv.Ifname, down)) + default: + out = append(out, check("up_"+id, running, "error", fmt.Sprintf(t.T("%s is down."), srv.Ifname), "ifup:"+srv.Ifname, down)) + } + // the devices the sync loads, by the same choice the agent compares with every minute + loaded := t.T("Devices loaded") + label + if st.Up && in.Unread != nil && in.Unread(srv.Ifname) { + out = append(out, check("peers_"+id, loaded, "warn", t.T("The tunnel could not be read, so its devices could not be checked."), "", + t.T("The devices in AmneziaWG could not be checked")+label)) + } else if st.Up && in.Peers != nil { + p := in.Peers(srv) + bad := t.T("Not every device is loaded into AmneziaWG") + label + switch { + case p.Missing == 0 && p.Extra == 0: + out = append(out, check("peers_"+id, loaded, "ok", fmt.Sprintf(t.N(int64(p.Loaded), "%d device is loaded in the tunnel.", "%d devices are loaded in the tunnel."), p.Loaded), "", bad)) + case p.Extra != 0: + out = append(out, check("peers_"+id, loaded, "warn", fmt.Sprintf(t.N(int64(p.Expected), "%d of %d device missing, %d loaded that should not be.", + "%d of %d devices missing, %d loaded that should not be."), p.Missing, p.Expected, p.Extra), "sync", bad)) + default: + out = append(out, check("peers_"+id, loaded, "warn", fmt.Sprintf(t.N(int64(p.Expected), "%d of %d device missing.", "%d of %d devices missing."), p.Missing, p.Expected), "sync", bad)) + } + } + rules := sectionIs(in.Firewall, "dawnline_"+id+"_port", "rule") && sectionIs(in.Firewall, "dawnline_"+id+"_zone", "zone") + if rules { + out = append(out, check("fw_"+id, t.T("Firewall rules")+label, "ok", fmt.Sprintf(t.T("Zone %s and the WAN rule for UDP %d exist."), srv.Ifname, srv.Port), "", "")) + } else { + out = append(out, check("fw_"+id, t.T("Firewall rules")+label, "error", t.T("Firewall zone or WAN rule is missing."), "apply", t.T("AmneziaWG firewall rules are missing")+label)) + } + if c, ok := in.reply("reply_"+id, t.T("Answers reach devices")+label, t.T("AmneziaWG answers may not reach devices")+label, "udp", srv.Port); ok { + out = append(out, c) + } + // port collisions with other tunnels + var clash []string + if in.Network != nil { + for _, s := range in.Network.OfType("interface") { + proto, _ := s.Get("proto") + lp, _ := s.Get("listen_port") + if n, _ := strconv.Atoi(strings.TrimSpace(lp)); s.Name != srv.Ifname && (proto == "amneziawg" || proto == "wireguard") && n == srv.Port { + clash = append(clash, s.Name) + } + } + } + if len(clash) > 0 { + out = append(out, check("port_"+id, t.T("Port is free")+label, "error", fmt.Sprintf(t.T("UDP %d is also used by %s."), srv.Port, strings.Join(clash, ", ")), "", t.T("AmneziaWG port is taken")+label)) + } + var overlaps []string + if sc, ok := ipnet.Subnet(srv.Subnet); ok { + for _, o := range in.Subnets { + // every network of the router but this server's own tunnel's + if o.Iface == srv.Ifname { + continue + } + if oc, ok := ipnet.Subnet(o.CIDR); ok && overlap(sc, oc) { + overlaps = append(overlaps, o.Iface+" ("+o.CIDR+")") + } + } + } + if len(overlaps) > 0 { + out = append(out, check("subnet_"+id, t.T("Subnet is unique")+label, "error", fmt.Sprintf(t.T("%s overlaps %s."), srv.Subnet, strings.Join(overlaps, ", ")), "", t.T("AmneziaWG subnet overlaps another network")+label)) + } else { + out = append(out, check("subnet_"+id, t.T("Subnet is unique")+label, "ok", fmt.Sprintf(t.T("%s does not overlap other networks."), srv.Subnet), "", "")) + } + // whether the home networks are on a common subnet, while anyone on the server has home access + reach := false + for _, p := range m.People { + reach = reach || (p.Server == id && (p.Access == "lan" || p.Access == "both")) + } + if nets := in.HomeNets(srv); reach && len(nets) > 0 { + c := check("homenet_"+id, t.T("Home network addresses")+label, "ok", + fmt.Sprintf(t.T("%s is not a common home subnet: the networks people connect from rarely use the same addresses."), strings.Join(nets, ", ")), "", "") + if bad := CommonHome(nets); len(bad) > 0 { + c.Status = "warn" + c.Detail = fmt.Sprintf(t.T("%s is one of the most common home subnets. On a network with the same addresses, people with home access reach your home instead of their own: their printer or TV there is out of reach while connected, with LAN Bypass too. A rarer subnet for your home network avoids it, for example 10.37.12.0/24."), strings.Join(bad, ", ")) + } + // advice, not a fault: no notice elsewhere + out = append(out, c) + } + if c, has := in.behind(id, label); has { + out = append(out, c) + } + return out +} + +// behind is the check of the networks behind a server's routers, when any router has one written: each is +// in effect (a peer of the tunnel, a route, a place in the access table), or the check says which is not +// and what it shares addresses with; a route the router would not take is said in its own words. +func (in *Inputs) behind(id, label string) (Check, bool) { + m, t := in.M, in.T + if in.Behind == nil { + return Check{}, false + } + title := t.T("Networks behind routers") + label + var bad []string + written, routed := 0, 0 + for _, did := range m.DeviceIDs() { + d := m.Devices[did] + p := m.People[d.Person] + if p == nil || p.Server != id || d.Kind != "router" || d.Waiting || len(d.Behind) == 0 { + continue + } + written += len(d.Behind) + routed += len(in.Behind[did]) + who := p.Name + " · " + d.Name + for _, s := range d.Behind { + n, why := model.BehindNet(s) + switch { + case why != "": + bad = append(bad, fmt.Sprintf(t.T("%s behind %s is not a network a router may have behind it."), s, who)) + case has(in.Behind[did], n.String()): + default: + c := m.BehindClash(n, did, in.Own) + switch { + case c == nil: + bad = append(bad, fmt.Sprintf(t.T("%s behind %s is written twice, or is one more than a router may have."), n.String(), who)) + case c.Server != "": + bad = append(bad, fmt.Sprintf(t.T("%s behind %s shares addresses with the tunnel network of %s (%s)."), n.String(), who, m.Servers[c.Server].Name, c.Net)) + case c.Device != "": + bad = append(bad, fmt.Sprintf(t.T("%s behind %s shares addresses with %s behind %s."), n.String(), who, c.Net, m.Devices[c.Device].Name)) + default: + bad = append(bad, fmt.Sprintf(t.T("%s behind %s shares addresses with %s, which the router has itself."), n.String(), who, c.Net)) + } + } + } + } + switch { + case written == 0: + return Check{}, false + case len(bad) > 0: + return check("sites_"+id, title, "warn", strings.Join(bad, " ")+" "+t.T("Such a network is not in effect: change it in the server's Network settings."), "", + t.T("A network behind a router isn’t in effect")+label), true + case in.RouteError != "": + return check("sites_"+id, title, "error", fmt.Sprintf(t.T("A route to a network behind a router couldn't be set: %s."), in.RouteError), "sync", + t.T("A network behind a router has no route")+label), true + } + return check("sites_"+id, title, "ok", + fmt.Sprintf(t.N(int64(routed), "%d network behind routers is carried by the tunnel.", "%d networks behind routers are carried by the tunnel."), routed), "", ""), true +} + +func (in *Inputs) portal() []Check { + t, s := in.T, in.M.Settings + portal, bad := t.T("Personal portal"), t.T("Personal portal isn’t working") + if need := in.Needs["https"]; len(need) > 0 { + return []Check{check("portal", portal, "error", fmt.Sprintf(t.T("HTTPS isn't available on this router: install %s."), strings.Join(need, ", ")), "install:https", bad)} + } + p := in.Portal() + out := []Check{} + switch { + case len(p.Owners) > 0: + out = append(out, check("portal", portal, "error", fmt.Sprintf(t.T("TCP %d is already used by %s. Choose another port in Settings."), s.PortalPort, strings.Join(p.Owners, ", ")), "", bad)) + case p.Listening: + out = append(out, check("portal", portal, "ok", fmt.Sprintf(t.T("Listening on TCP %d."), s.PortalPort), "", bad)) + default: + out = append(out, check("portal", portal, "error", fmt.Sprintf(t.T("Nothing listens on TCP %d."), s.PortalPort), "restart", bad)) + } + if h := s.PortalHost; h == "" { + out = append(out, check("portal_host", t.T("Portal address"), "error", t.T("Set the public hostname in Settings so links can be generated."), "", t.T("Portal address isn’t set"))) + } else { + cf := false + for _, ip := range p.IPs { + cf = cf || endpoint.Cloudflare(ip) + } + ips := strings.Join(p.IPs, ", ") + title, problem := t.T("Portal address points here"), t.T("Portal address doesn’t point here") + switch { + case len(p.IPs) == 0: + out = append(out, check("portal_dns", title, "error", fmt.Sprintf(t.T("%s does not resolve."), h), "", problem)) + case cf: + out = append(out, check("portal_dns", title, "ok", fmt.Sprintf(t.T("%s goes through Cloudflare; in Russia such connections often stall after ~16 KB."), h), "", problem)) + case p.WAN != "" && !has(p.IPs, p.WAN): + out = append(out, check("portal_dns", title, "warn", fmt.Sprintf(t.T("%s points at %s, not this router (%s)."), h, ips, p.WAN), "", problem)) + case p.WAN != "": + out = append(out, check("portal_dns", title, "ok", fmt.Sprintf(t.T("%s → %s (this router)."), h, ips), "", problem)) + default: + out = append(out, check("portal_dns", title, "ok", h+" → "+ips+".", "", problem)) + } + } + if c, ok := in.reply("portal_reply", t.T("Portal answers reach visitors"), t.T("Portal answers may not reach visitors"), "tcp", s.PortalPort); ok { + out = append(out, c) + } + // IP addresses have no certificate: the portal also answers plain HTTP for them + var plain []string + hosts := append([]string{s.PortalHost}, s.PortalAlt...) + for i, h := range hosts { + if _, ip := ipnet.IP(h); ip && h != "" && !has(hosts[:i], h) { + plain = append(plain, h) + } + } + if len(plain) > 0 { + out = append(out, check("portal_http", t.T("Plain HTTP links"), "warn", + fmt.Sprintf(t.T("Links on %s use plain HTTP: the link and the VPN keys in configurations travel unencrypted."), strings.Join(plain, ", ")), "", t.T("Portal links use plain HTTP"))) + } + title := t.T("Portal certificate") + if _, ip := ipnet.IP(s.PortalHost); ip { + return append(out, check("cert", title, "skip", t.T("The main address is an IP: its links use plain HTTP."), "", "")) + } + covers := s.PortalHost == "" || p.SelfSigned + for _, n := range p.Names { + covers = covers || endpoint.Covers(n, s.PortalHost) + } + problem := t.T("Portal certificate needs attention") + switch { + case p.SelfSigned && len(in.Needs["acme"]) > 0: + out = append(out, check("cert", title, "warn", t.T("Using a self-signed certificate: browsers will show a warning. ACME can get a free Let’s Encrypt one."), "", problem)) + case p.SelfSigned: + out = append(out, check("cert", title, "warn", t.T("Using a self-signed certificate: browsers will show a warning."), "", problem)) + case !covers: + out = append(out, check("cert", title, "warn", fmt.Sprintf(t.T("%s does not cover %s (it has %s): browsers will warn."), p.Cert, s.PortalHost, strings.Join(p.Names, ", ")), "", problem)) + case p.Valid: + out = append(out, check("cert", title, "ok", fmt.Sprintf(t.T("%s covers %s and is valid for more than 14 days."), p.Cert, s.PortalHost), "", problem)) + default: + out = append(out, check("cert", title, "warn", fmt.Sprintf(t.T("%s expires within 14 days."), p.Cert), "", problem)) + } + return out +} + +// Run makes every check. +func Run(in Inputs) []Check { + t, m := in.T, in.M + out := []Check{} + ids := m.ServerIDs() + if len(ids) > 0 { + out = append(out, in.awg()) + } + if in.Year >= 2025 { + out = append(out, check("clock", t.T("Clock is set"), "ok", t.T("End dates and quotas use the router clock."), "", "")) + } else { + out = append(out, check("clock", t.T("Clock is set"), "error", t.T("The router clock looks wrong; end dates will misbehave. Check NTP."), "", t.T("Clock isn’t set"))) + } + fix := "restart" + status := "error" + if in.AgentRunning { + fix, status = "", "ok" + } + out = append(out, check("agent", t.T("Background agent running"), status, t.T("Counts traffic and enforces end dates and quotas."), fix, t.T("Background agent isn’t running"))) + // a full overlay fails every config write on the router + if in.FreeKB != nil { + free := *in.FreeKB + problem := t.T("The router is running out of flash") + switch { + case free < 2048: + status := "warn" + if free < 512 { + status = "error" + } + mb := strconv.FormatFloat(float64(int64(float64(free)/1024*10))/10, 'g', -1, 64) + out = append(out, check("flash", t.T("Free space on the router"), status, + fmt.Sprintf(t.T("%s MB free: settings may stop saving. Remove old backups (Settings → Backups) or shorten the history."), mb), "", problem)) + default: + out = append(out, check("flash", t.T("Free space on the router"), "ok", fmt.Sprintf(t.T("%d MB free on the overlay."), free/1024), "", problem)) + } + } + if len(ids) == 0 { + return append(out, check("server", t.T("Server configured"), "warn", t.T("Set a server up in Settings."), "", t.T("No server yet"))) + } + if in.NftLoaded { + out = append(out, check("nft", t.T("Access rules loaded"), "ok", t.T("Table inet dawnline enforces who may reach LAN and the internet."), "", "")) + } else { + out = append(out, check("nft", t.T("Access rules loaded"), "error", t.T("Table inet dawnline is missing: no device is loaded into the tunnels until it is back."), "apply", t.T("Access rules aren’t loaded"))) + } + likeHome := false + for _, id := range ids { + likeHome = likeHome || (m.Servers[id].LanLike && m.Servers[id].Enabled) + } + if likeHome { + if pr := in.PolicyRouting; len(pr) > 0 { + out = append(out, check("policy", t.T("Internet like a home device not bypassed"), "warn", + fmt.Sprintf(t.T("Policy routing on the router (%s) sends marked traffic straight out, past the home-device path: tunnel traffic it matches skips your LAN's proxies and filters."), strings.Join(pr, "; ")), + "", t.T("Other policy routing bypasses the home-device path"))) + } else { + out = append(out, check("policy", t.T("Internet like a home device not bypassed"), "ok", t.T("No other policy routing ahead of the tunnel rules."), "", "")) + } + } + // a device the sync has to leave out: its sentences, how many more, then what it means + if in.ModelErrors != nil { + if data := in.ModelErrors(); len(data) > 0 { + parts := []string{strings.Join(data[:min(len(data), 4)], " ")} + if len(data) > 4 { + parts = append(parts, fmt.Sprintf(t.T("(%d more)"), len(data)-4)) + } + parts = append(parts, t.T("Such devices are left out of the tunnels: fix or remove them.")) + out = append(out, check("data", t.T("People and devices consistent"), "error", strings.Join(parts, " "), "", t.T("People and devices are inconsistent"))) + } else { + out = append(out, check("data", t.T("People and devices consistent"), "ok", t.T("Every device has a key and an address of its own inside its server."), "", "")) + } + } + keyed := false + for _, id := range ids { + srv := m.Servers[id] + keyed = keyed || (srv.Enabled && srv.PrivateKey != "") + label := "" + if len(ids) > 1 { + label = " (" + srv.Name + ")" + } + if !srv.Enabled { + out = append(out, check("srv_"+id, t.T("Server")+label, "skip", t.T("Server is disabled."), "", "")) + continue + } + out = append(out, in.server(id, srv, label)...) + host := m.EndpointHost(srv) + status, text := endpoint.Words(endpoint.Of(host, in.Endpoint(srv, host)), "UDP "+strconv.Itoa(srv.Port), t) + out = append(out, check("ep_"+id, t.T("Public address")+label, status, text, "", t.T("Public address needs attention")+label)) + if srv.LanLike { + ls := in.LikeHome + active, bridged := ls["active"] == true, ls["bridged"] == true + title, problem := t.T("Internet like a home device")+label, t.T("Internet like a home device isn’t working")+label + nh := in.Needs["home"] + switch { + case active && bridged: + out = append(out, check("home_"+id, title, "ok", fmt.Sprintf(t.T("Traffic enters %s as %s, so it is handled like any device on your LAN."), ls["dev"], ls["address"]), "", problem)) + case len(nh) > 0: + out = append(out, check("home_"+id, title, "warn", fmt.Sprintf(t.T("Needs %s. Internet traffic leaves through WAN directly until then."), strings.Join(nh, ", ")), "install:home", problem)) + case active: + out = append(out, check("home_"+id, title, "warn", fmt.Sprintf(t.T("The link is up but not attached to %s."), ls["dev"]), "apply", problem)) + default: + // the path's own sentence, then what it means + why, _ := ls["error"].(string) + if ls["error"] == nil { + why = t.T("Not set up.") + } + out = append(out, check("home_"+id, title, "warn", why+" "+t.T("Internet traffic leaves through WAN directly."), "apply", problem)) + } + } + } + // while every server is off the resolver only idles on loopback: nothing to check + if keyed { + running := in.ResolverConfAge != nil && in.ResolverRunning + // a new config (a server turned on, the home link up) restarts it: give it a few seconds + restarting := !running && in.ResolverConfAge != nil && *in.ResolverConfAge < 10 + title, problem := t.T("DNS for Home-only devices"), t.T("DNS for Home-only devices isn’t working") + switch { + case restarting: + out = append(out, check("resolver", title, "ok", t.T("Restarting with the new settings."), "", problem)) + case running && in.LikeHome["active"] == true && in.LikeHome["transit"] != nil && in.LikeHome["transit"] != "": + out = append(out, check("resolver", title, "ok", fmt.Sprintf(t.T("Plain resolver running next to the LAN (%s)."), in.LikeHome["transit"]), "", problem)) + case running: + out = append(out, check("resolver", title, "ok", fmt.Sprintf(t.T("Plain resolver on port %d."), 5354), "", problem)) + default: + out = append(out, check("resolver", title, "warn", t.T("The resolver is not running; Home-only devices cannot resolve names."), "apply", problem)) + } + } + if m.Settings.PortalEnabled { + out = append(out, in.portal()...) + } + return out +} diff --git a/backend/health/health_test.go b/backend/health/health_test.go new file mode 100644 index 0000000..1f99bab --- /dev/null +++ b/backend/health/health_test.go @@ -0,0 +1,282 @@ +package health + +import ( + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +const settings = ` +config settings 'settings' + option portal_enabled '1' + option portal_port '4500' + option portal_host 'vpn.example.org' + list portal_alt '203.0.113.7' +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option private_key 'k' + option endpoint 'vpn.example.org' +config server 'cabin' + option name 'Cabin' + option ifname 'dawn1' + option port '4600' + option subnet '10.78.0.0/24' + option enabled '0' +config person 'anna' + option server 'home' + option access 'both' +` + +// a router where everything is as it should be +func healthy(t *testing.T) Inputs { + c, err := uci.Parse(settings) + if err != nil { + t.Fatal(err) + } + fw, _ := uci.Parse("config rule 'dawnline_home_port'\nconfig zone 'dawnline_home_zone'\n") + network, _ := uci.Parse("config interface 'dawn0'\n\toption proto 'amneziawg'\n\toption listen_port '4500'\n") + free, age := int64(40960), int64(600) + return Inputs{ + M: model.Load(c, nil), Loaded: true, Handler: true, Year: 2027, AgentRunning: true, FreeKB: &free, NftLoaded: true, + ModelErrors: func() []string { return nil }, Firewall: fw, Network: network, + Iface: func(string) Iface { return Iface{Exists: true, Up: true} }, + Unread: func(string) bool { return false }, + Peers: func(*model.Server) Peers { return Peers{Expected: 2, Loaded: 2} }, + Replies: &Replies{OK: true}, Subnets: []Subnet{{"lan", "192.168.77.1/24"}, {"dawn0", "10.77.0.1/24"}}, + HomeNets: func(*model.Server) []string { return []string{"192.168.77.0/24"} }, + Endpoint: func(*model.Server, string) endpoint.Reads { + return endpoint.Reads{IPs: []string{"203.0.113.7"}, WAN: "203.0.113.7"} + }, + LikeHome: map[string]any{"active": true, "bridged": true, "dev": "br-lan", "address": "192.168.77.9", "transit": "169.254.7.2"}, + Needs: map[string][]string{}, ResolverConfAge: &age, ResolverRunning: true, + Portal: func() Portal { + return Portal{Listening: true, IPs: []string{"203.0.113.7"}, WAN: "203.0.113.7", Cert: "/etc/ssl/acme/x.crt", Valid: true, Names: []string{"*.example.org"}} + }, + } +} + +func byID(list []Check) map[string]Check { + out := map[string]Check{} + for _, c := range list { + out[c.ID] = c + } + return out +} + +func TestAHealthyRouter(t *testing.T) { + list := Run(healthy(t)) + var ids []string + for _, c := range list { + ids = append(ids, c.ID) + // the plain HTTP links are a standing warning, the server turned off is skipped + want := "ok" + switch c.ID { + case "portal_http": + want = "warn" + case "srv_cabin": + want = "skip" + } + if c.Status != want || (c.Status == "ok") != (c.Problem == nil && c.Fix == nil) && c.ID != "srv_cabin" { + t.Errorf("%s: %s %q fix %v problem %v", c.ID, c.Status, c.Detail, c.Fix, c.Problem) + } + } + want := "awg clock agent flash nft policy data up_home peers_home fw_home reply_home subnet_home homenet_home ep_home home_home srv_cabin resolver portal portal_dns portal_reply portal_http cert" + if got := strings.Join(ids, " "); got != want { + t.Fatalf("the checks and their order:\n %s\n %s", got, want) + } + // two servers: each check of a server carries its name + if c := byID(list)["up_home"]; c.Title != "Tunnel running (Home)" || c.Detail != "dawn0 is up, listening on UDP 4500." { + t.Fatalf("a server's check: %+v", c) + } +} + +func TestWhatGoesWrong(t *testing.T) { + for name, c := range map[string]struct { + break_ func(in *Inputs) + id string + status string + fix string + detail string + }{ + "a package is missing": {func(in *Inputs) { in.Missing = []string{"kmod-amneziawg"} }, "awg", "error", "install:awg", "kmod-amneziawg is missing."}, + "the firmware changed": {func(in *Inputs) { + in.Missing, in.KernelWas, in.KernelIs = []string{"kmod-amneziawg"}, "6.6.1", "6.12.9" + }, "awg", "error", "install:awg", "kernel 6.6.1 → 6.12.9"}, + "the module won't load": {func(in *Inputs) { in.Loaded, in.WhyNotLoaded = false, "Exec format error." }, "awg", "error", "updates", "doesn't load: Exec format error. Reinstall"}, + "netifd has no protocol": {func(in *Inputs) { in.Handler = false }, "awg", "error", "netrestart", "netifd doesn't know"}, + "an update waits": {func(in *Inputs) { in.WaitsForReboot = true }, "awg", "warn", "", "after a reboot"}, + "the clock is wrong": {func(in *Inputs) { in.Year = 1970 }, "clock", "error", "", "Check NTP"}, + "the agent is gone": {func(in *Inputs) { in.AgentRunning = false }, "agent", "error", "restart", ""}, + "little flash": {func(in *Inputs) { kb := int64(1536); in.FreeKB = &kb }, "flash", "warn", "", "1.5 MB free"}, + "no flash": {func(in *Inputs) { kb := int64(100); in.FreeKB = &kb }, "flash", "error", "", "0 MB free"}, + "no access rules": {func(in *Inputs) { in.NftLoaded = false }, "nft", "error", "apply", "is missing"}, + "other policy routing": {func(in *Inputs) { in.PolicyRouting = []string{"pref 1000 fwmark 0x1 → table 100"} }, "policy", "warn", "", "(pref 1000 fwmark 0x1 → table 100)"}, + "broken devices": {func(in *Inputs) { + in.ModelErrors = func() []string { return []string{"a.", "b.", "c.", "d.", "e.", "f."} } + }, "data", "error", "", + "a. b. c. d. (2 more) Such devices"}, + "the tunnel is down": {func(in *Inputs) { in.Iface = func(string) Iface { return Iface{Exists: true} } }, "up_home", "error", "ifup:dawn0", "dawn0 is down."}, + "the tunnel has an error": {func(in *Inputs) { + in.Iface = func(string) Iface { return Iface{Exists: true, Errors: []string{"NO_DEVICE"}} } + }, "up_home", "error", "ifup:dawn0", "is down: NO_DEVICE."}, + "the tunnel is not there": {func(in *Inputs) { in.Iface = func(string) Iface { return Iface{} } }, "up_home", "error", "apply", "does not exist"}, + "the tunnel's protocol": {func(in *Inputs) { + in.Iface = func(string) Iface { return Iface{Exists: true, Errors: []string{"INVALID_PROTO"}} } + }, "up_home", "error", "netrestart", "netifd doesn't know"}, + "the tunnel is unreadable": {func(in *Inputs) { in.Unread = func(string) bool { return true } }, "peers_home", "warn", "", "could not be read"}, + "a device is missing": {func(in *Inputs) { + in.Peers = func(*model.Server) Peers { return Peers{Expected: 3, Missing: 1, Loaded: 2} } + }, "peers_home", "warn", "sync", "1 of 3 devices missing."}, + "a device too many": {func(in *Inputs) { + in.Peers = func(*model.Server) Peers { return Peers{Expected: 1, Extra: 2, Loaded: 3} } + }, "peers_home", "warn", "sync", "0 of 1 device missing, 2 loaded"}, + "no firewall rule": {func(in *Inputs) { in.Firewall, _ = uci.Parse("config zone 'dawnline_home_zone'\n") }, "fw_home", "error", "apply", "is missing"}, + "answers are swallowed": {func(in *Inputs) { in.Replies = &Replies{Diverts: []string{"pref 9 → table 100"}} }, "reply_home", "error", "apply", "Answers from UDP 4500 are swallowed"}, + "a proxy that is passed": {func(in *Inputs) { in.Replies = &Replies{OK: true, Diverts: []string{"pref 9 → table 100"}} }, "portal_reply", "ok", "", "Answers from TCP 4500 go straight out. A proxy"}, + "the port is another's": {func(in *Inputs) { + in.Network, _ = uci.Parse("config interface 'wg0'\n\toption proto 'wireguard'\n\toption listen_port '4500'\n") + }, "port_home", "error", "", "UDP 4500 is also used by wg0."}, + "the subnet is another's": {func(in *Inputs) { in.Subnets = append(in.Subnets, Subnet{"guest", "10.77.0.129/25"}) }, "subnet_home", "error", "", "10.77.0.0/24 overlaps guest (10.77.0.129/25)."}, + "a common home network": {func(in *Inputs) { in.HomeNets = func(*model.Server) []string { return []string{"192.168.1.0/24"} } }, "homenet_home", "warn", "", "192.168.1.0/24 is one of the most common"}, + "the address is elsewhere": {func(in *Inputs) { + in.Endpoint = func(*model.Server, string) endpoint.Reads { + return endpoint.Reads{IPs: []string{"198.51.100.4"}, WAN: "203.0.113.7"} + } + }, "ep_home", "warn", "", "not this router"}, + "the home path needs a package": {func(in *Inputs) { + in.LikeHome, in.Needs = map[string]any{"active": false}, map[string][]string{"home": {"kmod-veth"}} + }, "home_home", "warn", "install:home", "Needs kmod-veth."}, + "the home path is unattached": {func(in *Inputs) { in.LikeHome = map[string]any{"active": true, "bridged": false, "dev": "br-lan"} }, "home_home", "warn", "apply", "not attached to br-lan"}, + "the home path was refused": {func(in *Inputs) { in.LikeHome = map[string]any{"active": false, "error": "No LAN detected."} }, "home_home", "warn", "apply", "No LAN detected. Internet traffic leaves"}, + "the home path is not set up": {func(in *Inputs) { in.LikeHome = map[string]any{"active": false, "error": nil} }, "home_home", "warn", "apply", "Not set up. Internet traffic"}, + "the resolver stopped": {func(in *Inputs) { in.ResolverRunning = false }, "resolver", "warn", "apply", "is not running"}, + "the resolver restarts": {func(in *Inputs) { age := int64(3); in.ResolverRunning, in.ResolverConfAge = false, &age }, "resolver", "ok", "", "Restarting"}, + "the resolver beside the tunnel": {func(in *Inputs) { in.LikeHome = map[string]any{"active": false} }, "resolver", "ok", "", "on port 5354"}, + "no HTTPS on the router": {func(in *Inputs) { in.Needs = map[string][]string{"https": {"openssl-util"}} }, "portal", "error", "install:https", "install openssl-util"}, + "the portal's port is taken": {func(in *Inputs) { + in.Portal = func() Portal { return Portal{Owners: []string{"nginx"}, Listening: true} } + }, "portal", "error", "", "already used by nginx"}, + "the portal is silent": {func(in *Inputs) { in.Portal = func() Portal { return Portal{} } }, "portal", "error", "restart", "Nothing listens on TCP 4500."}, + "the portal's name is elsewhere": {func(in *Inputs) { + in.Portal = func() Portal { + return Portal{Listening: true, IPs: []string{"198.51.100.4"}, WAN: "203.0.113.7", Valid: true, Names: []string{"vpn.example.org"}} + } + }, + "portal_dns", "warn", "", "points at 198.51.100.4, not this router (203.0.113.7)."}, + "the portal through Cloudflare": {func(in *Inputs) { + in.Portal = func() Portal { return Portal{Listening: true, IPs: []string{"104.16.1.1"}, WAN: "203.0.113.7"} } + }, "portal_dns", "ok", "", "Cloudflare"}, + "a self-signed certificate": {func(in *Inputs) { + in.Portal = func() Portal { return Portal{Listening: true, SelfSigned: true} } + in.Needs = map[string][]string{"acme": {"acme"}} + }, "cert", "warn", "", "ACME can get"}, + "a certificate for another name": {func(in *Inputs) { + in.Portal = func() Portal { + return Portal{Listening: true, Cert: "/c.crt", Valid: true, Names: []string{"other.example.org"}} + } + }, "cert", "warn", "", "/c.crt does not cover vpn.example.org (it has other.example.org)"}, + "a certificate about to end": {func(in *Inputs) { + in.Portal = func() Portal { return Portal{Listening: true, Cert: "/c.crt", Names: []string{"vpn.example.org"}} } + }, "cert", "warn", "", "expires within 14 days"}, + } { + in := healthy(t) + c.break_(&in) + got, has := byID(Run(in))[c.id] + fix := "" + if got.Fix != nil { + fix = *got.Fix + } + // a common home network is advice, not a fault: it warns with no problem to put in a notice + problem := c.status != "ok" && c.id != "homenet_home" + if !has || got.Status != c.status || fix != c.fix || !strings.Contains(got.Detail, c.detail) || problem != (got.Problem != nil) { + t.Errorf("%s: %s %s fix %q problem %v\n %s", name, c.id, got.Status, fix, got.Problem != nil, got.Detail) + } + } + // no server yet: only what the router itself needs, and the advice to set one up + in := healthy(t) + c, _ := uci.Parse("config settings 'settings'\n") + in.M = model.Load(c, nil) + var ids []string + for _, x := range Run(in) { + ids = append(ids, x.ID) + } + if strings.Join(ids, " ") != "clock agent flash server" { + t.Fatalf("with no server: %v", ids) + } + if got := CommonHome([]string{"192.168.1.0/24", "10.37.12.0/24", "192.168.0.0/16", "odd"}); strings.Join(got, " ") != "192.168.1.0/24 192.168.0.0/16" { + t.Fatalf("common home networks: %v", got) + } +} + +// The networks behind a server's routers: no check while none is written, then each in effect, or which is +// not and what it shares addresses with, or the route the router would not take. +func TestNetworksBehindRoutersAreChecked(t *testing.T) { + c, err := uci.Parse(settings + ` +config person 'boris' + option name 'Boris' + option server 'home' + option access 'both' +config device 'r1' + option person 'boris' + option name 'Dacha' + option kind 'router' + option address '10.77.0.2' +config device 'r2' + option person 'boris' + option name 'Garage' + option kind 'router' + option address '10.77.0.3' +`) + if err != nil { + t.Fatal(err) + } + own := []string{"192.168.50.0/24"} + run := func() (Check, bool) { + m := model.Load(c, nil) + in := Inputs{M: m, Behind: m.BehindOf(own), Own: own} + return in.behind("home", "") + } + if _, has := run(); has { + t.Error("a check with no network written") + } + c.SetList("r1", "behind_net", []string{"192.168.2.0/24", "172.20.0.0/16"}) + if got, has := run(); !has || got.ID != "sites_home" || got.Status != "ok" || got.Detail != "2 networks behind routers are carried by the tunnel." { + t.Errorf("all in effect: %+v", got) + } + // each way a written network is not in effect, in its words + c.SetList("r1", "behind_net", []string{"192.168.2.0/24", "10.77.0.128/25", "192.168.50.0/25", "the garage"}) + c.SetList("r2", "behind_net", []string{"192.168.2.128/25"}) + got, _ := run() + for _, want := range []string{ + "10.77.0.128/25 behind Boris · Dacha shares addresses with the tunnel network of Home (10.77.0.0/24).", + "192.168.50.0/25 behind Boris · Dacha shares addresses with 192.168.50.0/24, which the router has itself.", + "the garage behind Boris · Dacha is not a network a router may have behind it.", + "192.168.2.128/25 behind Boris · Garage shares addresses with 192.168.2.0/24 behind Dacha.", + "Such a network is not in effect: change it in the server's Network settings.", + } { + if !strings.Contains(got.Detail, want) { + t.Errorf("the check lacks %q:\n%s", want, got.Detail) + } + } + if got.Status != "warn" || got.Problem == nil || *got.Problem != "A network behind a router isn’t in effect" { + t.Errorf("networks not in effect: %+v", got) + } + // a router that waits for the admin's answer is not checked: nothing of it is in effect by design + c.Set("r2", "waiting", "1") + c.SetList("r1", "behind_net", []string{"192.168.2.0/24"}) + if got, _ := run(); got.Status != "ok" || got.Detail != "1 network behind routers is carried by the tunnel." { + t.Errorf("with a waiting router: %+v", got) + } + // a route the router would not take + m := model.Load(c, nil) + in := Inputs{M: m, Behind: m.BehindOf(own), Own: own, RouteError: "192.168.2.0/24 dev dawn0: RTNETLINK answers: a made-up failure"} + if got, _ := in.behind("home", ""); got.Status != "error" || got.Fix == nil || *got.Fix != "sync" || !strings.Contains(got.Detail, "a made-up failure") { + t.Errorf("a route refused: %+v", got) + } +} diff --git a/backend/health/testdata/broken.uci b/backend/health/testdata/broken.uci new file mode 100644 index 0000000..2fbd94b --- /dev/null +++ b/backend/health/testdata/broken.uci @@ -0,0 +1,136 @@ +config settings 'settings' + +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' + +config server 'cabin' + option name 'Cabin' + option ifname 'dawn1' + option port '4600' + option subnet '10.78.0.0/24' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + +config circle 'family' + option server 'home' + option name 'Family' + +config circle 'lost' + option server 'gone' + option name 'Lost' + +config service 'nas' + option name 'NAS' + option address '192.168.1.5' + +config person 'anna' + option server 'home' + option name 'Anna' + option code 'abcdef-ghijkl-mnopqr' + option circle 'family' + list services 'nas' + +config person 'boris' + option server 'gone' + option name 'Boris' + option code 'abcdef-ghijkl-mnopqr' + option circle 'nowhere' + list services 'nas' + list services 'printer' + +config person 'clara' + option server 'cabin' + option name 'Clara' + option paused '1' + +config person 'dmitri' + option server 'home' + option name 'Dmitri' + option expires '2020-01-01' + +config device 'good' + option person 'anna' + option name 'Phone' + option address '10.77.0.2' + option public_key 'HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=' + option preshared_key 'TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=' + +config device 'same' + option person 'anna' + option name 'Tablet' + option address '10.77.0.2' + option public_key 'TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=' + +config device 'off' + option person 'anna' + option name 'Old laptop' + option address '10.77.0.9' + option public_key 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=' + option disabled '1' + +config device 'badkey' + option person 'anna' + option name 'Laptop' + option address '10.77.0.3' + option public_key 'not a key' + option private_key 'neither' + option preshared_key 'nor this' + option mtu '9000' + option keepalive '9999' + +config device 'noaddr' + option person 'anna' + option name 'Watch' + option public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA=' + +config device 'oddaddr' + option person 'anna' + option name 'TV' + option address '10.77.0.300' + option public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA=' + +config device 'outside' + option person 'anna' + option name 'Console' + option address '10.99.0.4' + option public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA=' + +config device 'routers' + option person 'anna' + option name 'Camera' + option address '10.77.0.1' + option public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=' + +config device 'ownkey' + option person 'anna' + option name 'Mirror' + option address '10.77.0.7' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' + +config device 'orphan' + option person 'nobody' + option name 'Orphan' + option address '10.77.0.8' + option public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA=' + +config device 'noserver' + option person 'boris' + option name 'Boris phone' + option address '10.77.0.2' + option public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA=' + +config device 'paused' + option person 'clara' + option name 'Clara phone' + option address '10.78.0.2' + option public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA=' + +config device 'expired' + option person 'dmitri' + option name 'Dmitri phone' + option address '10.77.0.20' + option public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA=' diff --git a/backend/health/testdata/servers.uci b/backend/health/testdata/servers.uci new file mode 100644 index 0000000..66ccc46 --- /dev/null +++ b/backend/health/testdata/servers.uci @@ -0,0 +1,47 @@ +config settings 'settings' + +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + +config server 'twin' + option name 'Twin' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.128/25' + option endpoint 'bad host' + +config server 'lanname' + option name 'Lan name' + option ifname 'lan' + option port '4600' + option subnet '10.80.0.0/24' + +config server 'ours' + option name 'Ours' + option ifname 'dawn5' + option port '4700' + option subnet '10.81.0.0/24' + +config server 'internal' + option name 'Internal' + option ifname 'dlx0' + option port '0' + option subnet 'ten' + +config server 'odd' + option name 'Odd' + option ifname 'Bad-Name-Too-Long' + option port '70000' + option subnet '10.82.0.0/24' + option jmin '90' + option jmax '50' + option h1 '5' + option h2 '5' + +config person 'anna' + option server 'gone' + option name 'Anna' diff --git a/backend/health/testdata/trace.json b/backend/health/testdata/trace.json new file mode 100644 index 0000000..c76d72f --- /dev/null +++ b/backend/health/testdata/trace.json @@ -0,0 +1,170 @@ +{ + "ts": 1800000000, + "errors": [ + "Person Boris: server gone does not exist.", + "Person Boris: circle nowhere does not exist.", + "Person Boris: has the same personal link as Anna.", + "Device Tablet of Anna: address 10.77.0.2 is also used by device Phone of Anna.", + "Device Laptop of Anna: the public key is not a key.", + "Device Laptop of Anna: the private key is not a key.", + "Device Laptop of Anna: the preshared key is not a key.", + "Device Laptop of Anna: MTU 9000 is not between 1280 and 1500.", + "Device Laptop of Anna: keep-alive 9999 is not between 0 and 600 seconds.", + "Device Watch of Anna: address (none) is not a plain IPv4 address.", + "Device TV of Anna: address 10.77.0.300 is not a plain IPv4 address.", + "Device Console of Anna: address 10.99.0.4 is outside Home's tunnel 10.77.0.0/24.", + "Device Camera of Anna: address 10.77.0.1 is the router's own address on Home.", + "Device Mirror of Anna: the public key is the server's own.", + "Device Orphan: person nobody does not exist.", + "Circle Lost: server gone does not exist." + ], + "states": { + "anna": "active", + "boris": "no_server", + "clara": "paused", + "dmitri": "expired" + }, + "tunnels": { + "home": [ + "good", + "same", + "outside", + "routers" + ], + "cabin": [ + ] + }, + "diffs": [ + { + "server": "home", + "loaded": [ + "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=", + "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=", + "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA=", + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=" + ], + "diff": { + "loaded": 4, + "missing": 0, + "extra": 0 + } + }, + { + "server": "home", + "loaded": [ + "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=", + "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA=", + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=" + ], + "diff": { + "loaded": 3, + "missing": 1, + "extra": 0 + } + }, + { + "server": "home", + "loaded": [ + "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=", + "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=", + "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA=", + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA=", + "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZA=" + ], + "diff": { + "loaded": 5, + "missing": 0, + "extra": 1 + } + }, + { + "server": "home", + "loaded": [ + "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZA=" + ], + "diff": { + "loaded": 1, + "missing": 4, + "extra": 1 + } + }, + { + "server": "home", + "loaded": [ + ], + "diff": { + "loaded": 0, + "missing": 4, + "extra": 0 + } + }, + { + "server": "cabin", + "loaded": [ + ], + "diff": { + "loaded": 0, + "missing": 0, + "extra": 0 + } + }, + { + "server": "cabin", + "loaded": [ + ], + "diff": { + "loaded": 0, + "missing": 0, + "extra": 0 + } + }, + { + "server": "cabin", + "loaded": [ + "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZA=" + ], + "diff": { + "loaded": 1, + "missing": 0, + "extra": 1 + } + }, + { + "server": "cabin", + "loaded": [ + "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZA=" + ], + "diff": { + "loaded": 1, + "missing": 0, + "extra": 1 + } + }, + { + "server": "cabin", + "loaded": [ + ], + "diff": { + "loaded": 0, + "missing": 0, + "extra": 0 + } + } + ], + "network": "config interface 'lan'\n\toption proto 'static'\n\nconfig device 'odd'\n\nconfig interface 'dawn5'\n\toption proto 'amneziawg'\n\toption _dawnline '1'\n", + "config_errors": [ + "Person Anna: server gone does not exist.", + "Server Twin: Subnet overlaps 10.77.0.0/24.", + "Server Twin: Endpoint must be a hostname or IP address.", + "Server Twin: interface dawn0 is also used by Home.", + "Server Twin: UDP 4500 is also used by Home.", + "Server Lan name: lan is one of the router's own network interfaces.", + "Server Internal: Port must be 1-65535.", + "Server Internal: Subnet must look like 10.77.0.0/24.", + "Server Internal: dlx0 is one of the router's own network interfaces.", + "Server Odd: Interface name: 1-12 lowercase letters, digits or _.", + "Server Odd: Port must be 1-65535.", + "Server Odd: Jmin must not be larger than Jmax.", + "Server Odd: H1 and H2 overlap: each packet type needs values of its own." + ] +} diff --git a/backend/hub/hub.go b/backend/hub/hub.go new file mode 100644 index 0000000..6810083 --- /dev/null +++ b/backend/hub/hub.go @@ -0,0 +1,251 @@ +// Package hub is the live state the backend shows its pages: named documents +// (topics) and the ordered stream of their changes. +// +// A producer puts a whole document; the hub works out what changed and +// publishes only that (a JSON Merge Patch), numbered. A page takes a snapshot +// once, then follows the stream; one that fell behind (a tab that slept, a +// connection that dropped) asks with the number it last saw and gets what it +// missed, or a new snapshot when that is no longer kept. Nothing is published +// for a document that did not change, so a producer may put as often as it +// likes. +// +// The hub knows no transport: api serves it over ubus, portal over HTTP. It +// owns no data of its own either: what a topic holds is its producer's. +package hub + +import ( + "context" + "crypto/rand" + "encoding/hex" + "sync" +) + +// The operations of an event. +const ( + OpPut = "put" // data is the whole document + OpPatch = "patch" // data is a merge patch to the document + OpAppend = "append" // data is { items, keep }: new entries of a list, and how many it holds at most + OpDrop = "drop" // the topic is gone +) + +// Event is one change of one topic. Seq grows by one with every event of the +// hub, whatever its topic: a reader that sees a number skipped has missed one. +type Event struct { + Seq uint64 `json:"seq"` + Topic string `json:"topic"` + Op string `json:"op"` + Data any `json:"data,omitempty"` +} + +// Answer is what a reader gets when it asks where the hub is: the documents +// (Docs, a snapshot) or the events since the number it gave (Events), and the +// number it is at after applying them. Epoch names this run of the hub: a +// number from another run means nothing. +type Answer struct { + Epoch string `json:"epoch"` + Seq uint64 `json:"seq"` + Docs map[string]any `json:"docs,omitempty"` + Events []Event `json:"events,omitempty"` +} + +// journalSize is how many events are kept for readers that fell behind. A +// reader further back gets a snapshot, which is always right, only larger. +const journalSize = 512 + +// Hub holds the documents and publishes their changes. +type Hub struct { + mu sync.Mutex + epoch string + seq uint64 + docs map[string]any + journal []Event + wake chan struct{} + subs map[*Sub]struct{} +} + +// New makes an empty hub with an epoch of its own. +func New() *Hub { + var b [6]byte + rand.Read(b[:]) + return &Hub{ + epoch: hex.EncodeToString(b[:]), + docs: map[string]any{}, + wake: make(chan struct{}), + subs: map[*Sub]struct{}{}, + } +} + +// Epoch names this run of the hub. +func (h *Hub) Epoch() string { return h.epoch } + +// Put sets a topic's document and publishes what changed in it, if anything. +// The value goes through encoding/json: a struct is published as its JSON. +func (h *Hub) Put(topic string, doc any) error { + next, err := plain(doc) + if err != nil { + return err + } + h.mu.Lock() + defer h.mu.Unlock() + prev, had := h.docs[topic] + if !had { + h.docs[topic] = next + h.publish(Event{Topic: topic, Op: OpPut, Data: next}) + return nil + } + patch, changed := Diff(prev, next) + if !changed { + return nil + } + h.docs[topic] = next + // Only an object can be patched; anything else is sent whole. + if _, object := next.(map[string]any); object { + if _, was := prev.(map[string]any); was { + h.publish(Event{Topic: topic, Op: OpPatch, Data: patch}) + return nil + } + } + h.publish(Event{Topic: topic, Op: OpPut, Data: next}) + return nil +} + +// Append adds entries to a topic that is a list (a log, the points of a +// meter) and publishes them; the list keeps its newest `keep` entries. +func (h *Hub) Append(topic string, keep int, items ...any) error { + if len(items) == 0 { + return nil + } + added, err := plain(items) + if err != nil { + return err + } + h.mu.Lock() + defer h.mu.Unlock() + old, _ := h.docs[topic].([]any) + // A new slice every time: a snapshot handed out earlier is never written to. + list := make([]any, 0, len(old)+len(items)) + list = append(append(list, old...), added.([]any)...) + if keep > 0 && len(list) > keep { + list = list[len(list)-keep:] + } + h.docs[topic] = list + h.publish(Event{Topic: topic, Op: OpAppend, Data: map[string]any{"items": added, "keep": float64(keep)}}) + return nil +} + +// Drop removes a topic and tells its readers. +func (h *Hub) Drop(topic string) { + h.mu.Lock() + defer h.mu.Unlock() + if _, had := h.docs[topic]; !had { + return + } + delete(h.docs, topic) + h.publish(Event{Topic: topic, Op: OpDrop}) +} + +// publish numbers an event, keeps it and hands it to whoever follows. Called +// with the lock held. +func (h *Hub) publish(e Event) { + h.seq++ + e.Seq = h.seq + h.journal = append(h.journal, e) + if len(h.journal) > journalSize { + h.journal = append([]Event(nil), h.journal[len(h.journal)-journalSize:]...) + } + close(h.wake) + h.wake = make(chan struct{}) + for s := range h.subs { + select { + case s.c <- e: + default: + // A follower that does not keep up is let go; it asks again with Sync. + delete(h.subs, s) + close(s.c) + } + } +} + +// Sync answers a reader that is at (epoch, seq) and wants the topics `want` +// accepts (nil: all): the events it missed when they are still kept, a +// snapshot otherwise (another epoch, too far behind, or its first time: no epoch). +func (h *Hub) Sync(epoch string, seq uint64, want func(topic string) bool) Answer { + h.mu.Lock() + defer h.mu.Unlock() + return h.sync(epoch, seq, want) +} + +func (h *Hub) sync(epoch string, seq uint64, want func(string) bool) Answer { + a := Answer{Epoch: h.epoch, Seq: h.seq} + // A reader of this run that is not ahead of it, and whose next event is + // still kept. Zero is a number like any other: a reader that took its + // snapshot before anything was published follows from the first event. + if epoch == h.epoch && seq <= h.seq && (seq == h.seq || (len(h.journal) > 0 && h.journal[0].Seq <= seq+1)) { + a.Events = []Event{} + for _, e := range h.journal { + if e.Seq > seq && (want == nil || want(e.Topic)) { + a.Events = append(a.Events, e) + } + } + return a + } + a.Docs = make(map[string]any, len(h.docs)) + for topic, doc := range h.docs { + if want == nil || want(topic) { + a.Docs[topic] = doc + } + } + return a +} + +// Wait is Sync that does not answer "nothing new": it waits until there is an +// event the reader wants, or ctx ends (then the answer has no events, and the +// reader asks again). A reader that needs a snapshot gets it at once. +func (h *Hub) Wait(ctx context.Context, epoch string, seq uint64, want func(topic string) bool) Answer { + for { + h.mu.Lock() + a := h.sync(epoch, seq, want) + wake := h.wake + h.mu.Unlock() + if a.Docs != nil || len(a.Events) > 0 { + return a + } + // Events of other topics moved the number: the reader is told, so its + // next question is not answered from the start of the journal. + seq = a.Seq + select { + case <-ctx.Done(): + return a + case <-wake: + } + } +} + +// Sub follows the hub: every event from the moment it subscribed, in order. +type Sub struct { + h *Hub + c chan Event +} + +// Follow subscribes. The channel is closed when the follower did not keep up +// (its buffer of 256 events filled) or called Close. +func (h *Hub) Follow() *Sub { + s := &Sub{h: h, c: make(chan Event, 256)} + h.mu.Lock() + h.subs[s] = struct{}{} + h.mu.Unlock() + return s +} + +// Events is the follower's channel. +func (s *Sub) Events() <-chan Event { return s.c } + +// Close ends the subscription. +func (s *Sub) Close() { + s.h.mu.Lock() + if _, on := s.h.subs[s]; on { + delete(s.h.subs, s) + close(s.c) + } + s.h.mu.Unlock() +} diff --git a/backend/hub/hub_test.go b/backend/hub/hub_test.go new file mode 100644 index 0000000..3da1385 --- /dev/null +++ b/backend/hub/hub_test.go @@ -0,0 +1,177 @@ +package hub + +import ( + "context" + "encoding/json" + "reflect" + "testing" + "time" +) + +func doc(s string) any { + var v any + if err := json.Unmarshal([]byte(s), &v); err != nil { + panic(err) + } + return v +} + +// A patch holds only what changed, and applying it gives the new document. +func TestDiffAndMerge(t *testing.T) { + cases := []struct{ a, b, patch string }{ + {`{"a":1,"b":2}`, `{"a":1,"b":3}`, `{"b":3}`}, + {`{"a":1,"b":2}`, `{"a":1}`, `{"b":null}`}, + {`{"a":1}`, `{"a":1,"c":{"d":true}}`, `{"c":{"d":true}}`}, + {`{"p":{"d1":{"online":false,"rx":1},"d2":{"online":true}}}`, `{"p":{"d1":{"online":true,"rx":1},"d2":{"online":true}}}`, `{"p":{"d1":{"online":true}}}`}, + {`{"l":[1,2,3]}`, `{"l":[1,2]}`, `{"l":[1,2]}`}, + {`{"a":{"b":1}}`, `{"a":"text"}`, `{"a":"text"}`}, + {`{"a":"text"}`, `{"a":{"b":1}}`, `{"a":{"b":1}}`}, + } + for _, c := range cases { + patch, changed := Diff(doc(c.a), doc(c.b)) + if !changed { + t.Fatalf("%s → %s: no change seen", c.a, c.b) + } + if !reflect.DeepEqual(patch, doc(c.patch)) { + got, _ := json.Marshal(patch) + t.Fatalf("%s → %s: patch %s, want %s", c.a, c.b, got, c.patch) + } + if got := Merge(doc(c.a), patch); !reflect.DeepEqual(got, doc(c.b)) { + t.Fatalf("%s + %s did not give %s", c.a, c.patch, c.b) + } + } + if _, changed := Diff(doc(`{"a":[1,{"b":2}]}`), doc(`{"a":[1,{"b":2}]}`)); changed { + t.Fatal("equal documents differ") + } +} + +// Nulls never reach a document: a patch could not tell one from a removal. +func TestPlainDropsNulls(t *testing.T) { + got, err := plain(map[string]any{"a": nil, "b": map[string]any{"c": nil, "d": 1}, "l": []any{nil, 1}}) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, doc(`{"b":{"d":1},"l":[null,1]}`)) { + t.Fatalf("got %v", got) + } +} + +func TestPutPublishesOnlyChanges(t *testing.T) { + h := New() + sub := h.Follow() + defer sub.Close() + h.Put("people", doc(`{"p1":{"name":"Myata","online":false}}`)) + h.Put("people", doc(`{"p1":{"name":"Myata","online":false}}`)) // the same: nothing + h.Put("people", doc(`{"p1":{"name":"Myata","online":true}}`)) + first, second := <-sub.Events(), <-sub.Events() + if first.Seq != 1 || first.Op != OpPut || second.Seq != 2 || second.Op != OpPatch { + t.Fatalf("events: %+v %+v", first, second) + } + if !reflect.DeepEqual(second.Data, doc(`{"p1":{"online":true}}`)) { + t.Fatalf("patch: %v", second.Data) + } + select { + case e := <-sub.Events(): + t.Fatalf("an event for nothing: %+v", e) + default: + } +} + +// A reader gets a snapshot first, then what it missed; from another run or +// too far behind, a snapshot again. +func TestSync(t *testing.T) { + h := New() + h.Put("a", doc(`{"x":1}`)) + h.Put("b", doc(`{"y":1}`)) + snap := h.Sync("", 0, nil) + if snap.Seq != 2 || len(snap.Docs) != 2 || snap.Events != nil { + t.Fatalf("snapshot: %+v", snap) + } + h.Put("a", doc(`{"x":2}`)) + h.Put("b", doc(`{"y":2}`)) + only := func(topic string) bool { return topic == "a" } + got := h.Sync(snap.Epoch, snap.Seq, only) + if got.Docs != nil || len(got.Events) != 1 || got.Events[0].Topic != "a" || got.Seq != 4 { + t.Fatalf("catch-up: %+v", got) + } + // A snapshot taken before anything was published is followed from the first event. + if early := h.Sync(snap.Epoch, 0, nil); early.Docs != nil || len(early.Events) != 4 { + t.Fatalf("from zero: %+v", early) + } + if up := h.Sync(snap.Epoch, 4, nil); up.Docs != nil || len(up.Events) != 0 { + t.Fatalf("up to date: %+v", up) + } + if other := h.Sync("another-run", 3, nil); other.Docs == nil { + t.Fatal("a number of another run was taken for ours") + } + if ahead := h.Sync(snap.Epoch, 99, nil); ahead.Docs == nil { + t.Fatal("a number ahead of the hub was accepted") + } + for i := 0; i < journalSize+10; i++ { + h.Put("a", map[string]any{"x": i + 10}) + } + if far := h.Sync(snap.Epoch, 4, nil); far.Docs == nil { + t.Fatal("events no longer kept were promised") + } +} + +func TestAppendKeepsNewest(t *testing.T) { + h := New() + h.Append("meter", 3, 1, 2) + h.Append("meter", 3, 3, 4) + snap := h.Sync("", 0, nil) + if !reflect.DeepEqual(snap.Docs["meter"], doc(`[2,3,4]`)) { + t.Fatalf("list: %v", snap.Docs["meter"]) + } + ev := h.Sync(snap.Epoch, 1, nil).Events + if len(ev) != 1 || ev[0].Op != OpAppend || !reflect.DeepEqual(ev[0].Data, doc(`{"items":[3,4],"keep":3}`)) { + t.Fatalf("event: %+v", ev) + } +} + +// Wait holds until something the reader wants happens, and gives up with its context. +func TestWait(t *testing.T) { + h := New() + h.Put("a", doc(`{"x":1}`)) + at := h.Sync("", 0, nil) + only := func(topic string) bool { return topic == "a" } + got := make(chan Answer, 1) + go func() { got <- h.Wait(context.Background(), at.Epoch, at.Seq, only) }() + h.Put("b", doc(`{"y":1}`)) // not wanted: the wait goes on + select { + case a := <-got: + t.Fatalf("answered for another topic: %+v", a) + case <-time.After(50 * time.Millisecond): + } + h.Put("a", doc(`{"x":2}`)) + select { + case a := <-got: + if len(a.Events) != 1 || a.Seq != 3 { + t.Fatalf("answer: %+v", a) + } + case <-time.After(time.Second): + t.Fatal("never answered") + } + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Millisecond) + defer cancel() + if a := h.Wait(ctx, at.Epoch, 3, only); len(a.Events) != 0 || a.Docs != nil || a.Seq != 3 { + t.Fatalf("timed out with: %+v", a) + } +} + +// A follower that does not read is let go, not waited for. +func TestSlowFollowerIsDropped(t *testing.T) { + h := New() + sub := h.Follow() + for i := 0; i < 300; i++ { + h.Put("a", map[string]any{"x": i}) + } + n := 0 + for range sub.Events() { + n++ + } + if n != 256 { + t.Fatalf("read %d events before the channel closed", n) + } + sub.Close() // closing again is harmless +} diff --git a/backend/hub/patch.go b/backend/hub/patch.go new file mode 100644 index 0000000..9d0b403 --- /dev/null +++ b/backend/hub/patch.go @@ -0,0 +1,101 @@ +// The difference between two versions of a document as a JSON Merge Patch +// (RFC 7396): an object that holds only what changed, null where a field went. +// Documents are what encoding/json makes of JSON (map[string]any, []any, +// float64, string, bool); they hold no null, which a merge patch could not +// tell from "remove this" (plain() drops them on the way in). +// +// Pure: no state, no clock. hub.go keeps the versions. +package hub + +import ( + "encoding/json" + "reflect" +) + +// plain turns any value into a document: through encoding/json, so a struct +// is seen the way a client will see it, and without nulls. +func plain(v any) (any, error) { + raw, err := json.Marshal(v) + if err != nil { + return nil, err + } + var out any + if err := json.Unmarshal(raw, &out); err != nil { + return nil, err + } + return dropNulls(out), nil +} + +// dropNulls removes null fields of objects, at any depth. A null inside an +// array stays: an array is replaced whole by a patch, never merged. +func dropNulls(v any) any { + switch x := v.(type) { + case map[string]any: + for k, e := range x { + if e == nil { + delete(x, k) + } else { + x[k] = dropNulls(e) + } + } + case []any: + for i, e := range x { + x[i] = dropNulls(e) + } + } + return v +} + +// Diff returns the merge patch that turns document a into b, and whether they +// differ at all. Objects are compared field by field; anything else (an +// array, a number, a string) is replaced whole when it changed. The patch +// shares b's values: neither may be changed afterwards. +func Diff(a, b any) (any, bool) { + am, aok := a.(map[string]any) + bm, bok := b.(map[string]any) + if !aok || !bok { + if reflect.DeepEqual(a, b) { + return nil, false + } + return b, true + } + patch := map[string]any{} + for k := range am { + if _, still := bm[k]; !still { + patch[k] = nil + } + } + for k, bv := range bm { + av, had := am[k] + if !had { + patch[k] = bv + continue + } + if p, changed := Diff(av, bv); changed { + patch[k] = p + } + } + return patch, len(patch) > 0 +} + +// Merge applies a merge patch to a document and returns the result. The +// document is changed in place where it is an object; what a client does with +// a patch, kept here so a test can hold Diff to it. +func Merge(doc, patch any) any { + pm, ok := patch.(map[string]any) + if !ok { + return patch + } + dm, ok := doc.(map[string]any) + if !ok { + dm = map[string]any{} + } + for k, pv := range pm { + if pv == nil { + delete(dm, k) + continue + } + dm[k] = Merge(dm[k], pv) + } + return dm +} diff --git a/backend/i18n/i18n.go b/backend/i18n/i18n.go new file mode 100644 index 0000000..a4f2fbe --- /dev/null +++ b/backend/i18n/i18n.go @@ -0,0 +1,317 @@ +// Package i18n puts the backend's messages into the admin's language, as dawnline.i18n does through LuCI's +// catalog reader: text is English in the code and looked up in the luci-i18n-dawnline- catalog +// (/usr/lib/lua/luci/i18n/dawnline..lmo), placeholders filled after the lookup. +// +// A catalog: the translations, then an index entry per string sorted by key (key hash, number of forms, +// offset, length: big-endian uint32s), then the index's offset. A key is the msgid, "ctx\x01" before it and +// "\x02" after it for plural form n; its hash is Paul Hsieh's SuperFastHash seeded with the length. The +// Plural-Forms formula sits under key 0. Held to LuCI's own reader on testdata (scripts/ucode-golden.sh). +package i18n + +import ( + "encoding/binary" + "os" + "regexp" + "sort" + "strconv" + "strings" +) + +// Dir is where LuCI keeps its catalogs. +const Dir = "/usr/lib/lua/luci/i18n" + +// A Catalog is one language's translations. A nil one speaks English. +type Catalog struct { + data []byte + index []byte + // plural is the Plural-Forms expression ("" when the catalog has none) + plural string +} + +var tag = regexp.MustCompile(`^[a-z][a-z][a-z]?([_-][A-Za-z][A-Za-z][A-Za-z]?[A-Za-z]?)?$`) + +// Use is the catalog for a language as a page names it ("ru", "pt_BR"), or nil for English, a language +// with no Dawnline catalog, or anything that is no language. +func Use(dir, lang string) *Catalog { + if lang == "en" || !tag.MatchString(lang) { + return nil + } + c, _ := Load(dir + "/dawnline." + strings.ToLower(strings.ReplaceAll(lang, "_", "-")) + ".lmo") + return c +} + +// Load reads a catalog file. +func Load(path string) (*Catalog, error) { + raw, err := os.ReadFile(path) + if err != nil { + return nil, err + } + if len(raw) < 4 { + return nil, os.ErrInvalid + } + at := int(binary.BigEndian.Uint32(raw[len(raw)-4:])) + if at > len(raw)-4 || (len(raw)-4-at)%16 != 0 { + return nil, os.ErrInvalid + } + c := &Catalog{data: raw[:at], index: raw[at : len(raw)-4]} + if formula, ok := c.find(0); ok { + if i := strings.Index(formula, "plural="); i >= 0 { + c.plural = strings.TrimSpace(strings.SplitN(formula[i+len("plural="):], ";", 2)[0]) + } + } + return c, nil +} + +func (c *Catalog) find(key uint32) (string, bool) { + n := len(c.index) / 16 + i := sort.Search(n, func(i int) bool { return binary.BigEndian.Uint32(c.index[i*16:]) >= key }) + if i == n || binary.BigEndian.Uint32(c.index[i*16:]) != key { + return "", false + } + off, size := int(binary.BigEndian.Uint32(c.index[i*16+8:])), int(binary.BigEndian.Uint32(c.index[i*16+12:])) + if off+size > len(c.data) { + return "", false + } + return string(c.data[off : off+size]), true +} + +// canon is a key as the reader looks it up: runs of white space are one space, none at either end. +func canon(s string) string { + return strings.Join(strings.FieldsFunc(s, func(r rune) bool { + return r == ' ' || r == '\t' || r == '\n' || r == '\v' || r == '\f' || r == '\r' + }), " ") +} + +// T is msg in the catalog's language: the English when it has no translation. +func (c *Catalog) T(msg string) string { + if c != nil { + if k := canon(msg); k != "" { + if s, ok := c.find(hash([]byte(k))); ok { + return s + } + } + } + return msg +} + +// N is one or many for n, by the language's plural rules (Russian has three forms). +func (c *Catalog) N(n int64, one, many string) string { + if c != nil && c.plural != "" { + if form, ok := eval(c.plural, n); ok { + if s, found := c.find(hash([]byte(canon(one) + "\x02" + strconv.FormatInt(form, 10)))); found { + return s + } + } + } + if n == 1 { + return one + } + return many +} + +// hash is SuperFastHash of the bytes, seeded with their length (lmo.c sfh_hash). +func hash(data []byte) uint32 { + if len(data) == 0 { + return 0 + } + get16 := func(i int) uint32 { return uint32(data[i]) | uint32(data[i+1])<<8 } + s8 := func(i int) uint32 { return uint32(int32(int8(data[i]))) } + h := uint32(len(data)) + i := 0 + for n := len(data) >> 2; n > 0; n, i = n-1, i+4 { + h += get16(i) + tmp := get16(i+2)<<11 ^ h + h = h<<16 ^ tmp + h += h >> 11 + } + switch len(data) & 3 { + case 3: + h += get16(i) + h ^= h << 16 + h ^= s8(i+2) << 18 + h += h >> 11 + case 2: + h += get16(i) + h ^= h << 11 + h += h >> 17 + case 1: + h += s8(i) + h ^= h << 10 + h += h >> 1 + } + h ^= h << 3 + h += h >> 5 + h ^= h << 4 + h += h >> 17 + h ^= h << 25 + h += h >> 6 + return h +} + +// eval works a Plural-Forms expression out for n: C's operators on whole numbers. +func eval(expr string, n int64) (v int64, ok bool) { + p := &parser{s: expr, n: n} + defer func() { + if recover() != nil { + v, ok = 0, false + } + }() + v = p.ternary() + p.space() + return v, p.i == len(p.s) +} + +type parser struct { + s string + i int + n int64 +} + +func (p *parser) space() { + for p.i < len(p.s) && (p.s[p.i] == ' ' || p.s[p.i] == '\t') { + p.i++ + } +} + +// take eats op when it is next (and not the start of a longer operator). +func (p *parser) take(op string) bool { + p.space() + if !strings.HasPrefix(p.s[p.i:], op) { + return false + } + if rest := p.s[p.i+len(op):]; len(op) == 1 && rest != "" && strings.ContainsRune("<>!=", rune(op[0])) && rest[0] == '=' { + return false + } + p.i += len(op) + return true +} + +func truth(b bool) int64 { + if b { + return 1 + } + return 0 +} + +func (p *parser) ternary() int64 { + c := p.or() + if !p.take("?") { + return c + } + a := p.ternary() + if !p.take(":") { + panic("no :") + } + b := p.ternary() + if c != 0 { + return a + } + return b +} + +func (p *parser) or() int64 { + v := p.and() + for p.take("||") { + r := p.and() + v = truth(v != 0 || r != 0) + } + return v +} + +func (p *parser) and() int64 { + v := p.equal() + for p.take("&&") { + r := p.equal() + v = truth(v != 0 && r != 0) + } + return v +} + +func (p *parser) equal() int64 { + v := p.compare() + for { + switch { + case p.take("=="): + v = truth(v == p.compare()) + case p.take("!="): + v = truth(v != p.compare()) + default: + return v + } + } +} + +func (p *parser) compare() int64 { + v := p.sum() + for { + switch { + case p.take("<="): + v = truth(v <= p.sum()) + case p.take(">="): + v = truth(v >= p.sum()) + case p.take("<"): + v = truth(v < p.sum()) + case p.take(">"): + v = truth(v > p.sum()) + default: + return v + } + } +} + +func (p *parser) sum() int64 { + v := p.product() + for { + switch { + case p.take("+"): + v += p.product() + case p.take("-"): + v -= p.product() + default: + return v + } + } +} + +func (p *parser) product() int64 { + v := p.unary() + for { + switch { + case p.take("*"): + v *= p.unary() + case p.take("/"): + v /= p.unary() + case p.take("%"): + v %= p.unary() + default: + return v + } + } +} + +func (p *parser) unary() int64 { + if p.take("!") { + return truth(p.unary() == 0) + } + if p.take("(") { + v := p.ternary() + if !p.take(")") { + panic("no )") + } + return v + } + if p.take("n") { + return p.n + } + p.space() + j := p.i + for j < len(p.s) && p.s[j] >= '0' && p.s[j] <= '9' { + j++ + } + v, err := strconv.ParseInt(p.s[p.i:j], 10, 64) + if err != nil { + panic(err) + } + p.i = j + return v +} diff --git a/backend/i18n/i18n_test.go b/backend/i18n/i18n_test.go new file mode 100644 index 0000000..3c89fbd --- /dev/null +++ b/backend/i18n/i18n_test.go @@ -0,0 +1,90 @@ +package i18n + +import ( + "encoding/json" + "os" + "testing" +) + +// The catalogs of testdata answer as LuCI's own reader answers from them (testdata/trace.uc). +func TestAsLuCI(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var trace map[string]struct { + T map[string]*string `json:"t"` + N [][]any `json:"n"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace) != 2 { + t.Fatalf("%d languages", len(trace)) + } + for lang, want := range trace { + c, err := Load("testdata/" + lang + ".lmo") + if err != nil { + t.Fatal(err) + } + found := 0 + for id, s := range want.T { + // the reader says nothing where Dawnline then keeps the English + w := id + if s != nil { + w = *s + found++ + } + if got := c.T(id); got != w { + t.Errorf("%s: T(%q) = %q, LuCI %q", lang, id, got, w) + } + } + if found < 2 || len(want.N) < 100 { + t.Fatalf("%s: the trace exercises too little", lang) + } + for _, r := range want.N { + n, one, many := int64(r[0].(float64)), r[1].(string), r[2].(string) + if got := c.N(n, one, many); got != r[3] { + t.Errorf("%s: N(%v, %q) = %q, LuCI %q", lang, r[0], one, got, r[3]) + } + } + } +} + +func TestUse(t *testing.T) { + dir := t.TempDir() + raw, _ := os.ReadFile("testdata/ru.lmo") + os.WriteFile(dir+"/dawnline.ru.lmo", raw, 0o644) + os.WriteFile(dir+"/dawnline.pt-br.lmo", raw, 0o644) + os.WriteFile(dir+"/dawnline.xx.lmo", []byte("no"), 0o644) + for lang, speaks := range map[string]bool{"ru": true, "pt_BR": true, "pt-br": true, "en": false, "": false, "de": false, "../ru": false, "xx": false, "RU": false} { + if c := Use(dir, lang); (c != nil) != speaks { + t.Errorf("%q: %v", lang, c != nil) + } + } + var none *Catalog + if none.T("Save") != "Save" || none.N(1, "%s device", "%s devices") != "%s device" || none.N(4, "%s device", "%s devices") != "%s devices" { + t.Fatal("no catalog does not speak English") + } +} + +func TestPluralRules(t *testing.T) { + for expr, want := range map[string][]int64{ + "(n != 1)": {1, 0, 1, 1}, + "n>1": {0, 0, 1, 1}, + "0": {0, 0, 0, 0}, + "n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : 4": {0, 1, 2, 3}, + "!(n-1) + 2*3/2": {3, 4, 3, 3}, + } { + for n, w := range want { + if got, ok := eval(expr, int64(n)); !ok || got != w { + t.Errorf("%s for %d: %d %v, want %d", expr, n, got, ok, w) + } + } + } + for _, bad := range []string{"", "n ?", "(n", "n n", "n % 0", "x"} { + if _, ok := eval(bad, 3); ok { + t.Errorf("%q was taken", bad) + } + } +} diff --git a/backend/i18n/messages.js b/backend/i18n/messages.js new file mode 100644 index 0000000..a2dca25 --- /dev/null +++ b/backend/i18n/messages.js @@ -0,0 +1,668 @@ +// The backend's messages, for the translations' extractor (web/i18n/extract.ts reads this file as it read +// the ucode sources): what the Go backend says to people. _() a sentence in the reader's language, N_() one +// with a plural, L_() a line of the service log (written in English, translated where it is shown). +// +// The Go code asks the catalog by these very words (i18n.Catalog.T, N). A sentence the backend says that is +// not listed here has no translation: when you add or change one in backend/, add or change it here, then +// run "npm run i18n" in web/ and translate it (rules/i18n.md). Nothing runs this file. +function messages() { + L_("%d system package"); + L_("%d system packages"); + L_("%s (after %d repair)"); + L_("%s (after %d repairs)"); + L_("%s - %d repairs didn't help"); + L_("%s - %s"); + L_("%s - not repaired again (%d repairs didn't help)"); + L_("%s has no IPv4 address."); + L_("%s is not a bridge, so Dawnline cannot join the LAN as a device."); + L_("%s needs a manual switch in Components"); + L_("%s still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations."); + L_("%s still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations."); + L_("%s · restored"); + L_("Access rules"); + L_("Activity"); + L_("AmneziaWG is missing from the router"); + L_("AmneziaWG is running again · accepting connections on port %d"); + L_("AmneziaWG is running again"); + L_("AmneziaWG isn't accepting connections on port %d"); + L_("AmneziaWG isn't running"); + L_("Backup"); + L_("Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings."); + L_("Changed: %s."); + L_("Choose a disguise in Settings → Disguise: it replaces the values set by hand."); + L_("Choose another interface name in the server settings."); + L_("Components"); + L_("Connections"); + L_("DNS for Home-only devices"); + L_("Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed."); + L_("Firewall"); + L_("Install it in Dawnline → Components."); + L_("Install that AmneziaWG build in Settings → Updates, or switch the disguise in Settings → Disguise."); + L_("Internet like a home device"); + L_("MTU is now automatic"); + L_("Missing: %s."); + L_("No LAN detected."); + L_("No free address on %s."); + L_("No free link-local range for the internal link."); + L_("No free routing table."); + L_("People"); + L_("Personal links"); + L_("Personal portal"); + L_("Router"); + L_("Servers"); + L_("Speed"); + L_("System packages"); + L_("The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why."); + L_("Traffic"); + L_("Watchdog"); + L_("Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline."); + L_("a new build needs a manual switch in Components"); + L_("answers again"); + L_("are loaded again"); + L_("are missing"); + L_("automatic update failed"); + L_("background check failed: %s"); + L_("can't reach Dawnline (luci.dawnline is missing in rpcd)"); + L_("can't use the network interface %s: it exists and isn't Dawnline's"); + L_("certificate expires %s"); + L_("certificate expires within 7 days"); + L_("certificate renewed · valid until %s"); + L_("couldn't be repaired: %s"); + L_("couldn't be updated - the previous rules stay, and changes to access wait until they load"); + L_("couldn't load - no device is loaded into the tunnels until they do"); + L_("couldn't load devices into the tunnel"); + L_("couldn't start · %d failed attempts in %d min"); + L_("couldn't start"); + L_("failed - internet goes out directly for now"); + L_("failed: %s"); + L_("has an invalid interface name \"%s\""); + L_("installed the %s build · %s"); + L_("installed the %s build"); + L_("interface %s has Dawnline's settings again"); + L_("interface %s was changed outside Dawnline"); + L_("is kept down"); + L_("is kept down: its disguise has values AmneziaWG cannot take"); + L_("is kept down: its disguise needs AmneziaWG %s (installed: %s)"); + L_("is kept down: its disguise needs AmneziaWG %s (installed: none)"); + L_("is off"); + L_("is on · traffic enters %s as %s"); + L_("is ready again"); + L_("isn't answering on port %d"); + L_("isn't installed: no tunnel can run - install it in Dawnline → Components"); + L_("isn't installed: tunnels were left as they are"); + L_("isn't known to the network service - restart the network or reboot"); + L_("isn't running on this router (fw4): tunnels and the portal are closed"); + L_("isn't running"); + L_("kernel module isn't installed: no tunnel can run - install it in Dawnline → Components"); + L_("kernel module isn't loaded"); + L_("loading it"); + L_("loading them again"); + L_("moved to word codes"); + L_("netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed."); + L_("network changed - Dawnline set itself up again"); + L_("nightly backup failed: %s"); + L_("public address changed · %s → %s"); + L_("reaches Dawnline again"); + L_("reloading rpcd"); + L_("restarted · version %s"); + L_("restarting for the AmneziaWG update"); + L_("restarting it"); + L_("restoring them"); + L_("rules for Dawnline are in place again"); + L_("rules for Dawnline aren't loaded"); + L_("rules for Dawnline were changed or removed"); + L_("runs again"); + L_("runs without its fast path"); + L_("setting it up again"); + L_("started with the router · version %s"); + L_("started · accepting connections on port %s"); + L_("started · version %s"); + L_("started"); + L_("stopped unexpectedly - started again"); + L_("stopped unexpectedly"); + L_("update failed"); + L_("update to %s failed its check - rolled back to %s"); + L_("updated automatically · %s → %s"); + L_("updated automatically · %s"); + L_("updated · %s → %s"); + L_("updated · %s"); + L_("updates available · %s"); + L_("was broken - set up again (%s as %s)"); + L_("Routes"); + L_("couldn't set a route to a network behind a router"); + N_(0, "%d device is loaded in the tunnel.", "%d devices are loaded in the tunnel."); + N_(0, "%d of %d device missing, %d loaded that should not be.", "%d of %d devices missing, %d loaded that should not be."); + N_(0, "%d of %d device missing.", "%d of %d devices missing."); + N_(0, "%d package update in the feeds: %s", "%d package updates in the feeds: %s"); + N_(0, "%s AAAA → %s is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.", "%s AAAA → %s are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records."); + N_(0, "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router.", "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router."); + N_(0, "%s already has %d device. Remove one first to lower the limit to %d.", "%s already has %d devices. Remove one first to lower the limit to %d."); + N_(0, "%s is missing.", "%s are missing."); + N_(0, "%s → %s: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS.", "%s → %s: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS."); + N_(0, "Reloading the kernel module (%d tunnel restarts)", "Reloading the kernel module (%d tunnels restart)"); + _("%d MB free on the overlay"); + _("%d MB free on the overlay."); + _("%s MB free: settings may stop saving. Remove old backups (Settings → Backups) or shorten the history."); + _("%s already exists."); + _("%s and %s are not in one circle"); + _("%s and %s overlap: each packet type needs values of its own."); + _("%s can't be reached: %s"); + _("%s can't be reached: it is turned off"); + _("%s can't be reached: their access has ended"); + _("%s can't be reached: their server is turned off"); + _("%s can't be reached: they are paused"); + _("%s can't be reached: they have no server"); + _("%s can't be reached: they used up their data"); + _("%s can't connect: %s"); + _("%s can't connect: their access has ended"); + _("%s can't connect: their server is turned off"); + _("%s can't connect: they are paused"); + _("%s can't connect: they have no server"); + _("%s can't connect: they used up their data"); + _("%s can't use the network interface %s: it exists and isn't Dawnline's."); + _("%s cannot be changed for several people at once."); + _("%s covers %s and is valid for more than 14 days."); + _("%s does not cover %s (it has %s): browsers will warn."); + _("%s does not exist."); + _("%s does not overlap other networks."); + _("%s does not resolve."); + _("%s doesn't reach %s"); + _("%s expires within 14 days."); + _("%s goes through Cloudflare; in Russia such connections often stall after ~16 KB."); + _("%s has Home and Internet"); + _("%s has Home only"); + _("%s has Home only: only DNS and the portal on the router."); + _("%s has Home only: their device's own internet reaches it, not the tunnel."); + _("%s has Internet only"); + _("%s has Internet only."); + _("%s has Internet only: only DNS and the portal on the router."); + _("%s has a tag that is not closed with >."); + _("%s has an invalid interface name \"%s\"."); + _("%s has never connected"); + _("%s has no IPv4 address."); + _("%s has no room for every device on %s."); + _("%s has no server"); + _("%s has only some home services"); + _("%s is %s, one of %s's home services"); + _("%s is 0 or 1."); + _("%s is active"); + _("%s is at home (%s)"); + _("%s is connected"); + _("%s is down."); + _("%s is down: %s."); + _("%s is in %s, which %s doesn't reach"); + _("%s is in home network %s"); + _("%s is in the list twice."); + _("%s is kept down."); + _("%s is kept down: its disguise has values AmneziaWG cannot take. %s"); + _("%s is kept down: its disguise needs AmneziaWG %s (installed: %s)."); + _("%s is kept down: its disguise needs AmneziaWG %s (installed: none)."); + _("%s is not a bridge, so Dawnline cannot join the LAN as a device."); + _("%s is not a common home subnet: the networks people connect from rarely use the same addresses."); + _("%s is not a package Dawnline manages"); + _("%s is not an IP address."); + _("%s is not in a firewall zone, so the server port cannot be opened on it."); + _("%s is not one of %s's home services"); + _("%s is not one of Dawnline's tunnels."); + _("%s is on another server"); + _("%s is on the internet"); + _("%s is one of the most common home subnets. On a network with the same addresses, people with home access reach your home instead of their own: their printer or TV there is out of reach while connected, with LAN Bypass too. A rarer subnet for your home network avoids it, for example 10.37.12.0/24."); + _("%s is part of %s; choose %s instead."); + _("%s is the WAN."); + _("%s is this router on a network %s doesn't reach"); + _("%s is this router"); + _("%s is this router: DNS is open to everyone"); + _("%s is this router: the personal portal is open to everyone"); + _("%s is turned off"); + _("%s is up, listening on UDP %d."); + _("%s isn't connected right now"); + _("%s isn't in %s's home network"); + _("%s may not contain # or a line break."); + _("%s must be a number or a range like 10-100, up to 65535."); + _("%s must be a number or a range like 100-200, up to 4294967295."); + _("%s must be a number or a range like 5-15, from 1 to 65535."); + _("%s must be a value, not a list."); + _("%s must be a whole number from 0 to 65535."); + _("%s must be at least 12 with header protection."); + _("%s must be from %d to %d."); + _("%s must be on or off."); + _("%s on this router"); + _("%s overlaps %s."); + _("%s points at %s, not this router (%s)."); + _("%s points at %s, not this router (WAN %s). Check your DNS / DDNS."); + _("%s points at this router (%s)."); + _("%s reaches %s."); + _("%s reaches no home network."); + _("%s · interface settings"); + _("%s → %s (Cloudflare). %s reaches the router only if this name is DNS-only there, or use the router's IP."); + _("%s → %s (this router)."); + _("%s → %s: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router."); + _("%s → %s: IPv6 only, so only devices with IPv6 connect (the router's IPv4 %s has no name)."); + _("%s → %s: IPv6 only, so only devices with IPv6 connect."); + _("%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ."); + _("%s: the device's own network handles it."); + _("(%d more)"); + _("Access must be lan, internet or both."); + _("Access rules aren’t loaded"); + _("Access rules couldn't be updated (%s): the previous rules stay, so this change isn't in effect yet."); + _("Access rules couldn't load (%s): no device is loaded into the tunnels until they do."); + _("Access rules loaded"); + _("Access rules"); + _("Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link."); + _("Address must be an IPv4 address."); + _("Agent"); + _("All ports"); + _("Allowed: %s"); + _("AmneziaWG %s: no source publishes this build for this firmware any more"); + _("AmneziaWG answers may not reach devices"); + _("AmneziaWG firewall rules are missing"); + _("AmneziaWG installed"); + _("AmneziaWG is down"); + _("AmneziaWG is installed, but its kernel module doesn't load on this firmware"); + _("AmneziaWG is not installed (%s): install it in Dawnline → Components."); + _("AmneziaWG is not installed"); + _("AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced."); + _("AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum."); + _("AmneziaWG is not installed: install it in Dawnline → Components."); + _("AmneziaWG is up to date (%s)"); + _("AmneziaWG isn’t installed"); + _("AmneziaWG needs a build for the new firmware"); + _("AmneziaWG port is taken"); + _("AmneziaWG subnet overlaps another network"); + _("AmneziaWG update is available: %s → %s"); + _("AmneziaWG's kernel module doesn't load on this firmware: reinstall a build for this kernel in Components."); + _("AmneziaWG’s kernel module doesn’t load"); + _("An update is running: wait for it to finish, then remove Dawnline."); + _("Another component action is already running"); + _("Answers from %s are swallowed by a proxy on the router (%s): clients get no reply."); + _("Answers from %s go straight out. A proxy on the router diverts its own traffic (%s); these answers skip it."); + _("Answers from %s go straight out."); + _("Answers reach devices"); + _("At most %d people at once."); + _("Automatic update: %s"); + _("Background agent isn’t running"); + _("Background agent running"); + _("Backing up configuration"); + _("Backup does not contain /etc/config/dawnline."); + _("Backup failed: %s"); + _("Backup failed: the archive could not be written (is the flash full?)"); + _("Backup is too large."); + _("Backup not found."); + _("Balanced needs AmneziaWG 2.0 or newer on the router: install a current build in Dawnline → Components."); + _("Both are %s's devices"); + _("Both are in %s"); + _("Cannot detect the firmware target"); + _("Cannot reach github.com/%s"); + _("Check every 6h, 12h, 1d or 7d."); + _("Checking AmneziaWG"); + _("Checking Dawnline"); + _("Checking system packages"); + _("Choose a device on at least one side."); + _("Choose a free port between 1 and 65535 (not 22, 53, 80 or 443)."); + _("Choose a system log level: errors, warnings, normal or verbose."); + _("Choose the interface that leads to the internet."); + _("Circle %s: server %s does not exist."); + _("Clock is set"); + _("Clock isn’t set"); + _("Could not find a free id, try again."); + _("Couldn't load devices into %s: %s."); + _("Couldn't save /etc/config/dawnline: %s. Is the flash full?"); + _("Couldn't save /etc/config/dawnline: the write failed. Is the flash full?"); + _("Couldn't write %s. Is the flash full?"); + _("Counts traffic and enforces end dates and quotas."); + _("Cross-site request refused."); + _("DNS for Home-only devices isn’t working"); + _("DNS for Home-only devices"); + _("Daily traffic history must be 7-1830 days."); + _("Data limit must be a positive number of GB."); + _("Dawnline is up to date (%s)"); + _("Dawnline update is available: %s → %s"); + _("Default device limit must be 1-32."); + _("Device %s of %s: MTU %d is not between 1280 and 1500."); + _("Device %s of %s: address %s is also used by device %s of %s."); + _("Device %s of %s: address %s is not a plain IPv4 address."); + _("Device %s of %s: address %s is outside %s's tunnel %s."); + _("Device %s of %s: address %s is the router's own address on %s."); + _("Device %s of %s: address (none) is not a plain IPv4 address."); + _("Device %s of %s: keep-alive %d is not between 0 and 600 seconds."); + _("Device %s of %s: the preshared key is not a key."); + _("Device %s of %s: the private key is not a key."); + _("Device %s of %s: the public key is not a key."); + _("Device %s of %s: the public key is the server's own."); + _("Device %s: person %s does not exist."); + _("Device limit must be between 1 and 32."); + _("Device limit reached (%d)."); + _("Device not found."); + _("Devices in one circle reach each other."); + _("Devices loaded"); + _("Devices of different servers never reach each other."); + _("Devices reach each other on this server"); + _("Domain may use lowercase letters, digits, dashes and dots."); + _("Download failed: %s"); + _("Downloading %s from %s"); + _("Downloading %s"); + _("Each change needs the id of a person."); + _("End date must be YYYY-MM-DD."); + _("End dates and quotas use the router clock."); + _("Endpoint must be a hostname or IP address."); + _("Enter a circle name: up to 32 characters, without < > \" or \\."); + _("Enter a device name: up to %d letters, digits, spaces and - _ ."); + _("Enter a name: up to 48 characters, without < > \" or \\."); + _("Enter a time as HH:MM, 00:00 to 23:59."); + _("Error: %s"); + _("Every device has a key and an address of its own inside its server."); + _("Extra data must be a positive number of GB."); + _("Fallback DNS must be an IPv4 address (or empty for none)."); + _("File %s does not exist."); + _("Finished"); + _("Firewall rules"); + _("Firewall zone or WAN rule is missing."); + _("Firewall"); + _("Free space on the router"); + _("GitHub API rate limit reached: try again in an hour."); + _("GitHub did not answer, trying mirrors"); + _("GitHub: %s"); + _("HTTPS isn't available on this router: install %s."); + _("Home access includes the router."); + _("Home access reaches every home network."); + _("Home and Internet"); + _("Home devices reach only people with home access."); + _("Home network addresses"); + _("Home only"); + _("Home"); + _("I1-I5 together must be at most 2000 characters, not %d."); + _("Install updates immediately or scheduled."); + _("Installation failed"); + _("Installed Dawnline %s is newer than the release %s"); + _("Installing %s"); + _("Installing package"); + _("Installing the %s build"); + _("Installing the translation"); + _("Interface name: 1-12 lowercase letters, digits or _."); + _("Internet like a home device isn’t working"); + _("Internet like a home device not bypassed"); + _("Internet like a home device"); + _("Internet only"); + _("Internet traffic leaves through WAN directly."); + _("Invalid JSON."); + _("Invalid backup name."); + _("Invalid option %s."); + _("Invalid port %s."); + _("Invalid public key."); + _("Invalid section %s."); + _("Invalid service id."); + _("Invalid value for %s."); + _("It is in the tunnel network %s."); + _("It leaves like a home device would."); + _("It leaves through %s."); + _("It leaves through the WAN."); + _("Its configuration doesn't send it to the router"); + _("Its configuration sends it to the router"); + _("Jmin must not be larger than Jmax."); + _("Keep activity for 0 (no age limit) to 9999 days."); + _("Keep-alive must be 0-600 seconds."); + _("Keeping AmneziaWG %s for rollback"); + _("Keeping Dawnline %s for rollback"); + _("Kernel module, awg tool and the netifd protocol are present."); + _("Key generation failed (is amneziawg-tools installed?)."); + _("Key generation failed (no random data)."); + _("Key generation failed."); + _("Links on %s use plain HTTP: the link and the VPN keys in configurations travel unencrypted."); + _("Links on IP addresses use plain HTTP on the next port (%d), which the portal cannot take. Choose another portal port."); + _("Listening on TCP %d."); + _("Loading the kernel module"); + _("Log size must be 100-20000 events."); + _("Looking for the %s build for OpenWrt %s"); + _("LuCI link"); + _("MTU must be 1280-1500."); + _("Maximum needs AmneziaWG 3.1 on the router (kmod-amneziawg, amneziawg-tools 3.1): install a 3.1 build in Dawnline → Components."); + _("Method not allowed."); + _("Monthly data must be a positive number of GB."); + _("Monthly traffic history must be 1-120 months."); + _("Needs %s. Internet traffic leaves through WAN directly until then."); + _("Network interface %s already exists."); + _("Networks a person does not reach cannot reach them either."); + _("No %s build for OpenWrt %s in %s, or it could not be verified"); + _("No AmneziaWG build for OpenWrt %s (%s) yet"); + _("No AmneziaWG build for OpenWrt %s yet"); + _("No LAN detected."); + _("No device uses %s"); + _("No free address left on %s."); + _("No free address on %s."); + _("No free addresses left in the server subnet."); + _("No free link-local range for the internal link."); + _("No free routing table."); + _("No other policy routing ahead of the tunnel rules."); + _("No previous AmneziaWG build is kept on the router"); + _("No previous Dawnline version is kept on the router"); + _("No public address: devices will not know where to connect."); + _("No release %s in %s."); + _("No server yet"); + _("No server yet."); + _("Not a Dawnline export."); + _("Not a valid backup archive."); + _("Not enough free space on the router: %d MB free, about %d MB needed. Remove old backups or packages first"); + _("Not every device is loaded into AmneziaWG"); + _("Not found."); + _("Not set up."); + _("Nothing listens on TCP %d."); + _("Nothing to change for %s."); + _("Nothing to change."); + _("Nothing to install"); + _("Nothing to save."); + _("Older than must be a number of days."); + _("On one of the networks %s reaches."); + _("One of the networks %s reaches."); + _("Only devices of people with home access can be reached."); + _("Only home devices reach people's devices."); + _("Only people with home access reach other devices."); + _("Only the admin can change how a device connects."); + _("Only the admin can turn devices off."); + _("Open Overview → Health."); + _("Open this link over HTTPS to get the connection settings."); + _("Other addresses must be hostnames or IP addresses."); + _("Other policy routing bypasses the home-device path"); + _("Package installation failed"); + _("Paused must be true or false."); + _("People and devices are inconsistent"); + _("People and devices consistent"); + _("Person %s: circle %s does not exist."); + _("Person %s: has the same personal link as %s."); + _("Person %s: home service %s does not exist."); + _("Person %s: server %s does not exist."); + _("Personal portal isn’t working"); + _("Personal portal"); + _("Plain HTTP links"); + _("Plain resolver on port %d."); + _("Plain resolver running next to the LAN (%s)."); + _("Policy routing on the router (%s) sends marked traffic straight out, past the home-device path: tunnel traffic it matches skips your LAN's proxies and filters."); + _("Port is free"); + _("Port must be 1-65535."); + _("Portal address doesn’t point here"); + _("Portal address isn’t set"); + _("Portal address points here"); + _("Portal address"); + _("Portal answers may not reach visitors"); + _("Portal answers reach visitors"); + _("Portal certificate needs attention"); + _("Portal certificate"); + _("Portal links use plain HTTP"); + _("Portal port must be 1-65535."); + _("Portal"); + _("Ports %s"); + _("Private addresses outside the home network are blocked."); + _("Public address must be a hostname or IP address."); + _("Public address needs attention"); + _("Public address"); + _("Redirect must be a full http:// or https:// address."); + _("Refreshing package lists"); + _("RejectAfterTime must be at most 180 seconds."); + _("Release %s has no %s: it stays as it is"); + _("Release %s has no translation into %s: install a release that has one"); + _("Release %s publishes no checksum for %s: not installing an unverified package"); + _("Removing the translation"); + _("Request too large."); + _("Resolver"); + _("Restarting the network so it knows AmneziaWG (connections drop for a few seconds)"); + _("Restarting with the new settings."); + _("Rolling back to %s"); + _("S2 must not be S1 + 56: the handshake initiation and response would have the same size."); + _("Save the log every 10min, hourly or off."); + _("Server %d"); + _("Server %s: %s is one of the router's own network interfaces."); + _("Server %s: %s"); + _("Server %s: UDP %s is also used by %s."); + _("Server %s: interface %s is also used by %s."); + _("Server ID may use lowercase letters, digits and underscores."); + _("Server configured"); + _("Server is disabled."); + _("Server → Access → Home network."); + _("Server"); + _("Server: Enter a name: up to 48 characters, without < > \" or \\."); + _("Service: Enter a name: up to 48 characters, without < > \" or \\."); + _("Set a server up in Settings."); + _("Set the public hostname in Settings so links can be generated."); + _("Set up a server first."); + _("Setup failed: %s"); + _("Something went wrong on the router. Try again; if it goes on, look at the Log."); + _("Subnet is unique"); + _("Subnet must look like 10.77.0.0/24."); + _("Subnet overlaps %s."); + _("Such devices are left out of the tunnels: fix or remove them."); + _("System packages are up to date"); + _("TCP %d is already used by %s. Choose another port in Settings."); + _("TCP %d is already used by %s. Choose another portal port."); + _("TCP %d is already used by %s. Links on IP addresses use plain HTTP on the port after the portal's. Choose another portal port."); + _("TCP %d is sent on by port forward “%s”. Choose another portal port."); + _("Table inet dawnline enforces who may reach LAN and the internet."); + _("Table inet dawnline is missing: no device is loaded into the tunnels until it is back."); + _("That id is taken."); + _("That is the same device"); + _("The AmneziaWG update is installed and starts after a reboot."); + _("The AmneziaWG update waits for a reboot"); + _("The WAN address %s is CGNAT (shared by the ISP): %s cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6."); + _("The WAN address %s is private: this router is behind another one. Forward %s on it, or devices cannot connect."); + _("The admin has turned this device off."); + _("The configuration in this file cannot be read."); + _("The devices in AmneziaWG could not be checked"); + _("The firewall lets it through"); + _("The firmware changed (kernel %s → %s): the AmneziaWG build installed for it is gone. Install the build for this firmware."); + _("The header protection key is not a key."); + _("The id may use lowercase letters, digits and underscores."); + _("The kept AmneziaWG build was made for another firmware: it would not load on this one"); + _("The kernel module doesn't load. Reinstall a build for this kernel in Components."); + _("The kernel module doesn't load: %s Reinstall a build for this kernel in Components."); + _("The link is up but not attached to %s."); + _("The main address is an IP: its links use plain HTTP."); + _("The network doesn’t know AmneziaWG yet"); + _("The new AmneziaWG kernel module doesn't load on this firmware: the tunnels stay down until it does (see the log above)"); + _("The old kernel module stays loaded (another AmneziaWG interface may use it): the AmneziaWG update is installed and starts after a reboot."); + _("The person has no server."); + _("The resolver is not running; Home-only devices cannot resolve names."); + _("The router clock looks wrong; end dates will misbehave. Check NTP."); + _("The router is running out of flash"); + _("The router reaches it only while its VPN is on."); + _("The translation could not be removed"); + _("The tunnel could not be read, so its devices could not be checked."); + _("The update stopped unexpectedly."); + _("There is no session the router could reach."); + _("This configuration can't be used: %s"); + _("This is a SNAPSHOT firmware: the AmneziaWG projects publish builds for releases only"); + _("This key is already in use."); + _("Too many changes in a short time. Try again in a few minutes."); + _("Traffic enters %s as %s, so it is handled like any device on your LAN."); + _("Trying mirror %s"); + _("Tunnel running"); + _("Turn the device on again on its page."); + _("Type \"remove\" to confirm."); + _("UDP %d is also used by %s."); + _("UDP %d is used by %s. Choose another port."); + _("UDP port must be 1-65535."); + _("Unexpected entry in backup: %s"); + _("Unexpected file in backup: %s"); + _("Unknown AmneziaWG build %s"); + _("Unknown DNS choice."); + _("Unknown action."); + _("Unknown category."); + _("Unknown choice for devices reaching each other."); + _("Unknown circle."); + _("Unknown component %s"); + _("Unknown device type."); + _("Unknown device."); + _("Unknown disguise method."); + _("Unknown fix."); + _("Unknown location service."); + _("Unknown page."); + _("Unknown person."); + _("Unknown release."); + _("Unknown scope."); + _("Unknown server."); + _("Unknown service %s."); + _("Unknown service."); + _("Unknown setting %s."); + _("Unknown update target."); + _("Update failed"); + _("Updating %s"); + _("Updating AmneziaWG"); + _("Updating Dawnline"); + _("Updating system packages"); + _("Upload is empty or too large."); + _("Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x."); + _("Using a self-signed certificate: browsers will show a warning. ACME can get a free Let’s Encrypt one."); + _("Using a self-signed certificate: browsers will show a warning."); + _("Warning: %s sent a file that does not match GitHub's sha256, discarded"); + _("Warning: could not keep %s: %s"); + _("Warning: the installed build is no longer published, nothing to keep for rollback"); + _("Your access has ended."); + _("Your access is paused."); + _("Zone %s and the WAN rule for UDP %d exist."); + _("\"%s\" already exists."); + _("\"%s\" is already taken."); + _("\"%s\" is not a device or an IPv4 address."); + _("\"Devices reach each other\" is off on %s"); + _("another program on this router"); + _("apk did not install %s %s (installed: %s)"); + _("apk did not reinstall the version that is already installed"); + _("apk doesn't reinstall an installed version. Install a different release, or run install.sh on the router"); + _("home"); + _("interface %s"); + _("netifd doesn't know the amneziawg protocol (AmneziaWG missing, or the network wasn't restarted after installing it)."); + _("no circle"); + _("port forward “%s”"); + _("server “%s”"); + _("sha256 matches the release (%s…)"); + _("the router itself"); + _("Networks %s and %s share addresses."); + _("Network %s is not written like 192.168.2.0/24."); + _("Network %s is not private (10.x, 172.16-31.x, 192.168.x)."); + _("Network %s is taken: %s is behind %s (%s). Two sites need different addresses."); + _("Network %s is taken: %s is the tunnel network of %s. The two ends of a tunnel need different addresses."); + _("Network %s is taken: the router has %s itself. The two ends of a tunnel need different addresses."); + _("Network %s is too wide: /%d at the most."); + _("A router has %d networks behind it at the most."); + _("Couldn't set the routes to the networks behind routers (%s): they aren't reachable yet."); + _("Only a router has networks behind it."); + _("Network %s is taken on this server. Ask the admin which addresses are free."); + _("Network %s is taken: %s is behind your %s. Two sites need different addresses."); + _("Add the router as a new device: a device cannot be made one here."); + _("The admin adds routers on this server. Ask them for one."); + _("This router waits for an answer to its request: it has no configuration yet."); + _("This device asks for nothing."); + _("Unknown answer."); + _("Unknown choice for routers on people's pages."); + _("%s is behind %s"); + _("%s: the tunnel carries this network, and the rules see a host there as they see the router."); + _("%s is behind this device"); + _("A router reaches its own network without the tunnel."); + _("Networks behind routers"); + _("%s behind %s is not a network a router may have behind it."); + _("%s behind %s is written twice, or is one more than a router may have."); + _("%s behind %s shares addresses with the tunnel network of %s (%s)."); + _("%s behind %s shares addresses with %s behind %s."); + _("%s behind %s shares addresses with %s, which the router has itself."); + _("Such a network is not in effect: change it in the server's Network settings."); + _("A network behind a router isn’t in effect"); + _("A route to a network behind a router couldn't be set: %s."); + _("A network behind a router has no route"); + N_(0, "%d network behind routers is carried by the tunnel.", "%d networks behind routers are carried by the tunnel."); +} diff --git a/backend/i18n/portal-messages.js b/backend/i18n/portal-messages.js new file mode 100644 index 0000000..5994886 --- /dev/null +++ b/backend/i18n/portal-messages.js @@ -0,0 +1,148 @@ +// The backend's messages that reach the portal's visitors, for the translations' extractor (web/i18n/extract.ts reads this file as it read +// the ucode sources): what the Go backend says to people. _() a sentence in the reader's language, N_() one +// with a plural, L_() a line of the service log (written in English, translated where it is shown). +// +// The Go code asks the catalog by these very words (i18n.Catalog.T, N). A sentence the backend says that is +// not listed here has no translation: when you add or change one in backend/, add or change it here, then +// run "npm run i18n" in web/ and translate it (rules/i18n.md). Nothing runs this file. +function portalMessages() { + L_("AmneziaWG is missing from the router"); + L_("AmneziaWG is running again · accepting connections on port %d"); + L_("AmneziaWG is running again"); + L_("AmneziaWG isn't accepting connections on port %d"); + L_("AmneziaWG isn't running"); + L_("Choose a disguise in Settings → Disguise: it replaces the values set by hand."); + L_("Choose another interface name in the server settings."); + L_("Install that AmneziaWG build in Settings → Updates, or switch the disguise in Settings → Disguise."); + L_("Missing: %s."); + L_("can't use the network interface %s: it exists and isn't Dawnline's"); + L_("couldn't load devices into the tunnel"); + L_("has an invalid interface name \"%s\""); + L_("is kept down"); + L_("is kept down: its disguise has values AmneziaWG cannot take"); + L_("is kept down: its disguise needs AmneziaWG %s (installed: %s)"); + L_("is kept down: its disguise needs AmneziaWG %s (installed: none)"); + L_("is ready again"); + L_("isn't installed: no tunnel can run - install it in Dawnline → Components"); + L_("isn't known to the network service - restart the network or reboot"); + L_("kernel module isn't installed: no tunnel can run - install it in Dawnline → Components"); + L_("kernel module isn't loaded"); + L_("loading it"); + L_("netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed."); + L_("restarting it"); + L_("setting it up again"); + N_(0, "%s already has %d device. Remove one first to lower the limit to %d.", "%s already has %d devices. Remove one first to lower the limit to %d."); + _("%s and %s overlap: each packet type needs values of its own."); + _("%s can't use the network interface %s: it exists and isn't Dawnline's."); + _("%s cannot be changed for several people at once."); + _("%s has a tag that is not closed with >."); + _("%s has an invalid interface name \"%s\"."); + _("%s has no room for every device on %s."); + _("%s is in the list twice."); + _("%s is kept down."); + _("%s is kept down: its disguise has values AmneziaWG cannot take. %s"); + _("%s is kept down: its disguise needs AmneziaWG %s (installed: %s)."); + _("%s is kept down: its disguise needs AmneziaWG %s (installed: none)."); + _("%s may not contain # or a line break."); + _("%s must be a number or a range like 10-100, up to 65535."); + _("%s must be a number or a range like 100-200, up to 4294967295."); + _("%s must be a number or a range like 5-15, from 1 to 65535."); + _("%s must be a value, not a list."); + _("%s must be a whole number from 0 to 65535."); + _("%s must be at least 12 with header protection."); + _("%s must be from %d to %d."); + _("%s must be on or off."); + _("%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ."); + _("Access must be lan, internet or both."); + _("Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link."); + _("AmneziaWG is not installed (%s): install it in Dawnline → Components."); + _("AmneziaWG is not installed: install it in Dawnline → Components."); + _("At most %d people at once."); + _("Circle %s: server %s does not exist."); + _("Cross-site request refused."); + _("Data limit must be a positive number of GB."); + _("Device %s of %s: MTU %d is not between 1280 and 1500."); + _("Device %s of %s: address %s is also used by device %s of %s."); + _("Device %s of %s: address %s is not a plain IPv4 address."); + _("Device %s of %s: address %s is outside %s's tunnel %s."); + _("Device %s of %s: address %s is the router's own address on %s."); + _("Device %s of %s: address (none) is not a plain IPv4 address."); + _("Device %s of %s: keep-alive %d is not between 0 and 600 seconds."); + _("Device %s of %s: the preshared key is not a key."); + _("Device %s of %s: the private key is not a key."); + _("Device %s of %s: the public key is not a key."); + _("Device %s of %s: the public key is the server's own."); + _("Device %s: person %s does not exist."); + _("Device limit must be between 1 and 32."); + _("Device limit reached (%d)."); + _("Device not found."); + _("Each change needs the id of a person."); + _("End date must be YYYY-MM-DD."); + _("Endpoint must be a hostname or IP address."); + _("Enter a device name: up to %d letters, digits, spaces and - _ ."); + _("Extra data must be a positive number of GB."); + _("I1-I5 together must be at most 2000 characters, not %d."); + _("Interface name: 1-12 lowercase letters, digits or _."); + _("Invalid JSON."); + _("Invalid public key."); + _("Jmin must not be larger than Jmax."); + _("Keep-alive must be 0-600 seconds."); + _("Key generation failed (is amneziawg-tools installed?)."); + _("Key generation failed (no random data)."); + _("Key generation failed."); + _("MTU must be 1280-1500."); + _("Method not allowed."); + _("Monthly data must be a positive number of GB."); + _("No free address left on %s."); + _("No free addresses left in the server subnet."); + _("Not found."); + _("Nothing to change for %s."); + _("Nothing to change."); + _("Only the admin can change how a device connects."); + _("Only the admin can turn devices off."); + _("Open this link over HTTPS to get the connection settings."); + _("Paused must be true or false."); + _("Person %s: circle %s does not exist."); + _("Person %s: has the same personal link as %s."); + _("Person %s: home service %s does not exist."); + _("Person %s: server %s does not exist."); + _("Port must be 1-65535."); + _("RejectAfterTime must be at most 180 seconds."); + _("Request too large."); + _("S2 must not be S1 + 56: the handshake initiation and response would have the same size."); + _("Set up a server first."); + _("Something went wrong on the router. Try again; if it goes on, look at the Log."); + _("Subnet must look like 10.77.0.0/24."); + _("Subnet overlaps %s."); + _("The admin has turned this device off."); + _("The header protection key is not a key."); + _("The id may use lowercase letters, digits and underscores."); + _("The person has no server."); + _("This key is already in use."); + _("Too many changes in a short time. Try again in a few minutes."); + _("Unknown DNS choice."); + _("Unknown action."); + _("Unknown circle."); + _("Unknown device type."); + _("Unknown device."); + _("Unknown person."); + _("Unknown server."); + _("Unknown service %s."); + _("Your access has ended."); + _("Your access is paused."); + _("\"%s\" already exists."); + _("\"%s\" is already taken."); + _("Networks %s and %s share addresses."); + _("Network %s is not written like 192.168.2.0/24."); + _("Network %s is not private (10.x, 172.16-31.x, 192.168.x)."); + _("Network %s is taken on this server. Ask the admin which addresses are free."); + _("Network %s is taken: %s is behind your %s. Two sites need different addresses."); + _("Network %s is taken: %s is the tunnel network of %s. The two ends of a tunnel need different addresses."); + _("Network %s is taken: the router has %s itself. The two ends of a tunnel need different addresses."); + _("Network %s is too wide: /%d at the most."); + _("A router has %d networks behind it at the most."); + _("Add the router as a new device: a device cannot be made one here."); + _("Only a router has networks behind it."); + _("The admin adds routers on this server. Ask them for one."); + _("This router waits for an answer to its request: it has no configuration yet."); +} diff --git a/backend/i18n/testdata/de.lmo b/backend/i18n/testdata/de.lmo new file mode 100644 index 0000000..d83e589 Binary files /dev/null and b/backend/i18n/testdata/de.lmo differ diff --git a/backend/i18n/testdata/de.po b/backend/i18n/testdata/de.po new file mode 100644 index 0000000..2368dd4 --- /dev/null +++ b/backend/i18n/testdata/de.po @@ -0,0 +1,13 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "%s device" +msgid_plural "%s devices" +msgstr[0] "%s Gerät" +msgstr[1] "%s Geräte" + +msgid "Save" +msgstr "Speichern" diff --git a/backend/i18n/testdata/ru.lmo b/backend/i18n/testdata/ru.lmo new file mode 100644 index 0000000..f6cfa25 Binary files /dev/null and b/backend/i18n/testdata/ru.lmo differ diff --git a/backend/i18n/testdata/ru.po b/backend/i18n/testdata/ru.po new file mode 100644 index 0000000..f507d9e --- /dev/null +++ b/backend/i18n/testdata/ru.po @@ -0,0 +1,51 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Language: ru\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +msgid "Save" +msgstr "Сохранить" + +msgctxt "state" +msgid "Off" +msgstr "Выкл." + +msgid "%s device" +msgid_plural "%s devices" +msgstr[0] "%s устройство" +msgstr[1] "%s устройства" +msgstr[2] "%s устройств" + +msgid "%d day" +msgid_plural "%d days" +msgstr[0] "%d день" +msgstr[1] "%d дня" +msgstr[2] "" + +msgid "Dawnline" +msgstr "Dawnline" + +msgid "Untranslated" +msgstr "" + +msgid "Say \"hi\" \\ there" +msgstr "Скажи «привет» \\ там" + +msgid "abc" +msgstr "abcde" + +msgid "%s is kept down." +msgstr "%s не запускается." + +msgid "two spaces inside" +msgstr "два пробела внутри" + +msgid " space around " +msgstr " пробел вокруг " + +msgid "a line\nbreak" +msgstr "перенос\nстроки" + +msgid "No LAN detected." +msgstr "Локальная сеть не найдена." diff --git a/backend/i18n/testdata/trace.json b/backend/i18n/testdata/trace.json new file mode 100644 index 0000000..3e6ff45 --- /dev/null +++ b/backend/i18n/testdata/trace.json @@ -0,0 +1,1356 @@ +{ + "ru": { + "t": { + "Save": "Сохранить", + "Off": null, + "state\u0001Off": "Выкл.", + "Dawnline": null, + "Untranslated": null, + "Say \"hi\" \\ there": "Скажи «привет» \\ там", + "abc": "abcde", + "%s is kept down.": "%s не запускается.", + "Not in the catalog": null, + "": null, + "two spaces inside": null, + "two spaces inside": null, + "two \t spaces\ninside": null, + " space around ": null, + "space around": null, + "a line\nbreak": null, + "a line break": null, + " Save ": "Сохранить", + "Save\n": "Сохранить", + "No LAN detected.": "Локальная сеть не найдена.", + "%s device": null, + "%s devices": null, + "%d day": null + }, + "n": [ + [ + 0, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 0, + "%d day", + "%d days", + "%d days" + ], + [ + 0, + "Save", + "Saves", + "Saves" + ], + [ + 0, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 1, + "%d day", + "%d days", + "%d день" + ], + [ + 1, + "Save", + "Saves", + "Save" + ], + [ + 1, + "%s cat", + "%s cats", + "%s cat" + ], + [ + 2, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 2, + "%d day", + "%d days", + "%d дня" + ], + [ + 2, + "Save", + "Saves", + "Saves" + ], + [ + 2, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 3, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 3, + "%d day", + "%d days", + "%d дня" + ], + [ + 3, + "Save", + "Saves", + "Saves" + ], + [ + 3, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 4, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 4, + "%d day", + "%d days", + "%d дня" + ], + [ + 4, + "Save", + "Saves", + "Saves" + ], + [ + 4, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 5, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 5, + "%d day", + "%d days", + "%d days" + ], + [ + 5, + "Save", + "Saves", + "Saves" + ], + [ + 5, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 9, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 9, + "%d day", + "%d days", + "%d days" + ], + [ + 9, + "Save", + "Saves", + "Saves" + ], + [ + 9, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 10, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 10, + "%d day", + "%d days", + "%d days" + ], + [ + 10, + "Save", + "Saves", + "Saves" + ], + [ + 10, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 11, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 11, + "%d day", + "%d days", + "%d days" + ], + [ + 11, + "Save", + "Saves", + "Saves" + ], + [ + 11, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 12, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 12, + "%d day", + "%d days", + "%d days" + ], + [ + 12, + "Save", + "Saves", + "Saves" + ], + [ + 12, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 14, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 14, + "%d day", + "%d days", + "%d days" + ], + [ + 14, + "Save", + "Saves", + "Saves" + ], + [ + 14, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 15, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 15, + "%d day", + "%d days", + "%d days" + ], + [ + 15, + "Save", + "Saves", + "Saves" + ], + [ + 15, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 20, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 20, + "%d day", + "%d days", + "%d days" + ], + [ + 20, + "Save", + "Saves", + "Saves" + ], + [ + 20, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 21, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 21, + "%d day", + "%d days", + "%d день" + ], + [ + 21, + "Save", + "Saves", + "Saves" + ], + [ + 21, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 22, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 22, + "%d day", + "%d days", + "%d дня" + ], + [ + 22, + "Save", + "Saves", + "Saves" + ], + [ + 22, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 25, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 25, + "%d day", + "%d days", + "%d days" + ], + [ + 25, + "Save", + "Saves", + "Saves" + ], + [ + 25, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 100, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 100, + "%d day", + "%d days", + "%d days" + ], + [ + 100, + "Save", + "Saves", + "Saves" + ], + [ + 100, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 101, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 101, + "%d day", + "%d days", + "%d день" + ], + [ + 101, + "Save", + "Saves", + "Saves" + ], + [ + 101, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 102, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 102, + "%d day", + "%d days", + "%d дня" + ], + [ + 102, + "Save", + "Saves", + "Saves" + ], + [ + 102, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 111, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 111, + "%d day", + "%d days", + "%d days" + ], + [ + 111, + "Save", + "Saves", + "Saves" + ], + [ + 111, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 112, + "%s device", + "%s devices", + "%s устройств" + ], + [ + 112, + "%d day", + "%d days", + "%d days" + ], + [ + 112, + "Save", + "Saves", + "Saves" + ], + [ + 112, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 121, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 121, + "%d day", + "%d days", + "%d день" + ], + [ + 121, + "Save", + "Saves", + "Saves" + ], + [ + 121, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1000001, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 1000001, + "%d day", + "%d days", + "%d день" + ], + [ + 1000001, + "Save", + "Saves", + "Saves" + ], + [ + 1000001, + "%s cat", + "%s cats", + "%s cats" + ], + [ + -1, + "%s device", + "%s devices", + "%s устройств" + ], + [ + -1, + "%d day", + "%d days", + "%d days" + ], + [ + -1, + "Save", + "Saves", + "Saves" + ], + [ + -1, + "%s cat", + "%s cats", + "%s cats" + ], + [ + -2, + "%s device", + "%s devices", + "%s устройств" + ], + [ + -2, + "%d day", + "%d days", + "%d days" + ], + [ + -2, + "Save", + "Saves", + "Saves" + ], + [ + -2, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1.5, + "%s device", + "%s devices", + "%s устройство" + ], + [ + 1.5, + "%d day", + "%d days", + "%d день" + ], + [ + 1.5, + "Save", + "Saves", + "Save" + ], + [ + 1.5, + "%s cat", + "%s cats", + "%s cat" + ], + [ + 2.9, + "%s device", + "%s devices", + "%s устройства" + ], + [ + 2.9, + "%d day", + "%d days", + "%d дня" + ], + [ + 2.9, + "Save", + "Saves", + "Saves" + ], + [ + 2.9, + "%s cat", + "%s cats", + "%s cats" + ] + ] + }, + "de": { + "t": { + "Save": "Speichern", + "Off": null, + "state\u0001Off": null, + "Dawnline": null, + "Untranslated": null, + "Say \"hi\" \\ there": null, + "abc": null, + "%s is kept down.": null, + "Not in the catalog": null, + "": null, + "two spaces inside": null, + "two spaces inside": null, + "two \t spaces\ninside": null, + " space around ": null, + "space around": null, + "a line\nbreak": null, + "a line break": null, + " Save ": "Speichern", + "Save\n": "Speichern", + "No LAN detected.": null, + "%s device": null, + "%s devices": null, + "%d day": null + }, + "n": [ + [ + 0, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 0, + "%d day", + "%d days", + "%d days" + ], + [ + 0, + "Save", + "Saves", + "Saves" + ], + [ + 0, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1, + "%s device", + "%s devices", + "%s Gerät" + ], + [ + 1, + "%d day", + "%d days", + "%d day" + ], + [ + 1, + "Save", + "Saves", + "Save" + ], + [ + 1, + "%s cat", + "%s cats", + "%s cat" + ], + [ + 2, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 2, + "%d day", + "%d days", + "%d days" + ], + [ + 2, + "Save", + "Saves", + "Saves" + ], + [ + 2, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 3, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 3, + "%d day", + "%d days", + "%d days" + ], + [ + 3, + "Save", + "Saves", + "Saves" + ], + [ + 3, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 4, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 4, + "%d day", + "%d days", + "%d days" + ], + [ + 4, + "Save", + "Saves", + "Saves" + ], + [ + 4, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 5, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 5, + "%d day", + "%d days", + "%d days" + ], + [ + 5, + "Save", + "Saves", + "Saves" + ], + [ + 5, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 9, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 9, + "%d day", + "%d days", + "%d days" + ], + [ + 9, + "Save", + "Saves", + "Saves" + ], + [ + 9, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 10, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 10, + "%d day", + "%d days", + "%d days" + ], + [ + 10, + "Save", + "Saves", + "Saves" + ], + [ + 10, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 11, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 11, + "%d day", + "%d days", + "%d days" + ], + [ + 11, + "Save", + "Saves", + "Saves" + ], + [ + 11, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 12, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 12, + "%d day", + "%d days", + "%d days" + ], + [ + 12, + "Save", + "Saves", + "Saves" + ], + [ + 12, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 14, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 14, + "%d day", + "%d days", + "%d days" + ], + [ + 14, + "Save", + "Saves", + "Saves" + ], + [ + 14, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 15, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 15, + "%d day", + "%d days", + "%d days" + ], + [ + 15, + "Save", + "Saves", + "Saves" + ], + [ + 15, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 20, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 20, + "%d day", + "%d days", + "%d days" + ], + [ + 20, + "Save", + "Saves", + "Saves" + ], + [ + 20, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 21, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 21, + "%d day", + "%d days", + "%d days" + ], + [ + 21, + "Save", + "Saves", + "Saves" + ], + [ + 21, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 22, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 22, + "%d day", + "%d days", + "%d days" + ], + [ + 22, + "Save", + "Saves", + "Saves" + ], + [ + 22, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 25, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 25, + "%d day", + "%d days", + "%d days" + ], + [ + 25, + "Save", + "Saves", + "Saves" + ], + [ + 25, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 100, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 100, + "%d day", + "%d days", + "%d days" + ], + [ + 100, + "Save", + "Saves", + "Saves" + ], + [ + 100, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 101, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 101, + "%d day", + "%d days", + "%d days" + ], + [ + 101, + "Save", + "Saves", + "Saves" + ], + [ + 101, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 102, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 102, + "%d day", + "%d days", + "%d days" + ], + [ + 102, + "Save", + "Saves", + "Saves" + ], + [ + 102, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 111, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 111, + "%d day", + "%d days", + "%d days" + ], + [ + 111, + "Save", + "Saves", + "Saves" + ], + [ + 111, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 112, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 112, + "%d day", + "%d days", + "%d days" + ], + [ + 112, + "Save", + "Saves", + "Saves" + ], + [ + 112, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 121, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 121, + "%d day", + "%d days", + "%d days" + ], + [ + 121, + "Save", + "Saves", + "Saves" + ], + [ + 121, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1000001, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 1000001, + "%d day", + "%d days", + "%d days" + ], + [ + 1000001, + "Save", + "Saves", + "Saves" + ], + [ + 1000001, + "%s cat", + "%s cats", + "%s cats" + ], + [ + -1, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + -1, + "%d day", + "%d days", + "%d days" + ], + [ + -1, + "Save", + "Saves", + "Saves" + ], + [ + -1, + "%s cat", + "%s cats", + "%s cats" + ], + [ + -2, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + -2, + "%d day", + "%d days", + "%d days" + ], + [ + -2, + "Save", + "Saves", + "Saves" + ], + [ + -2, + "%s cat", + "%s cats", + "%s cats" + ], + [ + 1.5, + "%s device", + "%s devices", + "%s Gerät" + ], + [ + 1.5, + "%d day", + "%d days", + "%d day" + ], + [ + 1.5, + "Save", + "Saves", + "Save" + ], + [ + 1.5, + "%s cat", + "%s cats", + "%s cat" + ], + [ + 2.9, + "%s device", + "%s devices", + "%s Geräte" + ], + [ + 2.9, + "%d day", + "%d days", + "%d days" + ], + [ + 2.9, + "Save", + "Saves", + "Saves" + ], + [ + 2.9, + "%s cat", + "%s cats", + "%s cats" + ] + ] + } +} diff --git a/backend/ipnet/ipnet.go b/backend/ipnet/ipnet.go new file mode 100644 index 0000000..04fc259 --- /dev/null +++ b/backend/ipnet/ipnet.go @@ -0,0 +1,157 @@ +// Package ipnet is IPv4 networks as Dawnline's settings and configurations write them, read exactly as +// the ucode backend reads them (dawnline.util ip2int, cidr_any, parse_cidr; dawnline.net collapse): the +// configurations devices hold are made of these, and a device must not be told to import again because +// two backends disagree on a prefix. +package ipnet + +import ( + "fmt" + "net/netip" + "regexp" + "sort" + "strconv" +) + +var ( + ipv4 = regexp.MustCompile(`^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$`) + cidr = regexp.MustCompile(`^([0-9.]+)(/([0-9]+))?$`) +) + +// IP is "a.b.c.d" as a number; ok is false for anything else (an octet over 255 too). +func IP(s string) (uint32, bool) { + m := ipv4.FindStringSubmatch(s) + if m == nil { + return 0, false + } + var n uint32 + for _, part := range m[1:] { + o, err := strconv.ParseUint(part, 10, 32) + if err != nil || o > 255 { + return 0, false + } + n = n*256 + uint32(o) + } + return n, true +} + +// String is a number as "a.b.c.d". +func String(n uint32) string { + return fmt.Sprintf("%d.%d.%d.%d", n>>24&255, n>>16&255, n>>8&255, n&255) +} + +// Net is an IPv4 network. +type Net struct { + // Base is its first address, Prefix its length, IP the address it was written with. + Base uint32 + Prefix int + IP uint32 +} + +// Size is how many addresses it holds. +func (n Net) Size() uint64 { return 1 << (32 - n.Prefix) } + +// Holds tells whether an address is in it. +func (n Net) Holds(ip uint32) bool { + return uint64(ip) >= uint64(n.Base) && uint64(ip) < uint64(n.Base)+n.Size() +} + +// Overlaps tells whether two networks share an address: one holds the other, or they are the same. +func (n Net) Overlaps(o Net) bool { return n.Holds(o.Base) || o.Holds(n.Base) } + +func (n Net) String() string { return fmt.Sprintf("%s/%d", String(n.Base), n.Prefix) } + +// Any reads "a.b.c.d[/len]" with any prefix 0 to 32 (a bare address is a /32). +func Any(s string) (Net, bool) { + m := cidr.FindStringSubmatch(s) + if m == nil { + return Net{}, false + } + ip, ok := IP(m[1]) + if !ok { + return Net{}, false + } + prefix := 32 + if m[2] != "" { + p, err := strconv.ParseUint(m[3], 10, 31) + if err != nil || p > 32 { + return Net{}, false + } + prefix = int(p) + } + size := uint64(1) << (32 - prefix) + return Net{Base: uint32(uint64(ip) - uint64(ip)%size), Prefix: prefix, IP: ip}, true +} + +// Subnet reads "a.b.c.d/len" as a tunnel's or a home's subnet may be: a prefix 8 to 30, written out. +func Subnet(s string) (Net, bool) { + m := cidr.FindStringSubmatch(s) + if m == nil || m[2] == "" { + return Net{}, false + } + n, ok := Any(s) + if !ok || n.Prefix < 8 || n.Prefix > 30 { + return Net{}, false + } + return n, true +} + +// First is the first host of a subnet: the router's address in a tunnel's. +func (n Net) First() uint32 { return n.Base + 1 } + +// Collapse drops the networks another of the list already covers, and answers the rest in address order. +// What is no network (or the default route) is left out. +func Collapse(list []string) []string { + seen := map[string]bool{} + var nets []Net + for _, s := range list { + if seen[s] { + continue + } + seen[s] = true + if n, ok := Any(s); ok && n.Prefix >= 1 { + nets = append(nets, n) + } + } + sort.SliceStable(nets, func(i, j int) bool { + if nets[i].Prefix != nets[j].Prefix { + return nets[i].Prefix < nets[j].Prefix + } + return nets[i].Base < nets[j].Base + }) + var keep []Net + for _, n := range nets { + inside := false + for _, k := range keep { + if k.Holds(n.Base) { + inside = true + break + } + } + if !inside { + keep = append(keep, n) + } + } + sort.SliceStable(keep, func(i, j int) bool { return keep[i].Base < keep[j].Base }) + out := make([]string, 0, len(keep)) + for _, n := range keep { + out = append(out, n.String()) + } + return out +} + +var hexColons = regexp.MustCompile(`^[0-9A-Fa-f:.]+$`) + +// Private6 tells whether an IPv6 address is one the tunnel's "everything but the local network" list +// leaves out: in fc00::/7, fe80::/10 or ff00::/8. False for anything that is no IPv6 address. +func Private6(s string) bool { + if len(s) < 2 || len(s) > 45 || !hexColons.MatchString(s) { + return false + } + a, err := netip.ParseAddr(s) + if err != nil || !a.Is6() { + return false + } + b := a.As16() + g := uint16(b[0])<<8 | uint16(b[1]) + return g&0xfe00 == 0xfc00 || g&0xffc0 == 0xfe80 || g&0xff00 == 0xff00 +} diff --git a/backend/journal/clear_test.go b/backend/journal/clear_test.go new file mode 100644 index 0000000..9e8a04e --- /dev/null +++ b/backend/journal/clear_test.go @@ -0,0 +1,109 @@ +package journal_test + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" +) + +// What clearing leaves of made-up logs, file for file as ucode leaves them (testdata/clear.uc). +func TestClearAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/clear.json") + if err != nil { + t.Fatal(err) + } + var trace struct { + Now int64 `json:"now"` + Events json.RawMessage `json:"events"` + Flash json.RawMessage `json:"flash"` + Cases []struct { + F struct { + Person, Device, Category string + Before int64 + } `json:"f"` + NoLive bool `json:"no_live"` + NoFlash bool `json:"no_flash"` + Removed int `json:"removed"` + Live any `json:"live"` + KeptFlash any `json:"kept_flash"` + } `json:"cases"` + Lines []string `json:"lines"` + Log []struct { + Days int64 `json:"days"` + Saved bool `json:"saved"` + NoLive bool `json:"no_live"` + Removed int `json:"removed"` + Live *string `json:"live"` + Kept *string `json:"kept"` + } `json:"log"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Cases) < 10 || len(trace.Log) < 6 { + t.Fatal("too few cases") + } + read := func(path string) any { + raw, err := os.ReadFile(path) + if err != nil { + return nil + } + var v any + json.Unmarshal(raw, &v) + return v + } + went := 0 + for i, c := range trace.Cases { + dir := t.TempDir() + os.MkdirAll(dir+"/data", 0o755) + if !c.NoLive { + os.WriteFile(dir+"/events.json", trace.Events, 0o600) + } + if !c.NoFlash { + os.WriteFile(dir+"/data/events.json", trace.Flash, 0o600) + } + got := journal.Log{Run: dir, Data: dir + "/data"}.Clear(journal.Filter{Person: c.F.Person, Device: c.F.Device, Category: c.F.Category, Before: c.F.Before}) + went += got + if got != c.Removed || !reflect.DeepEqual(read(dir+"/events.json"), c.Live) || !reflect.DeepEqual(read(dir+"/data/events.json"), c.KeptFlash) { + t.Errorf("case %d %+v: removed %d (ucode %d)\n live %v\n ucode %v\n flash %v\n ucode %v", i, c.F, got, c.Removed, read(dir+"/events.json"), c.Live, read(dir+"/data/events.json"), c.KeptFlash) + } + } + if went < 15 { + t.Fatalf("the cases remove too little: %d", went) + } + text := func(path string) *string { + raw, err := os.ReadFile(path) + if err != nil { + return nil + } + s := string(raw) + return &s + } + for i, c := range trace.Log { + dir := t.TempDir() + os.MkdirAll(dir+"/data", 0o755) + if !c.NoLive { + os.WriteFile(dir+"/service.log", []byte(strings.Join(trace.Lines, "\n")+"\n\n"), 0o600) + } + if c.Saved { + os.WriteFile(dir+"/data/service.log", []byte(strings.Join(trace.Lines[:3], "\n")+"\n"), 0o600) + } + l := servicelog.Log{RunDir: dir, Now: func() time.Time { return time.Unix(trace.Now, 0) }} + got := l.Clear(dir+"/data", c.Days) + if got != c.Removed || !reflect.DeepEqual(text(dir+"/service.log"), c.Live) || !reflect.DeepEqual(text(dir+"/data/service.log"), c.Kept) { + show := func(p *string) string { + if p == nil { + return "(no file)" + } + return *p + } + t.Errorf("log case %d %+v: removed %d (ucode %d)\n live %q\n ucode %q\n kept %q\n ucode %q", i, c, got, c.Removed, show(text(dir+"/service.log")), show(c.Live), show(text(dir+"/data/service.log")), show(c.Kept)) + } + } +} diff --git a/backend/journal/journal.go b/backend/journal/journal.go new file mode 100644 index 0000000..596bb06 --- /dev/null +++ b/backend/journal/journal.go @@ -0,0 +1,394 @@ +// Package journal is the activity log: what happened to people and their devices (a connect, a leave, a +// move, a link's trouble, a change someone made), kept in events.json. It is the writing half of +// dawnline.live's events in Go, on the same file under the same lock: the ucode that still runs (rpcd's +// own changes, the page that reads and clears the log) shares it. +// +// An event is kept as the file has it (a JSON object: ts, type, person, device, detail, where, the names +// at the time), so one written by a newer or older version passes through unchanged. +// +// The log lives in tmpfs (/events.json) and is copied to flash as often as Settings says; this +// package writes the tmpfs copy and makes the flash one when asked. +package journal + +import ( + "os" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// Event is one line of the log. +type Event = map[string]any + +// Categories are what Settings lets the admin switch off or clear. +var Categories = []string{"connections", "people", "problems"} + +var category = map[string]string{ + "connect": "connections", "disconnect": "connections", "roam": "connections", + // People and their devices: one category (devices used to have their own). + "device_added": "people", "device_removed": "people", + "device_changed": "people", "device_keys": "people", "link_changed": "people", + "person_added": "people", "person_removed": "people", "person_changed": "people", + "paused": "people", "resumed": "people", "expiring": "people", + "quota_reached": "people", "quota_restored": "people", + "server_down": "problems", "server_up": "problems", "portal_blocked": "problems", + // A device's link: failing in a named way, and working again. + "device_failing": "problems", "device_recovered": "problems", +} + +// CategoryOf is an event type's category; what is not known is a problem. +func CategoryOf(kind string) string { + if c, ok := category[kind]; ok { + return c + } + return "problems" +} + +// Policy is what the log keeps. +type Policy struct { + // KeepDays of activity (0: until Max), Max events at most, the Categories that are recorded, and how + // often the log is copied to flash: 10min | hourly | off. + KeepDays int + Max int + Categories []string + Persist string +} + +var ( + whole = regexp.MustCompile(`^-?[0-9]{1,9}$`) + listSplit = regexp.MustCompile(`[ ,]+`) +) + +func ranged(v any, dflt, lo, hi int) int { + s, _ := v.(string) + s = strings.TrimSpace(s) + if !whole.MatchString(s) { + return dflt + } + n, _ := strconv.Atoi(s) + if n < lo || n > hi { + return dflt + } + return n +} + +// PolicyOf reads the retention settings as dawnline.live policy() does. +func PolicyOf(r model.Retention) Policy { + var cats []string + switch c := r.LogCategory.(type) { + case nil: + cats = Categories + // older settings: only whether connections are logged + if r.LogConnections == "0" { + cats = []string{"people", "problems"} + } + case []string: + cats = c + case string: + cats = listSplit.Split(c, -1) + } + var kept []string + seen := map[string]bool{} + for _, c := range cats { + if c == "devices" { + c = "people" + } + known := false + for _, k := range Categories { + known = known || k == c + } + if known && !seen[c] { + seen[c] = true + kept = append(kept, c) + } + } + persist := "hourly" + if p, _ := r.LogPersist.(string); p == "10min" || p == "hourly" || p == "off" { + persist = p + } + return Policy{KeepDays: ranged(r.LogKeepDays, 30, 0, 9999), Max: ranged(r.LogMax, 2000, 100, 20000), Categories: kept, Persist: persist} +} + +func (p Policy) records(kind string) bool { + c := CategoryOf(kind) + for _, k := range p.Categories { + if k == c { + return true + } + } + return false +} + +func tsOf(e Event) float64 { + t, _ := e["ts"].(float64) + return t +} + +// trim drops events older than KeepDays and beyond Max. +func trim(ev []Event, pol Policy, now int64) []Event { + if pol.KeepDays > 0 { + cut := float64(now - int64(pol.KeepDays)*86400) + kept := ev[:0:0] + for _, e := range ev { + if tsOf(e) >= cut { + kept = append(kept, e) + } + } + ev = kept + } + if len(ev) > pol.Max { + ev = ev[len(ev)-pol.Max:] + } + return ev +} + +// Log is the activity log of one router: Run is its tmpfs directory, Data its flash one. +type Log struct { + Run, Data string +} + +func (l Log) live() string { return l.Run + "/events.json" } +func (l Log) flash() string { return l.Data + "/events.json" } + +// load is the log as it is now: the tmpfs copy, else what flash holds. +func (l Log) load() []Event { + var ev []Event + if files.ReadJSON(l.live(), &ev) { + return ev + } + ev = nil + files.ReadJSON(l.flash(), &ev) + return ev +} + +// Names gives the names an event carries, so the log still reads well once the person or the device is +// gone: a person's name, a device's name and kind, each "" when the settings have none. +type Names func(person, device string) (pname, dname, dkind string) + +// NamesOf reads the names from the settings. +func NamesOf(m *model.Model) Names { + return func(person, device string) (string, string, string) { + var pname, dname, dkind string + if p := m.People[person]; p != nil { + pname = p.Name + } + if d := m.Devices[device]; d != nil { + dname, dkind = d.Name, d.Kind + } + return pname, dname, dkind + } +} + +func named(e Event, names Names) Event { + person, _ := e["person"].(string) + device, _ := e["device"].(string) + pname, dname, dkind := names(person, device) + set := func(key, v string) { + if _, has := e[key]; !has && v != "" { + e[key] = v + } + } + if person != "" { + set("pname", pname) + } + if device != "" { + set("dname", dname) + set("dkind", dkind) + } + return e +} + +// Add writes events at the log's end: those whose category is recorded, each with the moment (unless it +// brings its own) and the names as they are now. +func (l Log) Add(list []Event, pol Policy, names Names, now int64) error { + var keep []Event + for _, e := range list { + if kind, _ := e["type"].(string); pol.records(kind) { + keep = append(keep, e) + } + } + if len(keep) == 0 { + return nil + } + defer files.Lock(l.Run, "events")() + ev := l.load() + for _, e := range keep { + if _, has := e["ts"]; !has { + e["ts"] = float64(now) + } + ev = append(ev, named(e, names)) + } + return files.WriteJSON(l.live(), trim(ev, pol, now), 0o600) +} + +// AddMerged is Add for one event that folds into the log's last one when that is of the same kind, person +// and device and no older than `window` seconds: a link that keeps failing and coming back is one line. +func (l Log) AddMerged(e Event, window int64, pol Policy, names Names, now int64) error { + kind, _ := e["type"].(string) + if !pol.records(kind) { + return nil + } + defer files.Lock(l.Run, "events")() + ev := l.load() + if n := len(ev); n > 0 { + last := ev[n-1] + if last["type"] == e["type"] && last["person"] == e["person"] && last["device"] == e["device"] && float64(now)-tsOf(last) < float64(window) { + old, _ := last["detail"].(string) + add, _ := e["detail"].(string) + var parts []string + seen := map[string]bool{} + for _, p := range append(strings.Split(old, ", "), strings.Split(add, ", ")...) { + if p != "" && !seen[p] { + seen[p] = true + parts = append(parts, p) + } + } + last["detail"] = strings.Join(parts, ", ") + last["ts"] = float64(now) + return files.WriteJSON(l.live(), trim(ev, pol, now), 0o600) + } + } + e["ts"] = float64(now) + ev = append(ev, named(e, names)) + return files.WriteJSON(l.live(), trim(ev, pol, now), 0o600) +} + +// Persist copies the log to flash, or drops the flash copy when it is kept in memory only. Only when +// something was logged since the last copy: flash is written rarely. +func (l Log) Persist(pol Policy, now int64) error { + if pol.Persist == "off" { + os.Remove(l.flash()) + return nil + } + live, err := os.Stat(l.live()) + if err != nil { + return nil + } + if kept, err := os.Stat(l.flash()); err == nil && !live.ModTime().After(kept.ModTime()) { + return nil + } + var ev []Event + if !files.ReadJSON(l.live(), &ev) { + return nil + } + os.MkdirAll(l.Data, 0o700) + return files.WriteJSON(l.flash(), trim(ev, pol, now), 0o600) +} + +// Filter says which events to remove: a person's, a device's, a category's, those older than Before (a +// moment, 0: any age). Every one given must match; none given matches everything. +type Filter struct { + Person, Device, Category string + Before int64 +} + +func (f Filter) hits(e Event) bool { + person, _ := e["person"].(string) + device, _ := e["device"].(string) + kind, _ := e["type"].(string) + return (f.Person == "" || person == f.Person) && (f.Device == "" || device == f.Device) && + (f.Category == "" || CategoryOf(kind) == f.Category) && (f.Before == 0 || tsOf(e) < float64(f.Before)) +} + +// Clear removes the events a filter matches from the live copy and the one on flash, and returns how many +// went (dawnline.live clear_events). +func (l Log) Clear(f Filter) int { + defer files.Lock(l.Run, "events")() + removed := 0 + for i, path := range []string{l.live(), l.flash()} { + var ev []Event + if !files.ReadJSON(path, &ev) { + continue + } + keep := []Event{} + for _, e := range ev { + if !f.hits(e) { + keep = append(keep, e) + } + } + if n := len(ev) - len(keep); (i == 0 || removed == 0) && n > removed { + removed = n + } + files.WriteJSON(path, keep, 0o600) + } + return removed +} + +// Events about someone's connection, not about the system: they stay out of syslog (the activity log has them). +var notSystem = map[string]bool{"connect": true, "disconnect": true, "roam": true, "device_failing": true, "device_recovered": true} + +// Level is an event's syslog level, or "" when it stays out of syslog (a connection: syslog says what the +// system does). People and their devices are info, problems warn and their end ("…_up") info. +func Level(e Event) string { + kind, _ := e["type"].(string) + cat := CategoryOf(kind) + if cat == "connections" || notSystem[kind] { + return "" + } + if cat == "problems" && !strings.HasSuffix(kind, "_up") { + return "warn" + } + return "info" +} + +// Line is an event as a syslog line: "Myata · Phone device changed · kind=phone, lan_bypass=on (portal)". +func Line(e Event) string { + str := func(keys ...string) string { + for _, k := range keys { + if s, _ := e[k].(string); s != "" { + return s + } + } + return "" + } + var who []string + for _, w := range []string{str("pname", "person"), str("dname", "device")} { + if w != "" { + who = append(who, w) + } + } + kind := str("type") + if kind == "" { + kind = "event" + } + parts := []string{} + if len(who) > 0 { + parts = append(parts, strings.Join(who, " · ")) + } + parts = append(parts, strings.ReplaceAll(kind, "_", " ")) + if d := str("detail"); d != "" { + parts = append(parts, "· "+d) + } + if by := str("by"); by != "" { + parts = append(parts, "("+by+")") + } + return strings.Join(parts, " ") +} + +// Named is an event with the names it carries, as the log keeps it. +func Named(e Event, names Names) Event { return named(e, names) } + +// SetPlaces gives a place to connections logged before their address was located (the lookup ends after +// the event): connect events since `since` from an address in where ("City · ISP" by address) that have +// none yet. Written only when something changed; whether it did. +func (l Log) SetPlaces(where map[string]string, since int64) bool { + defer files.Lock(l.Run, "events")() + ev := l.load() + changed := false + for i := len(ev) - 1; i >= 0 && tsOf(ev[i]) >= float64(since); i-- { + e := ev[i] + detail, _ := e["detail"].(string) + if had, _ := e["where"].(string); e["type"] == "connect" && had == "" && where[detail] != "" { + e["where"] = where[detail] + changed = true + } + } + if changed { + os.MkdirAll(l.Run, 0o755) + files.WriteJSON(l.live(), ev, 0o600) + } + return changed +} diff --git a/backend/journal/journal_test.go b/backend/journal/journal_test.go new file mode 100644 index 0000000..9d04dcb --- /dev/null +++ b/backend/journal/journal_test.go @@ -0,0 +1,140 @@ +package journal + +import ( + "encoding/json" + "os" + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +func read(t *testing.T, path string) []Event { + var ev []Event + raw, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + if err := json.Unmarshal(raw, &ev); err != nil { + t.Fatal(err) + } + return ev +} + +func names(person, device string) (string, string, string) { + return map[string]string{"anna": "Anna"}[person], map[string]string{"d1": "Phone"}[device], map[string]string{"d1": "phone"}[device] +} + +func TestPolicy(t *testing.T) { + for name, c := range map[string]struct { + r model.Retention + want Policy + }{ + "nothing set": {model.Retention{}, Policy{30, 2000, Categories, "hourly"}}, + "connections off": {model.Retention{LogConnections: "0"}, Policy{30, 2000, []string{"people", "problems"}, "hourly"}}, + "a list": {model.Retention{LogCategory: []string{"problems", "devices", "people", "nonsense"}, LogKeepDays: "0", LogMax: "100", LogPersist: "off"}, Policy{0, 100, []string{"problems", "people"}, "off"}}, + "one string": {model.Retention{LogCategory: "connections, problems"}, Policy{30, 2000, []string{"connections", "problems"}, "hourly"}}, + "out of range, a typo": {model.Retention{LogKeepDays: "99999", LogMax: "50", LogPersist: "daily"}, Policy{30, 2000, Categories, "hourly"}}, + } { + if got := PolicyOf(c.r); !reflect.DeepEqual(got, c.want) { + t.Errorf("%s: %+v, want %+v", name, got, c.want) + } + } +} + +func TestAddNamesTrimsAndFilters(t *testing.T) { + dir := t.TempDir() + l := Log{Run: dir, Data: dir + "/flash"} + pol := Policy{KeepDays: 1, Max: 3, Categories: []string{"connections"}, Persist: "hourly"} + now := int64(1_000_000) + // what flash holds is the log until the first write + os.MkdirAll(l.Data, 0o700) + os.WriteFile(l.flash(), []byte(`[{"ts":1,"type":"connect","future":"kept as it is"},{"ts":999990,"type":"connect","person":"old"}]`), 0o600) + if err := l.Add([]Event{ + {"type": "connect", "person": "anna", "device": "d1", "detail": "203.0.113.7"}, + {"type": "paused", "person": "anna"}, + {"type": "disconnect", "person": "gone", "device": "d9", "ts": float64(999999)}, + }, pol, names, now); err != nil { + t.Fatal(err) + } + got := read(t, l.live()) + want := []Event{ + {"ts": float64(999990), "type": "connect", "person": "old"}, + {"ts": float64(now), "type": "connect", "person": "anna", "device": "d1", "detail": "203.0.113.7", "pname": "Anna", "dname": "Phone", "dkind": "phone"}, + {"ts": float64(999999), "type": "disconnect", "person": "gone", "device": "d9"}, + } + if !reflect.DeepEqual(got, want) { + t.Fatalf("log: %v", got) + } + if st, _ := os.Stat(l.live()); st.Mode().Perm() != 0o600 { + t.Errorf("mode %v", st.Mode().Perm()) + } + for i := 0; i < 5; i++ { + l.Add([]Event{{"type": "roam", "person": "anna", "device": "d1"}}, pol, names, now+int64(i)) + } + if got := read(t, l.live()); len(got) != 3 || got[0]["type"] != "roam" { + t.Fatalf("not cut to the newest three: %v", got) + } + // nothing recorded: nothing written + before, _ := os.Stat(l.live()) + l.Add([]Event{{"type": "paused"}}, pol, names, now+10) + if after, _ := os.Stat(l.live()); !after.ModTime().Equal(before.ModTime()) { + t.Error("written for an event that is not recorded") + } +} + +func TestAddMerged(t *testing.T) { + dir := t.TempDir() + l := Log{Run: dir, Data: dir} + pol := Policy{Max: 100, Categories: Categories} + e := func(detail string) Event { + return Event{"type": "device_failing", "person": "anna", "device": "d1", "detail": detail} + } + l.AddMerged(e("trying"), 3600, pol, names, 1000) + l.AddMerged(e("dropped"), 3600, pol, names, 1500) + l.AddMerged(e("trying"), 3600, pol, names, 2000) + got := read(t, l.live()) + if len(got) != 1 || got[0]["detail"] != "trying, dropped" || got[0]["ts"] != float64(2000) || got[0]["pname"] != "Anna" { + t.Fatalf("merged: %v", got) + } + // past the window, or about another device: a line of its own + l.AddMerged(e("unstable"), 3600, pol, names, 2000+3600) + l.AddMerged(Event{"type": "device_failing", "person": "anna", "device": "d2", "detail": "trying"}, 3600, pol, names, 2000+3601) + if got := read(t, l.live()); len(got) != 3 { + t.Fatalf("not merged: %v", got) + } +} + +func TestPersist(t *testing.T) { + dir := t.TempDir() + l := Log{Run: dir, Data: dir + "/flash"} + pol := Policy{Max: 100, Categories: Categories, Persist: "hourly"} + l.Add([]Event{{"type": "connect"}}, pol, names, 1000) + if err := l.Persist(pol, 1000); err != nil { + t.Fatal(err) + } + if got := read(t, l.flash()); len(got) != 1 { + t.Fatalf("flash: %v", got) + } + pol.Persist = "off" + l.Persist(pol, 1000) + if _, err := os.Stat(l.flash()); err == nil { + t.Error("the flash copy stays though the log is kept in memory only") + } +} + +func TestAnEventInSyslog(t *testing.T) { + for line, e := range map[string]Event{ + "info Anna paused (admin)": {"type": "paused", "person": "anna", "pname": "Anna", "by": "admin"}, + "info Anna · Phone device changed · kind=phone (portal)": {"type": "device_changed", "person": "anna", "pname": "Anna", "device": "phone", "dname": "Phone", "detail": "kind=phone", "by": "portal"}, + "warn portal blocked · 203.0.113.7": {"type": "portal_blocked", "detail": "203.0.113.7"}, + "info server up": {"type": "server_up"}, + "warn bob unheard of": {"type": "unheard_of", "person": "bob"}, + " Anna connect": {"type": "connect", "pname": "Anna"}, + " Anna · Phone device failing": {"type": "device_failing", "pname": "Anna", "dname": "Phone"}, + } { + if got := Level(e) + " " + Line(e); got != line { + t.Errorf("%q, want %q", got, line) + } + } +} diff --git a/backend/journal/testdata/clear.json b/backend/journal/testdata/clear.json new file mode 100644 index 0000000..8cce722 --- /dev/null +++ b/backend/journal/testdata/clear.json @@ -0,0 +1,620 @@ +{ + "now": 1794460039, + "events": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "flash": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ], + "cases": [ + { + "f": { + }, + "removed": 7, + "live": [ + ], + "kept_flash": [ + ] + }, + { + "f": { + "person": "anna" + }, + "removed": 3, + "live": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "kept_flash": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ] + }, + { + "f": { + "device": "tv" + }, + "removed": 2, + "live": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "kept_flash": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + } + ] + }, + { + "f": { + "category": "connections" + }, + "removed": 4, + "live": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ], + "kept_flash": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ] + }, + { + "f": { + "category": "problems" + }, + "removed": 2, + "live": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "kept_flash": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + } + ] + }, + { + "f": { + "before": 1793855239 + }, + "removed": 4, + "live": [ + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + } + ], + "kept_flash": [ + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ] + }, + { + "f": { + "person": "anna", + "category": "connections", + "before": 1793855239 + }, + "removed": 1, + "live": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "kept_flash": [ + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ] + }, + { + "f": { + "person": "nobody" + }, + "removed": 0, + "live": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + }, + { + "type": "connect", + "person": "clara", + "device": "pad" + } + ], + "kept_flash": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + } + ] + }, + { + "f": { + "person": "clara" + }, + "no_flash": true, + "removed": 1, + "live": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1794287239, + "type": "unheard_of", + "person": "boris", + "device": "tv" + }, + { + "ts": 1794459939, + "type": "roam", + "person": "boris", + "device": "tv" + } + ], + "kept_flash": null + }, + { + "f": { + "device": "tv" + }, + "no_live": true, + "removed": 1, + "live": null, + "kept_flash": [ + { + "ts": 1791004039, + "type": "connect", + "person": "anna", + "device": "phone" + }, + { + "ts": 1792732039, + "type": "person_added", + "person": "boris" + }, + { + "ts": 1793682439, + "type": "device_failing", + "person": "anna", + "device": "laptop" + }, + { + "ts": 1794028039, + "type": "disconnect", + "person": "anna", + "device": "phone" + } + ] + }, + { + "f": { + }, + "no_live": true, + "no_flash": true, + "removed": 0, + "live": null, + "kept_flash": null + } + ], + "lines": [ + "{ \"ts\": 1791004039, \"msg\": \"old\" }", + "not json", + "{ \"msg\": \"no time\" }", + "{ \"ts\": 1794200839, \"msg\": \"recent\" }", + "{ \"ts\": 1794460029, \"msg\": \"new\" }" + ], + "log": [ + { + "days": 0, + "removed": 5, + "live": "", + "kept": null + }, + { + "days": 7, + "removed": 3, + "live": "{ \"ts\": 1794200839, \"msg\": \"recent\" }\n{ \"ts\": 1794460029, \"msg\": \"new\" }\n", + "kept": null + }, + { + "days": 1, + "removed": 4, + "live": "{ \"ts\": 1794460029, \"msg\": \"new\" }\n", + "kept": null + }, + { + "days": 400, + "removed": 2, + "live": "{ \"ts\": 1791004039, \"msg\": \"old\" }\n{ \"ts\": 1794200839, \"msg\": \"recent\" }\n{ \"ts\": 1794460029, \"msg\": \"new\" }\n", + "kept": null + }, + { + "days": 7, + "saved": true, + "removed": 3, + "live": "{ \"ts\": 1794200839, \"msg\": \"recent\" }\n{ \"ts\": 1794460029, \"msg\": \"new\" }\n", + "kept": "{ \"ts\": 1794200839, \"msg\": \"recent\" }\n{ \"ts\": 1794460029, \"msg\": \"new\" }\n" + }, + { + "days": 0, + "saved": true, + "removed": 5, + "live": "", + "kept": "" + }, + { + "days": 7, + "saved": true, + "no_live": true, + "removed": 3, + "live": "", + "kept": "" + } + ] +} diff --git a/backend/link/link.go b/backend/link/link.go new file mode 100644 index 0000000..aaec8b3 --- /dev/null +++ b/backend/link/link.go @@ -0,0 +1,509 @@ +// Package link tells how each device's link behaves, from the counters read off its tunnel every second: +// a device that knocks but never finishes connecting, one whose configuration is in use on two devices, +// one whose traffic the router drops, one whose connection keeps breaking. It is dawnline.link in Go, rule +// for rule; testdata holds the two to each other on the same reads (scripts/ucode-golden.sh). +// +// One History per device: a few events of the last ten minutes, not an entry per second. Classify reads it +// (pure); a state is shown only once it held for Hold seconds (Settle). The same history tells the set-up +// sheet, at once and without the hold, what a device being set up does right now (SetupState). +// +// What the counters mean (kmod 3.1, receive.c and send.c): +// - an accepted handshake initiation adds exactly Initiation bytes to the peer's rx. The router answers +// it; its own handshake time moves only when the first packet under the new keys arrives. +// - a keepalive adds Keepalive plus its content padding; a handshake response (the router initiated) +// Response; data 32 plus its padded length. Plain data is a multiple of 16, so 148, 296 and 444 never +// are data. +// - a data packet the router then drops (its source is not the device's address: an old configuration +// after renumbering) adds nothing to rx, but the router still answers it with a keepalive within +// about 10 s. +package link + +import ( + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +const ( + // History is the seconds of events kept per device. + HistorySpan = 600 + // Hold: a state is shown once it held this long (a flapping mobile link passes). + Hold = 180 + // CheckEvery: a device is classified at least this often when nothing happened (its spans age). + CheckEvery = 15 + + // Initiation is the bytes an accepted initiation adds to rx. + Initiation = 148 + // Response is the bytes a handshake response adds to rx (the router initiated). + Response = 92 + // Keepalive is the bytes an empty data packet adds to rx, before content padding. + Keepalive = 32 + // Random trailers without content padding: a keepalive grows up to a full packet. + trailerMax = 1500 + // Initiations a device sends at most in one second (retries are 5 s apart). + knocksPerTick = 3 + + // trying: at least tryKnocks accepted initiations within trySpan seconds while not online. + trySpan = 120 + tryKnocks = 3 + // Churning: at least churnCount handshakes within churnSpan seconds, with churnCount-1 of the gaps + // under churnGap seconds. A device that is there renews its keys every 100-120 s, more only when its + // packets get nothing back. + churnSpan = 300 + churnCount = 4 + churnGap = 45 + // shared: while churning, the endpoint went back to an earlier one this often. + shareReturns = 2 + // dropped: online with a handshake within dropHS seconds, nothing but handshakes and keepalives + // received for dropSpan seconds, and the router sent something at least dropAnswers times in that span + // with nothing coming in, under dropTx bytes in all (a real download is far more). + dropSpan = 180 + dropHS = 240 + dropAnswers = 6 + dropTx = 65536 + + // The set-up sheet's trying: at least setupKnocks accepted initiations within setupSpan seconds, none + // of them followed by a handshake. + setupSpan = 20 + setupKnocks = 2 + // nodata: online for setupQuiet seconds since the handshake its session began with, nothing but + // handshakes and keepalives in since, and the router answered at least once with nothing coming in. + setupQuiet = 15 + + // Per list, the newest entries kept (a device whose endpoint flips every second). + keepEntries = 64 +) + +// The states a link can be shown in; "" is nothing wrong, or nothing to tell. +const ( + Trying = "trying" + Shared = "shared" + Dropped = "dropped" + Unstable = "unstable" + // The set-up sheet's own. + Flowing = "flowing" + NoData = "nodata" +) + +// Read is a device's peer as its tunnel shows it at one look. +type Read struct { + Endpoint string + Handshake int64 + Rx, Tx int64 +} + +// Shown is a state and when it began. +type Shown struct { + State string `json:"state"` + Since int64 `json:"since"` +} + +type move struct { + at int64 + to, from string +} + +type answer struct { + at, bytes int64 +} + +// History is what is kept of one device's link. +type History struct { + start int64 + // The counters last read; counted is false before the first read and after the peer was gone. + rx, tx int64 + counted bool + // The newest handshake, the endpoint (seen: one was read), and when rx last carried data. + hs int64 + ep string + seen bool + data int64 + // Handshake times, endpoint changes, accepted initiations, and what the router sent with nothing received. + shakes []int64 + moves []move + knocks []int64 + answer []answer + + // What is shown (State, "" for nothing), a state waiting for Hold, the last classification and when + // it was made. + State string + Since int64 + pending *Shown + // Raw is the last classification, before the hold. + Raw string + checked int64 + + // For the set-up sheet: online at the last read, the handshake its online stretch began with (0 while + // away), what the sheet is told, and when that may change with time alone (0 for never). + on bool + sess int64 + Setup *Shown + due int64 +} + +// Fresh is a new, empty history for a device first seen at now. +func Fresh(now int64) *History { return &History{start: now} } + +// Change is what Settle changed in what is shown; either may be "". +type Change struct { + From, To string +} + +// KeepaliveMax is the largest rx a keepalive adds for a server's disguise: Keepalive plus the top of its +// ContentPaddingAddition, or a full packet with random trailers and no content padding. +func KeepaliveMax(srv *model.Server) int64 { + if srv == nil { + return Keepalive + } + if cpa := srv.Obf["content_padding_addition"]; cpa != "" { + parts := strings.Split(cpa, "-") + if hi, err := strconv.ParseFloat(strings.TrimSpace(parts[len(parts)-1]), 64); err == nil && hi > 0 { + return Keepalive + int64(hi) + } + } + if t := srv.Obf["random_trailers"]; t == "on" || t == "1" { + return Keepalive + trailerMax + } + return Keepalive +} + +// knock tells an rx increment made of accepted initiations only. +func knock(drx int64) bool { + return drx > 0 && drx%Initiation == 0 && drx <= knocksPerTick*Initiation +} + +// bare tells an rx increment that carried no data: nothing, or one keepalive of up to ka bytes; in the +// second a handshake completed (shook) also the handshake messages that came with it. Outside that second +// a handshake message is never counted in: with a padded keepalive their sums would cover every small +// packet up to some 670 bytes, and a device with light traffic would look like one whose data never comes +// through. +func bare(drx, ka int64, shook bool) bool { + if drx <= 0 { + return true + } + if !shook { + return drx >= Keepalive && drx <= ka + } + if drx > knocksPerTick*Initiation+Response+ka { + return false + } + for k := int64(0); k <= knocksPerTick; k++ { + for r := int64(0); r <= 1; r++ { + rest := drx - k*Initiation - r*Response + if rest == 0 || (rest >= Keepalive && rest <= ka) { + return true + } + } + } + return false +} + +func keep[T any](list []T, entry T) []T { + list = append(list, entry) + if len(list) > keepEntries { + list = list[1:] + } + return list +} + +// Observe folds one read of the device's peer into its history; ka is its KeepaliveMax. It returns true +// when something worth classifying again happened (a handshake, a new endpoint, a knock, an answer, data +// after a quiet span). Counters that went down (the peer added again, its tunnel set up again) start a new +// baseline. +func (h *History) Observe(p Read, now, ka int64) bool { + changed := false + shook := p.Handshake > h.hs + if shook { + h.shakes = keep(h.shakes, p.Handshake) + h.hs = p.Handshake + changed = true + } + if !h.seen || p.Endpoint != h.ep { + if h.seen && p.Endpoint != "" { + h.moves = keep(h.moves, move{at: now, to: p.Endpoint, from: h.ep}) + changed = true + } + h.ep, h.seen = p.Endpoint, true + } + if !h.counted || p.Rx < h.rx || p.Tx < h.tx { + h.rx, h.tx, h.counted = p.Rx, p.Tx, true + return changed + } + drx, dtx := p.Rx-h.rx, p.Tx-h.tx + h.rx, h.tx = p.Rx, p.Tx + switch { + case drx > 0 && !shook && knock(drx): + h.knocks = keep(h.knocks, now) + changed = true + case drx > 0 && !bare(drx, ka, shook): + if now-h.data >= dropSpan { + changed = true + } + h.data = now + case drx <= 0 && dtx > 0: + h.answer = keep(h.answer, answer{at: now, bytes: dtx}) + changed = true + } + return changed +} + +// Gone: the device's peer is not in its tunnel; the next read starts a new baseline. +func (h *History) Gone() { h.counted = false } + +// prune forgets events older than HistorySpan seconds. +func (h *History) prune(now int64) { + cut := now - HistorySpan + h.shakes = after(h.shakes, func(t int64) bool { return t > cut }) + h.knocks = after(h.knocks, func(t int64) bool { return t > cut }) + h.moves = after(h.moves, func(e move) bool { return e.at > cut }) + h.answer = after(h.answer, func(e answer) bool { return e.at > cut }) +} + +func after[T any](list []T, keep func(T) bool) []T { + out := list[:0:0] + for _, e := range list { + if keep(e) { + out = append(out, e) + } + } + return out +} + +// returns counts endpoint changes within the span that went back to an endpoint seen before in it +// (A → B → A → B: 2). +func (h *History) returns(now int64) int { + var seen map[string]bool + n := 0 + for _, e := range h.moves { + if now-e.at >= churnSpan { + continue + } + if seen == nil { + seen = map[string]bool{e.from: true} + } + if seen[e.to] { + n++ + } + seen[e.to] = true + } + return n +} + +func (h *History) churning(now int64) bool { + var hs []int64 + for _, t := range h.shakes { + if now-t < churnSpan { + hs = append(hs, t) + } + } + if len(hs) < churnCount { + return false + } + short := 0 + for i := 1; i < len(hs); i++ { + if hs[i]-hs[i-1] < churnGap { + short++ + } + } + return short >= churnCount-1 +} + +func (h *History) dropped(now int64) bool { + if now-h.start < dropSpan || now-h.data < dropSpan || !(h.hs > 0 && now-h.hs < dropHS) { + return false + } + var n, bytes int64 + for _, a := range h.answer { + if now-a.at < dropSpan { + n++ + bytes += a.bytes + } + } + return n >= dropAnswers && bytes < dropTx +} + +// Classify is what the history says about the device at now (on: it is online, as presence decides it): +// +// "" nothing wrong, or nothing to tell +// trying not online, but its initiations reach the router and are answered, and it never finishes +// connecting (the network may block it, or its configuration is out of date) +// shared connecting over and over from two or more alternating endpoints: one configuration on two devices +// unstable connecting over and over from one place: the connection keeps breaking +// dropped connected, but nothing it sends gets through: the router drops it (an old address in its +// configuration) +func (h *History) Classify(now int64, on bool) string { + if !on { + n := 0 + for _, t := range h.knocks { + if now-t < trySpan { + n++ + } + } + if n >= tryKnocks { + return Trying + } + return "" + } + if h.churning(now) { + if h.returns(now) >= shareReturns { + return Shared + } + return Unstable + } + if h.dropped(now) { + return Dropped + } + return "" +} + +// Settle turns a classification into what is shown: a state, or a change of state, shows once Classify +// gave it for Hold seconds (Since: when it began); nothing wrong shows at once when the device is online +// (it works), else after Hold as well. It returns the change, or nil when what is shown stays. +func (h *History) Settle(raw string, now int64, on bool) *Change { + if raw == h.State { + h.pending = nil + return nil + } + since := now + if raw != "" || !on { + if h.pending == nil || h.pending.State != raw { + h.pending = &Shown{State: raw, Since: now} + return nil + } + if now-h.pending.Since < Hold { + return nil + } + since = h.pending.Since + } + c := &Change{From: h.State, To: raw} + h.State = raw + h.Since = 0 + if raw != "" { + h.Since = since + } + h.pending = nil + return c +} + +// SetupState is what the device's link does at now for the set-up sheet (pure), and when that may change +// with time alone (0 for never: anything else comes with a read): +// +// trying its initiations reach the router and are answered, and no handshake follows +// flowing online, and data came in during this session +// nodata online for a while, nothing but handshakes and keepalives came in, and the router answered +// packets it dropped: an old address in the configuration +// "" none of these (waiting, idle, or away) +func (h *History) SetupState(now int64, on bool) (state string, due int64) { + n := 0 + for i := len(h.knocks) - 1; i >= 0; i-- { + t := h.knocks[i] + if t <= h.hs || now-t >= setupSpan { + break + } + if n++; n == setupKnocks { + return Trying, t + setupSpan + } + } + if !on || h.sess == 0 { + return "", 0 + } + if h.data >= h.sess { + return Flowing, 0 + } + if now-h.sess < setupQuiet { + return "", h.sess + setupQuiet + } + if len(h.answer) > 0 && h.answer[len(h.answer)-1].at >= h.sess { + return NoData, 0 + } + return "", 0 +} + +// setup brings Setup to SetupState after a read (moved: what Observe returned). Most reads cost a few +// compares: the state is worked out again only when something happened, the device came or went, data +// came in while it is not flowing, or its due time came. It returns true when Setup changed. +func (h *History) setup(now int64, on, moved bool) bool { + // A session begins with the handshake that brought the device online. + if !on { + h.sess = 0 + } else if h.sess == 0 { + h.sess = h.hs + } + came := on != h.on + h.on = on + cur := "" + if h.Setup != nil { + cur = h.Setup.State + } + if !moved && !came && !(h.due != 0 && now >= h.due) && !(h.data == now && cur != Flowing) { + return false + } + state, due := h.SetupState(now, on) + h.due = due + if state == cur { + return false + } + h.Setup = nil + if state != "" { + h.Setup = &Shown{State: state, Since: now} + } + return true +} + +// Step is one look at the device: its read folded in (nil: its peer is not in its tunnel), the set-up +// state brought up to date, and, when something happened or CheckEvery passed, the link classified again +// and settled. It returns the change in what is shown (nil for none) and whether Setup changed. +func (h *History) Step(p *Read, now int64, on bool, ka int64) (change *Change, setupChanged bool) { + moved := false + if p != nil { + moved = h.Observe(*p, now, ka) + } else { + h.Gone() + } + setupChanged = h.setup(now, on, moved) + if !moved && now-h.checked < CheckEvery { + return nil, setupChanged + } + h.checked = now + h.prune(now) + h.Raw = h.Classify(now, on) + return h.Settle(h.Raw, now, on), setupChanged +} + +// ShownOf is what is shown for every device, devices with nothing to show left out (link.json). +func ShownOf(hist map[string]*History) map[string]Shown { + out := map[string]Shown{} + for id, h := range hist { + if h.State != "" { + out[id] = Shown{State: h.State, Since: h.Since} + } + } + return out +} + +// SetupsOf is the set-up sheet's state of every device, devices with none left out (setup.json). +func SetupsOf(hist map[string]*History) map[string]Shown { + out := map[string]Shown{} + for id, h := range hist { + if h.Setup != nil { + out[id] = *h.Setup + } + } + return out +} + +// Event is what the activity log is told of a change: device_failing (the new state) when a state shows, +// device_recovered (the state it had) when it clears while the device is online. One that clears while the +// device is away (it stopped trying, it was paused) logs nothing: nobody saw it work. kind is "" for none. +func Event(c *Change, on bool) (kind, detail string) { + switch { + case c == nil: + return "", "" + case c.To != "": + return "device_failing", c.To + case on && c.From != "": + return "device_recovered", c.From + } + return "", "" +} diff --git a/backend/link/link_test.go b/backend/link/link_test.go new file mode 100644 index 0000000..5c4563c --- /dev/null +++ b/backend/link/link_test.go @@ -0,0 +1,179 @@ +package link + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// The generator of testdata/trace.uc, number for number. +type gen struct{ x int64 } + +func (g *gen) rnd(n int64) int64 { + g.x = (g.x*1103515245 + 12345) % 2147483648 + return (g.x >> 8) % n +} + +var endpoints = []string{"203.0.113.7:41821", "198.51.100.4:9000", "[2001:db8::1]:500"} + +var modes = [][]int64{ + {3, 40, 30, 60, 200, 300, 310, 150, 160}, + {1, 0, 5, 400, 420, 420, 425, 300, 300}, + {2, 150, 200, 20, 300, 500, 505, 100, 105}, + {1, 10, 2, 0, 250, 250, 252, 400, 400}, +} + +type run struct { + Seed int64 `json:"seed"` + Mode int `json:"mode"` + Ka int64 `json:"ka"` + Steps int `json:"steps"` + Hash int64 `json:"hash"` + Setups int `json:"setups"` + Changes [][]any `json:"changes"` +} + +// The same made-up reads through this package as trace.uc put through dawnline.link. +func trace(seed int64, mode int, ka int64, steps int) run { + g := &gen{x: seed} + p := modes[mode] + now, hs, rx, tx := int64(1000000), int64(0), int64(0), int64(0) + ep, present := "", true + h := Fresh(now) + out := run{Seed: seed, Mode: mode, Ka: ka, Steps: steps, Hash: 7, Changes: [][]any{}} + for i := 0; i < steps; i++ { + now++ + r := g.rnd(1000) + if present { + if r < p[0] { + present = false + } else { + if g.rnd(1000) < p[1] { + hs = now - g.rnd(2) + } + if g.rnd(1000) < p[2] { + ep = endpoints[g.rnd(3)] + } + switch k := g.rnd(1000); { + case k < p[3]: + rx += 148 * (1 + g.rnd(3)) + case k < p[4]: + rx += 32 + g.rnd(ka-31) + case k < p[5]: + rx += 48 + 16*g.rnd(90) + case k < p[6]: + rx = g.rnd(500) + tx = g.rnd(500) + } + if t := g.rnd(1000); t < p[7] { + tx += 32 + g.rnd(200) + } else if t < p[8] { + tx += 100000 + } + } + } else if r < 100 { + present, rx, tx, hs = true, 0, 0, 0 + } + on := present && hs > 0 && now-hs < 190 + var read *Read + if present { + read = &Read{Endpoint: ep, Handshake: hs, Rx: rx, Tx: tx} + } + change, sc := h.Step(read, now, on, ka) + word, flag := "-", 0 + if sc { + out.Setups++ + flag = 1 + } + if change != nil { + out.Changes = append(out.Changes, []any{float64(i), change.From, change.To}) + word = change.From + ">" + change.To + } + setup, since := "", int64(0) + if h.Setup != nil { + setup, since = h.Setup.State, h.Setup.Since + } + for _, c := range []byte(fmt.Sprintf("%s|%d|%s|%d|%s|%s|%d\n", word, flag, h.State, h.Since, h.Raw, setup, since)) { + out.Hash = (out.Hash*131 + int64(c)) % 1000000007 + } + } + return out +} + +// Step for step what dawnline.link does (testdata/trace.json, written by scripts/ucode-golden.sh). +func TestHeldToUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var want []run + if err := json.Unmarshal(raw, &want); err != nil { + t.Fatal(err) + } + if len(want) < 20 { + t.Fatalf("%d runs in the golden", len(want)) + } + states := map[string]bool{} + for _, w := range want { + got := trace(w.Seed, w.Mode, w.Ka, w.Steps) + if !reflect.DeepEqual(got.Changes, w.Changes) { + t.Errorf("mode %d ka %d seed %d: shown changes %v, ucode has %v", w.Mode, w.Ka, w.Seed, got.Changes, w.Changes) + continue + } + if got.Setups != w.Setups || got.Hash != w.Hash { + t.Errorf("mode %d ka %d seed %d: the same changes, but %d set-up changes and hash %d; ucode has %d and %d", + w.Mode, w.Ka, w.Seed, got.Setups, got.Hash, w.Setups, w.Hash) + } + for _, c := range w.Changes { + states[c[2].(string)] = true + } + } + for _, s := range []string{Trying, Shared, Dropped, Unstable, ""} { + if !states[s] { + t.Errorf("the golden never shows %q: the runs no longer exercise it", s) + } + } +} + +func TestKeepaliveMax(t *testing.T) { + for name, c := range map[string]struct { + obf map[string]string + want int64 + }{ + "plain": {map[string]string{}, 32}, + "padded": {map[string]string{"content_padding_addition": "10-100"}, 132}, + "one padding": {map[string]string{"content_padding_addition": "40"}, 72}, + "trailers": {map[string]string{"random_trailers": "on"}, 1532}, + "padding over trailers": {map[string]string{"content_padding_addition": "10-100", "random_trailers": "on"}, 132}, + "no padding to speak of": {map[string]string{"content_padding_addition": "0", "random_trailers": "1"}, 1532}, + } { + if got := KeepaliveMax(&model.Server{Obf: c.obf}); got != c.want { + t.Errorf("%s: %d, want %d", name, got, c.want) + } + } + if KeepaliveMax(nil) != 32 { + t.Error("no server") + } +} + +func TestEvent(t *testing.T) { + for _, c := range []struct { + change *Change + on bool + kind, detail string + }{ + {nil, true, "", ""}, + {&Change{To: Trying}, false, "device_failing", Trying}, + {&Change{From: Shared, To: Dropped}, true, "device_failing", Dropped}, + {&Change{From: Dropped}, true, "device_recovered", Dropped}, + {&Change{From: Trying}, false, "", ""}, + } { + if k, d := Event(c.change, c.on); k != c.kind || d != c.detail { + t.Errorf("%+v on=%v: %q %q", c.change, c.on, k, d) + } + } +} diff --git a/backend/link/testdata/trace.json b/backend/link/testdata/trace.json new file mode 100644 index 0000000..502ec04 --- /dev/null +++ b/backend/link/testdata/trace.json @@ -0,0 +1,402 @@ +[ + { + "seed": 43, + "mode": 0, + "ka": 32, + "steps": 1500, + "hash": 509250670, + "setups": 53, + "changes": [ + [ + 562, + "", + "shared" + ] + ] + }, + { + "seed": 2058, + "mode": 0, + "ka": 32, + "steps": 1500, + "hash": 116816300, + "setups": 57, + "changes": [ + [ + 301, + "", + "shared" + ], + [ + 684, + "shared", + "unstable" + ], + [ + 1100, + "unstable", + "shared" + ] + ] + }, + { + "seed": 143, + "mode": 0, + "ka": 132, + "steps": 1500, + "hash": 874068518, + "setups": 62, + "changes": [ + [ + 877, + "", + "unstable" + ], + [ + 1178, + "unstable", + "" + ] + ] + }, + { + "seed": 2158, + "mode": 0, + "ka": 132, + "steps": 1500, + "hash": 984212801, + "setups": 52, + "changes": [ + [ + 361, + "", + "shared" + ] + ] + }, + { + "seed": 1543, + "mode": 0, + "ka": 1532, + "steps": 1500, + "hash": 902450080, + "setups": 69, + "changes": [ + [ + 255, + "", + "unstable" + ], + [ + 474, + "unstable", + "" + ], + [ + 729, + "", + "shared" + ] + ] + }, + { + "seed": 3558, + "mode": 0, + "ka": 1532, + "steps": 1500, + "hash": 322096214, + "setups": 60, + "changes": [ + [ + 325, + "", + "shared" + ] + ] + }, + { + "seed": 1043, + "mode": 1, + "ka": 32, + "steps": 1500, + "hash": 336330855, + "setups": 3, + "changes": [ + [ + 187, + "", + "trying" + ] + ] + }, + { + "seed": 3058, + "mode": 1, + "ka": 32, + "steps": 1500, + "hash": 418109476, + "setups": 5, + "changes": [ + [ + 188, + "", + "trying" + ] + ] + }, + { + "seed": 1143, + "mode": 1, + "ka": 132, + "steps": 1500, + "hash": 984771206, + "setups": 3, + "changes": [ + [ + 197, + "", + "trying" + ] + ] + }, + { + "seed": 3158, + "mode": 1, + "ka": 132, + "steps": 1500, + "hash": 839850834, + "setups": 9, + "changes": [ + [ + 186, + "", + "trying" + ] + ] + }, + { + "seed": 2543, + "mode": 1, + "ka": 1532, + "steps": 1500, + "hash": 243396944, + "setups": 1, + "changes": [ + [ + 187, + "", + "trying" + ] + ] + }, + { + "seed": 4558, + "mode": 1, + "ka": 1532, + "steps": 1500, + "hash": 72908559, + "setups": 1, + "changes": [ + [ + 185, + "", + "trying" + ] + ] + }, + { + "seed": 2043, + "mode": 2, + "ka": 32, + "steps": 1500, + "hash": 493844650, + "setups": 3, + "changes": [ + [ + 211, + "", + "shared" + ] + ] + }, + { + "seed": 4058, + "mode": 2, + "ka": 32, + "steps": 1500, + "hash": 65535240, + "setups": 13, + "changes": [ + [ + 196, + "", + "shared" + ] + ] + }, + { + "seed": 2143, + "mode": 2, + "ka": 132, + "steps": 1500, + "hash": 401228843, + "setups": 15, + "changes": [ + [ + 228, + "", + "shared" + ] + ] + }, + { + "seed": 4158, + "mode": 2, + "ka": 132, + "steps": 1500, + "hash": 984996124, + "setups": 9, + "changes": [ + [ + 206, + "", + "shared" + ] + ] + }, + { + "seed": 3543, + "mode": 2, + "ka": 1532, + "steps": 1500, + "hash": 450519450, + "setups": 7, + "changes": [ + [ + 227, + "", + "shared" + ] + ] + }, + { + "seed": 5558, + "mode": 2, + "ka": 1532, + "steps": 1500, + "hash": 981222292, + "setups": 9, + "changes": [ + [ + 207, + "", + "shared" + ] + ] + }, + { + "seed": 3043, + "mode": 3, + "ka": 32, + "steps": 1500, + "hash": 247211500, + "setups": 5, + "changes": [ + [ + 366, + "", + "dropped" + ] + ] + }, + { + "seed": 5058, + "mode": 3, + "ka": 32, + "steps": 1500, + "hash": 199176889, + "setups": 5, + "changes": [ + [ + 726, + "", + "dropped" + ], + [ + 1296, + "dropped", + "" + ] + ] + }, + { + "seed": 3143, + "mode": 3, + "ka": 132, + "steps": 1500, + "hash": 546318254, + "setups": 5, + "changes": [ + [ + 455, + "", + "unstable" + ], + [ + 652, + "unstable", + "" + ], + [ + 988, + "", + "dropped" + ] + ] + }, + { + "seed": 5158, + "mode": 3, + "ka": 132, + "steps": 1500, + "hash": 746160914, + "setups": 2, + "changes": [ + [ + 361, + "", + "dropped" + ] + ] + }, + { + "seed": 4543, + "mode": 3, + "ka": 1532, + "steps": 1500, + "hash": 147637710, + "setups": 5, + "changes": [ + [ + 362, + "", + "dropped" + ] + ] + }, + { + "seed": 6558, + "mode": 3, + "ka": 1532, + "steps": 1500, + "hash": 890972522, + "setups": 7, + "changes": [ + [ + 1019, + "", + "dropped" + ] + ] + } +] diff --git a/backend/meter/meter.go b/backend/meter/meter.go new file mode 100644 index 0000000..f95d7fc --- /dev/null +++ b/backend/meter/meter.go @@ -0,0 +1,121 @@ +// Package meter is the live meter: each server's throughput and that of each device moving traffic, one +// point a second over the last two minutes (dawnline.meter in Go, rule for rule). +// +// A point is made from two looks at the tunnels that are about a second apart. Bytes are the peers' +// counters: what was sent includes the disguise (prefixes, padding, junk), what was received is the +// packets without their prefix, so both are close to what is on the wire. +// +// Pure: looks in, points out. Who looks every second, and for whom, is the producer's. +package meter + +import ( + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// Points is how many are kept: two minutes, one a second. +const Points = 120 + +// Sample is one look, as the meter needs it. +type Sample struct { + // Mono is a clock that only goes forward, in seconds with their fraction: the gap between two samples. + Mono float64 + // TS is the router's clock (unix seconds): the point's name. + TS int64 + // Servers are those whose tunnel was read. + Servers []string + // Dev is each device's counters on such a server. + Dev map[string]Counters +} + +// Counters are a device's bytes since its tunnel last added it, and the server it is on. +type Counters struct { + Rx, Tx int64 + Server string +} + +// Point is one second: bytes a second of each server's devices together (rx what came from them, tx what +// went to them), for every server whose tunnel was read, and of each device that moved something (one left +// out moved nothing). +type Point struct { + TS int64 `json:"ts"` + Servers map[string][2]int64 `json:"servers"` + Dev map[string][2]int64 `json:"dev"` +} + +// Take makes a sample of a look at the tunnels. +func Take(m *model.Model, d awg.Dump, mono float64, now int64) Sample { + s := Sample{Mono: mono, TS: now, Servers: []string{}, Dev: map[string]Counters{}} + read := map[string]bool{} + for _, id := range m.ServerIDs() { + if d.Reads[m.Servers[id].Ifname] == awg.Read { + read[id] = true + s.Servers = append(s.Servers, id) + } + } + for _, id := range m.DeviceIDs() { + dev := m.Devices[id] + p := m.People[dev.Person] + if p == nil || !read[p.Server] { + continue + } + if peer, there := d.Peers[dev.PublicKey]; there { + s.Dev[id] = Counters{Rx: peer.Rx, Tx: peer.Tx, Server: p.Server} + } + } + return s +} + +// delta is a counter's change, 0 when it went down (a tunnel set up again starts from zero). +func delta(a, b int64) int64 { + if b >= a { + return b - a + } + return 0 +} + +// Between is the point between two samples; ok is false when they are not a second or so apart (the first +// sample, a stalled watcher). A device is counted from its second sample on, on the server it was on in both. +func Between(a, b Sample) (Point, bool) { + dt := b.Mono - a.Mono + if !(dt > 0.2 && dt < 5) { + return Point{}, false + } + sum := map[string][2]int64{} + for _, sid := range b.Servers { + sum[sid] = [2]int64{} + } + p := Point{TS: b.TS, Servers: map[string][2]int64{}, Dev: map[string][2]int64{}} + for id, v := range b.Dev { + o, had := a.Dev[id] + if !had || o.Server != v.Server { + continue + } + rx, tx := delta(o.Rx, v.Rx), delta(o.Tx, v.Tx) + t := sum[v.Server] + sum[v.Server] = [2]int64{t[0] + rx, t[1] + tx} + if rx != 0 || tx != 0 { + p.Dev[id] = [2]int64{int64(float64(rx) / dt), int64(float64(tx) / dt)} + } + } + for sid, v := range sum { + p.Servers[sid] = [2]int64{int64(float64(v[0]) / dt), int64(float64(v[1]) / dt)} + } + return p, true +} + +// Keep adds a point to the ring (newest last) and returns it: at most Points of them, none older than +// Points seconds before the new one (the watcher may have stalled in between) and none from its second or +// later (the clock went back). `cut` tells that points were taken from the ring's end, so whoever shows the +// ring must show it anew, not only add the new point. +func Keep(ring []Point, p Point) (out []Point, cut bool) { + for len(ring) > 0 && ring[len(ring)-1].TS >= p.TS { + ring = ring[:len(ring)-1] + cut = true + } + ring = append(ring, p) + for len(ring) > Points || ring[0].TS <= p.TS-Points { + ring = ring[1:] + } + return ring, cut +} diff --git a/backend/meter/meter_test.go b/backend/meter/meter_test.go new file mode 100644 index 0000000..fd33248 --- /dev/null +++ b/backend/meter/meter_test.go @@ -0,0 +1,97 @@ +package meter + +import ( + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +const ( + keyA = "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" + keyB = "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=" +) + +func settings(t *testing.T) *model.Model { + c, err := uci.Parse(` +config server 'home' + option ifname 'dawn0' +config server 'cabin' + option ifname 'dawn1' +config person 'anna' + option server 'home' +config person 'boris' + option server 'cabin' +config device 'a' + option person 'anna' + option public_key '` + keyA + `' +config device 'b' + option person 'boris' + option public_key '` + keyB + `' +`) + if err != nil { + t.Fatal(err) + } + return model.Load(c, nil) +} + +func dump(reads map[string]string, peers map[string]awg.Peer) awg.Dump { + return awg.Dump{OK: true, Reads: reads, Peers: peers} +} + +func TestPoint(t *testing.T) { + m := settings(t) + both := map[string]string{"dawn0": awg.Read, "dawn1": awg.Read} + a := Take(m, dump(both, map[string]awg.Peer{keyA: {Rx: 1000, Tx: 5000}, keyB: {Rx: 10, Tx: 10}}), 100.0, 1000) + b := Take(m, dump(both, map[string]awg.Peer{keyA: {Rx: 3000, Tx: 9000}, keyB: {Rx: 10, Tx: 10}}), 102.0, 1002) + p, ok := Between(a, b) + want := Point{TS: 1002, Servers: map[string][2]int64{"home": {1000, 2000}, "cabin": {0, 0}}, Dev: map[string][2]int64{"a": {1000, 2000}}} + if !ok || !reflect.DeepEqual(p, want) { + t.Fatalf("point: %+v %v", p, ok) + } + // a tunnel that could not be read is not in the point at all; its device neither + c := Take(m, dump(map[string]string{"dawn0": awg.Read, "dawn1": awg.Failed}, map[string]awg.Peer{keyA: {Rx: 3000, Tx: 9000}, keyB: {Rx: 99, Tx: 99}}), 103.0, 1003) + p, _ = Between(b, c) + if _, has := p.Servers["cabin"]; has || len(p.Dev) != 0 || p.Servers["home"] != [2]int64{0, 0} { + t.Fatalf("an unread tunnel: %+v", p) + } + // counters that went down (the tunnel set up again) count as nothing, not as a negative speed + d := Take(m, dump(both, map[string]awg.Peer{keyA: {Rx: 5, Tx: 5}}), 104.0, 1004) + if p, _ := Between(c, d); p.Servers["home"] != [2]int64{0, 0} { + t.Fatalf("a reset counter: %+v", p) + } +} + +func TestNoPointAcrossAGap(t *testing.T) { + m := settings(t) + one := map[string]string{"dawn0": awg.Read} + a := Take(m, dump(one, nil), 100, 1000) + for _, mono := range []float64{100.1, 106} { + if _, ok := Between(a, Take(m, dump(one, nil), mono, 1001)); ok { + t.Errorf("a point over %.1f s", mono-100) + } + } +} + +func TestKeep(t *testing.T) { + var ring []Point + for ts := int64(1); ts <= 130; ts++ { + ring, _ = Keep(ring, Point{TS: ts}) + } + if len(ring) != Points || ring[0].TS != 11 || ring[len(ring)-1].TS != 130 { + t.Fatalf("ring: %d points, %d to %d", len(ring), ring[0].TS, ring[len(ring)-1].TS) + } + // the watcher stalled: what is older than two minutes before the new point goes + ring, cut := Keep(ring, Point{TS: 300}) + if len(ring) != 1 || cut { + t.Fatalf("after a stall: %d points, cut %v", len(ring), cut) + } + // the clock went back: points from that second or later go, and whoever shows the ring is told + ring, _ = Keep(ring, Point{TS: 301}) + ring, cut = Keep(ring, Point{TS: 300}) + if len(ring) != 1 || ring[0].TS != 300 || !cut { + t.Fatalf("after the clock went back: %+v, cut %v", ring, cut) + } +} diff --git a/backend/methods/act.go b/backend/methods/act.go new file mode 100644 index 0000000..8f97a00 --- /dev/null +++ b/backend/methods/act.go @@ -0,0 +1,132 @@ +package methods + +import ( + "errors" + "regexp" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +var ifupFix = regexp.MustCompile(`^ifup:([a-z][a-z0-9_]{0,11})$`) + +// healthFix runs a fix a check named and answers Health again with what the fix came to +// (dawnline.health fix): apply and sync are still the ucode backend's, the rest the service's own. +func healthFix(w *view.World, t *i18n.Catalog, d Deps, id, lang string) (map[string]any, error) { + var result any + switch { + case id == "apply": + if d.Apply != nil { + result = d.Apply(lang) + } + case id == "sync": + var warning any + if d.Sync != nil { + warning = d.Sync(lang) + } + result = map[string]any{"warning": warning} + case id == "restart": + if d.Background != nil { + d.Background("sleep 1; /etc/init.d/dawnline restart") + } + result = map[string]any{"code": 0} + // netifd learns protocol handlers (amneziawg) only when it starts; the answer goes out before the network blinks + case id == "netrestart": + if d.Background != nil { + d.Background("sleep 1; /etc/init.d/network restart") + } + result = map[string]any{"ok": true, "background": true} + case ifupFix.MatchString(id): + name := ifupFix.FindStringSubmatch(id)[1] + // only Dawnline's own tunnels: never another interface of the router + mine := false + for _, s := range w.M.Servers { + mine = mine || (s.Ifname == name && s.PrivateKey != "") + } + if !mine { + return nil, said{"%s is not one of Dawnline's tunnels.", []any{name}} + } + if d.Ifup != nil { + d.Ifup(name) + } + result = map[string]any{"ok": true} + default: + return nil, errors.New("Unknown fix.") + } + out := serviceLog(w, t, d.RunDir, d.DataDir) + out["checks"] = healthChecks(w, t, d) + out["result"] = result + return out, nil +} + +// check[:app|amneziawg|packages] | app[@tag|:reinstall|:rollback|:lang:|:nolang] +// | amneziawg[:auto|slava|grey[:ru]|:rollback] | pkgs: (only packages Dawnline manages) +var updateTarget = regexp.MustCompile(`^(check(:(app|amneziawg|packages))?|app(@v?[0-9][0-9A-Za-z.+~-]{0,40}|:reinstall|:rollback|:lang:[a-z]{2,3}(_[A-Za-z]{2,4})?|:nolang)?|amneziawg(:rollback|:(auto|slava|grey)(:ru)?)?|pkgs:[a-z0-9][a-z0-9.+,-]*)$`) + +// The packages Dawnline manages besides its own and AmneziaWG's. +var managedPackages = []string{"ip-full", "kmod-veth", "libustream-openssl", "openssl-util", "acme", "acme-acmesh-dnsapi", "luci-app-acme"} + +// updatesRun starts an update job: the updater does the work in the background. It answers the new job +// once its worker has written it (a quick check may be over by then), else none (the page follows +// updates_status); never an older job. It waits two seconds at most. +func updatesRun(d Deps, what, lang string) (map[string]any, error) { + if what == "" { + what = "check" + } + if len(what) > 400 || !updateTarget.MatchString(what) { + return nil, errors.New("Unknown update target.") + } + // checked here too, so a wrong name never becomes a failed job in the history + if names, isPkgs := strings.CutPrefix(what, "pkgs:"); isPkgs { + for _, n := range strings.Split(names, ",") { + known := false + for _, p := range managedPackages { + known = known || p == n + } + if n == "" { + return nil, errors.New("Unknown update target.") + } + if !known { + return nil, said{"%s is not a package Dawnline manages", []any{n}} + } + } + } + if updating(d.RunDir) { + return nil, errors.New("Another component action is already running") + } + type job struct { + ID any `json:"id"` + Started float64 `json:"started"` + } + var prev job + files.ReadJSON(d.RunDir+"/update-job.json", &prev) + began := clock() + args := []string{"install", what} + if rest, isCheck := strings.CutPrefix(what, "check"); isCheck { + args = []string{"check"} + if rest != "" { + args = append(args, strings.TrimPrefix(rest, ":")) + } + } + // the job speaks the admin's language, when its catalog is installed + speak := "" + if i18n.Use(d.Catalogs, lang) != nil { + speak = strings.ToLower(strings.ReplaceAll(lang, "_", "-")) + } + if d.Updater != nil { + d.Updater(speak, args) + } + for i := 0; i < 20; i++ { + var j job + var whole map[string]any + if files.ReadJSON(d.RunDir+"/update-job.json", &j) && j.ID != prev.ID && j.Started >= float64(began) { + files.ReadJSON(d.RunDir+"/update-job.json", &whole) + return map[string]any{"started": true, "job": whole}, nil + } + time.Sleep(100 * time.Millisecond) + } + return map[string]any{"started": true, "job": nil}, nil +} diff --git a/backend/methods/ask.go b/backend/methods/ask.go new file mode 100644 index 0000000..fd28bbe --- /dev/null +++ b/backend/methods/ask.go @@ -0,0 +1,269 @@ +package methods + +import ( + "errors" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// What a person asks of the admin about a router, and the admin's answer. +// +// On their own page a person may add a router and name the networks behind it. Where the server's rule +// says "ask", neither takes effect: the router waits (`waiting`: no device of the tunnel, no +// configuration) and the networks are only asked for (`ask_net`), until the admin takes them or turns +// them down with a reason the person then reads (`declined`, and `declined_net` for networks). Taking a +// network away is the person's own to do, at once. + +// asksNothing is the refusal for an answer to a device that asks for nothing. +var asksNothing = errors.New("This device asks for nothing.") + +// applied puts a change of the settings into effect by what it moved: the routes (everything is applied), +// who is in a tunnel (the sync), or nothing on the router. The pages are told either way. +func applied(d Deps, lang string, routes, loads bool) (warning any) { + switch { + case routes: + return rerouted(d, lang) + case loads && d.Sync != nil: + warning = d.Sync(lang) + } + if d.Told != nil { + d.Told() + } + return warning +} + +// netsGiven reads networks a page names again (ones the router has or was asked for), each as kept. +func netsGiven(given any) ([]string, error) { + list, _ := given.([]any) + out := []string{} + for _, v := range list { + s := trimmed(v) + if s == "" { + continue + } + n, why := model.BehindNet(s) + if why != "" { + return nil, said{"Network %s is not written like 192.168.2.0/24.", []any{s}} + } + out = append(out, n.String()) + } + return out, nil +} + +// deviceAnswer is the admin's answer to what a router's owner asked for on their own page: +// +// accept the router is a device of the tunnel from now on, and the networks asked for are its own +// (checked now against everything they must not share addresses with: refused in a sentence +// when they cannot be taken as they are) +// decline neither; `reason` is one of model.Declined, which the owner reads +// reopen the question is put back (the undo of either answer): `router` the router waits again, +// `networks` are asked for again and not its own +// +// `networks` with accept or decline names the ones answered, of a router that does not wait (each asked +// network has its own two answers on the page); without it the answer is to all that is asked. +func deviceAnswer(d Deps, a map[string]any) (map[string]any, error) { + id, answer := text(a["id"]), text(a["answer"]) + reason := text(a["reason"]) + known := false + for _, r := range model.Declined { + known = known || r == reason + } + if !known { + reason = "plain" + } + again, err := netsGiven(a["networks"]) + if err != nil { + return nil, err + } + var was model.Device + var detail []string + routes, loads := false, false + err = write(d, func(c *uci.Config, m *model.Model) error { + dev, err := admin.own(m, id) + if err != nil { + return err + } + was = *dev + if dev.Kind != "router" { + return asksNothing + } + // the router itself is asked for while it waits and is not turned down yet + router := dev.Waiting && dev.Declined == "" + // the networks this answer is about: all that is asked, or the ones named + asked := dev.Ask + if len(again) > 0 && !dev.Waiting && answer != "reopen" { + asked = without(dev.Ask, without(dev.Ask, again)) + if len(asked) == 0 { + return asksNothing + } + } + left := without(dev.Ask, asked) + switch answer { + case "accept": + // a router turned down asks for nothing until the question is put back, its networks neither + if (!router && len(asked) == 0) || (dev.Waiting && !router) { + return asksNothing + } + if len(asked) > 0 { + all := []any{} + for _, n := range append(append([]string{}, dev.Behind...), asked...) { + all = append(all, n) + } + nets, err := behindNets(m, id, all, ownNets(d, m), admin, false) + if err != nil { + return err + } + setBehind(c, id, nets) + detail = append(detail, "accepted="+strings.Join(asked, " ")) + routes = true + } + if router { + c.Delete(id, "waiting") + detail = append([]string{"accepted=router"}, detail...) + loads = true + } + setList(c, id, "ask_net", left) + if len(left) == 0 { + c.Delete(id, "asked") + } + // what was turned down before is answered anew for the networks taken now + if rest := without(dev.DeclinedNets, asked); len(rest) != len(dev.DeclinedNets) { + setList(c, id, "declined_net", rest) + if len(rest) == 0 && !dev.Waiting { + c.Delete(id, "declined") + } + } + case "decline": + switch { + case router: + // it stays as it is, waiting, for its owner to read why and remove + c.Set(id, "declined", reason) + c.Delete(id, "declined_net") + detail = append(detail, "declined=router", "reason="+reason) + case len(asked) > 0 && !dev.Waiting: + setList(c, id, "declined_net", append(without(dev.DeclinedNets, asked), asked...)) + c.Set(id, "declined", reason) + setList(c, id, "ask_net", left) + if len(left) == 0 { + c.Delete(id, "asked") + } + detail = append(detail, "declined="+strings.Join(asked, " "), "reason="+reason) + default: + return asksNothing + } + case "reopen": + back := a["router"] == true + if !back && len(again) == 0 { + return asksNothing + } + if back { + if !dev.Waiting { + c.Set(id, "waiting", "1") + loads = true + } + detail = append(detail, "reopened=router") + } + if len(again) > 0 { + if rest := without(dev.Behind, again); len(rest) != len(dev.Behind) { + setBehind(c, id, rest) + routes = !dev.Waiting + } + setList(c, id, "ask_net", append(without(dev.Ask, again), again...)) + detail = append(detail, "reopened="+strings.Join(again, " ")) + } + rest := without(dev.DeclinedNets, again) + setList(c, id, "declined_net", rest) + if len(rest) == 0 { + c.Delete(id, "declined") + } + c.Set(id, "asked", strconv.FormatInt(clock(), 10)) + default: + return errors.New("Unknown answer.") + } + return nil + }) + if err != nil { + return nil, err + } + warning := applied(d, text(a["lang"]), routes, loads) + logged(d, journal.Event{"type": "device_changed", "person": was.Person, "device": id, "detail": strings.Join(detail, ", "), "by": admin.By}) + return map[string]any{"warning": warning}, nil +} + +// DeviceWishAs is the networks a router's owner wants behind it, all of them at once, from their own page. +// One the router has and the list lacks goes at once: that is the owner's own to do. One it lacks is its +// own at once where the server's rule says so, else asked of the admin (a router that still waits asks for +// all of them). `cleared` names turned-down networks the owner has read and puts away; one asked for +// again is no longer turned down either. +func DeviceWishAs(d Deps, a map[string]any, who Actor) (map[string]any, error) { + id := text(a["id"]) + cleared, err := netsGiven(a["cleared"]) + if err != nil { + return nil, err + } + var was model.Device + var detail []string + routes := false + err = write(d, func(c *uci.Config, m *model.Model) error { + dev, err := who.own(m, id) + if err != nil { + return err + } + was = *dev + if dev.Kind != "router" { + return errors.New("Only a router has networks behind it.") + } + p := m.People[dev.Person] + if p == nil || m.Servers[p.Server] == nil { + return errors.New("The person has no server.") + } + asking := who.By != "admin" && (dev.Waiting || m.Servers[p.Server].PortalNets == "ask") + wanted, err := behindNets(m, id, a["networks"], ownNets(d, m), who, asking) + if err != nil { + return err + } + // what it has and keeps, in the order it has them; what is new, in the order asked + keep := without(dev.Behind, without(dev.Behind, wanted)) + added := without(wanted, dev.Behind) + behind, ask := keep, added + if !asking { + behind, ask = append(keep, added...), nil + } + if !sameList(behind, dev.Behind) { + setBehind(c, id, behind) + detail = append(detail, "networks="+behindSaid(behind)) + routes = !dev.Waiting + } + if !sameList(ask, dev.Ask) { + setList(c, id, "ask_net", ask) + if fresh := without(ask, dev.Ask); len(fresh) > 0 { + c.Set(id, "asked", strconv.FormatInt(clock(), 10)) + detail = append(detail, "asked="+strings.Join(fresh, " ")) + } else if len(ask) == 0 && !dev.Waiting { + c.Delete(id, "asked") + } + if gone := without(dev.Ask, ask); len(gone) > 0 { + detail = append(detail, "withdrew="+strings.Join(gone, " ")) + } + } + if rest := without(without(dev.DeclinedNets, cleared), wanted); len(rest) != len(dev.DeclinedNets) { + setList(c, id, "declined_net", rest) + if len(rest) == 0 && !dev.Waiting { + c.Delete(id, "declined") + } + } + return nil + }) + if err != nil { + return nil, err + } + warning := applied(d, text(a["lang"]), routes, false) + if len(detail) > 0 { + logged(d, journal.Event{"type": "device_changed", "person": was.Person, "device": id, "detail": strings.Join(detail, ", "), "by": who.By}) + } + return map[string]any{"warning": warning}, nil +} diff --git a/backend/methods/ask_test.go b/backend/methods/ask_test.go new file mode 100644 index 0000000..2f0af7e --- /dev/null +++ b/backend/methods/ask_test.go @@ -0,0 +1,378 @@ +package methods + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// What a person asks for about a router on their own page, and the admin's answers: Lev, on the server +// where everyone reaches everyone, by each of the server's rules. +func TestRequestsFromThePortal(t *testing.T) { + d, st, dir, ap, sy := sitesStand(t) + lev := Actor{By: "portal", Person: "lev"} + dev := func(id string) *model.Device { + t.Helper() + _, m, err := st.Read() + if err != nil { + t.Fatal(err) + } + if m.Devices[id] == nil { + t.Fatalf("no device %s", id) + } + return m.Devices[id] + } + loaded := func(id string) bool { + _, m, _ := st.Read() + states := map[string]string{} + for _, p := range m.PersonIDs() { + states[p] = "active" + } + for _, x := range health.TunnelDevices(m, "open", states) { + if x.ID == id { + return true + } + } + return false + } + nets := func(list ...string) []any { + out := []any{} + for _, n := range list { + out = append(out, n) + } + return out + } + wish := func(id string, a map[string]any) string { + a["id"] = id + if _, err := DeviceWishAs(d, a, lev); err != nil { + return err.Error() + } + return "" + } + answer := func(id, how string, more map[string]any) any { + a := map[string]any{"id": id, "answer": how} + for k, v := range more { + a[k] = v + } + return ask(t, d, "device_answer", a)["error"] + } + counts := func(what string, applied, synced int) { + t.Helper() + if *ap != applied || *sy != synced { + t.Errorf("%s: applied %d, synced %d, want %d and %d", what, *ap, *sy, applied, synced) + } + } + // Kira's router has a network, the admin's doing + if res := ask(t, d, "device_networks", map[string]any{"id": "kphone", "networks": nets("192.168.3.0/24")}); res["error"] != nil { + t.Fatal(res["error"]) + } + counts("the admin's own", 1, 0) + + // asked of the admin (the rule a server starts with): the router waits, its networks are only asked for + if _, err := DeviceCreateAs(d, map[string]any{"person": "lev", "name": "Dacha", "kind": "router", "networks": nets("10.79.0.0/24")}, lev); err == nil || + err.Error() != "Network 10.79.0.0/24 is taken: 10.79.0.0/24 is the tunnel network of Open. The two ends of a tunnel need different addresses." { + t.Errorf("the tunnel's own network: %v", err) + } + res, err := DeviceCreateAs(d, map[string]any{"person": "lev", "name": "Dacha", "kind": "router", "networks": nets("192.168.88.1/24", "192.168.3.128/25")}, lev) + if err != nil { + t.Fatal(err) + } + dacha, _ := res["id"].(string) + if x := dev(dacha); res["waiting"] != true || res["config"] != nil || !x.Waiting || x.Behind != nil || x.Asked == 0 || x.CreatedBy != "portal" || + !reflect.DeepEqual(x.Ask, []string{"192.168.88.0/24", "192.168.3.128/25"}) { + t.Fatalf("a router asked for: %v, %+v", res, x) + } + counts("a router that waits", 1, 0) + if loaded(dacha) || !loaded("lphone") { + t.Error("a router that waits is in the tunnel, or Lev's phone is not") + } + _, m, _ := st.Read() + if cfg := configOf(d, m, dacha); cfg != nil { + t.Errorf("a router that waits has a configuration: %v", cfg) + } + if _, err := DeviceRotateAs(d, map[string]any{"id": dacha}, lev); err == nil || !strings.Contains(err.Error(), "waits for an answer") { + t.Errorf("new keys for a router that waits: %v", err) + } + // taken as it is, it would share addresses with Kira's: the admin is told whose, and nothing is written + if got := answer(dacha, "accept", nil); got != "Network 192.168.3.128/25 is taken: 192.168.3.0/24 is behind Kphone (Kira). Two sites need different addresses." { + t.Errorf("accepting a clash: %v", got) + } + if !dev(dacha).Waiting { + t.Error("a refused answer took the router") + } + // Lev takes that one back; then the admin takes the router with what is left + if got := wish(dacha, map[string]any{"networks": nets("192.168.88.0/24")}); got != "" || !reflect.DeepEqual(dev(dacha).Ask, []string{"192.168.88.0/24"}) { + t.Errorf("a wish changed while it waits: %q, %v", got, dev(dacha).Ask) + } + if got := answer(dacha, "accept", nil); got != nil { + t.Fatalf("accept: %v", got) + } + if x := dev(dacha); x.Waiting || x.Ask != nil || x.Asked != 0 || !reflect.DeepEqual(x.Behind, []string{"192.168.88.0/24"}) || !loaded(dacha) { + t.Errorf("after the answer: %+v", x) + } + counts("accepted with a network", 2, 0) + if got := answer(dacha, "accept", nil); got != "This device asks for nothing." { + t.Errorf("an answer to nothing: %v", got) + } + if got := answer("lphone", "decline", nil); got != "This device asks for nothing." { + t.Errorf("an answer to a phone: %v", got) + } + + // one more network: asked for, turned down with a reason, put back, turned down, and put away by Lev + if got := wish(dacha, map[string]any{"networks": nets("192.168.88.0/24", "192.168.89.0/24")}); got != "" { + t.Fatal(got) + } + if x := dev(dacha); !reflect.DeepEqual(x.Ask, []string{"192.168.89.0/24"}) || !reflect.DeepEqual(x.Behind, []string{"192.168.88.0/24"}) || x.Asked == 0 { + t.Errorf("one more asked for: %+v", x) + } + counts("a network asked for", 2, 0) + if got := answer(dacha, "decline", map[string]any{"reason": "overlap"}); got != nil { + t.Fatal(got) + } + if x := dev(dacha); x.Declined != "overlap" || !reflect.DeepEqual(x.DeclinedNets, []string{"192.168.89.0/24"}) || x.Ask != nil || x.Asked != 0 { + t.Errorf("turned down: %+v", x) + } + if got := answer(dacha, "reopen", map[string]any{"networks": nets("192.168.89.0/24")}); got != nil { + t.Fatal(got) + } + if x := dev(dacha); x.Declined != "" || x.DeclinedNets != nil || !reflect.DeepEqual(x.Ask, []string{"192.168.89.0/24"}) { + t.Errorf("the question put back: %+v", x) + } + if got := answer(dacha, "decline", map[string]any{"reason": "because"}); got != nil || dev(dacha).Declined != "plain" { + t.Errorf("a reason nobody knows: %v, %q", got, dev(dacha).Declined) + } + if got := wish(dacha, map[string]any{"networks": nets("192.168.88.0/24"), "cleared": nets("192.168.89.0/24")}); got != "" || dev(dacha).Declined != "" || dev(dacha).DeclinedNets != nil { + t.Errorf("put away: %q, %+v", got, dev(dacha)) + } + counts("answers that move no route", 2, 0) + // accepted and undone: the network is asked for again, and its route goes + wish(dacha, map[string]any{"networks": nets("192.168.88.0/24", "192.168.89.0/24")}) + if got := answer(dacha, "accept", nil); got != nil || !reflect.DeepEqual(dev(dacha).Behind, []string{"192.168.88.0/24", "192.168.89.0/24"}) { + t.Fatalf("a network accepted: %v, %v", got, dev(dacha).Behind) + } + if got := answer(dacha, "reopen", map[string]any{"networks": nets("192.168.89.0/24")}); got != nil { + t.Fatal(got) + } + if x := dev(dacha); !reflect.DeepEqual(x.Behind, []string{"192.168.88.0/24"}) || !reflect.DeepEqual(x.Ask, []string{"192.168.89.0/24"}) { + t.Errorf("an accept undone: %+v", x) + } + counts("accepted and undone", 4, 0) + // two asked for, each with its own answer: one taken, the other turned down, neither touching the other + wish(dacha, map[string]any{"networks": nets("192.168.88.0/24", "192.168.89.0/24", "192.168.94.0/24")}) + if got := answer(dacha, "accept", map[string]any{"networks": nets("192.168.94.0/24")}); got != nil { + t.Fatal(got) + } + if x := dev(dacha); !reflect.DeepEqual(x.Behind, []string{"192.168.88.0/24", "192.168.94.0/24"}) || !reflect.DeepEqual(x.Ask, []string{"192.168.89.0/24"}) || x.Asked == 0 { + t.Errorf("one of two taken: %+v", x) + } + if got := answer(dacha, "accept", map[string]any{"networks": nets("192.168.99.0/24")}); got != "This device asks for nothing." { + t.Errorf("an answer to a network nobody asked for: %v", got) + } + if got := answer(dacha, "decline", map[string]any{"networks": nets("192.168.89.0/24"), "reason": "unneeded"}); got != nil { + t.Fatal(got) + } + if x := dev(dacha); x.Ask != nil || x.Declined != "unneeded" || !reflect.DeepEqual(x.DeclinedNets, []string{"192.168.89.0/24"}) { + t.Errorf("the other turned down: %+v", x) + } + counts("each with its own answer", 5, 0) + // taking a network away is Lev's own to do, at once; what was asked for goes with the list + if got := wish(dacha, map[string]any{"networks": nets()}); got != "" || dev(dacha).Behind != nil || dev(dacha).Ask != nil { + t.Errorf("all taken away: %q, %+v", got, dev(dacha)) + } + counts("taken away", 6, 0) + + // networks at once: the server's owner said so + if res := ask(t, d, "server_update", map[string]any{"id": "open", "values": map[string]any{"portal_nets": "free"}}); res["error"] != nil { + t.Fatal(res["error"]) + } + if got := wish(dacha, map[string]any{"networks": nets("192.168.90.0/24")}); got != "" || !reflect.DeepEqual(dev(dacha).Behind, []string{"192.168.90.0/24"}) || dev(dacha).Ask != nil { + t.Errorf("at once: %q, %+v", got, dev(dacha)) + } + counts("a network at once", 8, 0) + // then everything is held against it, and Lev is not told whose the addresses are + if got := wish(dacha, map[string]any{"networks": nets("192.168.90.0/24", "192.168.3.0/25")}); got != "Network 192.168.3.0/25 is taken on this server. Ask the admin which addresses are free." { + t.Errorf("another person's network: %q", got) + } + // a router still waits for the admin, with its network asked for all the same + res, err = DeviceCreateAs(d, map[string]any{"person": "lev", "name": "Cabin", "kind": "router", "networks": nets("192.168.92.0/24")}, lev) + cabin, _ := res["id"].(string) + if err != nil || !dev(cabin).Waiting || !reflect.DeepEqual(dev(cabin).Ask, []string{"192.168.92.0/24"}) { + t.Fatalf("a router asked for where networks are free: %v", err) + } + // turned down, it stays for Lev to read why; the answer undone, it is asked for again; then taken + if got := answer(cabin, "decline", map[string]any{"reason": "talk"}); got != nil || !dev(cabin).Waiting || dev(cabin).Declined != "talk" || loaded(cabin) { + t.Errorf("a router turned down: %v, %+v", got, dev(cabin)) + } + if got := answer(cabin, "accept", nil); got != "This device asks for nothing." { + t.Errorf("accepting what was turned down: %v", got) + } + if got := answer(cabin, "reopen", map[string]any{"router": true}); got != nil || dev(cabin).Declined != "" || !dev(cabin).Waiting { + t.Errorf("the router asked for again: %v, %+v", got, dev(cabin)) + } + counts("a router turned down and back", 8, 0) + if got := answer(cabin, "accept", nil); got != nil || dev(cabin).Waiting || !loaded(cabin) || !reflect.DeepEqual(dev(cabin).Behind, []string{"192.168.92.0/24"}) { + t.Errorf("the router taken: %v, %+v", got, dev(cabin)) + } + counts("a router taken with its network", 9, 0) + // that undone: it waits again, out of the tunnel (its network stays written and is in effect nowhere) + if got := answer(cabin, "reopen", map[string]any{"router": true}); got != nil || !dev(cabin).Waiting || loaded(cabin) { + t.Errorf("a taken router put back: %v, %+v", got, dev(cabin)) + } + counts("put back", 9, 1) + if _, m, _ := st.Read(); m.BehindOf(nil)[cabin] != nil { + t.Errorf("a waiting router's network is in effect: %v", m.BehindOf(nil)[cabin]) + } + + // routers at once, and no routers at all + ask(t, d, "server_update", map[string]any{"id": "open", "values": map[string]any{"portal_routers": "free"}}) + res, err = DeviceCreateAs(d, map[string]any{"person": "lev", "name": "Garage", "kind": "router", "networks": nets("192.168.93.0/24")}, lev) + garage, _ := res["id"].(string) + if err != nil || res["config"] == nil || dev(garage).Waiting || !reflect.DeepEqual(dev(garage).Behind, []string{"192.168.93.0/24"}) || !loaded(garage) { + t.Errorf("a router at once: %v, %v", err, res) + } + counts("a router at once", 11, 1) + if _, err := DeviceRotateAs(d, map[string]any{"id": "lphone", "kind": "router"}, lev); err != nil { + t.Errorf("a phone made a router where routers are free: %v", err) + } + ask(t, d, "server_update", map[string]any{"id": "open", "values": map[string]any{"portal_routers": "off"}}) + if _, err := DeviceCreateAs(d, map[string]any{"person": "lev", "name": "Shed", "kind": "router"}, lev); err == nil || + err.Error() != "The admin adds routers on this server. Ask them for one." { + t.Errorf("a router where the owner adds them: %v", err) + } + // on Boris's server the rule is the one a server starts with: no device is made a router there + if _, err := DeviceRotateAs(d, map[string]any{"id": "phone", "kind": "router"}, Actor{By: "portal", Person: "anna"}); err == nil || + err.Error() != "Add the router as a new device: a device cannot be made one here." { + t.Errorf("a phone made a router: %v", err) + } + if res := ask(t, d, "server_update", map[string]any{"id": "open", "values": map[string]any{"portal_nets": "sometimes"}}); res["error"] != "Unknown choice for routers on people's pages." { + t.Errorf("a rule nobody knows: %v", res["error"]) + } + // "ask" is what an unset rule means: back to it, the options leave the file + ask(t, d, "server_update", map[string]any{"id": "open", "values": map[string]any{"portal_routers": "ask", "portal_nets": "ask"}}) + if _, m, _ := st.Read(); m.Servers["open"].PortalRouters != "ask" || m.Servers["open"].PortalNets != "ask" { + t.Errorf("the rules back: %q, %q", m.Servers["open"].PortalRouters, m.Servers["open"].PortalNets) + } + // the log has what was asked and answered, in order, each by who did it + var said []string + for _, e := range journalOf(t, dir) { + if e["type"] == "device_changed" && (e["device"] == dacha || e["device"] == cabin) { + said = append(said, e["by"].(string)+": "+e["detail"].(string)) + } + } + want := []string{ + "portal: asked=router, asked=192.168.88.0/24 192.168.3.128/25", + "portal: withdrew=192.168.3.128/25", + "admin: accepted=router, accepted=192.168.88.0/24", + "portal: asked=192.168.89.0/24", + "admin: declined=192.168.89.0/24, reason=overlap", + "admin: reopened=192.168.89.0/24", + "admin: declined=192.168.89.0/24, reason=plain", + "portal: asked=192.168.89.0/24", + "admin: accepted=192.168.89.0/24", + "admin: reopened=192.168.89.0/24", + "portal: asked=192.168.94.0/24", + "admin: accepted=192.168.94.0/24", + "admin: declined=192.168.89.0/24, reason=unneeded", + "portal: networks=none", + "portal: networks=192.168.90.0/24", + "portal: asked=router, asked=192.168.92.0/24", + "admin: declined=router, reason=talk", + "admin: reopened=router", + "admin: accepted=router, accepted=192.168.92.0/24", + "admin: reopened=router", + } + if !reflect.DeepEqual(said, want) { + t.Errorf("logged:\n%s\nwant:\n%s", strings.Join(said, "\n"), strings.Join(want, "\n")) + } +} + +// The same through a person's own link: what the page is told about routers, a router asked for, its +// networks changed while it waits, and no configuration until the admin answers. +func TestARouterThroughThePersonsLink(t *testing.T) { + d, st, dir, _, _ := sitesStand(t) + c, _, _ := st.Read() + const code = "kamiro-telosu-bavine" + c.Set("lev", "code", code) + c.Set("settings", "portal_enabled", "1") + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + d.World = func() *view.World { + _, m, _ := st.Read() + return &view.World{M: m, Usage: usage.Empty(), Now: time.Now().Unix()} + } + call := func(method, path, body string) (int, map[string]any) { + q := PortalRequest{Method: method, Path: "/" + code + path, Host: "vpn.example.org:4500", HTTPS: true, Remote: "198.51.100.9"} + if method == "POST" { + q.ContentType, q.Origin, q.Body, q.ContentLength = "application/json", "https://"+q.Host, strings.NewReader(body), int64(len(body)) + } + a := Portal(d, q) + var out map[string]any + json.Unmarshal(a.Body, &out) + return a.Status, out + } + rules := func() (routers, nets any, router bool) { + status, state := call("GET", "/api/state", "") + if status != 200 { + t.Fatalf("the state: %d", status) + } + for _, k := range state["kinds"].([]any) { + router = router || k == "router" + } + server := state["server"].(map[string]any) + return server["routers"], server["nets"], router + } + if routers, nets, router := rules(); routers != "ask" || nets != "ask" || !router { + t.Errorf("the rules a server starts with: %v, %v, router offered: %v", routers, nets, router) + } + status, res := call("POST", "/api/devices", `{"name":"Dacha","kind":"router","networks":["192.168.88.9/24"]}`) + id, _ := res["id"].(string) + if status != 200 || res["waiting"] != true || res["config"] != nil || id == "" { + t.Fatalf("a router asked for: %d %v", status, res) + } + // the page's state has it as it stands: waiting, with what is asked for + var mine map[string]any + for _, x := range res["state"].(map[string]any)["person"].(map[string]any)["devices"].([]any) { + if dv := x.(map[string]any); dv["id"] == id { + mine = dv + } + } + if mine == nil || mine["waiting"] != true || !reflect.DeepEqual(mine["ask"], []any{"192.168.88.0/24"}) || mine["behind"] != nil { + t.Errorf("the device as the page has it: %v", mine) + } + if status, res = call("GET", "/api/devices/"+id+"/config", ""); status != 409 || res["error"] != "This router waits for an answer to its request: it has no configuration yet." { + t.Errorf("its configuration: %d %v", status, res) + } + if status, res = call("POST", "/api/devices/"+id, `{"action":"reconnect"}`); status != 400 || res["error"] != "This router waits for an answer to its request: it has no configuration yet." { + t.Errorf("set up again while it waits: %d %v", status, res) + } + if status, res = call("POST", "/api/devices/"+id, `{"action":"networks","networks":["192.168.88.0/24","192.168.89.0/24"]}`); status != 200 { + t.Fatalf("its networks changed: %d %v", status, res) + } + if _, m, _ := st.Read(); !reflect.DeepEqual(m.Devices[id].Ask, []string{"192.168.88.0/24", "192.168.89.0/24"}) || m.Devices[id].Behind != nil { + t.Errorf("what it asks for now: %+v", m.Devices[id]) + } + if status, res = call("POST", "/api/devices/"+id, `{"action":"networks","networks":["8.8.8.0/24"]}`); status != 400 || + res["error"] != "Network 8.8.8.0/24 is not private (10.x, 172.16-31.x, 192.168.x)." { + t.Errorf("a public network: %d %v", status, res) + } + if status, res = call("POST", "/api/devices/lphone", `{"action":"networks","networks":["192.168.95.0/24"]}`); status != 400 || res["error"] != "Only a router has networks behind it." { + t.Errorf("a network behind a phone: %d %v", status, res) + } + // where the owner adds routers, the page does not offer one and the router takes none + c, _, _ = st.Read() + c.Set("open", "portal_routers", "off") + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + if routers, _, router := rules(); routers != "off" || router { + t.Errorf("routers off: %v, router offered: %v", routers, router) + } + if status, res = call("POST", "/api/devices", `{"name":"Shed","kind":"router"}`); status != 400 || res["error"] != "The admin adds routers on this server. Ask them for one." { + t.Errorf("a router where the owner adds them: %d %v", status, res) + } +} diff --git a/backend/methods/backup.go b/backend/methods/backup.go new file mode 100644 index 0000000..4c090ce --- /dev/null +++ b/backend/methods/backup.go @@ -0,0 +1,365 @@ +package methods + +import ( + "archive/tar" + "bytes" + "compress/gzip" + "encoding/base64" + "errors" + "io" + "os" + "regexp" + "sort" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// How many backups of each kind stay (the newest): the nightly ones must not push out what the admin made +// by hand or what a removal left behind. A kind not named keeps three. +var backupKeep = map[string]int{"manual": 10, "auto": 7, "pre-delete": 5, "pre-remove": 3, "pre-update": 3, "pre-restore": 3, "pre-import": 3} + +// Kinds that hold the settings alone: made often, and never to bring history back. +var configOnly = map[string]bool{"auto": true, "pre-delete": true, "pre-remove": true, "pre-update": true} + +var backupKind = regexp.MustCompile(`^[a-z0-9-]{1,24}$`) + +// backupCreate makes a backup now and returns its name (dawnline.backup backup_create): the settings, and +// for the kinds that protect data about to be replaced the traffic history and the activity log too, as a +// tar.gz with the paths ucode's restore unpacks at /. Written whole or not at all. Of each kind the oldest +// beyond its number are removed. +func backupCreate(d Deps, reason string, keep ...string) (string, error) { + kind := "manual" + if backupKind.MatchString(reason) { + kind = reason + } + // the live counters and log first, so the backup has them as they are now + if !configOnly[kind] { + if raw, err := os.ReadFile(d.RunDir + "/usage.json"); err == nil { + files.Write(d.DataDir+"/usage.json", raw, 0o600) + } + if d.Store != nil { + if _, m, err := d.Store.Read(); err == nil { + journal.Log{Run: d.RunDir, Data: d.DataDir}.Persist(journal.PolicyOf(m.Settings.Retention), clock()) + } + } + } + dir := d.DataDir + "/backups" + os.MkdirAll(dir, 0o700) + name := "dawnline-" + time.Unix(clock(), 0).In(zone.Local()).Format("20060102-150405") + if kind != "manual" { + name += "-" + kind + } + name += ".tar.gz" + want := [][2]string{{"etc/config/dawnline", d.Config}} + if !configOnly[kind] { + want = append(want, [2]string{"etc/dawnline/usage.json", d.DataDir + "/usage.json"}, [2]string{"etc/dawnline/events.json", d.DataDir + "/events.json"}) + } + // not a backup's name until it is complete + tmp := dir + "/." + name + ".tmp" + err := func() error { + f, err := os.OpenFile(tmp, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600) + if err != nil { + return err + } + defer f.Close() + zw := gzip.NewWriter(f) + tw := tar.NewWriter(zw) + for _, w := range want { + raw, err := os.ReadFile(w[1]) + if err != nil { + continue + } + st, _ := os.Stat(w[1]) + if err := tw.WriteHeader(&tar.Header{Name: w[0], Mode: 0o600, Size: int64(len(raw)), ModTime: st.ModTime(), Typeflag: tar.TypeReg, Uname: "root", Gname: "root"}); err != nil { + return err + } + if _, err := tw.Write(raw); err != nil { + return err + } + } + if err := tw.Close(); err != nil { + return err + } + if err := zw.Close(); err != nil { + return err + } + return f.Sync() + }() + if err == nil { + err = os.Rename(tmp, dir+"/"+name) + } + if err != nil { + os.Remove(tmp) + return "", errors.New("Backup failed: the archive could not be written (is the flash full?)") + } + os.Chmod(dir+"/"+name, 0o600) + seen := map[string]int{} + for _, b := range backups(dir) { + // the new one, and the backup being restored: it must outlive the backup made just before restoring it + if b["name"] == name || (len(keep) > 0 && b["name"] == keep[0]) { + continue + } + k := b["reason"].(string) + keep, known := backupKeep[k] + if !known { + keep = 3 + } + if seen[k]++; seen[k] > keep { + os.Remove(dir + "/" + b["name"].(string)) + } + } + return name, nil +} + +// what a backup may hold, by its path in the archive +var backupFiles = []string{"etc/config/dawnline", "etc/dawnline/usage.json", "etc/dawnline/events.json"} + +// The unpacked size a backup may have (an upload itself is limited to 4 MB). +const maxUnpacked = 16 * 1024 * 1024 + +// unpack reads a backup archive after checking it as dawnline.backup check_archive does: only Dawnline's own +// files, all of them regular files (no links, devices or directories), within a sane unpacked size, the +// settings among them. +func unpack(raw []byte) (map[string][]byte, error) { + invalid := errors.New("Not a valid backup archive.") + zr, err := gzip.NewReader(bytes.NewReader(raw)) + if err != nil { + return nil, invalid + } + tr := tar.NewReader(zr) + out := map[string][]byte{} + var total int64 + for { + h, err := tr.Next() + if err == io.EOF { + break + } + if err != nil { + return nil, invalid + } + name := strings.TrimPrefix(strings.TrimPrefix(h.Name, "."), "/") + if h.Typeflag != tar.TypeReg { + return nil, said{"Unexpected entry in backup: %s", []any{name}} + } + known := false + for _, f := range backupFiles { + known = known || f == name + } + if !known { + return nil, said{"Unexpected file in backup: %s", []any{name}} + } + if total += h.Size; total > maxUnpacked { + return nil, errors.New("Backup is too large.") + } + data, err := io.ReadAll(io.LimitReader(tr, maxUnpacked+1)) + if err != nil { + return nil, invalid + } + out[name] = data + } + if out["etc/config/dawnline"] == nil { + return nil, errors.New("Backup does not contain /etc/config/dawnline.") + } + return out, nil +} + +// usable refuses settings that cannot replace the current ones, listing what is wrong with them. +func usable(d Deps, t *i18n.Catalog, text string) error { + c, err := uci.Parse(text) + if err != nil || len(c.Sections) == 0 { + return errors.New("The configuration in this file cannot be read.") + } + // the router's networks that are not Dawnline's own tunnels' (the current settings say which those are) + var foreign []string + if d.Addresses != nil && d.Store != nil { + ours := map[string]bool{} + if _, now, err := d.Store.Read(); err == nil { + for _, s := range now.Servers { + ours[s.Ifname] = true + } + } + for _, a := range d.Addresses() { + if !ours[a.Iface] { + foreign = append(foreign, a.CIDR) + } + } + } + if errs := health.ConfigErrors(model.Load(c, nil), t, parseFile("/etc/config/network"), foreign); len(errs) > 0 { + return said{"This configuration can't be used: %s", []any{strings.Join(errs, " ")}} + } + return nil +} + +// restore puts a backup's files in place: checked first, a backup of what is there made before, the +// settings written first under the config lock (when they cannot be, nothing else is touched), then the +// counters and the log, which the watcher takes up from flash; then ucode's full apply. +func restore(d Deps, lang string, raw []byte, name string) (map[string]any, error) { + parts, err := unpack(raw) + if err != nil { + return nil, err + } + if err := usable(d, i18n.Use(d.Catalogs, lang), string(parts["etc/config/dawnline"])); err != nil { + return nil, err + } + if _, err := backupCreate(d, "pre-restore", name); err != nil { + return nil, err + } + os.MkdirAll(d.DataDir, 0o700) + err = func() error { + defer files.Lock(d.RunDir, "config")() + for _, f := range [][2]string{{"etc/config/dawnline", d.Config}, {"etc/dawnline/usage.json", d.DataDir + "/usage.json"}, {"etc/dawnline/events.json", d.DataDir + "/events.json"}} { + if data, has := parts[f[0]]; has { + if files.Write(f[1], data, 0o600) != nil { + return said{"Couldn't write %s. Is the flash full?", []any{"/" + f[0]}} + } + } + } + return nil + }() + if err != nil { + return nil, err + } + // the live counters and log must follow the restored files: the watcher loads them from flash anew + os.Remove(d.RunDir + "/usage.json") + os.Remove(d.RunDir + "/events.json") + files.Write(d.RunDir+"/usage.reload", []byte(strconv.FormatInt(clock(), 10)), 0o600) + applied := map[string]any{} + if d.Apply != nil { + applied = d.Apply(lang) + } + if d.Told != nil { + d.Told() + } + return applied, nil +} + +// backupRestore brings a kept backup back. +func backupRestore(d Deps, name, lang string) (map[string]any, error) { + if !backupFile.MatchString(name) { + return nil, errors.New("Invalid backup name.") + } + raw, err := os.ReadFile(d.DataDir + "/backups/" + name) + if err != nil { + return nil, errors.New("Backup not found.") + } + out, err := restore(d, lang, raw, name) + if err == nil && d.Log != nil { + d.Log.Admin("dawnline", "restored", "backup", name, "") + } + return out, err +} + +// backupUpload brings back a backup the admin sends (base64, 4 MB at most). +func backupUpload(d Deps, data, lang string) (map[string]any, error) { + raw, err := base64.StdEncoding.DecodeString(strings.Trim(data, blank)) + if err != nil || len(raw) == 0 || len(raw) > 4*1024*1024 { + return nil, errors.New("Upload is empty or too large.") + } + out, err := restore(d, lang, raw, "") + if err == nil && d.Log != nil { + d.Log.Admin("dawnline", "restored", "backup", "from a file", "") + } + return out, err +} + +var ( + sectionName = regexp.MustCompile(`^[A-Za-z0-9_]{1,64}$`) + optionName = regexp.MustCompile(`^[a-z0-9_]{1,32}$`) +) + +// importAll replaces the settings with an export (dawnline.backup import_json): only Dawnline's kinds of +// section, options that are strings or lists of them; checked as a restore's, a backup made before. A +// section's options are written in the order of their names (the bus hands them over as a map). +func importAll(d Deps, data any, lang string) (map[string]any, error) { + o, _ := data.(map[string]any) + sections, isList := o["sections"].([]any) + if o == nil || o["format"] != "dawnline" || !isList { + return nil, errors.New("Not a Dawnline export.") + } + kinds := map[string]bool{"settings": true, "server": true, "person": true, "device": true, "service": true, "circle": true} + c := &uci.Config{} + for _, x := range sections { + s, _ := x.(map[string]any) + name, _ := s[".name"].(string) + kind, _ := s[".type"].(string) + if s == nil || !kinds[kind] || !sectionName.MatchString(name) { + return nil, said{"Invalid section %s.", []any{name}} + } + c.Add(kind, name) + keys := make([]string, 0, len(s)) + for k := range s { + if !strings.HasPrefix(k, ".") { + keys = append(keys, k) + } + } + sort.Strings(keys) + for _, k := range keys { + if !optionName.MatchString(k) { + return nil, said{"Invalid option %s.", []any{k}} + } + switch v := s[k].(type) { + case string: + // an empty value is written as it is: a cursor would drop it, a file keeps it + sec := c.Section(name) + sec.Values[k] = uci.Value{Str: v} + sec.Order = append(sec.Order, k) + case []any: + var list []string + for _, e := range v { + str, isString := e.(string) + if !isString { + return nil, said{"Invalid option %s.", []any{k}} + } + list = append(list, str) + } + if len(list) > 0 { + sec := c.Section(name) + sec.Values[k] = uci.Value{IsList: true, List: list} + sec.Order = append(sec.Order, k) + } + default: + return nil, said{"Invalid option %s.", []any{k}} + } + } + } + text := c.Format() + if err := usable(d, i18n.Use(d.Catalogs, lang), text); err != nil { + return nil, err + } + if _, err := backupCreate(d, "pre-import"); err != nil { + return nil, err + } + err := func() error { + defer files.Lock(d.RunDir, "config")() + if files.Write(d.Config, []byte(text), 0o600) != nil { + return said{"Couldn't write %s. Is the flash full?", []any{"/etc/config/dawnline"}} + } + return nil + }() + if err != nil { + return nil, err + } + applied := map[string]any{} + if d.Apply != nil { + applied = d.Apply(lang) + } + if d.Log != nil { + d.Log.Admin("dawnline", "imported", "", "settings from a file", "") + } + if d.Told != nil { + d.Told() + } + return applied, nil +} + +// BackupCreate saves a backup of a kind ("auto": the nightly one) for who keeps the router on its own. +func BackupCreate(d Deps, kind string) (string, error) { return backupCreate(d, kind) } diff --git a/backend/methods/behind_test.go b/backend/methods/behind_test.go new file mode 100644 index 0000000..aa798f0 --- /dev/null +++ b/backend/methods/behind_test.go @@ -0,0 +1,186 @@ +package methods + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + "unicode" + "unicode/utf8" + + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// sitesStand is access's household on the golden's router (which has 192.168.50.0/24 and 192.168.77.0/24 +// itself) with Boris's and Kira's devices made routers, and how often the full apply and the sync were +// asked for. +func sitesStand(t *testing.T) (d Deps, st *store.Store, dir string, applied, synced *int) { + t.Helper() + dir = t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + c.Set("bphone", "kind", "router") + c.Set("kphone", "kind", "router") + c.Set("lev", "device_limit", "10") + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + raw, err := os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + applied, synced = new(int), new(int) + st = &store.Store{Config: dir + "/dawnline", RunDir: dir} + d = Deps{World: func() *view.World { return &view.World{} }, Store: st, Config: dir + "/dawnline", RunDir: dir, DataDir: dir + "/data", + Snapshot: func() *netview.Snapshot { + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }}) + }, + AWG: func() map[string]any { return map[string]any{"tools": true, "kmod": true} }, + Apply: func(string) map[string]any { *applied++; return map[string]any{"warning": nil} }, + Sync: func(string) any { *synced++; return nil }} + // keys and ids as a row of made-up ones, each its own + keys, hex := newKeys, randHex + t.Cleanup(func() { newKeys, randHex = keys, hex }) + n := 0 + newKeys = func() Keys { + n++ + k := func(c byte) string { return strings.Repeat(string(c), 41) + string(rune('A'+n)) + "A=" } + return Keys{Private: k('P'), Public: k('Q'), Preshared: k('R')} + } + made := 0 + randHex = func(int) string { made++; return "0a0b0c0" + string(rune('0'+made)) } + return d, st, dir, applied, synced +} + +// The networks behind a router, as the admin sets them: access's household on the golden's router (which +// has 192.168.50.0/24 and 192.168.77.0/24 itself), every refusal in its words, and the full apply asked +// for only when something changed. +func TestNetworksBehindARouter(t *testing.T) { + d, st, dir, ap, sy := sitesStand(t) + behind := func(id string) []string { + _, m, err := st.Read() + if err != nil { + t.Fatal(err) + } + return m.Devices[id].Behind + } + set := func(id string, nets ...any) map[string]any { + return ask(t, d, "device_networks", map[string]any{"id": id, "networks": nets}) + } + // two networks, each told from its first address, the one written twice once + res := set("bphone", " 192.168.2.9/24 ", "172.20.0.0/16", "192.168.2.0/24", "") + if res["error"] != nil || !reflect.DeepEqual(behind("bphone"), []string{"192.168.2.0/24", "172.20.0.0/16"}) || *ap != 1 || *sy != 0 { + t.Fatalf("set: %v, %v, applied %d, synced %d", res, behind("bphone"), *ap, *sy) + } + if !reflect.DeepEqual(res["networks"], []string{"192.168.2.0/24", "172.20.0.0/16"}) { + t.Errorf("answered %v", res["networks"]) + } + // the same again: nothing written, nothing applied + if res = set("bphone", "192.168.2.0/24", "172.20.0.0/16"); res["error"] != nil || *ap != 1 { + t.Errorf("the same list: %v, applied %d", res, *ap) + } + for _, r := range []struct { + id string + nets []any + want string + }{ + {"bphone", []any{"192.168.2.0"}, "Network 192.168.2.0 is not written like 192.168.2.0/24."}, + {"bphone", []any{"10.0.0.0/8"}, "Network 10.0.0.0/8 is too wide: /16 at the most."}, + {"bphone", []any{"8.8.8.0/24"}, "Network 8.8.8.0/24 is not private (10.x, 172.16-31.x, 192.168.x)."}, + {"bphone", []any{"192.168.4.0/24", "192.168.4.128/25"}, "Networks 192.168.4.0/24 and 192.168.4.128/25 share addresses."}, + {"bphone", []any{"10.77.0.0/16"}, "Network 10.77.0.0/16 is taken: 10.77.0.0/24 is the tunnel network of Home. The two ends of a tunnel need different addresses."}, + {"bphone", []any{"192.168.50.0/25"}, "Network 192.168.50.0/25 is taken: the router has 192.168.50.0/24 itself. The two ends of a tunnel need different addresses."}, + {"kphone", []any{"172.20.5.0/24"}, "Network 172.20.5.0/24 is taken: 172.20.0.0/16 is behind Bphone (Boris). Two sites need different addresses."}, + {"phone", []any{"192.168.9.0/24"}, "Only a router has networks behind it."}, + {"nobody", []any{"192.168.9.0/24"}, "Unknown device."}, + {"bphone", []any{"192.168.10.0/24", "192.168.11.0/24", "192.168.12.0/24", "192.168.13.0/24", "192.168.14.0/24", "192.168.15.0/24", + "192.168.16.0/24", "192.168.17.0/24", "192.168.18.0/24"}, "A router has 8 networks behind it at the most."}, + } { + if res := set(r.id, r.nets...); res["error"] != r.want { + t.Errorf("%s %v: %v, want %q", r.id, r.nets, res["error"], r.want) + } + // the page shows a refusal as it came only when it begins as a sentence does (web/src/admin/failure.ts): + // one that began with the network's address would be read as a program's error + if first, _ := utf8.DecodeRuneInString(r.want); !unicode.IsUpper(first) { + t.Errorf("%q does not begin with a capital letter", r.want) + } + } + if *ap != 1 || !reflect.DeepEqual(behind("bphone"), []string{"192.168.2.0/24", "172.20.0.0/16"}) { + t.Errorf("a refusal wrote or applied: %d, %v", *ap, behind("bphone")) + } + // the names in a refusal are the settings' own + _, m, _ := st.Read() + if m.Servers["home"].Name != "Home" || m.Devices["bphone"].Name != "Bphone" || m.People["boris"].Name != "Boris" { + t.Fatalf("the household's names moved: %q, %q, %q", m.Servers["home"].Name, m.Devices["bphone"].Name, m.People["boris"].Name) + } + // none: the option goes, and the routes with it + if res = set("bphone"); res["error"] != nil || behind("bphone") != nil || *ap != 2 { + t.Errorf("none: %v, %v, applied %d", res, behind("bphone"), *ap) + } + if file, _ := os.ReadFile(dir + "/dawnline"); strings.Contains(string(file), "behind_net") { + t.Error("the option is still in the file") + } + // a router added with its networks is applied in full; another device is loaded by the sync, as before + res = ask(t, d, "device_create", map[string]any{"person": "lev", "name": "Dacha", "kind": "router", "networks": []any{"192.168.88.1/24"}}) + if res["error"] != nil || res["id"] != "d_0a0b0c01" || !reflect.DeepEqual(behind("d_0a0b0c01"), []string{"192.168.88.0/24"}) || *ap != 3 || *sy != 0 { + t.Fatalf("a router with its network: %v, applied %d, synced %d", res["error"], *ap, *sy) + } + if res = ask(t, d, "device_create", map[string]any{"person": "lev", "name": "Tablet", "kind": "tablet", "networks": []any{"192.168.89.0/24"}}); res["error"] != "Only a router has networks behind it." { + t.Errorf("a tablet with a network: %v", res["error"]) + } + if res = ask(t, d, "device_create", map[string]any{"person": "lev", "name": "Second", "kind": "router", "networks": []any{"192.168.88.128/25"}}); res["error"] != + "Network 192.168.88.128/25 is taken: 192.168.88.0/24 is behind Dacha (Lev). Two sites need different addresses." { + t.Errorf("a second router on the first one's addresses: %v", res["error"]) + } + if *ap != 3 || *sy != 0 { + t.Errorf("refusals applied: %d, %d", *ap, *sy) + } + // set up again as a phone: what is no router has nothing behind it + if res = ask(t, d, "device_rotate", map[string]any{"id": "d_0a0b0c01", "kind": "phone"}); res["error"] != nil || behind("d_0a0b0c01") != nil || *ap != 4 { + t.Errorf("a router made a phone: %v, %v, applied %d", res["error"], behind("d_0a0b0c01"), *ap) + } + // and the log has each change in its words + var details []string + for _, e := range journalOf(t, dir) { + if e["type"] == "device_changed" { + details = append(details, e["detail"].(string)) + } + } + want := []string{"networks=192.168.2.0/24 172.20.0.0/16", "networks=none", "networks=192.168.88.0/24", "kind=phone, networks=none"} + if !reflect.DeepEqual(details, want) { + t.Errorf("logged %v, want %v", details, want) + } +} + +// journalOf is the activity log a test's methods wrote, the oldest first. +func journalOf(t *testing.T, dir string) []map[string]any { + t.Helper() + var list []map[string]any + raw, err := os.ReadFile(dir + "/events.json") + if err != nil { + t.Fatal(err) + } + if err := json.Unmarshal(raw, &list); err != nil { + t.Fatal(err) + } + if len(list) > 1 && list[0]["ts"].(float64) > list[len(list)-1]["ts"].(float64) { + for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 { + list[i], list[j] = list[j], list[i] + } + } + return list +} diff --git a/backend/methods/clear.go b/backend/methods/clear.go new file mode 100644 index 0000000..54c5074 --- /dev/null +++ b/backend/methods/clear.go @@ -0,0 +1,147 @@ +package methods + +import ( + "errors" + "os" + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +var olderDays = regexp.MustCompile(`^[1-9][0-9]{0,3}$`) + +// logsClear removes activity by person, device, category and/or age; nothing given clears it all +// (dawnline.rpc.status logs_clear). What went is written in the service log. +func logsClear(w *view.World, d Deps, person, device, category, older string) (map[string]any, error) { + f := journal.Filter{Device: device} + if person != "" { + if w.M.People[person] == nil { + return nil, errors.New("Unknown person.") + } + f.Person = person + } + if category != "" { + known := false + for _, c := range journal.Categories { + known = known || c == category + } + if !known { + return nil, errors.New("Unknown category.") + } + f.Category = category + } + if older != "" { + if !olderDays.MatchString(older) { + return nil, errors.New("Older than must be a number of days.") + } + days, _ := strconv.ParseInt(older, 10, 64) + f.Before = time.Now().Unix() - days*86400 + } + removed := journal.Log{Run: d.RunDir, Data: d.DataDir}.Clear(f) + if removed > 0 && d.Log != nil { + note := []string{strconv.Itoa(removed) + " event"} + if removed != 1 { + note[0] += "s" + } + if f.Category != "" { + note = append(note, f.Category) + } + if f.Person != "" { + note = append(note, w.M.People[f.Person].Name) + } + if older != "" { + note = append(note, "older than "+older+" days") + } + d.Log.Admin("dawnline", "cleared", "", "the activity log", strings.Join(note, " · ")) + } + return map[string]any{"ok": true, "removed": removed}, nil +} + +// serviceLogClear removes the service log's entries, all of them or those older than a number of days. +func serviceLogClear(d Deps, older string) map[string]any { + // as ucode reads the number: anything that is not one clears it all + days, _ := strconv.ParseInt(strings.TrimSpace(older), 10, 64) + if days < 0 { + days = 0 + } + removed := 0 + if d.Log != nil { + removed = d.Log.Clear(d.DataDir, days) + if removed > 0 { + note := strconv.Itoa(removed) + " entries" + if removed == 1 { + note = "1 entry" + } + if days > 0 { + note += " older than " + older + " days" + } + d.Log.Admin("dawnline", "cleared", "", "the service log", note) + } + } + return map[string]any{"removed": removed} +} + +// usageClear forgets traffic history: everyone's, a person's (with their devices and their limit), a +// device's, or a person's limit month alone (dawnline.rpc.status usage_clear). +func usageClear(w *view.World, d Deps, scope, id string) (map[string]any, error) { + m := w.M + who := "for everyone" + switch scope { + case "all": + case "person", "limit": + if m.People[id] == nil { + return nil, errors.New("Unknown person.") + } + who = "for " + m.People[id].Name + case "device": + dev := m.Devices[id] + if dev == nil { + return nil, errors.New("Unknown device.") + } + owner := "" + if p := m.People[dev.Person]; p != nil { + owner = p.Name + } + who = "for " + dev.Name + " (" + owner + ")" + default: + return nil, errors.New("Unknown scope.") + } + if d.ResetUsage == nil || !d.ResetUsage(scope, id) { + return nil, errors.New("The router is still starting. Try again in a moment.") + } + if d.Log != nil { + msg := "reset traffic history" + if scope == "limit" { + msg = "reset the data limit's usage" + } + d.Log.Admin("dawnline", msg, "", who, "") + } + return map[string]any{"ok": true}, nil +} + +// geoClear forgets the places found for addresses, in the live copy and on flash. +func geoClear(d Deps) map[string]any { + empty := map[string]any{"ips": map[string]any{}, "home": nil} + os.MkdirAll(d.RunDir, 0o755) + files.WriteJSON(d.RunDir+"/geo.json", empty, 0o600) + os.MkdirAll(d.DataDir, 0o700) + files.WriteJSON(d.DataDir+"/geo.json", empty, 0o600) + return map[string]any{"ok": true} +} + +// backupDelete removes a backup by its name. +func backupDelete(dir, name string) (map[string]any, error) { + if !backupFile.MatchString(name) { + return nil, errors.New("Invalid backup name.") + } + if !exists(dir + "/" + name) { + return nil, errors.New("Backup not found.") + } + os.Remove(dir + "/" + name) + return map[string]any{"ok": true}, nil +} diff --git a/backend/methods/device.go b/backend/methods/device.go new file mode 100644 index 0000000..93adbf6 --- /dev/null +++ b/backend/methods/device.go @@ -0,0 +1,846 @@ +package methods + +import ( + "crypto/ecdh" + crand "crypto/rand" + "encoding/base64" + "encoding/json" + "errors" + "os" + "regexp" + "strconv" + "strings" + "unicode/utf8" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// DeviceNameMax is the longest name a device takes, in characters. +const DeviceNameMax = 20 + +// Past ASCII, letters of any language are welcome in a device's name; these blocks are not: symbols, +// punctuation, arrows, maths, emoji and invisibles (both ends in). +var nameSymbols = [][2]rune{{0x80, 0xbf}, {0xd7, 0xd7}, {0xf7, 0xf7}, {0x2000, 0x2bff}, {0x3000, 0x303f}, {0xd800, 0xf8ff}, {0xfe00, 0xfe0f}, + {0xfe30, 0xfe4f}, {0xfeff, 0xfeff}, {0xfff0, 0xffff}, {0x1f000, 0x1fbff}, {0xe0000, 0xe007f}} + +// ValidDeviceName tells a device's name (trimmed by the caller): 1 to DeviceNameMax characters, not blank, +// each an ASCII letter, digit, space or one of - _ . or, past ASCII, none of nameSymbols. Broken UTF-8 is refused. +func ValidDeviceName(s string) bool { + if strings.Trim(s, blank) == "" || !utf8.ValidString(s) || utf8.RuneCountInString(s) > DeviceNameMax { + return false + } + for _, r := range s { + if r < 0x80 { + if !(r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z' || r >= '0' && r <= '9' || r == ' ' || r == '.' || r == '_' || r == '-') { + return false + } + continue + } + for _, b := range nameSymbols { + if r >= b[0] && r <= b[1] { + return false + } + } + } + return true +} + +var linkNumber = regexp.MustCompile(`^[0-9]{1,4}$`) + +// Actor is who changes a device (dawnline.devices opts): the admin, or the portal for one person. The +// portal is held to that person's own devices and their device limit, cannot touch a device the admin +// turned off, and may bring the device's public key from the browser. Defer: the page came through the +// device being set up again, so its new keys are loaded a moment after the answer is out. +type Actor struct { + By, Person string + PublicKey string + Defer bool +} + +var admin = Actor{By: "admin"} + +// own is the device an actor may touch, or why not. +func (who Actor) own(m *model.Model, id string) (*model.Device, error) { + dev := m.Devices[id] + if dev == nil || (who.Person != "" && dev.Person != who.Person) { + if who.Person != "" { + return nil, errors.New("Device not found.") + } + return nil, errors.New("Unknown device.") + } + if who.By == "portal" && dev.Disabled { + return nil, errors.New("The admin has turned this device off.") + } + return dev, nil +} + +// deviceUpdate renames a device, turns it off or on, or changes how it connects (its own MTU and +// keep-alive, "" the server's again; LAN Bypass): dawnline.devices update(), as the admin. +func deviceUpdate(d Deps, a map[string]any) (map[string]any, error) { + return DeviceUpdateAs(d, a, admin) +} + +// DeviceUpdateAs is deviceUpdate for an actor: only the admin turns devices off or sets the MTU and +// keep-alive; the portal may rename and switch LAN Bypass. +func DeviceUpdateAs(d Deps, a map[string]any, who Actor) (map[string]any, error) { + id := text(a["id"]) + name, renames := a["name"].(string) + _, switches := a["disabled"].(bool) + off := truthy(a["disabled"]) + if switches && who.By != "admin" { + return nil, errors.New("Only the admin can turn devices off.") + } + if (a["mtu"] != nil || a["keepalive"] != nil) && who.By != "admin" { + return nil, errors.New("Only the admin can change how a device connects.") + } + var was model.Device + var linked, said_ []string + fn := func(c *uci.Config, m *model.Model) error { + dev, err := who.own(m, id) + if err != nil { + return err + } + was = *dev + if renames && name != dev.Name { + name = strings.Trim(name, blank) + if !ValidDeviceName(name) { + return said{"Enter a device name: up to %d letters, digits, spaces and - _ .", []any{DeviceNameMax}} + } + if p := m.People[dev.Person]; p != nil { + for _, o := range p.Devices { + if o != id && lower(m.Devices[o].Name) == lower(name) { + return said{`"%s" already exists.`, []any{name}} + } + } + } + c.Set(id, "name", name) + } + if switches { + if off { + c.Set(id, "disabled", "1") + } else { + c.Delete(id, "disabled") + } + } + // its link values: only those given change, each told with what it became + put := func(k string, v, old *int, shown string) { + if (v == nil) == (old == nil) && (v == nil || *v == *old) { + return + } + if v == nil { + c.Delete(id, k) + } else { + c.Set(id, k, strconv.Itoa(*v)) + } + linked = append(linked, k) + said_ = append(said_, k+"="+shown) + } + number := func(v any, lo, hi int, msg string) (*int, string, error) { + s := trimmed(v) + if s == "" { + return nil, "auto", nil + } + n, _ := strconv.Atoi(s) + if !linkNumber.MatchString(s) || n < lo || n > hi { + return nil, "", errors.New(msg) + } + return &n, s, nil + } + if a["mtu"] != nil { + v, shown, err := number(a["mtu"], 1280, 1500, "MTU must be 1280-1500.") + if err != nil { + return err + } + var old *int + if dev.MTU != 0 { + old = &dev.MTU + } + put("mtu", v, old, shown) + } + if a["keepalive"] != nil { + v, shown, err := number(a["keepalive"], 0, 600, "Keep-alive must be 0-600 seconds.") + if err != nil { + return err + } + put("keepalive", v, dev.Keepalive, shown) + } + if on, given := a["lan_bypass"].(bool); given { + one := 1 + var v, old *int + shown := "off" + if on { + v, shown = &one, "on" + } + if dev.LanBypass { + old = &one + } + put("lan_bypass", v, old, shown) + } + return nil + } + var warning any + var err error + // a change of the link values alone is in the device's configuration: nothing on the router changes + if renames || switches { + warning, err = change(d, text(a["lang"]), fn) + } else { + err = write(d, fn) + } + if err != nil { + return nil, err + } + event := func(detail string) { + logged(d, journal.Event{"type": "device_changed", "person": was.Person, "device": id, "detail": detail, "by": who.By}) + } + if switches && off != was.Disabled { + if off { + event("turned off") + } else { + event("turned on") + } + } else if renames && a["name"] != was.Name { + event("renamed from " + was.Name) + } + if len(linked) > 0 { + event(strings.Join(said_, ", ")) + } + if d.Told != nil { + d.Told() + } + return map[string]any{"warning": warning}, nil +} + +// rerouted has everything put into effect after a change of the settings that moves routes (the networks +// behind a router): the home-like path keeps its own rules for them, which only the full apply brings up +// to date. The warning is that apply's. +func rerouted(d Deps, lang string) (warning any) { + if d.Apply != nil { + warning = d.Apply(lang)["warning"] + } + if d.Told != nil { + d.Told() + } + return warning +} + +// ownNets is the router's own networks, which none behind a device may share addresses with (nil where +// the router cannot be looked at). +func ownNets(d Deps, m *model.Model) []string { + if d.Snapshot == nil { + return nil + } + if snap := d.Snapshot(); snap != nil { + return snap.Own(m) + } + return nil +} + +// behindNets reads the networks behind a device as a page gives them (a list; blanks around each and +// empty entries dropped), each told from its first address, or says what is wrong with the first that +// will not do: no private network of a site's size, too many, two that share addresses, or one that +// something else has already (a tunnel, the router itself, another device). +// +// asking: the list is only asked of the admin, who answers with everything in view; then what another +// router has is not held against it here. The portal is never told whose a network is unless it is the +// person's own. +func behindNets(m *model.Model, device string, given any, own []string, who Actor, asking bool) ([]string, error) { + list, _ := given.([]any) + var nets []ipnet.Net + out := []string{} + for _, v := range list { + s := trimmed(v) + if s == "" { + continue + } + n, why := model.BehindNet(s) + switch why { + case "form": + return nil, said{"Network %s is not written like 192.168.2.0/24.", []any{s}} + case "wide": + return nil, said{"Network %s is too wide: /%d at the most.", []any{s, model.BehindWidest}} + case "public": + return nil, said{"Network %s is not private (10.x, 172.16-31.x, 192.168.x).", []any{s}} + } + // the same one written twice is one + twice := false + for _, o := range nets { + if o.Base == n.Base && o.Prefix == n.Prefix { + twice = true + } else if o.Overlaps(n) { + return nil, said{"Networks %s and %s share addresses.", []any{o.String(), n.String()}} + } + } + if twice { + continue + } + if c := m.BehindClash(n, device, own); c != nil { + switch { + case c.Server != "": + return nil, said{"Network %s is taken: %s is the tunnel network of %s. The two ends of a tunnel need different addresses.", []any{n.String(), c.Net, m.Servers[c.Server].Name}} + case c.Device == "": + return nil, said{"Network %s is taken: the router has %s itself. The two ends of a tunnel need different addresses.", []any{n.String(), c.Net}} + } + o := m.Devices[c.Device] + switch { + case who.Person != "" && o.Person == who.Person: + return nil, said{"Network %s is taken: %s is behind your %s. Two sites need different addresses.", []any{n.String(), c.Net, o.Name}} + case who.Person != "" && !asking: + return nil, said{"Network %s is taken on this server. Ask the admin which addresses are free.", []any{n.String()}} + case who.Person == "": + owner := o.Person + if p := m.People[o.Person]; p != nil { + owner = p.Name + } + return nil, said{"Network %s is taken: %s is behind %s (%s). Two sites need different addresses.", []any{n.String(), c.Net, o.Name, owner}} + } + } + nets = append(nets, n) + out = append(out, n.String()) + } + if len(out) > model.BehindMost { + return nil, said{"A router has %d networks behind it at the most.", []any{model.BehindMost}} + } + return out, nil +} + +func sameList(a, b []string) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true +} + +// deviceNetworks sets the networks behind a router, all of them at once (none: it is a device like any +// other again). The tunnel then carries them both ways: a host there has its owner's access, and whoever +// reaches the router reaches it. A list that is the one there changes nothing and applies nothing. +func deviceNetworks(d Deps, a map[string]any) (map[string]any, error) { + id := text(a["id"]) + var was model.Device + var nets []string + same := false + err := write(d, func(c *uci.Config, m *model.Model) error { + dev, err := admin.own(m, id) + if err != nil { + return err + } + was = *dev + if nets, err = behindNets(m, id, a["networks"], ownNets(d, m), admin, false); err != nil { + return err + } + if len(nets) > 0 && dev.Kind != "router" { + return errors.New("Only a router has networks behind it.") + } + if same = sameList(nets, dev.Behind); same { + return nil + } + setBehind(c, id, nets) + // what its owner asked for and now has is asked no more + if rest := without(dev.Ask, nets); len(rest) != len(dev.Ask) { + setList(c, id, "ask_net", rest) + if len(rest) == 0 && !dev.Waiting { + c.Delete(id, "asked") + } + } + return nil + }) + if err != nil { + return nil, err + } + if same { + return map[string]any{"networks": nets, "warning": nil}, nil + } + warning := rerouted(d, text(a["lang"])) + logged(d, journal.Event{"type": "device_changed", "person": was.Person, "device": id, "detail": "networks=" + behindSaid(nets), "by": admin.By}) + return map[string]any{"networks": nets, "warning": warning}, nil +} + +// setList writes a list option, or removes it when the list is empty. +func setList(c *uci.Config, id, option string, list []string) { + if len(list) == 0 { + c.Delete(id, option) + return + } + c.SetList(id, option, list) +} + +// setBehind writes a device's networks: the list, or no option at all when there are none. +func setBehind(c *uci.Config, id string, nets []string) { setList(c, id, "behind_net", nets) } + +// without is a list minus what another has, in its own order. +func without(list, drop []string) []string { + out := []string{} + for _, x := range list { + gone := false + for _, y := range drop { + gone = gone || x == y + } + if !gone { + out = append(out, x) + } + } + return out +} + +// behindSaid is a device's networks in a line of the activity log. +func behindSaid(nets []string) string { + if len(nets) == 0 { + return "none" + } + return strings.Join(nets, " ") +} + +// deviceDelete removes a device. The event carries its name and kind: the log reads well once it is gone. +func deviceDelete(d Deps, id, lang string) (map[string]any, error) { + return DeviceDeleteAs(d, id, lang, admin) +} + +// DeviceDeleteAs is deviceDelete for an actor. +func DeviceDeleteAs(d Deps, id, lang string, who Actor) (map[string]any, error) { + var was model.Device + warning, err := change(d, lang, func(c *uci.Config, m *model.Model) error { + dev, err := who.own(m, id) + if err != nil { + return err + } + was = *dev + c.DeleteSection(id) + return nil + }) + if err != nil { + return nil, err + } + logged(d, journal.Event{"type": "device_removed", "person": was.Person, "device": id, "detail": was.Name, "dname": was.Name, "dkind": was.Kind, "by": who.By}) + if d.Told != nil { + d.Told() + } + return map[string]any{"warning": warning}, nil +} + +// Keys is a device's new keys. +type Keys struct { + Private, Public, Preshared string +} + +// newKeys makes a device's keys as `awg genkey`, `awg pubkey` and `awg genpsk` do: a Curve25519 private +// key (32 random bytes, clamped), its public key, and 32 random bytes to share. A test puts its own in its place. +var newKeys = func() Keys { + priv := make([]byte, 32) + crand.Read(priv) + priv[0] &= 248 + priv[31] = priv[31]&127 | 64 + psk := make([]byte, 32) + crand.Read(psk) + k := Keys{Private: base64.StdEncoding.EncodeToString(priv), Preshared: base64.StdEncoding.EncodeToString(psk)} + if key, err := ecdh.X25519().NewPrivateKey(priv); err == nil { + k.Public = base64.StdEncoding.EncodeToString(key.PublicKey().Bytes()) + } + return k +} + +var deviceKinds = []string{"computer", "phone", "tablet", "router", "other"} + +// needAWG refuses, in the admin's words, while AmneziaWG is not on the router: no device's keys can be loaded. +func needAWG(d Deps) error { + if d.AWG == nil { + return nil + } + state := d.AWG() + if state["tools"] == true && state["kmod"] == true { + return nil + } + var miss []string + list, _ := state["missing"].([]any) + for _, x := range list { + miss = append(miss, text(x)) + } + if len(miss) > 0 { + return said{"AmneziaWG is not installed (%s): install it in Dawnline → Components.", []any{strings.Join(miss, ", ")}} + } + return errors.New("AmneziaWG is not installed: install it in Dawnline → Components.") +} + +// homeOf is the home networks a device's person reaches, for its configuration. +func homeOf(d Deps, m *model.Model, dev *model.Device) []string { + p := m.People[dev.Person] + if p == nil || d.Home == nil { + return nil + } + srv := m.Servers[p.Server] + if srv == nil { + return nil + } + return d.Home(srv, p) +} + +// markIssued remembers that a device was just given its current configuration, and when +// (dawnline.awg mark_issued): what it holds, as a fingerprint, in issued.json. +func markIssued(d Deps, m *model.Model, id string) { + dev := m.Devices[id] + if dev == nil || dev.Waiting { + return + } + fp := handout.Fingerprint(m, dev, homeOf(d, m, dev)) + if fp == "" { + return + } + defer files.Lock(d.RunDir, "issued")() + path := d.DataDir + "/issued.json" + var raw map[string]json.RawMessage + files.ReadJSON(path, &raw) + all := map[string]any{} + for k, v := range raw { + if m.Devices[k] == nil { + continue + } + // an entry from before moments were kept is the fingerprint alone + var old string + if json.Unmarshal(v, &old) == nil { + if old != "" { + all[k] = map[string]any{"fp": old, "ts": 0} + } + continue + } + all[k] = v + } + all[id] = map[string]any{"fp": fp, "ts": clock()} + os.MkdirAll(d.DataDir, 0o700) + files.WriteJSON(path, all, 0o600) +} + +// markReconnect remembers that a device is set up again: handshakes up to now are its old configuration's. +func markReconnect(d Deps, m *model.Model, id string, late int64) { + defer files.Lock(d.RunDir, "reconnect")() + path := d.DataDir + "/reconnect.json" + all := map[string]any{} + files.ReadJSON(path, &all) + all[id] = clock() + late + for k := range all { + if m.Devices[k] == nil { + delete(all, k) + } + } + os.MkdirAll(d.DataDir, 0o700) + files.WriteJSON(path, all, 0o600) +} + +// configOf is a device's configuration as a method answers it. +func configOf(d Deps, m *model.Model, id string) map[string]any { + dev := m.Devices[id] + // a router that waits for the admin's answer has none yet + if dev == nil || dev.Waiting { + return nil + } + cfg := handout.ClientConfig(m, dev, homeOf(d, m, dev)) + if cfg == nil { + return nil + } + raw, _ := json.Marshal(cfg) + var out map[string]any + json.Unmarshal(raw, &out) + return out +} + +// deviceCreate adds a device for a person with fresh keys: { id, config } (dawnline.devices add(), as the +// admin, who is not held to the person's device limit). +func deviceCreate(d Deps, a map[string]any) (map[string]any, error) { + return DeviceCreateAs(d, a, admin) +} + +// DeviceCreateAs is deviceCreate for an actor: the portal is held to the person's device limit, and may +// bring the device's public key (its private key then never leaves the browser). +func DeviceCreateAs(d Deps, a map[string]any, who Actor) (map[string]any, error) { + if err := needAWG(d); err != nil { + return nil, err + } + person, kind := text(a["person"]), text(a["kind"]) + name := trimmed(a["name"]) + bypass, _ := a["lan_bypass"].(bool) + id := "" + var nets []string + // waits: a router asked of the admin; asks: its networks are asked too, not its own yet + waits, asks := false, false + err := write(d, func(c *uci.Config, m *model.Model) error { + p := m.People[person] + if p == nil { + return errors.New("Unknown person.") + } + srv := m.Servers[p.Server] + if srv == nil { + return errors.New("The person has no server.") + } + if !ValidDeviceName(name) { + return said{"Enter a device name: up to %d letters, digits, spaces and - _ .", []any{DeviceNameMax}} + } + if who.By == "portal" && len(p.Devices) >= p.DeviceLimit { + return said{"Device limit reached (%d).", []any{p.DeviceLimit}} + } + known := false + for _, k := range deviceKinds { + known = known || k == kind + } + if !known { + kind = "other" + } + for _, o := range p.Devices { + if lower(m.Devices[o].Name) == lower(name) { + return said{`"%s" already exists.`, []any{name}} + } + } + // A router from someone's own page, by the server's rule: not taken there at all, asked of the admin + // (it waits: no device of the tunnel, no configuration), or added at once. Its networks likewise: + // asked with it, or its own from the start. + if kind == "router" && who.By == "portal" { + switch srv.PortalRouters { + case "off": + return errors.New("The admin adds routers on this server. Ask them for one.") + case "ask": + waits = true + } + asks = waits || srv.PortalNets == "ask" + } + if a["networks"] != nil { + var err error + if nets, err = behindNets(m, "", a["networks"], ownNets(d, m), who, asks); err != nil { + return err + } + if len(nets) > 0 && kind != "router" { + return errors.New("Only a router has networks behind it.") + } + } + addr := allocAddress(m, srv, func(q *model.Person) string { return q.Server }, func(x *model.Device) string { return x.Address }) + if addr == "" { + return errors.New("No free addresses left in the server subnet.") + } + k := newKeys() + if who.PublicKey != "" { + if !awg.ValidKey(who.PublicKey) { + return errors.New("Invalid public key.") + } + k.Public, k.Private = who.PublicKey, "" + } + if !awg.ValidKey(k.Public) { + return errors.New("Key generation failed (is amneziawg-tools installed?).") + } + for _, o := range m.Devices { + if o.PublicKey == k.Public { + return errors.New("This key is already in use.") + } + } + // a server's own key is in every configuration: the kernel would silently ignore such a peer + for _, s := range m.Servers { + if s.PublicKey == k.Public { + return errors.New("This key is already in use.") + } + } + id = "d_" + randHex(4) + c.Add("device", id) + c.Set(id, "person", person) + c.Set(id, "name", name) + c.Set(id, "kind", kind) + c.Set(id, "address", addr) + c.Set(id, "public_key", k.Public) + if k.Private != "" { + c.Set(id, "private_key", k.Private) + } + c.Set(id, "preshared_key", k.Preshared) + c.Set(id, "created", strconv.FormatInt(clock(), 10)) + c.Set(id, "created_by", who.By) + if bypass { + c.Set(id, "lan_bypass", "1") + } + if waits { + c.Set(id, "waiting", "1") + } + if asks { + setList(c, id, "ask_net", nets) + } else { + setBehind(c, id, nets) + } + if waits || (asks && len(nets) > 0) { + c.Set(id, "asked", strconv.FormatInt(clock(), 10)) + } + return nil + }) + if err != nil { + return nil, err + } + // With networks of its own the routes move: everything is applied. A router that waits changes + // nothing on the router. Else the sync loads the device. + var warning any + switch { + case len(nets) > 0 && !asks: + warning = rerouted(d, text(a["lang"])) + case waits: + if d.Told != nil { + d.Told() + } + default: + if d.Sync != nil { + warning = d.Sync(text(a["lang"])) + } + if d.Told != nil { + d.Told() + } + } + _, m, _ := d.Store.Read() + logged(d, journal.Event{"type": "device_added", "person": person, "device": id, "detail": name, "by": who.By}) + var detail []string + if waits { + detail = append(detail, "asked=router") + } + if len(nets) > 0 && asks { + detail = append(detail, "asked="+behindSaid(nets)) + } else if len(nets) > 0 { + detail = append(detail, "networks="+behindSaid(nets)) + } + if len(detail) > 0 { + logged(d, journal.Event{"type": "device_changed", "person": person, "device": id, "detail": strings.Join(detail, ", "), "by": who.By}) + } + if waits { + return map[string]any{"id": id, "config": nil, "waiting": true, "warning": warning}, nil + } + markIssued(d, m, id) + if d.Told != nil { + d.Told() + } + return map[string]any{"id": id, "config": configOf(d, m, id), "warning": warning}, nil +} + +// deviceRotate sets a device up from scratch (the admin's New keys): new keys, so the configuration it +// holds stops working with the sync, and it counts as not set up until it connects with the new one. Its +// kind and LAN Bypass change with the keys when given. It answers the new configuration. +func deviceRotate(d Deps, a map[string]any) (map[string]any, error) { + return DeviceRotateAs(d, a, admin) +} + +// DeviceRotateAs is deviceRotate for an actor. With who.Defer the new keys are loaded a moment after the +// answer: the device the page came through would lose its tunnel before the answer gets out. +func DeviceRotateAs(d Deps, a map[string]any, who Actor) (map[string]any, error) { + id := text(a["id"]) + kind := text(a["kind"]) + bypass, bypassGiven := a["lan_bypass"].(bool) + var changed []string + person := "" + // unrouted: the device was a router with networks behind it, which went with its kind + unrouted := false + put := func(fn func(c *uci.Config, m *model.Model) error) (any, error) { + if err := write(d, fn); err != nil { + return nil, err + } + if unrouted { + return rerouted(d, text(a["lang"])), nil + } + var warning any + if d.Sync != nil { + warning = d.Sync(text(a["lang"])) + } + if d.Told != nil { + d.Told() + } + return warning, nil + } + if who.Defer { + put = func(fn func(c *uci.Config, m *model.Model) error) (any, error) { + if err := write(d, fn); err != nil { + return nil, err + } + if d.Background != nil { + d.Background("sleep 3; /usr/bin/dawnline sync") + } + return nil, nil + } + } + warning, err := put(func(c *uci.Config, m *model.Model) error { + dev, err := who.own(m, id) + if err != nil { + return err + } + person = dev.Person + if dev.Waiting { + return errors.New("This router waits for an answer to its request: it has no configuration yet.") + } + if p := m.People[dev.Person]; who.By == "portal" && kind == "router" && dev.Kind != "router" && p != nil { + if srv := m.Servers[p.Server]; srv == nil || srv.PortalRouters != "free" { + return errors.New("Add the router as a new device: a device cannot be made one here.") + } + } + if kind != "" { + known := false + for _, k := range deviceKinds { + known = known || k == kind + } + if !known { + return errors.New("Unknown device type.") + } + if kind != dev.Kind { + c.Set(id, "kind", kind) + changed = append(changed, "kind="+kind) + // what is no router any more has nothing behind it, and asks for nothing + if len(dev.Behind) > 0 { + c.Delete(id, "behind_net") + changed = append(changed, "networks=none") + unrouted = true + } + for _, k := range []string{"ask_net", "asked", "declined", "declined_net"} { + c.Delete(id, k) + } + } + } + if bypassGiven && bypass != dev.LanBypass { + if bypass { + c.Set(id, "lan_bypass", "1") + changed = append(changed, "lan_bypass=on") + } else { + c.Delete(id, "lan_bypass") + changed = append(changed, "lan_bypass=off") + } + } + k := newKeys() + if !awg.ValidKey(k.Public) || k.Private == "" { + return errors.New("Key generation failed.") + } + c.Set(id, "private_key", k.Private) + c.Set(id, "public_key", k.Public) + if k.Preshared != "" { + c.Set(id, "preshared_key", k.Preshared) + } + return nil + }) + if err != nil { + return nil, err + } + if len(changed) > 0 { + logged(d, journal.Event{"type": "device_changed", "person": person, "device": id, "detail": strings.Join(changed, ", "), "by": who.By}) + } + _, m, _ := d.Store.Read() + logged(d, journal.Event{"type": "device_keys", "person": person, "device": id, "detail": m.Devices[id].Name, "by": who.By}) + markIssued(d, m, id) + // a deferred sync lets the old keys live a few seconds more + late := int64(0) + if who.Defer { + late = 5 + } + markReconnect(d, m, id, late) + if d.Told != nil { + d.Told() + } + cfg := configOf(d, m, id) + if cfg != nil && warning != nil && warning != "" { + cfg["warning"] = warning + } + if cfg == nil { + return map[string]any{"result": nil}, nil + } + return cfg, nil +} diff --git a/backend/methods/events.lock b/backend/methods/events.lock new file mode 100644 index 0000000..e69de29 diff --git a/backend/methods/health.go b/backend/methods/health.go new file mode 100644 index 0000000..4017ab7 --- /dev/null +++ b/backend/methods/health.go @@ -0,0 +1,360 @@ +package methods + +import ( + "fmt" + "os" + "os/exec" + "regexp" + "sort" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/health" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/roster" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +var ( + dfFree = regexp.MustCompile(`\n\S+\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s`) + markRule = regexp.MustCompile(`^(\d+):.*fwmark 0x([0-9a-f]+)(/0x[0-9a-f]+)?.* lookup (\S+)`) + defRoute = regexp.MustCompile(`(^|\n)default [^\n]*`) +) + +func run(name string, args ...string) (string, bool) { + out, err := exec.Command(name, args...).Output() + return string(out), err == nil +} + +// policyRouting is policy routing by another package (mwan3, pbr): an fwmark rule ahead of Dawnline's +// (pref < 5205) whose table has a default route of its own sends marked tunnel traffic straight out. +func policyRouting(rules string, table func(name string) string) []string { + out := []string{} + for _, line := range strings.Split(rules, "\n") { + m := markRule.FindStringSubmatch(line) + if m == nil { + continue + } + var pref int + fmt.Sscan(m[1], &pref) + if pref >= 5205 { + continue + } + def := defRoute.FindString(table(m[4])) + if def == "" || strings.Contains(def, "local default") || strings.Contains(def, "dev dlx0") { + continue + } + out = append(out, "pref "+m[1]+" fwmark 0x"+m[2]+" → table "+m[4]) + } + return out +} + +// tcpListening tells whether anything listens on a TCP port, by /proc/net/tcp and tcp6 (state 0A). +func tcpListening(port int, tables ...string) bool { + hex := fmt.Sprintf(":%04X ", port) + for _, t := range tables { + for _, line := range strings.Split(t, "\n") { + if strings.Index(line, hex) > 0 && strings.Contains(line, " 0A ") { + return true + } + } + } + return false +} + +// healthChecks gathers what Health's checks are made from and makes them. +func healthChecks(w *view.World, t *i18n.Catalog, d Deps) []health.Check { + m := w.M + in := health.Inputs{M: m, T: t, Needs: Needs(), Firewall: parseFile("/etc/config/firewall"), Network: parseFile("/etc/config/network")} + in.ModelErrors = func() []string { return health.ModelErrors(m, t) } + in.Unread = func(ifname string) bool { return w.Reads[ifname] == awg.Failed } + states := map[string]string{} + for id, p := range m.People { + states[id] = state.Of(m, p, w.Usage, w.Now) + } + in.Peers = func(srv *model.Server) health.Peers { + return health.PeerDiff(health.TunnelDevices(m, srv.ID, states), w.Peers, srv.Ifname) + } + // answers from our ports, and the proxies that would swallow them + diverts := health.ProxyDiverts(func(fam string) string { + out, _ := run("ip", fam, "rule", "show") + return out + }, func(fam, name string) string { + out, _ := run("ip", fam, "route", "show", "table", name) + return out + }) + rep := &health.Replies{Diverts: []string{}} + for _, x := range diverts { + rep.Diverts = append(rep.Diverts, x.String()) + } + if script := health.ReplyScript(m, diverts); script == "" { + rep.OK = true + } else { + kept, _ := os.ReadFile(d.RunDir + "/reply.nft") + _, loaded := run("nft", "list", "table", "inet", "dawnline_reply") + rep.OK = string(kept) == script && loaded + } + in.Replies = rep + // AmneziaWG, after loading an installed module that is not loaded yet + state := roster.AwgState(d.Handler) + if state["kmod"] == true && state["loaded"] == false { + exec.Command("modprobe", "amneziawg").Run() + state = roster.AwgState(d.Handler) + } + for _, p := range state["missing"].([]any) { + in.Missing = append(in.Missing, p.(string)) + } + in.Loaded, in.Handler = state["loaded"] == true, state["handler"] == true + rel, _ := os.ReadFile("/proc/sys/kernel/osrelease") + var rec struct { + OSRelease string `json:"osrelease"` + } + if files.ReadJSON(d.DataDir+"/awg.json", &rec); rec.OSRelease != "" && rec.OSRelease != strings.TrimSpace(string(rel)) { + in.KernelWas, in.KernelIs = rec.OSRelease, strings.TrimSpace(string(rel)) + } + if len(in.Missing) == 0 && !in.Loaded { + out, _ := exec.Command("sh", "-c", "modprobe amneziawg 2>&1; dmesg | grep -i amneziawg | tail -n 3").Output() + in.WhyNotLoaded = strings.Trim(string(out), " \t\r\n\v\f") + } + in.WaitsForReboot = awg.SystemCaps(d.DataDir).Pending + in.Year = time.Unix(w.Now, 0).In(zone.Local()).Year() + // what counts traffic and enforces end dates and limits is this backend: it answers, so it runs + in.AgentRunning = true + df, ok := run("df", "-Pk", "/overlay") + if !ok { + df, _ = run("df", "-Pk", "/") + } + if f := dfFree.FindStringSubmatch(df); f != nil { + var kb int64 + fmt.Sscan(f[1], &kb) + in.FreeKB = &kb + } + _, in.NftLoaded = run("nft", "list", "table", "inet", "dawnline") + rules, _ := run("ip", "-4", "rule", "show") + in.PolicyRouting = policyRouting(rules, func(name string) string { + out, _ := run("ip", "-4", "route", "show", "table", name) + return out + }) + in.Iface = func(ifname string) health.Iface { + st := map[string]any(nil) + if d.Bus != nil { + st = d.Bus("network.interface."+ifname, "status", nil) + } + if st == nil { + return health.Iface{} + } + f := health.Iface{Exists: true, Up: st["up"] == true} + errs, _ := st["errors"].([]any) + for _, e := range errs { + if em, ok := e.(map[string]any); ok { + f.Errors = append(f.Errors, text(em["code"])) + } + } + return f + } + if d.Addresses != nil { + for _, a := range d.Addresses() { + in.Subnets = append(in.Subnets, health.Subnet{Iface: a.Iface, CIDR: a.CIDR}) + } + } + snap := d.Snapshot() + // the networks behind people's routers: which are in effect here, and what the last sync said of their routes + in.Behind, in.Own = snap.Behind(m), snap.Own(m) + if said, err := os.ReadFile(d.RunDir + "/routes.err"); err == nil { + in.RouteError = strings.TrimSpace(string(said)) + } + in.HomeNets = func(srv *model.Server) []string { + _, _, nets, _ := snap.ServerNet(srv) + return nets + } + in.Endpoint = func(srv *model.Server, host string) endpoint.Reads { return endpointReads(d, srv, host) } + in.LikeHome, _ = roster.LikeHome(d.RunDir) + if st, err := os.Stat("/var/etc/dawnline-dns.conf"); err == nil { + age := time.Now().Unix() - st.ModTime().Unix() + in.ResolverConfAge = &age + pid, _ := os.ReadFile("/var/run/dawnline-dns.pid") + p := strings.TrimSpace(string(pid)) + in.ResolverRunning = p != "" && strings.Trim(p, "0123456789") == "" && exists("/proc/"+p) + } + in.Portal = func() health.Portal { + s := m.Settings + p := health.Portal{} + for _, h := range listening("tcp") { + if h.port == s.PortalPort { + p.Owners = append(p.Owners, h.name) + } + } + tcp, _ := os.ReadFile("/proc/net/tcp") + tcp6, _ := os.ReadFile("/proc/net/tcp6") + p.Listening = tcpListening(s.PortalPort, string(tcp), string(tcp6)) + if s.PortalHost != "" && d.Resolve != nil { + p.IPs = d.Resolve(s.PortalHost) + } + if d.RouterWAN != nil { + p.WAN = d.RouterWAN(m) + } + p.Cert, p.SelfSigned = PortalCert(s, d.DataDir) + if c := certOf(p.Cert); c != nil { + p.Valid = c.NotAfter.After(time.Now().Add(14 * 24 * time.Hour)) + if !p.SelfSigned { + p.Names = c.DNSNames + } + } + return p + } + return health.Run(in) +} + +// acmeCert is an ACME certificate on the router and the names it covers. +type acmeCert struct { + names []string +} + +func acmeCerts() []acmeCert { + var out []acmeCert + entries, _ := os.ReadDir("/etc/ssl/acme") + for _, e := range entries { + base, is := strings.CutSuffix(e.Name(), ".fullchain.crt") + if !is || base == "" || !exists("/etc/ssl/acme/"+base+".key") { + continue + } + c := acmeCert{} + if x := certOf("/etc/ssl/acme/" + e.Name()); x != nil { + c.names = x.DNSNames + } + out = append(out, c) + } + return out +} + +// portalCandidates is the addresses the portal could use in links, found on the router: names in ACME +// certificates, server endpoints, DDNS names, the current ones, and the WAN IP; each with where it points +// and whether a certificate covers it, the best first (dawnline.portalcert portal_candidates). +func portalCandidates(m *model.Model, d Deps) []map[string]any { + wan := "" + if d.RouterWAN != nil { + wan = d.RouterWAN(m) + } + var names []string + add := func(h string) { + if _, ip := ipnet.IP(h); h == "" || ip || !endpoint.ValidHost(h) || strings.HasPrefix(h, "*.") { + return + } + for _, n := range names { + if n == h { + return + } + } + names = append(names, h) + } + certs := acmeCerts() + for _, c := range certs { + for _, n := range c.names { + add(n) + } + } + for _, id := range m.ServerIDs() { + add(m.Servers[id].Endpoint) + } + if ddns := parseFile("/etc/config/ddns"); ddns != nil { + for _, s := range ddns.OfType("service") { + if on, _ := s.Get("enabled"); on != "0" { + h, _ := s.Get("lookup_host") + add(h) + h, _ = s.Get("domain") + add(h) + } + } + } + hosts := view.PortalHosts(m) + for _, h := range hosts { + add(h) + } + type cand struct { + m map[string]any + score int + } + var list []cand + put := func(host, kind string, ips []string, here, cf, cert bool) { + score := 0 + if here { + score += 4 + } + if cert { + score += 2 + } + if kind == "name" { + score++ + } + if cf { + score -= 8 + } + list = append(list, cand{map[string]any{"host": host, "kind": kind, "ips": ips, "here": here, "cloudflare": cf, "cert": cert}, score}) + } + // every name asked at once: each lookup may wait two seconds + found := make([][]string, len(names)) + done := make(chan int) + for i, h := range names { + go func() { + if d.Resolve != nil { + found[i] = d.Resolve(h) + } + done <- i + }() + } + for range names { + <-done + } + for i, h := range names { + ips := found[i] + if ips == nil { + ips = []string{} + } + here, cf, covered := false, false, false + for _, ip := range ips { + here = here || (wan != "" && ip == wan) + cf = cf || endpoint.Cloudflare(ip) + } + for _, c := range certs { + for _, n := range c.names { + covered = covered || endpoint.Covers(n, h) + } + } + put(h, "name", ips, here, cf, covered) + } + if wan != "" { + put(wan, "ip", []string{wan}, true, false, false) + } + for _, h := range hosts { + if _, ip := ipnet.IP(h); ip && h != wan { + put(h, "ip", []string{h}, false, false, false) + } + } + // best first: here with a certificate, then here, then the rest + sort.SliceStable(list, func(i, j int) bool { return list[i].score > list[j].score }) + out := []map[string]any{} + for _, c := range list { + out = append(out, c.m) + } + return out +} + +// portalInfo is the slow part of the portal's settings (DNS lookups and Health's checks of the portal), +// fetched after the page shows. +func portalInfo(w *view.World, t *i18n.Catalog, d Deps) map[string]any { + checks := []health.Check{} + for _, c := range healthChecks(w, t, d) { + switch c.ID { + case "portal", "portal_dns", "portal_reply", "portal_http", "cert": + checks = append(checks, c) + } + } + return map[string]any{"candidates": portalCandidates(w.M, d), "checks": checks} +} diff --git a/backend/methods/home.go b/backend/methods/home.go new file mode 100644 index 0000000..0fa17a2 --- /dev/null +++ b/backend/methods/home.go @@ -0,0 +1,147 @@ +package methods + +import ( + "errors" + "os" + "sort" + "strings" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// homeHosts is the devices at home for the Home services picker: DHCP leases and static hosts in a +// server's home networks, with the services they announce (Bonjour, when umdns runs). A server not named +// is the first one. Each device's services are in the order of their type, then their name. +func homeHosts(w *view.World, d Deps, id, leases, dhcp string) (map[string]any, error) { + srv := w.M.Servers[id] + if ids := w.M.ServerIDs(); srv == nil && len(ids) > 0 { + srv = w.M.Servers[ids[0]] + } + if srv == nil || d.Snapshot == nil { + return nil, errors.New("No server yet.") + } + _, _, cidrs, _ := d.Snapshot().ServerNet(srv) + var nets []ipnet.Net + for _, c := range cidrs { + if n, ok := ipnet.Any(c); ok && strings.Contains(c, "/") { + nets = append(nets, n) + } + } + inside := func(ip string) bool { + n, ok := ipnet.IP(ip) + if !ok { + return false + } + for _, r := range nets { + if r.Holds(n) { + return true + } + } + return false + } + type host struct { + Address string `json:"address"` + Name string `json:"name"` + MAC string `json:"mac"` + Services []map[string]any `json:"services"` + } + hosts := map[string]*host{} + raw, _ := os.ReadFile(leases) + for _, line := range strings.Split(string(raw), "\n") { + if f := strings.Split(line, " "); len(f) >= 4 && inside(f[2]) { + name := f[3] + if name == "*" { + name = "" + } + hosts[f[2]] = &host{Address: f[2], Name: name, MAC: f[1], Services: []map[string]any{}} + } + } + if c := parseFile(dhcp); c != nil { + for _, h := range c.OfType("host") { + ip, _ := h.Get("ip") + if ip == "" || !inside(ip) || hosts[ip] != nil { + continue + } + name, _ := h.Get("name") + mac := h.Values["mac"] + if mac.IsList && len(mac.List) > 0 { + mac.Str = mac.List[0] + } + hosts[ip] = &host{Address: ip, Name: name, MAC: mac.Str, Services: []map[string]any{}} + } + } + // what is announced on the home networks, from OpenWrt's mDNS daemon while it answers + var browse map[string]any + if d.Bus != nil { + browse = d.Bus("umdns", "browse", map[string]any{"address": true, "array": true}) + } + types := make([]string, 0, len(browse)) + for t := range browse { + types = append(types, t) + } + sort.Strings(types) + for _, t := range types { + insts, _ := browse[t].(map[string]any) + names := make([]string, 0, len(insts)) + for n := range insts { + names = append(names, n) + } + sort.Strings(names) + for _, name := range names { + i, _ := insts[name].(map[string]any) + addr := text(i["ipv4"]) + if list, ok := i["ipv4"].([]any); ok && len(list) > 0 { + addr = text(list[0]) + } + if addr == "" { + continue + } + port := i["port"] + if port == nil { + port = 0 + } + svc := map[string]any{"type": t, "name": name, "port": port} + if h := hosts[addr]; h != nil { + h.Services = append(h.Services, svc) + } else if inside(addr) { + hn := strings.TrimSuffix(strings.TrimSuffix(text(i["host"]), "."), ".local") + hosts[addr] = &host{Address: addr, Name: hn, Services: []map[string]any{svc}} + } + } + } + list := make([]*host, 0, len(hosts)) + for _, h := range hosts { + list = append(list, h) + } + sort.Slice(list, func(i, j int) bool { + a, _ := ipnet.IP(list[i].Address) + b, _ := ipnet.IP(list[j].Address) + return a < b + }) + return map[string]any{"hosts": list, "mdns": browse != nil}, nil +} + +// export is every section of the settings as written, for the admin to keep (it holds private keys). +func export(d Deps) (map[string]any, error) { + sections := []map[string]any{} + if c := parseFile(d.Config); c != nil { + for _, s := range c.Sections { + o := map[string]any{".type": s.Type, ".name": s.Name} + for k, v := range s.Values { + if v.IsList { + o[k] = v.List + } else { + o[k] = v.Str + } + } + sections = append(sections, o) + } + } + if d.Log != nil { + d.Log.Admin("dawnline", "exported", "", "all settings", "the file holds private keys") + } + return map[string]any{"format": "dawnline", "version": backend.Version, "exported": time.Now().Unix(), "sections": sections}, nil +} diff --git a/backend/methods/issued.lock b/backend/methods/issued.lock new file mode 100644 index 0000000..e69de29 diff --git a/backend/methods/methods.go b/backend/methods/methods.go new file mode 100644 index 0000000..35377e7 --- /dev/null +++ b/backend/methods/methods.go @@ -0,0 +1,855 @@ +// Package methods is the admin's questions the Go backend answers itself: methods of the ubus object +// `dawnline` that were luci.dawnline's (dawnline.rpc.*), with the same arguments and the same answers, a +// failure as { error } in the page's language. hello names them, and a page asks them here instead. +// +// events { limit, person, device, since } the newest of the activity log +// person_usage { id, days } a person's days of traffic, and each of their devices' +// person_links { id } the personal code and links (admins only: the access list) +// device_config { id } a device's configuration, to show (admins only) +// service_log the watchdog's state and the newest of the service log +// backup_list the backups kept on the router +// backup_read { name } one of them, in base64 (admins only: it holds keys) +// settings_get the Settings page's data +// server_ports { id } the ports and networks a server must avoid +// interfaces { id } a server's interfaces: what exists, what is detected, what it uses +// updates_status the Components tab's data +// setup_defaults what a new server starts from +// health Health's checks, the watchdog's state and the service log +// home_hosts { id } the devices at home, for the Home services picker +// export every section of the settings (admins only: it holds keys) +// access_check { from, to } where a connection between two sides stops, in words (admins only) +// +// and the first that change something, none of them the settings or the tunnels (admins only): +// +// logs_clear { person, device, category, older_days } remove activity; nothing given clears it all +// service_log_clear { older_days } remove the service log's entries +// usage_clear { scope, id } forget traffic history: all | person | device | limit +// geo_clear forget the places found for addresses +// backup_delete { name } remove a backup +// +// and those that change the settings (package store), each put into effect by the ucode backend's sync +// until apply is ported: +// +// service_set { id, name, address, ports } add or change a home service +// service_delete { id } remove one, and take it from everyone who had it +// circle_set { id, server, name, color, members } add or change a circle; members replaces who is in it +// circle_delete { id } remove one, and take everyone out of it +// person_pause { id, paused } pause a person, or let them on again +// person_delete { id } remove a person and their devices +// person_update { id, …fields } an immediate edit from a person's page +// people_update { list } several people at once, all or nothing +// person_create { name, slug, server, access, device_limit, expires, quota_gb, quota_period } +// person_regen { id, remove } a new personal link, the old one's devices taken away when asked +// device_update { id, name, disabled, mtu, keepalive, lan_bypass } rename, turn off or on, how it connects +// device_delete { id } remove a device +// device_create { person, name, kind, lan_bypass, networks } a new device with keys made here: its id and configuration +// device_networks { id, networks } the networks behind a router, all at once; applied in full +// device_answer { id, answer, reason, router, networks } what a router's owner asked for: accept, decline, reopen +// device_rotate { id, kind, lan_bypass } new keys: the device is set up again, its new configuration +// settings_update { values } save settings, "" back to the default; the portal checked as it will be +// server_update { id, values } a server's settings, applied at once (ucode's full apply for now) +// server_interfaces { id, auto_wan, wan_device, auto_lan, lan_devices, lan_like, device_mesh, mesh } +// server_delete { id } a server with its people, their devices and its circles; a backup first +// server_obfuscation { id, preset } a new disguise for a server: off, balanced or max +// health_fix { id } run a fix a check named, and Health again +// updates_run { what } start an update job (the updater works in the background) +// apply put everything into effect (ucode's full apply for now) +// server_create { id, name, ifname, port, subnet, endpoint, mtu, preset, lan_zone, wan_zone, lan_like, +// portal_enabled, portal_port } set a server up, with keys made here +// backup_create a backup now: its name +// backup_restore { name } bring a kept backup back (checked first, a backup made before) +// backup_upload { data } the same for a backup the admin sends, in base64 +// import { data } replace the settings with an export +// +// portal_info the addresses the portal could use and Health's checks of it +// endpoint_probe { host, id, port } where a public address points, as the admin types it +// updates_releases { page } Dawnline's releases, five a page +// updates_notes { component, tag, build } a release's notes +// updates_changes { from, to } what changed between the installed version and a release +package methods + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "os" + "os/exec" + "regexp" + "sort" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/access" + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/roster" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/store" + + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ubus" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// Deps is what the methods read. +type Deps struct { + // World is the settings, the counters and the tunnels as the watcher last saw them (nil before its first look). + World func() *view.World + // Events is the whole activity log, the oldest first, home names with the connections that have them. + Events func() []map[string]any + // Catalogs is where the translations are (i18n.Dir). + Catalogs string + // Home is the home networks a person reaches on their server; HostIP, where a name points ("" nowhere). + Home func(srv *model.Server, p *model.Person) []string + HostIP func(host string) string + // RunDir and DataDir are the state's (/var/run/dawnline, /etc/dawnline); Config the settings file. + RunDir, DataDir, Config string + // Addresses is every IPv4 address of netifd's interfaces. + Addresses func() []Address + // Snapshot is a fresh look at the router's interfaces. + Snapshot func() *netview.Snapshot + // Board is `ubus call system board`'s answer. + Board func() map[string]any + // Handler tells whether netifd lists the amneziawg protocol. + Handler func() bool + // GitHub asks GitHub (nil: the methods that need it are not offered). + GitHub *github.Client + // Resolve is a name's addresses; WANOf the WAN's IPv4 for a server (nil: the default WAN), "" when none. + Resolve func(host string) []string + WANOf func(srv *model.Server) string + // Bus asks another ubus object (nil answer: it did not answer); RouterWAN is the router's WAN address. + Bus func(object, method string, args map[string]any) map[string]any + RouterWAN func(m *model.Model) string + // Log writes the service log (nil: nothing is written). + Log *servicelog.Log + // ResetUsage forgets traffic history in the watcher's counters (false: it has not looked yet). + ResetUsage func(scope, id string) bool + // Store changes the settings; Sync puts them into effect and returns a warning for the admin (nil: none). + Store *store.Store + Sync func(lang string) any + // Told has the pages told of a change at once: the settings read anew and the topics put again. + Told func() + // AWG is what of AmneziaWG is on the router (nil: not asked). + AWG func() map[string]any + // Reload has the service take new portal settings (its own restart among them): after the answer is out. + Reload func() + // Apply has the ucode backend put everything into effect (its full apply) and returns what that came to. + Apply func(lang string) map[string]any + // Caps is what the installed AmneziaWG can do (nil: read on the router). + Caps func() awg.Caps + // Restart turns the service on and restarts it after a server is made (the network first when netifd + // does not know AmneziaWG yet), in the background: this very process restarts with it. + Restart func(network bool) + // Background runs a shell script detached, after the answer is out; Ifup brings a netifd interface up; + // Updater starts the updater with these arguments, speaking a language ("" English). + Background func(script string) + Ifup func(name string) + Updater func(lang string, args []string) + // SyncPlan is what Go's own sync would load, with nothing loaded (nil: not there). + SyncPlan func() any + // Teardown removes everything Dawnline made on the router, from the settings as they were (nil: not there); + // Stop then stops the service and keeps it from starting, once the answer is out. + Teardown func(m *model.Model) + Stop func() + // ApplyPlan is what Go's own full apply would change, with nothing changed (nil: not there). + ApplyPlan func() any +} + +// num is a number as the bus hands it over. +func num(v any) float64 { + switch n := v.(type) { + case int: + return float64(n) + case int32: + return float64(n) + case int64: + return float64(n) + case uint32: + return float64(n) + case uint64: + return float64(n) + case float64: + return n + } + return 0 +} + +func text(v any) string { + s, _ := v.(string) + return s +} + +// days is how much history a caller may ask for: 1 to 400, 30 when not said. +func days(v any) int { + n := num(v) + if v == nil || n < 1 { + return 30 + } + if n > 400 { + return 400 + } + return int(n) +} + +// a method's own work: its answer, or the failure to tell the page (said in English, translated by wrap) +type call func(w *view.World, args map[string]any) (map[string]any, error) + +// unworded puts an error that has no sentence for a person into the system log: the page is told it went wrong. +func (d Deps) unworded(line string) { + if d.Log != nil { + d.Log.Say("error", "dawnline", line) + } +} + +// said is a failure whose sentence has values: translated first, filled after. +type said struct { + msg string + args []any +} + +func (s said) Error() string { return fmt.Sprintf(s.msg, s.args...) } + +// List is the methods, to add to the object. +func List(d Deps) []ubus.Method { + wrap := func(fn call) ubus.Handler { + return func(_ context.Context, args map[string]any) (map[string]any, error) { + t := i18n.Use(d.Catalogs, text(args["lang"])) + w := d.World() + if w == nil { + return map[string]any{"error": t.T("The router is still starting. Try again in a moment.")}, nil + } + res, err := fn(w, args) + if s, refused := err.(access.Said); refused { + return map[string]any{"error": fmt.Sprintf(t.T(s.Msg), s.Args...)}, nil + } + if f, isGitHub := err.(github.Failure); isGitHub { + return map[string]any{"error": fmt.Sprintf(t.T(f.Msg), f.Args...)}, nil + } + if s, filled := err.(said); filled { + return map[string]any{"error": fmt.Sprintf(t.T(s.msg), s.args...)}, nil + } + if err != nil { + return map[string]any{"error": wordsOf(t, err, d.unworded)}, nil + } + return res, nil + } + } + // the same, for an answer that has words of its own in the page's language + worded := func(fn func(w *view.World, t *i18n.Catalog) map[string]any) ubus.Handler { + return func(_ context.Context, args map[string]any) (map[string]any, error) { + t := i18n.Use(d.Catalogs, text(args["lang"])) + w := d.World() + if w == nil { + return map[string]any{"error": t.T("The router is still starting. Try again in a moment.")}, nil + } + return fn(w, t), nil + } + } + list := []ubus.Method{} + if d.GitHub != nil { + list = append(list, + ubus.Method{Name: "updates_releases", Params: map[string]ubus.Kind{"page": ubus.Int, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return releases(d.GitHub, a["page"]) })}, + ubus.Method{Name: "updates_notes", Params: map[string]ubus.Kind{"component": ubus.String, "tag": ubus.String, "build": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return notes(d.GitHub, text(a["component"]), text(a["tag"]), text(a["build"])) + })}, + ubus.Method{Name: "updates_changes", Params: map[string]ubus.Kind{"from": ubus.String, "to": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return changes(d.GitHub, text(a["from"]), text(a["to"])) + })}, + ) + } + return append(list, []ubus.Method{ + {Name: "device_config", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return deviceConfig(w, d, text(a["id"])) + })}, + {Name: "service_log", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { return serviceLog(w, t, d.RunDir, d.DataDir) })}, + {Name: "settings_get", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { return settingsGet(w, t, d) })}, + {Name: "server_ports", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: func(_ context.Context, a map[string]any) (map[string]any, error) { + return worded(func(w *view.World, t *i18n.Catalog) map[string]any { return serverPorts(w, t, d, text(a["id"])) })(nil, a) + }}, + {Name: "interfaces", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { return interfaces(w, d, text(a["id"])) })}, + {Name: "updates_status", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { return updatesStatus(w, t, d) })}, + {Name: "setup_defaults", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { return setupDefaults(w, t, d) })}, + {Name: "endpoint_probe", Params: map[string]ubus.Kind{"host": ubus.String, "id": ubus.String, "port": ubus.Int, "lang": ubus.String}, + Handle: func(_ context.Context, a map[string]any) (map[string]any, error) { + return worded(func(w *view.World, t *i18n.Catalog) map[string]any { return endpointProbe(w, t, d, a) })(nil, a) + }}, + {Name: "home_hosts", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return homeHosts(w, d, text(a["id"]), "/tmp/dhcp.leases", "/etc/config/dhcp") + })}, + {Name: "export", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: wrap(func(*view.World, map[string]any) (map[string]any, error) { return export(d) })}, + {Name: "access_check", Params: map[string]ubus.Kind{"from": ubus.String, "to": ubus.String, "lang": ubus.String}, + Handle: func(_ context.Context, a map[string]any) (map[string]any, error) { + return wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return accessCheck(w, i18n.Use(d.Catalogs, text(a["lang"])), d, text(a["from"]), text(a["to"])) + })(nil, a) + }}, + {Name: "logs_clear", Params: map[string]ubus.Kind{"person": ubus.String, "device": ubus.String, "category": ubus.String, "older_days": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return logsClear(w, d, text(a["person"]), text(a["device"]), text(a["category"]), text(a["older_days"])) + })}, + {Name: "service_log_clear", Params: map[string]ubus.Kind{"older_days": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return serviceLogClear(d, text(a["older_days"])), nil + })}, + {Name: "usage_clear", Params: map[string]ubus.Kind{"scope": ubus.String, "id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return usageClear(w, d, text(a["scope"]), text(a["id"])) + })}, + {Name: "geo_clear", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: wrap(func(*view.World, map[string]any) (map[string]any, error) { return geoClear(d), nil })}, + {Name: "backup_delete", Params: map[string]ubus.Kind{"name": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return backupDelete(d.DataDir+"/backups", text(a["name"])) + })}, + {Name: "service_set", Params: map[string]ubus.Kind{"id": ubus.String, "name": ubus.String, "address": ubus.String, "ports": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return serviceSet(d, a) })}, + {Name: "service_delete", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return serviceDelete(d, text(a["id"]), text(a["lang"])) + })}, + {Name: "circle_set", Params: map[string]ubus.Kind{"id": ubus.String, "server": ubus.String, "name": ubus.String, "color": ubus.Int, "members": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return circleSet(d, a) })}, + {Name: "circle_delete", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return circleDelete(d, text(a["id"]), text(a["lang"])) + })}, + {Name: "person_pause", Params: map[string]ubus.Kind{"id": ubus.String, "paused": ubus.Bool, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return personPause(d, text(a["id"]), truthy(a["paused"]), text(a["lang"])) + })}, + {Name: "person_delete", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return personDelete(d, text(a["id"]), text(a["lang"])) + })}, + {Name: "person_update", Params: map[string]ubus.Kind{"id": ubus.String, "name": ubus.String, "access": ubus.String, "device_limit": ubus.String, "expires": ubus.String, + "quota_gb": ubus.String, "quota_period": ubus.String, "bonus_gb": ubus.String, "note": ubus.String, "dns_mode": ubus.String, "paused": ubus.Bool, + "services": ubus.Array, "circle": ubus.String, "home_nets": ubus.Array, "server": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return personUpdate(d, a) })}, + {Name: "people_update", Params: map[string]ubus.Kind{"list": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return peopleUpdate(d, a) })}, + {Name: "person_create", Params: map[string]ubus.Kind{"name": ubus.String, "slug": ubus.String, "server": ubus.String, "access": ubus.String, "device_limit": ubus.String, + "expires": ubus.String, "quota_gb": ubus.String, "quota_period": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return personCreate(d, a) })}, + {Name: "person_regen", Params: map[string]ubus.Kind{"id": ubus.String, "remove": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return personRegen(d, a) })}, + {Name: "device_update", Params: map[string]ubus.Kind{"id": ubus.String, "name": ubus.String, "disabled": ubus.Bool, "mtu": ubus.String, "keepalive": ubus.String, + "lan_bypass": ubus.Bool, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return deviceUpdate(d, a) })}, + {Name: "device_delete", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return deviceDelete(d, text(a["id"]), text(a["lang"])) + })}, + {Name: "device_create", Params: map[string]ubus.Kind{"person": ubus.String, "name": ubus.String, "kind": ubus.String, "lan_bypass": ubus.Bool, + "networks": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return deviceCreate(d, a) })}, + {Name: "device_networks", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "networks": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return deviceNetworks(d, a) })}, + {Name: "device_answer", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "answer": ubus.String, "reason": ubus.String, "router": ubus.Bool, + "networks": ubus.Array, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return deviceAnswer(d, a) })}, + {Name: "device_rotate", Params: map[string]ubus.Kind{"id": ubus.String, "kind": ubus.String, "lan_bypass": ubus.Bool, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return deviceRotate(d, a) })}, + {Name: "settings_update", Params: map[string]ubus.Kind{"values": ubus.Table, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return settingsUpdate(d, a) })}, + {Name: "server_update", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "values": ubus.Table, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return serverUpdate(d, a) })}, + {Name: "server_interfaces", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "auto_wan": ubus.Bool, "wan_device": ubus.String, "auto_lan": ubus.Bool, + "lan_devices": ubus.Array, "lan_like": ubus.Bool, "device_mesh": ubus.Bool, "mesh": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return serverInterfaces(d, a) })}, + {Name: "server_delete", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return serverDelete(d, text(a["id"]), text(a["lang"])) + })}, + {Name: "backup_create", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: wrap(func(*view.World, map[string]any) (map[string]any, error) { + name, err := backupCreate(d, "") + if err != nil { + return nil, err + } + return map[string]any{"name": name}, nil + })}, + {Name: "server_obfuscation", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "preset": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return serverObfuscation(d, text(a["id"]), asString(a["preset"]), text(a["lang"])) + })}, + {Name: "server_create", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "name": ubus.String, "ifname": ubus.String, "port": ubus.Int, "subnet": ubus.String, + "endpoint": ubus.String, "mtu": ubus.Int, "preset": ubus.String, "lan_zone": ubus.String, "wan_zone": ubus.String, "lan_like": ubus.Bool, + "portal_enabled": ubus.Bool, "portal_port": ubus.Int, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { return serverCreate(d, a) })}, + {Name: "health_fix", Waits: true, Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: func(_ context.Context, a map[string]any) (map[string]any, error) { + return wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return healthFix(w, i18n.Use(d.Catalogs, text(a["lang"])), d, text(a["id"]), text(a["lang"])) + })(nil, a) + }}, + {Name: "updates_run", Params: map[string]ubus.Kind{"what": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return updatesRun(d, text(a["what"]), text(a["lang"])) + })}, + {Name: "apply", Waits: true, Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + out := map[string]any{} + if d.Apply != nil { + out = d.Apply(text(a["lang"])) + } + if d.Told != nil { + d.Told() + } + return out, nil + })}, + {Name: "uninstall", Waits: true, Params: map[string]ubus.Kind{"confirm": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return uninstall(d, text(a["confirm"])) + })}, + {Name: "backup_restore", Waits: true, Params: map[string]ubus.Kind{"name": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return backupRestore(d, text(a["name"]), text(a["lang"])) + })}, + {Name: "backup_upload", Waits: true, Params: map[string]ubus.Kind{"data": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return backupUpload(d, text(a["data"]), text(a["lang"])) + })}, + {Name: "import", Waits: true, Params: map[string]ubus.Kind{"data": ubus.Table, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return importAll(d, a["data"], text(a["lang"])) + })}, + // What Go's sync would load: for root on the router, to hold it to what runs there. No access list names it. + {Name: "sync_plan", Handle: func(context.Context, map[string]any) (map[string]any, error) { + if d.SyncPlan == nil { + return map[string]any{}, nil + } + raw, _ := json.Marshal(d.SyncPlan()) + var out map[string]any + json.Unmarshal(raw, &out) + return out, nil + }}, + // What Go's full apply would do: for root on the router, likewise. + {Name: "apply_plan", Waits: true, Handle: func(context.Context, map[string]any) (map[string]any, error) { + if d.ApplyPlan == nil { + return map[string]any{}, nil + } + raw, _ := json.Marshal(d.ApplyPlan()) + var out map[string]any + json.Unmarshal(raw, &out) + return out, nil + }}, + {Name: "portal_info", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { return portalInfo(w, t, d) })}, + // Health: the checks, with the watchdog's state and the service log beside them. + {Name: "health", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: worded(func(w *view.World, t *i18n.Catalog) map[string]any { + out := serviceLog(w, t, d.RunDir, d.DataDir) + out["checks"] = healthChecks(w, t, d) + return out + })}, + {Name: "backup_read", Params: map[string]ubus.Kind{"name": ubus.String, "lang": ubus.String}, + Handle: wrap(func(_ *view.World, a map[string]any) (map[string]any, error) { + return backupRead(d.DataDir+"/backups", text(a["name"])) + })}, + {Name: "backup_list", Params: map[string]ubus.Kind{"lang": ubus.String}, + Handle: wrap(func(*view.World, map[string]any) (map[string]any, error) { + return map[string]any{"backups": backups(d.DataDir + "/backups")}, nil + })}, + {Name: "events", Params: map[string]ubus.Kind{"limit": ubus.Int, "person": ubus.String, "device": ubus.String, "since": ubus.Int, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return events(w, d.Events(), text(a["person"]), text(a["device"]), num(a["since"]), int(num(a["limit"]))), nil + })}, + {Name: "person_usage", Params: map[string]ubus.Kind{"id": ubus.String, "days": ubus.Int, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { + return personUsage(w, text(a["id"]), days(a["days"])) + })}, + {Name: "person_links", Params: map[string]ubus.Kind{"id": ubus.String, "lang": ubus.String}, + Handle: wrap(func(w *view.World, a map[string]any) (map[string]any, error) { return personLinks(w, text(a["id"])) })}, + }...) +} + +// events is the newest `limit` entries of the log that pass every filter given, how many passed before the +// limit, and what the log keeps (dawnline.rpc.status events_list). +func events(w *view.World, log []map[string]any, person, device string, since float64, limit int) map[string]any { + kept := []map[string]any{} + for _, e := range log { + // the tunnel down/up events of older versions are left out: the service log tells it better + if t := text(e["type"]); t == "server_down" || t == "server_up" { + continue + } + if (person != "" && text(e["person"]) != person) || (device != "" && text(e["device"]) != device) || (since != 0 && num(e["ts"]) <= since) { + continue + } + kept = append(kept, e) + } + total := len(kept) + if limit <= 0 { + limit = 300 + } + if len(kept) > limit { + kept = kept[len(kept)-limit:] + } + return map[string]any{"events": kept, "total": total, "policy": policy(w)} +} + +func personUsage(w *view.World, id string, days int) (map[string]any, error) { + p := w.M.People[id] + if p == nil { + return nil, errors.New("Unknown person.") + } + devs := map[string]any{} + for _, d := range p.Devices { + devs[d] = view.Series([]*usage.Record{w.Usage.Devices[d]}, days, w.Now) + } + return map[string]any{"person": view.Series([]*usage.Record{w.Usage.People[id]}, days, w.Now), "devices": devs}, nil +} + +func personLinks(w *view.World, id string) (map[string]any, error) { + p := w.M.People[id] + if p == nil { + return nil, errors.New("Unknown person.") + } + hosts := view.PortalHosts(w.M) + var link any + links := []string{} + for i, h := range hosts { + l := view.PortalLink(w.M, p, h) + if l == "" { + continue + } + if i == 0 { + link = l + } + links = append(links, l) + } + return map[string]any{"code": p.Code, "link": link, "links": links}, nil +} + +// deviceConfig is a device's configuration, for the admin to show (QR code, file, text). Showing it marks +// nothing: a configuration counts as given out when it is made or fetched on the portal. +func deviceConfig(w *view.World, d Deps, id string) (map[string]any, error) { + dev := w.M.Devices[id] + if dev == nil { + return nil, errors.New("Unknown device.") + } + if dev.Waiting { + return nil, errors.New("This router waits for an answer to its request: it has no configuration yet.") + } + var home []string + p := w.M.People[dev.Person] + var srv *model.Server + if p != nil { + srv = w.M.Servers[p.Server] + } + if srv != nil && d.Home != nil { + home = d.Home(srv, p) + } + cfg := handout.ClientConfig(w.M, dev, home) + if cfg == nil { + return map[string]any{"result": nil}, nil + } + raw, _ := json.Marshal(cfg) + var out map[string]any + json.Unmarshal(raw, &out) + // V2RayTun on Android takes the server by its IP: only where it can connect at all, and AmneziaWG 3.1 + // (Maximum) is beyond it. + if dev.Kind != "router" && dev.Kind != "computer" && srv.Preset != "max" && d.HostIP != nil { + if am, ok := out["amnezia"].(map[string]any); ok { + am["host_ip"] = nil + if ip := d.HostIP(text(am["host"])); ip != "" { + am["host_ip"] = ip + } + } + } + return out, nil +} + +// ordered is a JSON object's keys in the order the file has them. +func ordered(raw json.RawMessage) []string { + dec := json.NewDecoder(bytes.NewReader(raw)) + if t, err := dec.Token(); err != nil || t != json.Delim('{') { + return nil + } + var keys []string + for dec.More() { + k, err := dec.Token() + if err != nil { + return keys + } + keys = append(keys, k.(string)) + var skip json.RawMessage + if dec.Decode(&skip) != nil { + return keys + } + } + return keys +} + +// serviceLog is the watchdog's state and the newest two hundred entries of the service log, newest first +// (dawnline.watchdog view): target and repair names in the page's language, the log as it was written. +func serviceLog(w *view.World, t *i18n.Catalog, run, data string) map[string]any { + var st struct { + Last any `json:"last"` + Targets json.RawMessage `json:"targets"` + Repairs []map[string]any `json:"repairs"` + } + files.ReadJSON(run+"/watchdog.json", &st) + var beat float64 + files.ReadJSON(run+"/agent.beat", &beat) + names := map[string]string{"agent": t.T("Agent"), "nft": t.T("Access rules"), "fw": t.T("Firewall"), "portal": t.T("Portal"), + "resolver": t.T("Resolver"), "rpc": t.T("LuCI link")} + chip := func(id string, stored any) any { + if n, ok := names[id]; ok { + return n + } + if srv := w.M.Servers[strings.TrimPrefix(id, "cfg_")]; srv != nil && strings.HasPrefix(id, "cfg_") { + return fmt.Sprintf(t.T("%s · interface settings"), srv.Name) + } + return stored + } + now := time.Now().Unix() + targets := []any{map[string]any{"id": "agent", "name": names["agent"], "ok": beat > 0 && float64(now)-beat < 180, "tries": 0}} + var byID map[string]map[string]any + if json.Unmarshal(st.Targets, &byID) == nil { + for _, id := range ordered(st.Targets) { + x := byID[id] + tries := x["tries"] + if tries == nil { + tries = 0 + } + targets = append(targets, map[string]any{"id": id, "name": chip(id, x["name"]), "ok": truthy(x["ok"]), "tries": tries}) + } + } + repairs := []any{} + for _, r := range st.Repairs { + r["name"] = chip(text(r["id"]), r["name"]) + repairs = append(repairs, r) + } + var last, beatAt any = st.Last, nil + if beat != 0 { + beatAt = beat + } + raw, err := os.ReadFile(run + "/service.log") + if err != nil { + raw, _ = os.ReadFile(data + "/service.log") + } + lines := strings.Split(string(raw), "\n") + log := []any{} + for i := len(lines) - 1; i >= 0 && len(log) < 200; i-- { + var e map[string]any + if lines[i] != "" && json.Unmarshal([]byte(lines[i]), &e) == nil && e != nil && truthy(e["ts"]) { + log = append(log, e) + } + } + return map[string]any{ + "watchdog": map[string]any{"enabled": w.M.Settings.Watchdog, "last": last, "beat": beatAt, "now": now, "targets": targets, "repairs": repairs}, + "log": log, + } +} + +// truthy is a JSON value as ucode's !! reads it. +func truthy(v any) bool { + switch x := v.(type) { + case nil: + return false + case bool: + return x + case float64: + return x != 0 + case string: + return x != "" + } + return true +} + +var backupName = regexp.MustCompile(`^dawnline-([0-9]{8}-[0-9]{6})(-([a-z0-9-]+))?\.tar\.gz$`) + +// backups is the backups kept in dir, the newest first: why each was made is in its name. +func backups(dir string) []map[string]any { + out := []map[string]any{} + entries, _ := os.ReadDir(dir) + for _, e := range entries { + m := backupName.FindStringSubmatch(e.Name()) + if m == nil { + continue + } + reason := m[3] + if reason == "" { + reason = "manual" + } + var created, size int64 + if st, err := os.Stat(dir + "/" + e.Name()); err == nil { + created, size = st.ModTime().Unix(), st.Size() + } + out = append(out, map[string]any{"name": e.Name(), "created": created, "size": size, "reason": reason}) + } + sort.SliceStable(out, func(i, j int) bool { return out[i]["created"].(int64) > out[j]["created"].(int64) }) + return out +} + +// orNull is a name, or null when there is none. +func orNull(s string) any { + if s == "" { + return nil + } + return s +} + +// interfaces is a server's interfaces for Settings: what exists, what is detected, what the server uses +// (dawnline.rpc.servers interfaces_get). A server not named is the first one. +func interfaces(w *view.World, d Deps, id string) (map[string]any, error) { + srv := w.M.Servers[id] + if ids := w.M.ServerIDs(); srv == nil && len(ids) > 0 { + srv = w.M.Servers[ids[0]] + } + if srv == nil || d.Snapshot == nil { + return nil, errors.New("No server yet.") + } + snap := d.Snapshot() + wan, home, nets, zones := snap.ServerNet(srv) + byDev := map[string]netview.HomeOf{} + homes := []any{} + for _, h := range home { + byDev[h.Dev] = h + homes = append(homes, map[string]any{"dev": h.Dev, "auto": h.Auto, "nets": h.Nets, "zone": orNull(h.Zone), "missing": h.Missing}) + } + devs := []any{} + for _, name := range snap.Names() { + x := snap.Devices[name] + h, isHome := byDev[name] + devs = append(devs, map[string]any{ + "name": x.Name, "category": x.Category, "kind": x.Kind, "up": x.Up, "master": orNull(x.Master), "members": x.Members, "nets": x.Nets, + "addrs": x.Addrs, "logical": orNull(x.Logical), "proto": orNull(x.Proto), "zone": orNull(x.Zone), + "own": name == srv.Ifname, "home": isHome, "auto": isHome && h.Auto, + }) + } + // saved names that no longer exist still show, so they can be removed + for _, h := range home { + if h.Missing { + devs = append(devs, map[string]any{"name": h.Dev, "category": "other", "kind": "other", "missing": true, "nets": []string{}, "addrs": []string{}, + "members": []string{}, "home": true, "auto": h.Auto}) + } + } + lanOnly := 0 + for _, p := range w.M.People { + if p.Server == srv.ID && p.Access == "lan" { + lanOnly++ + } + } + lans := srv.LanDevices + if lans == nil { + lans = []string{} + } + likeHome, _ := roster.LikeHome(d.RunDir) + return map[string]any{ + "server": srv.ID, "ifname": srv.Ifname, + "detected": map[string]any{"wan": orNull(snap.WAN), "lan": orNull(snap.LAN)}, + "saved": map[string]any{"wan": srv.DetectedWan, "lan": srv.DetectedLan}, + "config": map[string]any{"auto_wan": srv.AutoWan, "wan_device": srv.WanDevice, "auto_lan": srv.AutoLan, "lan_devices": lans, "lan_like": srv.LanLike, + "device_mesh": srv.DeviceMesh, "mesh": srv.Mesh}, + "like_home": likeHome, "needs": Needs()["home"], + "effective": map[string]any{"wan": map[string]any{"dev": orNull(wan.Dev), "auto": wan.Auto, "zone": wan.Zone, "missing": wan.Missing}, + "home": homes, "nets": nets, "zones": zones}, + "zones": snap.Zones, "devices": devs, "lan_only": lanOnly, + }, nil +} + +// endpointProbe is where a public address points, as the admin types it: the facts Health uses, in words. +// `id` names the server whose WAN to compare with (a new one: the default WAN). +func endpointProbe(w *view.World, t *i18n.Catalog, d Deps, a map[string]any) map[string]any { + host := strings.Trim(text(a["host"]), " \t\r\n\v\f") + if host != "" && !endpoint.ValidHost(host) { + return map[string]any{"error": t.T("Public address must be a hostname or IP address.")} + } + srv := w.M.Servers[strings.Trim(text(a["id"]), " \t\r\n\v\f")] + f := endpoint.Of(host, endpointReads(d, srv, host)) + port := 4500 + if srv != nil { + port = srv.Port + } else if p := int(num(a["port"])); p != 0 { + port = p + } + status, words := endpoint.Words(f, fmt.Sprintf("UDP %d", port), t) + raw, _ := json.Marshal(f) + var out map[string]any + json.Unmarshal(raw, &out) + out["status"], out["text"] = status, words + return out +} + +// endpointReads is what a public address's facts are made from, read on the router. +func endpointReads(d Deps, srv *model.Server, host string) endpoint.Reads { + r := endpoint.Reads{} + if host != "" && d.Resolve != nil { + r.IPs = d.Resolve(host) + } + if d.WANOf != nil { + r.WAN = d.WANOf(srv) + } + // the router's IPv6 only when the name has some to compare with + for _, ip := range r.IPs { + if strings.Contains(ip, ":") { + r.Router6, r.Known6 = router6() + break + } + } + return r +} + +// router6 is the router's public IPv6 addresses, and whether `ip` could tell. +func router6() ([]string, bool) { + out, err := exec.Command("ip", "-6", "-j", "addr", "show", "scope", "global").Output() + if err != nil { + return nil, false + } + if len(bytes.TrimSpace(out)) == 0 { + return []string{}, true + } + var links []struct { + Info []struct { + Family string `json:"family"` + Local string `json:"local"` + DADFailed bool `json:"dadfailed"` + } `json:"addr_info"` + } + if json.Unmarshal(out, &links) != nil { + return nil, false + } + return endpoint.Own6(links), true +} + +// accessCheck is "Check access" between two sides, each a device's id or an IPv4 address. +func accessCheck(w *view.World, t *i18n.Catalog, d Deps, from, to string) (map[string]any, error) { + states := map[string]string{} + for id, p := range w.M.People { + states[id] = state.Of(w.M, p, w.Usage, w.Now) + } + ctx := access.Ctx{States: states, Peers: w.Peers, Snap: d.Snapshot(), T: t, Online: func(dev *model.Device, peer awg.Peer) bool { + // the watcher's word; without one, a recent handshake + if w.Online != nil { + return w.Online[dev.ID] + } + return peer.Handshake > 0 && w.Now-peer.Handshake < 190 + }} + ok, steps, err := access.Check(w.M, from, to, ctx) + if err != nil { + return nil, err + } + return map[string]any{"ok": ok, "steps": steps}, nil +} diff --git a/backend/methods/methods_test.go b/backend/methods/methods_test.go new file mode 100644 index 0000000..13bd5fa --- /dev/null +++ b/backend/methods/methods_test.go @@ -0,0 +1,800 @@ +package methods + +import ( + "archive/tar" + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "os" + "reflect" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/disguise" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/ubus" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +func world() *view.World { + m := &model.Model{ + People: map[string]*model.Person{"anna": {ID: "anna", Name: "Anna", Server: "home", Code: "abcdef-ghijkl-mnopqr", Devices: []string{"phone"}}}, + Servers: map[string]*model.Server{"home": {ID: "home"}}, + Devices: map[string]*model.Device{"phone": {ID: "phone", Person: "anna"}}, + } + m.Settings.PortalEnabled, m.Settings.PortalPort, m.Settings.PortalHost, m.Settings.PortalAlt = true, 4500, "vpn.example.org", []string{"203.0.113.7", "vpn.example.org"} + return &view.World{M: m, Usage: usage.Empty(), Now: 1_800_000_000} +} + +func ask(t *testing.T, d Deps, name string, args map[string]any) map[string]any { + t.Helper() + for _, m := range List(d) { + if m.Name == name { + res, err := m.Handle(context.Background(), args) + if err != nil { + t.Fatal(err) + } + return res + } + } + t.Fatalf("no method %s", name) + return nil +} + +func TestEvents(t *testing.T) { + log := []map[string]any{ + {"ts": 10.0, "type": "connect", "person": "anna", "device": "phone"}, + {"ts": 20.0, "type": "server_down"}, + {"ts": 30.0, "type": "disconnect", "person": "anna", "device": "phone"}, + {"ts": 40.0, "type": "connect", "person": "boris", "device": "tv"}, + {"ts": 50.0, "type": "roam", "person": "anna", "device": "laptop"}, + } + d := Deps{World: world, Events: func() []map[string]any { return log }} + ts := func(res map[string]any) (out []float64) { + for _, e := range res["events"].([]map[string]any) { + out = append(out, e["ts"].(float64)) + } + return + } + for name, c := range map[string]struct { + args map[string]any + want []float64 + total int + }{ + "all but the old tunnel events": {map[string]any{}, []float64{10, 30, 40, 50}, 4}, + "a person's": {map[string]any{"person": "anna"}, []float64{10, 30, 50}, 3}, + "a device's, the newest one": {map[string]any{"device": "phone", "limit": int32(1)}, []float64{30}, 2}, + "after a moment": {map[string]any{"since": int64(30)}, []float64{40, 50}, 2}, + "nothing passes": {map[string]any{"person": "nobody"}, nil, 0}, + } { + res := ask(t, d, "events", c.args) + if got := ts(res); !reflect.DeepEqual(got, c.want) || res["total"] != c.total { + t.Errorf("%s: %v of %v", name, got, res["total"]) + } + } + pol := ask(t, d, "events", nil)["policy"].(map[string]any) + if pol["keep_days"] != 30 || pol["max"] != 2000 || pol["persist"] != "hourly" || pol["usage_days"] != 62 || pol["usage_months"] != 24 || len(pol["categories"].([]string)) != 3 { + t.Fatalf("the policy: %v", pol) + } +} + +func TestPersonQuestions(t *testing.T) { + d := Deps{World: world, Events: func() []map[string]any { return nil }} + links := ask(t, d, "person_links", map[string]any{"id": "anna"}) + want := map[string]any{"code": "abcdef-ghijkl-mnopqr", "link": "https://vpn.example.org:4500/abcdef-ghijkl-mnopqr", + "links": []string{"https://vpn.example.org:4500/abcdef-ghijkl-mnopqr", "http://203.0.113.7:4501/abcdef-ghijkl-mnopqr"}} + if !reflect.DeepEqual(links, want) { + t.Fatalf("links: %v", links) + } + u := ask(t, d, "person_usage", map[string]any{"id": "anna", "days": 7}) + if len(u["person"].([]view.Day)) != 7 || len(u["devices"].(map[string]any)["phone"].([]view.Day)) != 7 { + t.Fatalf("usage: %v", u) + } + if u := ask(t, d, "person_usage", map[string]any{"id": "anna"}); len(u["person"].([]view.Day)) != 30 { + t.Fatal("days not said are thirty") + } + for _, name := range []string{"person_links", "person_usage"} { + if res := ask(t, d, name, map[string]any{"id": "nobody"}); res["error"] != "Unknown person." { + t.Errorf("%s for nobody: %v", name, res) + } + } + // before the watcher's first look there is nothing to answer from + starting := Deps{World: func() *view.World { return nil }} + if res := ask(t, starting, "events", nil); res["error"] == nil { + t.Fatal("answered with no world") + } + var _ []ubus.Method = List(d) +} + +func TestServiceLogAndBackups(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data/backups", 0o755) + os.WriteFile(dir+"/watchdog.json", []byte(`{"last":1799999990,"targets":{"nft":{"ok":true,"name":"Access rules","tries":0},"cfg_home":{"ok":false,"name":"old","tries":2},"awg_home":{"ok":1,"name":"Home · AmneziaWG"}},"repairs":[{"id":"fw","name":"Firewall","ts":5}]}`), 0o600) + os.WriteFile(dir+"/service.log", []byte("{\"ts\":1,\"msg\":\"a\"}\nnot json\n\n{\"msg\":\"no time\"}\n{\"ts\":3,\"msg\":\"c\"}\n"), 0o600) + for i, name := range []string{"dawnline-20270101-000000.tar.gz", "dawnline-20270102-000000-pre-update.tar.gz", "notes.txt"} { + os.WriteFile(dir+"/data/backups/"+name, []byte("x"), 0o600) + at := time.Unix(1_800_000_000+int64(i)*60, 0) + os.Chtimes(dir+"/data/backups/"+name, at, at) + } + w := world() + w.M.Servers["home"].Name = "Home" + d := Deps{World: func() *view.World { return w }, RunDir: dir, DataDir: dir + "/data"} + res := ask(t, d, "service_log", nil) + wd := res["watchdog"].(map[string]any) + var got []string + for _, x := range wd["targets"].([]any) { + m := x.(map[string]any) + got = append(got, fmt.Sprint(m["id"], "=", m["name"], "/", m["ok"], "/", m["tries"])) + } + want := []string{"agent=Agent/false/0", "nft=Access rules/true/0", "cfg_home=Home · interface settings/false/2", "awg_home=Home · AmneziaWG/true/0"} + if !reflect.DeepEqual(got, want) || wd["beat"] != nil || wd["last"] != 1799999990.0 || len(wd["repairs"].([]any)) != 1 { + t.Fatalf("the watchdog: %v %v", got, wd) + } + if log := res["log"].([]any); len(log) != 2 || log[0].(map[string]any)["msg"] != "c" { + t.Fatalf("the log: %v", log) + } + b := ask(t, d, "backup_list", nil)["backups"].([]map[string]any) + if len(b) != 2 || b[0]["reason"] != "pre-update" || b[1]["reason"] != "manual" || b[1]["size"] != int64(1) { + t.Fatalf("backups: %v", b) + } +} + +func TestDeviceConfig(t *testing.T) { + d := Deps{World: world, HostIP: func(string) string { return "203.0.113.7" }} + if res := ask(t, d, "device_config", map[string]any{"id": "nothing"}); res["error"] != "Unknown device." { + t.Fatalf("an unknown device: %v", res) + } + res := ask(t, d, "device_config", map[string]any{"id": "phone"}) + am, _ := res["amnezia"].(map[string]any) + if res["conf"] == nil || am == nil || am["host_ip"] != "203.0.113.7" { + t.Fatalf("a phone's configuration: %v", res) + } + w := world() + w.M.Devices["phone"].Kind = "computer" + res = ask(t, Deps{World: func() *view.World { return w }, HostIP: d.HostIP}, "device_config", map[string]any{"id": "phone"}) + if _, has := res["amnezia"].(map[string]any)["host_ip"]; has { + t.Fatal("a computer was given the server's IP") + } +} + +func TestTakenPorts(t *testing.T) { + netstat := `Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name +tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1899/uhttpd +tcp 0 0 0.0.0.0:4500 0.0.0.0:* LISTEN 2001/dawnlined +tcp 0 0 192.168.1.1:8443 0.0.0.0:* LISTEN 2100/nginx +tcp 0 0 :::8443 :::* LISTEN 2100/nginx +tcp 0 0 :::9000 :::* LISTEN - +udp 0 0 0.0.0.0:53 0.0.0.0:* 900/dnsmasq +` + progs := programs(netstat, "tcp", func(pid string) string { + if pid == "2001" { + return "/usr/libexec/dawnline/dawnlined\x00-portal-port\x004500" + } + return "/usr/sbin/other" + }) + if !reflect.DeepEqual(progs, []held{{80, "uhttpd"}, {8443, "nginx"}}) { + t.Fatalf("programs: %v", progs) + } + fw, _ := uci.Parse(` +config redirect 'web' + option name 'Web server' + option src 'wan' + option src_dport '8080-8090 9443' + option proto 'tcp' +config redirect 'game' + option src 'wan' + option src_dport '27015' + option proto 'udp' +config redirect 'both' + option src 'wan' + option src_dport '5000:5010' +config redirect 'off' + option src 'wan' + option src_dport '6000' + option enabled '0' +config redirect 'dawnline_x' + option src 'wan' + option src_dport '7000' +config redirect 'lan' + option src 'lan' + option src_dport '7100' +`) + w := world() + got := tcpTaken(w.M, nil, progs, fw) + var lines []string + for _, x := range got { + lines = append(lines, fmt.Sprint(x["from"], "-", x["to"], " ", x["who"])) + } + want := []string{"22-22 the router itself", "53-53 the router itself", "80-80 the router itself", "443-443 the router itself", "8443-8443 nginx on this router", + "8080-8090 port forward “Web server”", "9443-9443 port forward “Web server”", "5000-5010 port forward “both”"} + if !reflect.DeepEqual(lines, want) { + t.Fatalf("taken:\n%v\n%v", lines, want) + } + + // UDP: the other server, a tunnel of the router's own, what is bound, a forward + conf, _ := uci.Parse("config settings 'settings'\nconfig server 'home'\n\toption name 'Home'\n\toption port '4500'\n\toption ifname 'dawn0'\n\toption subnet '10.77.0.0/24'\n" + + "config server 'cabin'\n\toption name 'Cabin'\n\toption port '4600'\n\toption ifname 'dawn1'\n\toption subnet '10.78.0.9/24'\n") + w.M = model.Load(conf, nil) + network, _ := uci.Parse("config interface 'wg0'\n\toption listen_port '51820'\nconfig interface 'dawn0'\n\toption listen_port '4500'\nconfig interface 'lan'\n") + proc := " sl local_address rem_address st\n 12: 00000000:0035 00000000:0000 07 x\n 13: 00000000:1194 00000000:0000 07 x\n 14: 0A000001:D431 08080808:0035 01 x\n 15: 00000000:CA6C 00000000:0000 07 x\n 16: 00000000:0043 00000000:0000 07 x\n" + udp := programs(netstat, "udp", func(string) string { return "" }) + lines = nil + for _, x := range udpTaken(w.M, w.M.Servers["home"], nil, network, fw, udpBound(proc, proc), udp) { + lines = append(lines, fmt.Sprint(x["from"], "-", x["to"], " ", x["who"])) + } + want = []string{"4600-4600 server “Cabin”", "51820-51820 interface wg0", "53-53 dnsmasq on this router", "67-67 another program on this router", + "27015-27015 port forward “game”", "5000-5010 port forward “both”"} + if !reflect.DeepEqual(lines, want) { + t.Fatalf("taken UDP:\n%v\n%v", lines, want) + } + nets := takenNetworks(w.M, []Address{{"lan", "192.168.1.1/24"}, {"guest", "192.168.1.7/24"}, {"wan", "203.0.113.7/32"}}) + if fmt.Sprint(nets) != "[map[cidr:192.168.1.0/24 name:lan] map[cidr:10.77.0.0/24 name:Home] map[cidr:10.78.0.0/24 name:Cabin]]" { + t.Fatalf("networks: %v", nets) + } +} + +func TestSettingsAndBackupRead(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data/backups", 0o755) + os.WriteFile(dir+"/config", []byte("config settings 'settings'\n\toption portal_port '4500'\n\tlist portal_alt 'a.example'\n\tlist portal_alt 'b.example'\n"), 0o600) + os.WriteFile(dir+"/events.json", []byte(`[{"ts":5,"type":"connect"},{"ts":9,"type":"person_added"}]`), 0o600) + os.WriteFile(dir+"/geo.json", []byte(`{"ips":{"203.0.113.7":{},"198.51.100.4":{}}}`), 0o600) + os.WriteFile(dir+"/data/backups/dawnline-20270101-000000.tar.gz", []byte("archive"), 0o600) + w := world() + w.M.Settings.PortalEnabled = false + w.Usage.People["anna"] = &usage.Record{Days: map[string]usage.Pair{"2027-01-02": {1, 2}, "2026-12-30": {1, 2}}} + d := Deps{World: func() *view.World { return w }, RunDir: dir, DataDir: dir + "/data", Config: dir + "/config"} + res := ask(t, d, "settings_get", nil) + set := res["settings"].(map[string]any) + if set["portal_port"] != "4500" || !reflect.DeepEqual(set["portal_alt"], []string{"a.example", "b.example"}) || set["domain"] != "" || len(set) != len(Settings)+1 || res["cert"] != nil || res["geo_cached"] != 2 { + t.Fatalf("settings: %v %v %v", set, res["cert"], res["geo_cached"]) + } + logs := res["logs"].(map[string]any) + if logs["events"] != 2 || logs["oldest"] != 5.0 || logs["usage_since"] != "2026-12-30" || logs["usage_days"] != 2 || logs["log_ram"] != int64(58) || + !reflect.DeepEqual(logs["by_category"], map[string]int{"connections": 1, "people": 1, "problems": 0}) { + t.Fatalf("logs: %v", logs) + } + if got := ask(t, d, "backup_read", map[string]any{"name": "dawnline-20270101-000000.tar.gz"}); got["data"] != "YXJjaGl2ZQ==" { + t.Fatalf("a backup: %v", got) + } + for name, want := range map[string]string{"../config": "Invalid backup name.", "dawnline-20270102-000000.tar.gz": "Backup not found."} { + if got := ask(t, d, "backup_read", map[string]any{"name": name}); got["error"] != want { + t.Errorf("%s: %v", name, got) + } + } + if !covers("*.example.org", "vpn.example.org") || covers("*.example.org", "a.vpn.example.org") || covers("*.example.org", "example.org") || !covers("vpn.example.org", "vpn.example.org") { + t.Fatal("which names a certificate covers") + } +} + +func TestUpdatesStatus(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data/keep/app", 0o755) + os.MkdirAll(dir+"/i18n", 0o755) + os.WriteFile(dir+"/i18n/dawnline.ru.lmo", nil, 0o644) + os.WriteFile(dir+"/i18n/base.ru.lmo", nil, 0o644) + os.WriteFile(dir+"/update-job.json", []byte(`{"id":"j1","state":"running","started":5}`), 0o600) + os.WriteFile(dir+"/data/keep/app/pkg.apk", []byte("x"), 0o600) + os.WriteFile(dir+"/data/keep/app/meta.json", []byte(`{"version":"0.17.0","files":["`+dir+`/data/keep/app/pkg.apk"],"saved":7}`), 0o600) + hist := "[" + for i := 0; i < 15; i++ { + hist += fmt.Sprintf(`{"ts":%d},`, i) + } + os.WriteFile(dir+"/data/update-history.json", []byte(hist[:len(hist)-1]+"]"), 0o600) + d := Deps{World: world, RunDir: dir, DataDir: dir + "/data", Catalogs: dir + "/i18n"} + res := ask(t, d, "updates_status", nil) + job := res["job"].(map[string]any) + // nobody holds the lock: the job that says it runs has stopped + if job["state"] != "failed" || job["error"] != "The update stopped unexpectedly." || job["finished"] == nil { + t.Fatalf("a job whose worker is gone: %v", job) + } + kept := res["kept"].(map[string]any) + if kept["amneziawg"] != nil || kept["app"].(map[string]any)["version"] != "0.17.0" || len(res["history"].([]any)) != 12 || + !reflect.DeepEqual(res["translations"], []string{"ru"}) || res["check"] != nil || res["repo"] != Repo { + t.Fatalf("status: %v", res) + } + os.Remove(dir + "/data/keep/app/pkg.apk") + if res := ask(t, d, "updates_status", nil); res["kept"].(map[string]any)["app"] != nil { + t.Fatal("a kept version whose file is gone is still offered") + } +} + +func TestWhatANewServerStartsFrom(t *testing.T) { + held := func(ranges ...[2]int) (out []map[string]any) { + for _, r := range ranges { + out = append(out, map[string]any{"from": r[0], "to": r[1]}) + } + return + } + if freePort(nil) != 4500 { + t.Fatal("the usual port is free and not taken") + } + for i := 0; i < 50; i++ { + if p := freePort(held([2]int{4500, 4500}, [2]int{40000, 45000})); p <= 45000 || p > 60000 { + t.Fatalf("a port that is taken: %d", p) + } + n, ok := ipnet.Subnet(freeSubnet([]string{"10.0.0.0/9", "192.168.1.0/24", "not a network"})) + if !ok || n.Prefix != 24 || ipnet.String(n.Base)[:3] != "10." || n.Base < 10<<24|128<<16 { + t.Fatalf("a network inside one taken: %v", n) + } + } + if n := freeSubnet([]string{"10.0.0.0/8"}); n[:4] != "172." { + t.Fatalf("with all of 10/8 taken: %s", n) + } + if freePortalPort(4500, 0, held([2]int{4501, 4501}, [2]int{8443, 8443})) != 9443 || freePortalPort(4500, 0, nil) != 4500 || freePortalPort(4500, 7000, held([2]int{4500, 4500})) != 7000 { + t.Fatal("the portal's port") + } + conf, _ := uci.Parse("config settings 'settings'\nconfig server 'home'\n\toption ifname 'dawn0'\nconfig person 'server2'\n\toption server 'home'\n") + m := model.Load(conf, nil) + network, _ := uci.Parse("config interface 'dawn1'\nconfig interface 'lan'\n") + if freeServerID(m) != "server3" || freeIfname(m, network) != "dawn2" || idTaken(m, "nobody") || !idTaken(m, "api") || !idTaken(m, "main") { + t.Fatalf("free names: %s %s", freeServerID(m), freeIfname(m, network)) + } + for wan, want := range map[string]string{"": "none", "203.0.113.7": "public", "100.70.1.1": "cgnat", "192.168.1.2": "private", "10.1.1.1": "private"} { + if got := wanKind(wan); got != want { + t.Errorf("%q is %s", wan, got) + } + } +} + +func TestHomeHostsAndExport(t *testing.T) { + dir := t.TempDir() + os.WriteFile(dir+"/leases", []byte("1800000000 aa:bb:cc:00:00:01 192.168.77.20 nas *\n1800000000 aa:bb:cc:00:00:02 192.168.77.5 * *\n1800000000 aa:bb:cc:00:00:03 10.9.9.9 elsewhere *\n"), 0o644) + os.WriteFile(dir+"/dhcp", []byte("config host\n\toption name 'printer'\n\toption ip '192.168.77.9'\n\tlist mac 'aa:bb:cc:00:00:04'\n\tlist mac 'aa:bb:cc:00:00:05'\nconfig host\n\toption name 'again'\n\toption ip '192.168.77.20'\n"), 0o644) + os.WriteFile(dir+"/config", []byte("config settings 'settings'\n\toption portal_port '4500'\n\tlist portal_alt 'a.example'\nconfig server 'home'\n\toption private_key 'secret'\n"), 0o600) + conf, _ := uci.Parse("config settings 'settings'\nconfig server 'home'\n\toption ifname 'dawn0'\n\toption lan_device 'br-lan'\n\toption auto_lan '0'\n") + w := &view.World{M: model.Load(conf, nil), Usage: usage.Empty()} + var logged []string + d := Deps{World: func() *view.World { return w }, Config: dir + "/config", RunDir: dir, + Snapshot: func() *netview.Snapshot { + return &netview.Snapshot{Devices: map[string]*netview.Device{"br-lan": {Name: "br-lan", Nets: []string{"192.168.77.0/24"}}}} + }, + Bus: func(object, method string, _ map[string]any) map[string]any { + if object != "umdns" { + return nil + } + return map[string]any{ + "_ipp._tcp": map[string]any{"Printer": map[string]any{"ipv4": []any{"192.168.77.9"}, "port": 631, "host": "printer.local"}}, + "_airplay._tcp": map[string]any{"TV": map[string]any{"ipv4": "192.168.77.30", "port": 7000, "host": "tv.local."}, "Far": map[string]any{"ipv4": "10.1.1.1"}, "None": map[string]any{}}, + } + }, + Log: &servicelog.Log{RunDir: dir, Syslog: func(_, line string) { logged = append(logged, line) }}, + } + res, err := homeHosts(w, d, "", dir+"/leases", dir+"/dhcp") + if err != nil { + t.Fatal(err) + } + raw, _ := json.Marshal(res) + want := `{"hosts":[{"address":"192.168.77.5","name":"","mac":"aa:bb:cc:00:00:02","services":[]},` + + `{"address":"192.168.77.9","name":"printer","mac":"aa:bb:cc:00:00:04","services":[{"name":"Printer","port":631,"type":"_ipp._tcp"}]},` + + `{"address":"192.168.77.20","name":"nas","mac":"aa:bb:cc:00:00:01","services":[]},` + + `{"address":"192.168.77.30","name":"tv","mac":"","services":[{"name":"TV","port":7000,"type":"_airplay._tcp"}]}],"mdns":true}` + if string(raw) != want { + t.Fatalf("the devices at home:\n%s", raw) + } + out := ask(t, d, "export", nil) + sections := out["sections"].([]map[string]any) + if out["format"] != "dawnline" || len(sections) != 2 || sections[0]["portal_port"] != "4500" || !reflect.DeepEqual(sections[0]["portal_alt"], []string{"a.example"}) || + sections[1][".type"] != "server" || sections[1][".name"] != "home" || sections[1]["private_key"] != "secret" { + t.Fatalf("an export: %v", out) + } + // taking the keys out of the router is written down + if len(logged) != 1 || logged[0] != "[info] [dawnline] admin exported all settings · the file holds private keys" { + t.Fatalf("the log: %v", logged) + } +} + +func TestClearingTheLogs(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data", 0o755) + now := time.Now().Unix() + os.WriteFile(dir+"/events.json", []byte(fmt.Sprintf(`[{"ts":%d,"type":"connect","person":"anna","device":"phone"},{"ts":%d,"type":"connect","person":"anna","device":"phone"},{"ts":%d,"type":"paused","person":"boris"}]`, + now-40*86400, now-100, now-50)), 0o600) + os.WriteFile(dir+"/service.log", []byte(fmt.Sprintf("{\"ts\":%d,\"msg\":\"old\"}\n{\"ts\":%d,\"msg\":\"new\"}\n", now-40*86400, now-10)), 0o600) + var said []string + d := Deps{World: world, RunDir: dir, DataDir: dir + "/data", Log: &servicelog.Log{RunDir: dir, Syslog: func(_, line string) { said = append(said, line) }}} + for args, want := range map[string]string{ + `{"person":"nobody"}`: "Unknown person.", `{"category":"gossip"}`: "Unknown category.", `{"older_days":"0"}`: "Older than must be a number of days.", `{"older_days":"a week"}`: "Older than must be a number of days.", + } { + var a map[string]any + json.Unmarshal([]byte(args), &a) + if res := ask(t, d, "logs_clear", a); res["error"] != want { + t.Errorf("%s: %v", args, res) + } + } + if res := ask(t, d, "logs_clear", map[string]any{"person": "anna", "older_days": "7"}); res["removed"] != 1 || res["ok"] != true { + t.Fatalf("an old event of a person's: %v", res) + } + if res := ask(t, d, "logs_clear", map[string]any{"device": "tv"}); res["removed"] != 0 { + t.Fatalf("nothing to remove: %v", res) + } + if res := ask(t, d, "service_log_clear", map[string]any{"older_days": "7"}); res["removed"] != 1 { + t.Fatalf("an old entry of the service log: %v", res) + } + want := []string{"[info] [dawnline] admin cleared the activity log · 1 event · Anna · older than 7 days", "[info] [dawnline] admin cleared the service log · 1 entry older than 7 days"} + if !reflect.DeepEqual(said, want) { + t.Fatalf("what was written down:\n%s", strings.Join(said, "\n")) + } + var left []map[string]any + raw, _ := os.ReadFile(dir + "/events.json") + json.Unmarshal(raw, &left) + if len(left) != 2 { + t.Fatalf("the activity left: %s", raw) + } + // the service log keeps its newer entry, and the two lines of what was cleared + raw, _ = os.ReadFile(dir + "/service.log") + if n := strings.Count(string(raw), "\n"); n != 3 || strings.Contains(string(raw), `"old"`) { + t.Fatalf("the service log left:\n%s", raw) + } +} + +func TestForgetting(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data/backups", 0o755) + os.WriteFile(dir+"/geo.json", []byte(`{"ips":{"203.0.113.7":{"city":"X"}},"home":{"lat":1}}`), 0o600) + os.WriteFile(dir+"/data/backups/dawnline-20270101-000000.tar.gz", []byte("x"), 0o600) + var said, reset []string + d := Deps{World: world, RunDir: dir, DataDir: dir + "/data", Log: &servicelog.Log{RunDir: dir, Syslog: func(_, line string) { said = append(said, line) }}, + ResetUsage: func(scope, id string) bool { reset = append(reset, scope+" "+id); return true }} + for args, want := range map[string]string{`{"scope":"some"}`: "Unknown scope.", `{"scope":"person","id":"nobody"}`: "Unknown person.", `{"scope":"limit","id":"nobody"}`: "Unknown person.", + `{"scope":"device","id":"nothing"}`: "Unknown device."} { + var a map[string]any + json.Unmarshal([]byte(args), &a) + if res := ask(t, d, "usage_clear", a); res["error"] != want { + t.Errorf("%s: %v", args, res) + } + } + for _, a := range []map[string]any{{"scope": "all"}, {"scope": "person", "id": "anna"}, {"scope": "limit", "id": "anna"}, {"scope": "device", "id": "phone"}} { + if res := ask(t, d, "usage_clear", a); res["ok"] != true { + t.Fatalf("%v: %v", a, res) + } + } + if strings.Join(reset, "; ") != "all ; person anna; limit anna; device phone" { + t.Fatalf("what was reset: %v", reset) + } + want := "[info] [dawnline] admin reset traffic history for everyone\n[info] [dawnline] admin reset traffic history for Anna\n" + + "[info] [dawnline] admin reset the data limit's usage for Anna\n[info] [dawnline] admin reset traffic history for (Anna)" + if got := strings.Join(said, "\n"); got != want { + t.Fatalf("what was written down:\n%s", got) + } + ask(t, d, "geo_clear", nil) + for _, f := range []string{dir + "/geo.json", dir + "/data/geo.json"} { + if raw, _ := os.ReadFile(f); strings.Join(strings.Fields(string(raw)), "") != `{"home":null,"ips":{}}` { + t.Fatalf("%s after forgetting: %s", f, raw) + } + } + for name, want := range map[string]string{"../x": "Invalid backup name.", "dawnline-20270102-000000.tar.gz": "Backup not found."} { + if res := ask(t, d, "backup_delete", map[string]any{"name": name}); res["error"] != want { + t.Errorf("%s: %v", name, res) + } + } + if res := ask(t, d, "backup_delete", map[string]any{"name": "dawnline-20270101-000000.tar.gz"}); res["ok"] != true || exists(dir+"/data/backups/dawnline-20270101-000000.tar.gz") { + t.Fatalf("a backup removed: %v", res) + } +} + +func TestBackupCreate(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data", 0o755) + os.WriteFile(dir+"/config", []byte("config settings 'settings'\n"), 0o600) + os.WriteFile(dir+"/usage.json", []byte(`{"live":true}`), 0o600) + os.WriteFile(dir+"/data/events.json", []byte(`[]`), 0o600) + d := Deps{Config: dir + "/config", RunDir: dir, DataDir: dir + "/data"} + now := int64(1_800_000_000) + clock = func() int64 { now += 60; return now } + defer func() { clock = func() int64 { return time.Now().Unix() } }() + read := func(name string) map[string]string { + f, err := os.Open(dir + "/data/backups/" + name) + if err != nil { + t.Fatal(err) + } + defer f.Close() + zr, err := gzip.NewReader(f) + if err != nil { + t.Fatal(err) + } + tr := tar.NewReader(zr) + out := map[string]string{} + for { + h, err := tr.Next() + if err != nil { + break + } + raw, _ := io.ReadAll(tr) + out[h.Name] = string(raw) + } + return out + } + // by hand: everything, the live counters put on flash first + name, err := backupCreate(d, "") + if err != nil || !backupFile.MatchString(name) || strings.Contains(name[len("dawnline-20270115-080100"):], "-") { + t.Fatalf("a backup by hand: %q %v", name, err) + } + if got := read(name); len(got) != 3 || got["etc/config/dawnline"] != "config settings 'settings'\n" || got["etc/dawnline/usage.json"] != `{"live":true}` || got["etc/dawnline/events.json"] != "[]" { + t.Fatalf("what it holds: %v", got) + } + // before a removal: the settings alone, and its kind in its name + name, _ = backupCreate(d, "pre-delete") + if got := read(name); len(got) != 1 || !strings.HasSuffix(name, "-pre-delete.tar.gz") { + t.Fatalf("a backup before a removal: %s %v", name, got) + } + // of each kind only the newest stay: five before removals and the one just made + for i := 0; i < 8; i++ { + backupCreate(d, "pre-delete") + at := time.Unix(now, 0) + os.Chtimes(dir+"/data/backups/"+"dawnline-"+at.In(zone.Local()).Format("20060102-150405")+"-pre-delete.tar.gz", at, at) + } + kinds := map[string]int{} + for _, b := range backups(dir + "/data/backups") { + kinds[b["reason"].(string)]++ + } + if kinds["pre-delete"] != 6 || kinds["manual"] != 1 { + t.Fatalf("what stays: %v", kinds) + } + left, _ := os.ReadDir(dir + "/data/backups") + for _, e := range left { + if strings.HasPrefix(e.Name(), ".") { + t.Fatalf("a half-written archive stays: %s", e.Name()) + } + } +} + +func TestANewDisguise(t *testing.T) { + dir := t.TempDir() + os.WriteFile(dir+"/dawnline", []byte("config settings 'settings'\nconfig server 'home'\n\toption name 'Home'\n\toption jc '3'\n\toption i5 ''\n\toption header_protection_key 'old'\n\toption preset 'strong'\n"), 0o600) + full := awg.Caps{V2: true, V3: true} + var said []string + d := Deps{World: world, Store: &store.Store{Config: dir + "/dawnline", RunDir: dir}, Caps: func() awg.Caps { return full }, + Log: &servicelog.Log{RunDir: dir, Syslog: func(_, line string) { said = append(said, line) }}} + for _, name := range []string{"balanced", "max", "", "off"} { + if res := ask(t, d, "server_obfuscation", map[string]any{"id": "home", "preset": name}); res["error"] != nil { + t.Fatalf("%s: %v", name, res) + } + _, m, _ := d.Store.Read() + srv := m.Servers["home"] + want := name + if want == "" { + // none named: the strongest this router runs + want = "max" + } + if srv.Preset != want || srv.Obf["i5"] != "" || srv.Obf["header_protection_key"] == "old" || len(disguise.Errors(srv.Obf)) != 0 || len(srv.Obf) != len(disguise.Preset(want)) { + t.Fatalf("%s left %s with %v", name, srv.Preset, srv.Obf) + } + } + if len(said) != 4 || said[1] != "[info] [awg] admin changed server Home · disguise: max" { + t.Fatalf("what was written down: %v", said) + } + // an AmneziaWG that cannot run it: told what to install + full = awg.Caps{V2: true} + if res := ask(t, d, "server_obfuscation", map[string]any{"id": "home", "preset": "max"}); !strings.HasPrefix(text(res["error"]), "Maximum needs AmneziaWG 3.1") { + t.Fatalf("3.1 on a 2.0 router: %v", res) + } + if res := ask(t, d, "server_obfuscation", map[string]any{"id": "home"}); res["error"] != nil { + t.Fatalf("the strongest a 2.0 router runs: %v", res) + } + if _, m, _ := d.Store.Read(); m.Servers["home"].Preset != "balanced" { + t.Fatalf("it is %s", m.Servers["home"].Preset) + } +} + +func TestFixesAndUpdates(t *testing.T) { + dir := t.TempDir() + conf, _ := uci.Parse("config settings 'settings'\nconfig server 'home'\n\toption ifname 'dawn0'\n\toption private_key 'k'\n\toption subnet '10.77.0.0/24'\nconfig server 'keyless'\n\toption ifname 'dawn1'\n") + w := &view.World{M: model.Load(conf, nil), Usage: usage.Empty(), Now: 1_800_000_000} + var did []string + d := Deps{World: func() *view.World { return w }, RunDir: dir, DataDir: dir, + Snapshot: func() *netview.Snapshot { return &netview.Snapshot{Devices: map[string]*netview.Device{}} }, + Apply: func(string) map[string]any { did = append(did, "apply"); return map[string]any{"applied": true} }, + Sync: func(string) any { did = append(did, "sync"); return "a warning" }, + Background: func(s string) { did = append(did, "run "+s) }, + Ifup: func(n string) { did = append(did, "ifup "+n) }, + Updater: func(lang string, args []string) { did = append(did, "updater "+lang+" "+strings.Join(args, " ")) }, + } + for id, want := range map[string]string{"apply": "apply", "sync": "sync", "restart": "run sleep 1; /etc/init.d/dawnline restart", + "netrestart": "run sleep 1; /etc/init.d/network restart", "ifup:dawn0": "ifup dawn0"} { + did = nil + res := ask(t, d, "health_fix", map[string]any{"id": id}) + if res["error"] != nil || res["result"] == nil || res["checks"] == nil || res["watchdog"] == nil || len(did) != 1 || did[0] != want { + t.Errorf("%s: did %v, answered error %v result %v", id, did, res["error"], res["result"]) + } + } + // never another interface of the router, nor a tunnel that has no keys + for id, want := range map[string]string{"ifup:br-lan": "Unknown fix.", "ifup:lan": "lan is not one of Dawnline's tunnels.", "ifup:dawn1": "dawn1 is not one of Dawnline's tunnels.", + "reboot": "Unknown fix.", "": "Unknown fix."} { + did = nil + if res := ask(t, d, "health_fix", map[string]any{"id": id}); res["error"] != want || len(did) != 0 { + t.Errorf("%q: %v, did %v", id, res["error"], did) + } + } + for what, want := range map[string]string{"": "updater check", "check:app": "updater check app", "app@v0.19.0": "updater install app@v0.19.0", + "amneziawg:slava:ru": "updater install amneziawg:slava:ru", "pkgs:ip-full,kmod-veth": "updater install pkgs:ip-full,kmod-veth"} { + did = nil + if res := ask(t, d, "updates_run", map[string]any{"what": what}); res["started"] != true || res["job"] != nil || len(did) != 1 || did[0] != want { + t.Errorf("%q: %v, did %v", what, res, did) + } + } + for what, want := range map[string]string{"everything": "Unknown update target.", "app; reboot": "Unknown update target.", "pkgs:busybox": "busybox is not a package Dawnline manages", + "pkgs:ip-full,": "Unknown update target."} { + did = nil + if res := ask(t, d, "updates_run", map[string]any{"what": what}); res["error"] != want || len(did) != 0 { + t.Errorf("%q: %v, did %v", what, res["error"], did) + } + } + // the job the updater wrote is answered, never an older one + os.WriteFile(dir+"/update-job.json", []byte(`{"id":"old","started":5,"state":"done"}`), 0o600) + d.Updater = func(string, []string) { + os.WriteFile(dir+"/update-job.json", []byte(fmt.Sprintf(`{"id":"new","started":%d,"state":"running"}`, time.Now().Unix()+1)), 0o600) + } + if res := ask(t, d, "updates_run", map[string]any{"what": "check"}); res["job"] == nil || res["job"].(map[string]any)["id"] != "new" { + t.Fatalf("the new job: %v", res) + } + if res := ask(t, d, "apply", nil); res["applied"] != true { + t.Fatalf("apply: %v", res) + } +} + +func TestRestoreAndImport(t *testing.T) { + dir := t.TempDir() + os.MkdirAll(dir+"/data", 0o755) + good := "\nconfig settings 'settings'\n\toption portal_port '4500'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\n" + os.WriteFile(dir+"/config", []byte(good), 0o600) + os.WriteFile(dir+"/usage.json", []byte(`{"devices":{},"people":{},"then":true}`), 0o600) + os.WriteFile(dir+"/data/events.json", []byte(`[{"ts":1,"type":"connect"}]`), 0o600) + var said []string + applied := 0 + d := Deps{World: world, Config: dir + "/config", RunDir: dir, DataDir: dir + "/data", Store: &store.Store{Config: dir + "/config", RunDir: dir}, + Apply: func(string) map[string]any { applied++; return map[string]any{"ok": true} }, + Log: &servicelog.Log{RunDir: dir, Syslog: func(_, line string) { said = append(said, line) }}} + now := int64(1_800_000_000) + clock = func() int64 { now += 60; return now } + defer func() { clock = func() int64 { return time.Now().Unix() } }() + kept, _ := backupCreate(d, "") + // the settings change, the counters move on, then the backup is brought back + os.WriteFile(dir+"/config", []byte(strings.Replace(good, "'Home'", "'Changed'", 1)), 0o600) + os.WriteFile(dir+"/usage.json", []byte(`{"devices":{},"people":{},"later":true}`), 0o600) + os.WriteFile(dir+"/data/usage.json", []byte(`{"devices":{},"people":{},"later":true}`), 0o600) + if res := ask(t, d, "backup_restore", map[string]any{"name": kept}); res["ok"] != true || applied != 1 { + t.Fatalf("a restore: %v, applied %d", res, applied) + } + if raw, _ := os.ReadFile(dir + "/config"); string(raw) != good { + t.Fatalf("the settings after:\n%s", raw) + } + if raw, _ := os.ReadFile(dir + "/data/usage.json"); !strings.Contains(string(raw), "then") { + t.Fatalf("the counters after: %s", raw) + } + // the watcher is told to load the counters anew, and what was there before the restore is kept + if !exists(dir+"/usage.reload") || exists(dir+"/usage.json") { + t.Fatal("the live counters were not handed back to flash") + } + kinds := map[string]int{} + for _, b := range backups(dir + "/data/backups") { + kinds[b["reason"].(string)]++ + } + if kinds["pre-restore"] != 1 || kinds["manual"] != 1 || len(said) != 1 || !strings.Contains(said[0], "admin restored backup "+kept) { + t.Fatalf("what stays %v, what was written down %v", kinds, said) + } + // what is no backup, or holds what a backup may not + archive := func(entries ...[3]string) string { + var buf bytes.Buffer + zw := gzip.NewWriter(&buf) + tw := tar.NewWriter(zw) + for _, e := range entries { + h := &tar.Header{Name: e[0], Mode: 0o600, Size: int64(len(e[1])), Typeflag: tar.TypeReg} + if e[2] == "link" { + h.Typeflag, h.Linkname, h.Size = tar.TypeSymlink, e[1], 0 + } + tw.WriteHeader(h) + if e[2] != "link" { + tw.Write([]byte(e[1])) + } + } + tw.Close() + zw.Close() + return base64.StdEncoding.EncodeToString(buf.Bytes()) + } + broken := strings.Replace(good, "'10.77.0.0/24'", "'not a network'", 1) + for name, c := range map[string][2]string{ + "nothing": {"", "Upload is empty or too large."}, + "not an archive": {base64.StdEncoding.EncodeToString([]byte("hello")), "Not a valid backup archive."}, + "another file": {archive([3]string{"etc/config/dawnline", good, ""}, [3]string{"etc/passwd", "x", ""}), "Unexpected file in backup: etc/passwd"}, + "a link": {archive([3]string{"etc/config/dawnline", "/etc/shadow", "link"}), "Unexpected entry in backup: etc/config/dawnline"}, + "no settings": {archive([3]string{"etc/dawnline/usage.json", "{}", ""}), "Backup does not contain /etc/config/dawnline."}, + "unreadable": {archive([3]string{"etc/config/dawnline", "config 'unclosed", ""}), "The configuration in this file cannot be read."}, + "settings that fail": {archive([3]string{"./etc/config/dawnline", broken, ""}), "This configuration can't be used: Server Home: Subnet must look like 10.77.0.0/24."}, + } { + before := applied + if res := ask(t, d, "backup_upload", map[string]any{"data": c[0]}); res["error"] != c[1] || applied != before { + t.Errorf("%s: %v", name, res["error"]) + } + } + if raw, _ := os.ReadFile(dir + "/config"); string(raw) != good { + t.Fatal("a refused upload touched the settings") + } + if res := ask(t, d, "backup_upload", map[string]any{"data": archive([3]string{"/etc/config/dawnline", strings.Replace(good, "'Home'", "'Sent'", 1), ""})}); res["ok"] != true { + t.Fatalf("a good upload: %v", res) + } + // an export comes back as the settings it was taken from + out := ask(t, d, "export", nil) + raw, _ := json.Marshal(out) + var sent map[string]any + json.Unmarshal(raw, &sent) + os.WriteFile(dir+"/config", []byte(good), 0o600) + if res := ask(t, d, "import", map[string]any{"data": sent}); res["ok"] != true { + t.Fatalf("an import: %v", res) + } + _, m, _ := d.Store.Read() + if m.Servers["home"].Name != "Sent" || m.Servers["home"].Subnet != "10.77.0.0/24" || m.Settings.PortalPort != 4500 { + t.Fatalf("the settings imported: %+v", m.Servers["home"]) + } + for name, c := range map[string]struct { + data any + want string + }{ + "not an export": {map[string]any{"format": "other", "sections": []any{}}, "Not a Dawnline export."}, + "nothing": {nil, "Not a Dawnline export."}, + "another kind": {map[string]any{"format": "dawnline", "sections": []any{map[string]any{".type": "interface", ".name": "lan"}}}, "Invalid section lan."}, + "a bad name": {map[string]any{"format": "dawnline", "sections": []any{map[string]any{".type": "person", ".name": "a b"}}}, "Invalid section a b."}, + "a bad option": {map[string]any{"format": "dawnline", "sections": []any{map[string]any{".type": "person", ".name": "anna", "Name": "x"}}}, "Invalid option Name."}, + "a number": {map[string]any{"format": "dawnline", "sections": []any{map[string]any{".type": "person", ".name": "anna", "limit": 5.0}}}, "Invalid option limit."}, + "what is broken": {map[string]any{"format": "dawnline", "sections": []any{map[string]any{".type": "settings", ".name": "settings"}, map[string]any{".type": "person", ".name": "anna", "server": "gone", "name": "Anna"}}}, "This configuration can't be used: Person Anna: server gone does not exist."}, + } { + if res := ask(t, d, "import", map[string]any{"data": c.data}); res["error"] != c.want { + t.Errorf("%s: %v", name, res["error"]) + } + } +} + +// A backup the ucode backend made with its own tar is read by Go's restore, file for file. +func TestUcodesBackupIsRead(t *testing.T) { + raw, err := os.ReadFile("testdata/backup.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Config string `json:"config"` + Archives []struct{ Name, Data string } + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + if len(golden.Archives) != 2 { + t.Fatalf("%d archives", len(golden.Archives)) + } + for i, a := range golden.Archives { + data, _ := base64.StdEncoding.DecodeString(a.Data) + parts, err := unpack(data) + if err != nil || string(parts["etc/config/dawnline"]) != golden.Config || !backupFile.MatchString(a.Name) { + t.Fatalf("%s: %v", a.Name, err) + } + // by hand: the counters and the log with it; before an update: the settings alone + if want := []int{3, 1}[i]; len(parts) != want { + t.Errorf("%s holds %d files, want %d", a.Name, len(parts), want) + } + } + if !strings.Contains(string(mustUnpack(t, golden.Archives[0].Data)["etc/dawnline/usage.json"]), "by ucode") { + t.Fatal("the counters in it are not the ones that were there") + } +} + +func mustUnpack(t *testing.T, b64 string) map[string][]byte { + data, _ := base64.StdEncoding.DecodeString(b64) + parts, err := unpack(data) + if err != nil { + t.Fatal(err) + } + return parts +} diff --git a/backend/methods/person.go b/backend/methods/person.go new file mode 100644 index 0000000..50a36c3 --- /dev/null +++ b/backend/methods/person.go @@ -0,0 +1,679 @@ +package methods + +import ( + crand "crypto/rand" + "errors" + "math" + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// personFields are what person_update takes as strings ("" clears an optional one), in the order they are +// applied and told; a name and a move are one person at a time. +var personFields = []string{"name", "access", "device_limit", "expires", "quota_gb", "quota_period", "bonus_gb", "note", "dns_mode", "server"} + +// fields is a person's changes from a call's arguments: the known ones that are given, and their names in +// the order ucode keeps them (the fields, then paused, services, circle, home_nets). +func fieldsOf(a map[string]any) (f map[string]any, order []string) { + f = map[string]any{} + take := func(k string) { + f[k] = a[k] + order = append(order, k) + } + for _, k := range personFields { + if a[k] != nil { + take(k) + } + } + if a["paused"] != nil { + take("paused") + } + if _, list := a["services"].([]any); list { + take("services") + } + if a["circle"] != nil { + take("circle") + } + if _, list := a["home_nets"].([]any); list { + take("home_nets") + } + return f, order +} + +// number reads a value as ucode's unary plus does: a whole number (decimal or 0x…), or one with a +// fraction or an exponent, blanks around it allowed. ok is false for anything else, and for none. +func number(v any) (float64, bool) { + switch x := v.(type) { + case string: + s := strings.Trim(x, blank) + if s == "" { + return 0, false + } + if n, err := strconv.ParseInt(s, 0, 64); err == nil && !strings.HasPrefix(strings.TrimLeft(s, "+-"), "0b") && !strings.HasPrefix(strings.TrimLeft(s, "+-"), "0o") { + return float64(n), true + } + if strings.ContainsAny(s, "nNiIxXpP_") { + return 0, false + } + n, err := strconv.ParseFloat(s, 64) + return n, err == nil + case nil: + return 0, false + } + return num(v), true +} + +// str is a value as ucode writes it into a string: a whole number plainly, another as C's %g does. +func str(n float64) string { + if n == math.Trunc(n) && math.Abs(n) < 1e15 { + return strconv.FormatInt(int64(n), 10) + } + return strconv.FormatFloat(n, 'g', -1, 64) +} + +// validDate tells YYYY-MM-DD, and a day that exists (2026-02-30 does not). +func validDate(s string) bool { + t, err := time.ParseInLocation("2006-01-02", s, zone.Local()) + return err == nil && len(s) == 10 && t.Format("2006-01-02") == s +} + +const ifaceChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.@-" + +// allocAddress is the first free address in a server's tunnel network (the router has the first), or "". +func allocAddress(m *model.Model, srv *model.Server, serverOf func(*model.Person) string, addressOf func(*model.Device) string) string { + t, ok := ipnet.Subnet(srv.Subnet) + if !ok { + return "" + } + used := map[uint32]bool{t.First(): true} + for _, id := range m.DeviceIDs() { + d := m.Devices[id] + if p := m.People[d.Person]; p != nil && serverOf(p) == srv.ID { + if n, ok := ipnet.IP(addressOf(d)); ok { + used[n] = true + } + } + } + last := uint32(uint64(t.Base) + t.Size() - 2) + for n := t.First() + 1; n <= last; n++ { + if !used[n] { + return ipnet.String(n) + } + } + return "" +} + +// updatePerson changes a person in the settings: only the fields given, "" clearing an optional one +// (dawnline.core update_person). A value that is refused leaves everything as it was (the caller's +// transaction writes nothing). t words the one refusal that counts devices. +func updatePerson(c *uci.Config, m *model.Model, id string, f map[string]any, records *usage.Usage, t *i18n.Catalog) error { + p := m.People[id] + if p == nil { + return errors.New("Unknown person.") + } + set := func(k, v string) { + if v == "" { + c.Delete(id, k) + } else { + c.Set(id, k, v) + } + } + given := func(k string) (string, bool) { + v, has := f[k] + if !has || v == nil { + return "", false + } + if s, isString := v.(string); isString { + return s, true + } + return str(num(v)), true + } + if v, ok := given("name"); ok { + if !ValidName(v) { + return errors.New(`Enter a name: up to 48 characters, without < > " or \.`) + } + set("name", strings.Trim(v, blank)) + } + if v, ok := given("access"); ok { + if v != "lan" && v != "internet" && v != "both" { + return errors.New("Access must be lan, internet or both.") + } + set("access", v) + } + if _, ok := given("device_limit"); ok { + x, _ := number(f["device_limit"]) + n := int(x) + if n < 1 || n > 32 { + return errors.New("Device limit must be between 1 and 32.") + } + if have := len(p.Devices); n < have { + return said{t.N(int64(have), "%s already has %d device. Remove one first to lower the limit to %d.", + "%s already has %d devices. Remove one first to lower the limit to %d."), []any{p.Name, have, n}} + } + set("device_limit", strconv.Itoa(n)) + } + if v, ok := given("expires"); ok { + if v != "" && !validDate(v) { + return errors.New("End date must be YYYY-MM-DD.") + } + set("expires", v) + } + if v, ok := given("dns_mode"); ok { + if v != "device" && v != "home" { + return errors.New("Unknown DNS choice.") + } + if v == "device" { + v = "" + } + set("dns_mode", v) + } + if v, ok := given("quota_gb"); ok { + q, isNumber := number(f["quota_gb"]) + if !isNumber { + q = -1 + } + if v != "" && (q < 0 || q > 100000) { + return errors.New("Data limit must be a positive number of GB.") + } + if q > 0 { + set("quota_gb", str(q)) + } else { + set("quota_gb", "") + } + } + if v, ok := given("quota_period"); ok { + if v != "total" { + v = "" + } + set("quota_period", v) + } + if _, ok := given("bonus_gb"); ok { + b, isNumber := number(f["bonus_gb"]) + if !isNumber || b < 0 || b > 100000 { + return errors.New("Extra data must be a positive number of GB.") + } + if b > 0 { + set("bonus_gb", str(b)) + // it lasts until their limit month ends (none running: a month from now) + now := time.Now().Unix() + from := now + if records != nil { + if lm := usage.LimitMonth(records.People[id], now); lm != nil { + from = int64(lm.Start) + } + } + set("bonus_until", strconv.FormatInt(usage.MonthAfter(from), 10)) + } else { + set("bonus_gb", "") + set("bonus_until", "") + } + set("bonus_month", "") + } + if v, ok := given("note"); ok { + note := []rune(strings.Trim(v, blank)) + if len(note) > 500 { + note = note[:500] + } + set("note", string(note)) + } + if list, ok := f["services"].([]any); ok { + var ids []string + for _, s := range list { + sid := text(s) + if m.Services[sid] == nil { + return said{"Unknown service %s.", []any{sid}} + } + ids = append(ids, sid) + } + if len(ids) > 0 { + c.SetList(id, "service", ids) + } else { + c.Delete(id, "service") + } + } + if v, ok := given("circle"); ok { + if ci := m.Circles[v]; v != "" && (ci == nil || ci.Server != p.Server) { + return errors.New("Unknown circle.") + } + set("circle", v) + } + // another server: every device gets an address in its tunnel (so each needs its configuration again); + // circles and home networks are the old server's and go + if v, ok := given("server"); ok && v != "" && v != p.Server { + srv := m.Servers[v] + if srv == nil { + return errors.New("Unknown server.") + } + set("server", v) + moved := map[string]string{} + serverOf := func(q *model.Person) string { + if q.ID == id { + return v + } + return q.Server + } + addressOf := func(d *model.Device) string { + if a, has := moved[d.ID]; has { + return a + } + return d.Address + } + for _, did := range p.Devices { + addr := allocAddress(m, srv, serverOf, addressOf) + if addr == "" { + return said{"No free address left on %s.", []any{srv.Name}} + } + moved[did] = addr + c.Set(did, "address", addr) + } + c.Delete(id, "circle") + c.Delete(id, "home_net") + } + if list, ok := f["home_nets"].([]any); ok { + var nets []string + seen := map[string]bool{} + for _, x := range list { + n := trimmed(x) + if n == "" || len(n) > 32 || strings.Trim(n, ifaceChars) != "" || seen[n] { + continue + } + seen[n] = true + nets = append(nets, n) + } + if len(nets) > 0 { + c.SetList(id, "home_net", nets) + } else { + c.Delete(id, "home_net") + } + } + if v, has := f["paused"]; has && v != nil { + if truthy(v) { + set("paused", "1") + } else { + set("paused", "") + } + } + return nil +} + +// records is the watcher's counters, or nil before it has looked. +func records(d Deps) *usage.Usage { + if w := d.World(); w != nil { + return w.Usage + } + return nil +} + +// merged puts an event in the activity log, folded into the last one of the same kind and person when that +// is no older than two minutes, and in syslog (dawnline.live add_event_merged). +func merged(d Deps, e journal.Event) { + _, m, err := d.Store.Read() + if err != nil { + return + } + names := journal.NamesOf(m) + if lvl := journal.Level(e); lvl != "" && d.Log != nil { + line := journal.Event{} + for k, v := range e { + line[k] = v + } + kind, _ := e["type"].(string) + d.Log.Say(lvl, journal.CategoryOf(kind), journal.Line(journal.Named(line, names))) + } + journal.Log{Run: d.RunDir, Data: d.DataDir}.AddMerged(e, 120, journal.PolicyOf(m.Settings.Retention), names, time.Now().Unix()) +} + +// personUpdate is an immediate edit from a person's page; it returns the person as the page shows them. +func personUpdate(d Deps, a map[string]any) (map[string]any, error) { + id := text(a["id"]) + f, order := fieldsOf(a) + t := i18n.Use(d.Catalogs, text(a["lang"])) + var was any + var before *model.Model + warning, err := change(d, text(a["lang"]), func(c *uci.Config, m *model.Model) error { + before = m + if p := m.People[id]; p != nil { + was = p.Access + } + return updatePerson(c, m, id, f, records(d), t) + }) + if err != nil { + return nil, err + } + // "moved to Test" says more than "server" + var changes []string + for _, k := range order { + switch { + case k == "note": + case k == "server" && before.Servers[text(f["server"])] != nil: + changes = append(changes, "moved to "+before.Servers[text(f["server"])].Name) + default: + changes = append(changes, k) + } + } + if len(changes) > 0 { + merged(d, journal.Event{"type": "person_changed", "person": id, "detail": strings.Join(changes, ", "), "by": "admin"}) + } + if d.Told != nil { + d.Told() + } + var person any + if w := d.World(); w != nil && w.M != nil && w.M.People[id] != nil { + person = w.PersonOf(w.M.People[id], true) + } + return map[string]any{"person": person, "was": was, "warning": warning}, nil +} + +// bulkMax is how many people one people_update changes at most. +const bulkMax = 500 + +// peopleUpdate changes several people at once (People's picks: extend, pause, resume, and their undo): +// `list` is [{ id, patch }] with person_update's fields. All or nothing: one transaction, one apply. +func peopleUpdate(d Deps, a map[string]any) (map[string]any, error) { + list, _ := a["list"].([]any) + if len(list) == 0 { + return nil, errors.New("Nothing to change.") + } + if len(list) > bulkMax { + return nil, said{"At most %d people at once.", []any{bulkMax}} + } + type one struct { + id string + f map[string]any + order []string + } + var todo []one + seen := map[string]bool{} + for _, x := range list { + o, _ := x.(map[string]any) + id, isString := o["id"].(string) + if !isString || id == "" || len(id) > 64 { + return nil, errors.New("Each change needs the id of a person.") + } + if seen[id] { + return nil, said{"%s is in the list twice.", []any{id}} + } + seen[id] = true + patch, _ := o["patch"].(map[string]any) + if len(patch) == 0 { + return nil, said{"Nothing to change for %s.", []any{id}} + } + for k, v := range patch { + if k == "paused" { + if _, isBool := v.(bool); !isBool { + return nil, errors.New("Paused must be true or false.") + } + continue + } + known := false + for _, pf := range personFields { + known = known || pf == k + } + if !known || k == "name" || k == "server" { + return nil, said{"%s cannot be changed for several people at once.", []any{k}} + } + switch v.(type) { + case string, int, int32, int64, float64: + default: + return nil, said{"%s must be a value, not a list.", []any{k}} + } + } + f, order := fieldsOf(patch) + todo = append(todo, one{id, f, order}) + } + t := i18n.Use(d.Catalogs, text(a["lang"])) + was := map[string]bool{} + warning, err := change(d, text(a["lang"]), func(c *uci.Config, m *model.Model) error { + for _, x := range todo { + if p := m.People[x.id]; p != nil { + was[x.id] = p.Paused + } + if err := updatePerson(c, m, x.id, x.f, records(d), t); err != nil { + return err + } + } + return nil + }) + if err != nil { + return nil, err + } + for _, x := range todo { + if v, has := x.f["paused"]; has && truthy(v) != was[x.id] { + kind := "resumed" + if truthy(v) { + kind = "paused" + } + logged(d, journal.Event{"type": kind, "person": x.id, "by": "admin"}) + } + var changes []string + for _, k := range x.order { + if k != "note" && k != "paused" { + changes = append(changes, k) + } + } + if len(changes) > 0 { + merged(d, journal.Event{"type": "person_changed", "person": x.id, "detail": strings.Join(changes, ", "), "by": "admin"}) + } + } + if d.Told != nil { + d.Told() + } + return map[string]any{"changed": len(todo), "warning": warning}, nil +} + +var _ = view.Person{} + +// clock is the moment a change is made at. A test puts its own in its place. +var clock = func() int64 { return time.Now().Unix() } + +// NewCode draws a personal code (for the steps that replace older ones). +func NewCode() string { return newCode() } + +// newCode is a personal code: three pronounceable words of three syllables each (kamiro-telosu-bavine), +// easy to read out or type; the code is the whole link path. A test puts its own in its place. +var newCode = func() string { + const consonants, vowels = "bdfgklmnprstvz", "aeiou" + pick := func(alphabet string) byte { + n := len(alphabet) + lim := 256 - 256%n + for { + var b [1]byte + crand.Read(b[:]) + if int(b[0]) < lim { + return alphabet[int(b[0])%n] + } + } + } + for { + words := make([]string, 3) + for w := range words { + var s []byte + for i := 0; i < 3; i++ { + s = append(s, pick(consonants), pick(vowels)) + } + words[w] = string(s) + } + code := strings.Join(words, "-") + bad := false + for _, x := range []string{"suka", "pido", "muda", "zalup", "dura", "gavn"} { + bad = bad || strings.Contains(code, x) + } + if !bad { + return code + } + } +} + +var ( + notLowerAlnum = regexp.MustCompile(`[^a-z0-9]+`) + personID = regexp.MustCompile(`^[a-z0-9_]{1,32}$`) +) + +// slugify turns a display name into an id to start from ("Мама Таня" → "mama-tanya"), "user" for nothing. +func slugify(s string) string { + out := notLowerAlnum.ReplaceAllString(lower(handout.Translit(strings.Trim(s, blank))), "-") + out = strings.Trim(out, "-") + if len(out) > 32 { + out = out[:32] + } + if out == "" { + return "user" + } + return out +} + +// link is a person's main link, or nil when the portal would not answer it. +func link(m *model.Model, id string) any { + p := m.People[id] + hosts := view.PortalHosts(m) + if p == nil || len(hosts) == 0 { + return nil + } + return orNull(view.PortalLink(m, p, hosts[0])) +} + +// personCreate adds a person (dawnline.core create_person): an id from their name, a personal code. +func personCreate(d Deps, a map[string]any) (map[string]any, error) { + name := trimmed(a["name"]) + id := "" + err := write(d, func(c *uci.Config, m *model.Model) error { + if !ValidName(name) { + return errors.New(`Enter a name: up to 48 characters, without < > " or \.`) + } + // the id is a section's name: letters, digits and underscores only; repeated names get _2, _3, … + base := trimmed(a["slug"]) + if base == "" { + base = slugify(name) + } + base = strings.ReplaceAll(base, "-", "_") + if !personID.MatchString(base) { + return errors.New("The id may use lowercase letters, digits and underscores.") + } + id = base + for n := 2; taken(m, id); n++ { + if n > 99 { + return said{`"%s" is already taken.`, []any{base}} + } + id = base[:min(len(base), 28)] + "_" + strconv.Itoa(n) + } + server := trimmed(a["server"]) + if ids := m.ServerIDs(); server == "" && len(ids) > 0 { + server = ids[0] + } + if m.Servers[server] == nil { + return errors.New("Set up a server first.") + } + access := "internet" + if a["access"] != nil { + access = text(a["access"]) + } + if access != "lan" && access != "internet" && access != "both" { + return errors.New("Access must be lan, internet or both.") + } + limit := m.Settings.DefaultDeviceLimit + if v := trimmed(a["device_limit"]); v != "" { + if x, ok := number(v); ok { + limit = int(x) + } + } + if limit < 1 || limit > 32 { + return errors.New("Device limit must be between 1 and 32.") + } + expires := trimmed(a["expires"]) + if expires != "" && !validDate(expires) { + return errors.New("End date must be YYYY-MM-DD.") + } + quota, _ := number(trimmed(a["quota_gb"])) + if quota < 0 || quota > 100000 { + return errors.New("Monthly data must be a positive number of GB.") + } + now := strconv.FormatInt(clock(), 10) + c.Add("person", id) + c.Set(id, "server", server) + c.Set(id, "name", name) + c.Set(id, "access", access) + c.Set(id, "device_limit", strconv.Itoa(limit)) + c.Set(id, "code", newCode()) + c.Set(id, "code_set", now) + c.Set(id, "created", now) + if expires != "" { + c.Set(id, "expires", expires) + } + if quota > 0 { + c.Set(id, "quota_gb", str(quota)) + period := "month" + if text(a["quota_period"]) == "total" { + period = "total" + } + c.Set(id, "quota_period", period) + } + return nil + }) + if err != nil { + return nil, err + } + logged(d, journal.Event{"type": "person_added", "person": id, "detail": name, "by": "admin"}) + if d.Told != nil { + d.Told() + } + _, m, _ := d.Store.Read() + return map[string]any{"id": id, "link": link(m, id)}, nil +} + +// personRegen gives a person a new personal link: the old one stops working at once. What it already +// handed out stays unless asked: `remove` lists the person's devices to take away with it. +func personRegen(d Deps, a map[string]any) (map[string]any, error) { + id := text(a["id"]) + var gone []*model.Device + err := write(d, func(c *uci.Config, m *model.Model) error { + if m.People[id] == nil { + return errors.New("Unknown person.") + } + c.Set(id, "code", newCode()) + c.Set(id, "code_set", strconv.FormatInt(clock(), 10)) + list, _ := a["remove"].([]any) + for _, x := range list { + if dev := m.Devices[text(x)]; dev != nil && dev.Person == id { + already := false + for _, g := range gone { + already = already || g.ID == dev.ID + } + if !already { + gone = append(gone, dev) + c.DeleteSection(dev.ID) + } + } + } + return nil + }) + if err != nil { + return nil, err + } + logged(d, journal.Event{"type": "link_changed", "person": id, "by": "admin"}) + var warning any + if len(gone) > 0 { + for _, dev := range gone { + logged(d, journal.Event{"type": "device_removed", "person": id, "device": dev.ID, "detail": dev.Name, "dname": dev.Name, "dkind": dev.Kind, "by": "admin"}) + } + if d.Sync != nil { + warning = d.Sync(text(a["lang"])) + } + } + if d.Told != nil { + d.Told() + } + _, m, _ := d.Store.Read() + return map[string]any{"link": link(m, id), "removed": len(gone), "warning": warning}, nil +} diff --git a/backend/methods/portal.go b/backend/methods/portal.go new file mode 100644 index 0000000..1926c17 --- /dev/null +++ b/backend/methods/portal.go @@ -0,0 +1,752 @@ +package methods + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "net/netip" + "os" + "regexp" + "sort" + "strconv" + "strings" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/access" + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// The personal portal's answers (dawnline.portal): +// +// GET / the app shell +// GET //assets/ its script and styles (gzipped when the browser takes it) +// GET //api/state +// POST //api/devices { name, kind, public_key?, lan_bypass?, networks? } +// GET //api/devices//config +// POST //api/devices/ { action: rename|reconnect|bypass|networks|delete, name?, kind?, lan_bypass?, on?, networks?, cleared? } +// +// The personal link is the key: every request carries its code, there are no sessions. Without a valid +// code every path answers the same bare 404, so nothing tells a scanner there is a portal here. Wrong +// codes are counted per client (a blocked client gets the same 404 for a wrong code; a valid link always +// opens): per IPv4 address or IPv6 /64, behind Cloudflare per visitor, with a higher ceiling for all +// Cloudflare visitors together. POST bodies must be JSON from the same origin. The portal can only manage +// the person's own devices within their limits, and not those the admin turned off (Actor). Changes +// through a link are limited too, and the configurations themselves (keys, the disguise) only go over +// HTTPS: a plain-HTTP link shows the page, but gets them from its HTTPS twin. + +const ( + portalFailLimit = 8 + portalFailWindow = 900 + portalSharedLimit = portalFailLimit * 25 + portalSharedKey = "cloudflare" + portalRateMax = 2000 + portalActionLimit = 40 + portalBodyMax = 8192 +) + +// PortalAssets is where the portal's script and styles are kept (outside any web root). +var PortalAssets = "/usr/share/dawnline/portal/assets" + +// PortalRequest is one request to the portal. +type PortalRequest struct { + Method, Path, Host string + HTTPS bool + Remote, CFConnectingIP string + Origin, ContentType string + AcceptLanguage, AcceptEncoding string + ContentLength int64 + Body io.Reader + // Live: the page has a stream to follow (the shell tells it). + Live bool +} + +// PortalAnswer is what it gets. +type PortalAnswer struct { + Status int + Header [][2]string + Body []byte +} + +type portalDone struct{ a PortalAnswer } + +type portalCall struct { + d Deps + q PortalRequest + t *i18n.Catalog + w *view.World + person *model.Person + base string + buckets []portalBucket +} + +type portalBucket struct { + key string + limit int +} + +var ( + wordCode = regexp.MustCompile(`^[a-z]{6}-[a-z]{6}-[a-z]{6}$`) + assetName = regexp.MustCompile(`^[a-z0-9-]+\.(js|css|png)$`) + takesGzip = regexp.MustCompile(`(^|[ ,])gzip([ ;,]|$)`) + firstLang = regexp.MustCompile(`^[ \t]*([A-Za-z][A-Za-z][A-Za-z]?)`) + portOfHost = regexp.MustCompile(`:([0-9]+)$`) + jsonType = regexp.MustCompile(`^application/json`) + bareFile = regexp.MustCompile(`^/(luci-static|cgi-bin|ubus)(/|$)`) + assetTypes = map[string]string{"js": "text/javascript", "css": "text/css", "png": "image/png"} +) + +func (c *portalCall) answer(status int, extra [][2]string, body []byte) { + h := [][2]string{{"X-Content-Type-Options", "nosniff"}, {"Referrer-Policy", "no-referrer"}, {"X-Frame-Options", "DENY"}, {"Cache-Control", "no-store"}} + for _, kv := range extra { + replaced := false + for i := range h { + if h[i][0] == kv[0] { + h[i][1], replaced = kv[1], true + } + } + if !replaced { + h = append(h, kv) + } + } + // HSTS pins the whole name: only when the visitor is on the standard port + port := "443" + if m := portOfHost.FindStringSubmatch(c.q.Host); m != nil { + port = m[1] + } + if c.q.HTTPS && port == "443" { + h = append(h, [2]string{"Strict-Transport-Security", "max-age=31536000"}) + } + panic(portalDone{PortalAnswer{Status: status, Header: h, Body: body}}) +} + +func (c *portalCall) json(status int, v any) { + raw, _ := json.Marshal(v) + c.answer(status, [][2]string{{"Content-Type", "application/json"}}, raw) +} + +func (c *portalCall) fail(status int, msg string) { + c.json(status, map[string]any{"error": msg}) +} + +// refuse is fail for what a change said: its words in the visitor's language. +func (c *portalCall) refuse(status int, err error) { + switch s := err.(type) { + case access.Said: + c.fail(status, fmt.Sprintf(c.t.T(s.Msg), s.Args...)) + case said: + c.fail(status, fmt.Sprintf(c.t.T(s.msg), s.args...)) + default: + c.fail(status, wordsOf(c.t, err, nil)) + } +} + +// notFound is the one answer for anything without a valid code: a bare 404, or the redirect from +// Settings. Files always get the 404: a missing asset must not turn into someone's website. +func (c *portalCall) notFound() { + parts := strings.Split(c.q.Path, "/") + file := bareFile.MatchString(c.q.Path) || strings.Contains(parts[len(parts)-1], ".") + if to := c.w.M.Settings.PortalRedirect; to != "" && !file { + c.answer(302, [][2]string{{"Location", to}, {"Cache-Control", "no-store"}, {"Content-Type", "text/plain"}}, []byte("Moved\n")) + } + c.answer(404, [][2]string{{"Content-Type", "text/plain"}}, []byte("Not found\n")) +} + +/* ---------- rate limiting ---------- */ + +// addrKey is the rate-limit key of an address: an IPv4 address, or the /64 of an IPv6 one ("": neither). +func addrKey(a string) string { + ip, err := netip.ParseAddr(a) + if err != nil { + return "" + } + if ip.Is4() { + return ip.String() + } + // an IPv4 address seen through an IPv6 socket + if ip.Is4In6() { + return ip.Unmap().String() + } + b := ip.As16() + return fmt.Sprintf("%x:%x:%x:%x::/64", uint16(b[0])<<8|uint16(b[1]), uint16(b[2])<<8|uint16(b[3]), uint16(b[4])<<8|uint16(b[5]), uint16(b[6])<<8|uint16(b[7])) +} + +// portalBuckets is what a request counts against: its client, and behind Cloudflare (the only proxy whose +// CF-Connecting-IP is believed) also the bucket all Cloudflare visitors share. +func portalBuckets(q PortalRequest) []portalBucket { + if !endpoint.Cloudflare(q.Remote) { + key := addrKey(q.Remote) + if key == "" { + key = q.Remote + } + return []portalBucket{{key, portalFailLimit}} + } + out := []portalBucket{{portalSharedKey, portalSharedLimit}} + if v := addrKey(strings.TrimSpace(q.CFConnectingIP)); v != "" && !endpoint.Cloudflare(v) { + out = append([]portalBucket{{v, portalFailLimit}}, out...) + } + return out +} + +type portalRate struct { + First int64 `json:"first"` + Count int `json:"count"` +} + +func (c *portalCall) rates() map[string]*portalRate { + st := map[string]*portalRate{} + files.ReadJSON(c.d.RunDir+"/portal-rate.json", &st) + now := time.Now().Unix() + for k, v := range st { + if v == nil || now-v.First > portalFailWindow { + delete(st, k) + } + } + return st +} + +func (c *portalCall) blocked() bool { + st := c.rates() + for _, b := range c.buckets { + if v := st[b.key]; v != nil && v.Count >= b.limit { + return true + } + } + return false +} + +// wrongCode counts a well-formed guess; a bucket that just filled is told in the activity log. +func (c *portalCall) wrongCode() { + var hit []string + func() { + defer files.Lock(c.d.RunDir, "portal-rate")() + st := c.rates() + now := time.Now().Unix() + for _, b := range c.buckets { + v := st[b.key] + if v == nil { + v = &portalRate{First: now} + st[b.key] = v + } + if v.Count++; v.Count == b.limit { + hit = append(hit, b.key) + } + } + // bounded: an attacker with many addresses cannot grow the file without end + if over := len(st) - portalRateMax; over > 0 { + keys := make([]string, 0, len(st)) + for k := range st { + keys = append(keys, k) + } + sort.Slice(keys, func(i, j int) bool { return st[keys[i]].First < st[keys[j]].First }) + for _, k := range keys[:over] { + delete(st, k) + } + } + os.MkdirAll(c.d.RunDir, 0o755) + files.WriteJSON(c.d.RunDir+"/portal-rate.json", st, 0o600) + }() + for _, k := range hit { + if k == portalSharedKey { + k = "all Cloudflare visitors" + } + logged(c.d, journal.Event{"type": "portal_blocked", "detail": k}) + } +} + +// action counts one more change through this link; refused beyond the limit a window. +func (c *portalCall) action() { + over := false + func() { + defer files.Lock(c.d.RunDir, "portal-rate")() + st := c.rates() + key := "act:" + c.person.ID + v := st[key] + if v == nil { + v = &portalRate{First: time.Now().Unix()} + st[key] = v + } + v.Count++ + over = v.Count > portalActionLimit + os.MkdirAll(c.d.RunDir, 0o755) + files.WriteJSON(c.d.RunDir+"/portal-rate.json", st, 0o600) + }() + if over { + c.fail(429, c.t.T("Too many changes in a short time. Try again in a few minutes.")) + } +} + +/* ---------- pages ---------- */ + +var htmlEscape = strings.NewReplacer("&", "&", "<", "<", ">", ">", `"`, """, "'", "'") + +// shell is the app shell; it reads the code from its own URL and sends it along. +func (c *portalCall) shell() { + // the build's time joins the version: every update gives the assets new URLs, so they are kept for good + var built int64 + if st, err := os.Stat(PortalAssets + "/portal.js"); err == nil { + built = st.ModTime().Unix() + } + v := fmt.Sprintf("?v=%s.%d", backend.Version, built) + title := "Dawnline" + if srv := c.w.M.Servers[c.person.Server]; srv != nil && srv.Name != "" { + title = srv.Name + } + // the icon goes in the page: a request of its own is one more round trip + favicon := "" + if icon, err := os.ReadFile(PortalAssets + "/icon.svg"); err == nil && len(icon) > 0 { + favicon = `` + "\n" + } + live := "" + if c.q.Live { + live = ` data-live="1"` + } + page := ` + + + + + + +` + htmlEscape.Replace(title) + ` +` + favicon + ` + + +
+ + + +` + c.answer(200, [][2]string{{"Content-Type", "text/html; charset=utf-8"}, + {"Content-Security-Policy", "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:; " + + "connect-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'"}}, []byte(page)) +} + +// asset is the script and the styles; the shell's ?v= changes with every build, so they never go stale. +func (c *portalCall) asset(name string) { + m := assetName.FindStringSubmatch(name) + if m == nil { + c.notFound() + } + h := [][2]string{{"Content-Type", assetTypes[m[1]]}, {"Cache-Control", "private, max-age=31536000, immutable"}, {"Vary", "Accept-Encoding"}} + // the build keeps a gzipped copy beside each: a third of the bytes for a browser that takes it + if takesGzip.MatchString(strings.ToLower(c.q.AcceptEncoding)) { + if gz, err := os.ReadFile(PortalAssets + "/" + name + ".gz"); err == nil { + c.answer(200, append(h, [2]string{"Content-Encoding", "gzip"}), gz) + } + } + data, err := os.ReadFile(PortalAssets + "/" + name) + if err != nil { + c.notFound() + } + c.answer(200, h, data) +} + +/* ---------- the API ---------- */ + +// reload is the settings again after a change. +func (c *portalCall) reload() { + c.w = c.d.World() + if c.w == nil { + c.fail(503, c.t.T("The router is still starting. Try again in a moment.")) + } + if c.person = c.w.M.People[c.person.ID]; c.person == nil { + c.notFound() + } +} + +// personState is the person's state for the page: a stop by the admin (pause, end of access) wins over +// their server being off, so they learn that their access is stopped. +func (c *portalCall) personState() string { + st := state.Of(c.w.M, c.person, c.w.Usage, c.w.Now) + if st == "server_off" { + if own := state.Own(c.person, c.w.Usage, c.w.Now); own == "paused" || own == "expired" { + return own + } + } + return st +} + +// needOpen refuses a change (or a configuration) while the person is stopped. +func (c *portalCall) needOpen() { + switch c.personState() { + case "paused": + c.fail(403, c.t.T("Your access is paused.")) + case "expired": + c.fail(403, c.t.T("Your access has ended.")) + } +} + +// httpsURL is the same link over HTTPS (for a plain-HTTP visitor), or "" when this is it. +func (c *portalCall) httpsURL() string { + if c.q.HTTPS { + return "" + } + h := strings.SplitN(c.q.Host, ":", 2)[0] + if strings.HasPrefix(c.q.Host, "[") { + if i := strings.Index(c.q.Host, "]"); i > 0 { + h = c.q.Host[:i+1] + } + } + port := "" + if p := c.w.M.Settings.PortalPort; p != 443 { + port = ":" + strconv.Itoa(p) + } + return "https://" + h + port + c.base +} + +// needHTTPS: keys and the disguise never travel in the clear; the answer names the HTTPS link to use. +func (c *portalCall) needHTTPS() { + if u := c.httpsURL(); u != "" { + c.json(403, map[string]any{"error": c.t.T("Open this link over HTTPS to get the connection settings."), "https_url": u}) + } +} + +func (c *portalCall) notReady() { + st := map[string]any{} + if c.d.AWG != nil { + st = c.d.AWG() + } + if c.d.AWG != nil && !(st["tools"] == true && st["kmod"] == true) { + c.fail(503, c.t.T("Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link.")) + } +} + +// PortalState is everything a person's page shows, for a visitor at `peer` (which of the person's +// devices the page is open on), over HTTPS or not, at `host`. +func PortalState(w *view.World, d Deps, person *model.Person, peer, host string, https bool) map[string]any { + c := &portalCall{d: d, w: w, person: person, base: "/" + person.Code, q: PortalRequest{Remote: peer, Host: host, HTTPS: https}} + return c.state() +} + +func (c *portalCall) state() map[string]any { + m, p := c.w.M, c.person + v := c.w.PersonOf(p, false) + raw, _ := json.Marshal(v) + var pv map[string]any + json.Unmarshal(raw, &pv) + st := c.personState() + pv["state"] = st + // day by day this month, for the page's chart + pv["month_days"] = view.Spark(c.w.Usage.People[p.ID], 30, c.w.Now) + // the device this page was opened from, through the tunnel or beside it + var here any + peer := strings.TrimPrefix(c.q.Remote, "::ffff:") + if peer != "" { + var near []string + for _, dv := range v.Devices { + if dv.Address == peer { + here, near = dv.ID, nil + break + } + if dv.Online && dv.Endpoint == peer { + near = append(near, dv.ID) + } + } + if here == nil && len(near) == 1 { + here = near[0] + } + } + server := map[string]any{"name": nil, "endpoint": "", "device_mesh": false, "awg_disguise": false, "preset": "off", "home": []string{}, + "routers": "off", "nets": "ask"} + kinds := deviceKinds + if srv := m.Servers[p.Server]; srv != nil { + // what the page offers about routers: a router among the kinds, and whether it and its networks are asked + server["routers"], server["nets"] = srv.PortalRouters, srv.PortalNets + if srv.PortalRouters == "off" { + kinds = without(deviceKinds, []string{"router"}) + } + neutral := handout.ObfNeutral(srv.Obf) + server["name"], server["endpoint"], server["device_mesh"], server["awg_disguise"] = srv.Name, m.EndpointHost(srv), srv.DeviceMesh, !neutral + // which apps (and versions) connect: off, balanced (2.0), max (3.1); legacy = the old junk-only presets + switch { + case neutral: + case srv.Preset == "balanced" || srv.Preset == "max": + server["preset"] = srv.Preset + default: + server["preset"] = "legacy" + } + // the home networks a device with LAN Bypass still sends into the tunnel + if p.Access == "both" && c.d.Home != nil { + if home := c.d.Home(srv, p); home != nil { + server["home"] = home + } + } + } + now := time.Unix(c.w.Now, 0).In(zone.Local()) + var https any + if u := c.httpsURL(); u != "" { + https = u + } + return map[string]any{ + "person": pv, "here": here, "server": server, + "can_add": len(p.Devices) < p.DeviceLimit, "locked": st == "paused" || st == "expired", + // over plain HTTP: where the configurations are (keys only travel encrypted) + "https_url": https, "kinds": kinds, + // the router's day and clock: access ends by them, not the browser's + "today": now.Format("2006-01-02"), "now": c.w.Now, "version": backend.Version, + } +} + +// body is the JSON object a POST carries ({} without a body). +func (c *portalCall) body() map[string]any { + if c.q.ContentLength <= 0 || c.q.Body == nil { + return map[string]any{} + } + if c.q.ContentLength > portalBodyMax { + c.fail(413, c.t.T("Request too large.")) + } + raw, _ := io.ReadAll(io.LimitReader(c.q.Body, c.q.ContentLength)) + var v any + if json.Unmarshal(raw, &v) != nil { + c.fail(400, c.t.T("Invalid JSON.")) + } + if obj, is := v.(map[string]any); is { + return obj + } + return map[string]any{} +} + +// withIP is a configuration as the portal sends it: with the server's address as an IP too, for an app +// that takes no name for AmneziaWG. +func (c *portalCall) withIP(cfg map[string]any) map[string]any { + if am, ok := cfg["amnezia"].(map[string]any); ok && c.d.HostIP != nil { + am["host_ip"] = nil + if ip := c.d.HostIP(text(am["host"])); ip != "" { + am["host_ip"] = ip + } + } + return cfg +} + +func (c *portalCall) ownDevice(id string) *model.Device { + dev := c.w.M.Devices[id] + if dev == nil || dev.Person != c.person.ID { + c.fail(404, c.t.T("Device not found.")) + } + return dev +} + +func (c *portalCall) api(method string, segs []string) { + lang := "" + if m := firstLang.FindStringSubmatch(c.q.AcceptLanguage); m != nil { + lang = m[1] + } + who := Actor{By: "portal", Person: c.person.ID} + switch { + case method == "GET" && len(segs) == 1 && segs[0] == "state": + c.json(200, c.state()) + case method == "POST" && len(segs) == 1 && segs[0] == "devices": + c.needOpen() + c.needHTTPS() + b := c.body() + c.notReady() + c.action() + who.PublicKey = text(b["public_key"]) + res, err := DeviceCreateAs(c.d, map[string]any{"person": c.person.ID, "name": b["name"], "kind": text(b["kind"]), "lan_bypass": b["lan_bypass"] == true, + "networks": b["networks"], "lang": lang}, who) + if err != nil { + c.refuse(400, err) + } + c.reload() + // a router asked of the admin has no configuration yet: the page says it waits + if res["waiting"] == true { + c.json(200, map[string]any{"id": res["id"], "waiting": true, "state": c.state()}) + } + cfg, _ := res["config"].(map[string]any) + c.json(200, map[string]any{"id": res["id"], "config": c.withIP(cfg), "state": c.state()}) + case method == "GET" && len(segs) == 3 && segs[0] == "devices" && segs[2] == "config": + dev := c.ownDevice(segs[1]) + c.needOpen() + c.needHTTPS() + if dev.Waiting { + c.fail(409, c.t.T("This router waits for an answer to its request: it has no configuration yet.")) + } + markIssued(c.d, c.w.M, dev.ID) + c.json(200, c.withIP(configOf(c.d, c.w.M, dev.ID))) + case method == "POST" && len(segs) == 2 && segs[0] == "devices": + dev := c.ownDevice(segs[1]) + c.needOpen() + b := c.body() + out := map[string]any{"ok": true} + var err error + switch b["action"] { + case "rename": + c.action() + _, err = DeviceUpdateAs(c.d, map[string]any{"id": dev.ID, "name": b["name"], "lang": lang}, who) + case "reconnect": + // set up from scratch: new keys and the new configuration, which the set-up sheet takes in + c.action() + c.needHTTPS() + c.notReady() + a := map[string]any{"id": dev.ID, "lang": lang} + // what it is and LAN Bypass may change with the keys (the sheet asks again); left out, they stay + if k, is := b["kind"].(string); is { + a["kind"] = k + } + if on, is := b["lan_bypass"].(bool); is { + a["lan_bypass"] = on + } + who.Defer = dev.Address == strings.TrimPrefix(c.q.Remote, "::ffff:") + var cfg map[string]any + if cfg, err = DeviceRotateAs(c.d, a, who); err == nil { + out["config"] = c.withIP(cfg) + } + case "bypass": + // LAN Bypass on or off, keys unchanged: the device takes its updated configuration + c.action() + c.needHTTPS() + on, is := b["on"].(bool) + if !is { + c.fail(400, c.t.T("Unknown action.")) + } + _, err = DeviceUpdateAs(c.d, map[string]any{"id": dev.ID, "lan_bypass": on, "lang": lang}, who) + case "networks": + // the networks behind a router as its owner wants them; turned-down ones they put away + c.action() + _, err = DeviceWishAs(c.d, map[string]any{"id": dev.ID, "networks": b["networks"], "cleared": b["cleared"], "lang": lang}, who) + case "delete": + c.action() + _, err = DeviceDeleteAs(c.d, dev.ID, lang, who) + default: + c.fail(400, c.t.T("Unknown action.")) + } + if err != nil { + c.refuse(400, err) + } + c.reload() + out["state"] = c.state() + c.json(200, out) + } + c.fail(404, c.t.T("Not found.")) +} + +// Portal answers one request to the portal. +func Portal(d Deps, q PortalRequest) (out PortalAnswer) { + lang := "" + if m := firstLang.FindStringSubmatch(q.AcceptLanguage); m != nil { + lang = m[1] + } + c := &portalCall{d: d, q: q, t: i18n.Use(d.Catalogs, lang), buckets: portalBuckets(q)} + defer func() { + r := recover() + switch x := r.(type) { + case nil: + case portalDone: + out = x.a + default: + // what broke, the path without its first part (the person's link code is a secret) + if d.Log != nil { + rest := "" + if i := strings.Index(strings.TrimPrefix(q.Path, "/"), "/"); i >= 0 { + rest = strings.TrimPrefix(q.Path, "/")[i:] + } + d.Log.Say("error", "portal", fmt.Sprintf("%s /%s: 500 · %v", q.Method, rest, r)) + } + out = PortalAnswer{Status: 500, Header: [][2]string{{"Content-Type", "text/plain"}}, Body: []byte("Error\n")} + } + }() + c.w = d.World() + if c.w == nil { + c.answer(503, [][2]string{{"Content-Type", "text/plain"}}, []byte("Starting\n")) + } + m := c.w.M + var segs []string + for _, s := range strings.Split(q.Path, "/") { + if s != "" { + segs = append(segs, s) + } + } + // Plain HTTP only for an IP address chosen in Settings (no certificate exists for it); names stay HTTPS-only. + if !q.HTTPS { + h := strings.SplitN(q.Host, ":", 2)[0] + if strings.HasPrefix(q.Host, "[") { + h = q.Host + } + _, isIP := ipnet.IP(h) + chosen := false + for _, x := range view.PortalHosts(m) { + chosen = chosen || x == h + } + if !isIP || !chosen { + c.notFound() + } + } + // the link is /[/assets/…|/api/…]: the code is the address + if len(segs) < 1 || !wordCode.MatchString(segs[0]) { + c.notFound() + } + for _, id := range m.PersonIDs() { + if p := m.People[id]; p.Code == segs[0] { + c.person = p + } + } + // A wrong code is indistinguishable from a path that does not exist. Only well-formed guesses count + // towards the limit, and a client over it is just no longer counted: a valid link always opens, so + // guesses from a shared address cannot lock its owner out. + if c.person == nil { + if !c.blocked() { + c.wrongCode() + } + c.notFound() + } + c.base = "/" + segs[0] + rest := segs[1:] + if len(rest) == 0 && q.Method == "GET" { + c.shell() + } + if len(rest) == 2 && rest[0] == "assets" && q.Method == "GET" { + c.asset(rest[1]) + } + if len(rest) == 0 || rest[0] != "api" { + c.notFound() + } + // CSRF: only same-origin JSON requests (a cross-site page cannot send application/json without CORS, + // and it would need the code anyway) + switch q.Method { + case "POST": + scheme := "http" + if q.HTTPS { + scheme = "https" + } + if !jsonType.MatchString(q.ContentType) || (q.Origin != "" && q.Origin != scheme+"://"+q.Host) { + c.fail(403, c.t.T("Cross-site request refused.")) + } + case "GET": + default: + c.fail(405, c.t.T("Method not allowed.")) + } + c.api(q.Method, rest[1:]) + return out +} + +// PortalHandler is Portal as a web server's handler; live: the pages it serves have a stream to follow. +func PortalHandler(d Deps, live bool) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + remote := r.RemoteAddr + if host, _, err := net.SplitHostPort(remote); err == nil { + remote = host + } + a := Portal(d, PortalRequest{Method: r.Method, Path: r.URL.Path, Host: r.Host, HTTPS: r.TLS != nil, Remote: remote, + CFConnectingIP: r.Header.Get("Cf-Connecting-Ip"), Origin: r.Header.Get("Origin"), ContentType: r.Header.Get("Content-Type"), + AcceptLanguage: r.Header.Get("Accept-Language"), AcceptEncoding: r.Header.Get("Accept-Encoding"), + ContentLength: r.ContentLength, Body: r.Body, Live: live}) + for _, kv := range a.Header { + w.Header().Set(kv[0], kv[1]) + } + w.WriteHeader(a.Status) + w.Write(a.Body) + }) +} diff --git a/backend/methods/portal_test.go b/backend/methods/portal_test.go new file mode 100644 index 0000000..3532445 --- /dev/null +++ b/backend/methods/portal_test.go @@ -0,0 +1,236 @@ +package methods + +import ( + "encoding/json" + "os" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// What a person does through their link: each change lands in the settings as theirs, within their +// limits, and never on what is not theirs. +func TestPortalChanges(t *testing.T) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + var who, code, mine, theirs string + for _, s := range c.OfType("device") { + p, _ := s.Get("person") + if who == "" { + who, mine = p, s.Name + } else if p != who && theirs == "" { + theirs = s.Name + } + } + code = "kamiro-telosu-bavine" + c.Set(who, "code", code) + c.Set(who, "device_limit", "5") + c.Set("settings", "portal_enabled", "1") + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + st := &store.Store{Config: dir + "/dawnline", RunDir: dir} + var later []string + d := Deps{Store: st, Config: dir + "/dawnline", RunDir: dir, DataDir: dir + "/data", + World: func() *view.World { + _, m, _ := st.Read() + return &view.World{M: m, Usage: usage.Empty(), Now: time.Now().Unix()} + }, + AWG: func() map[string]any { return map[string]any{"tools": true, "kmod": true} }, + Background: func(script string) { later = append(later, script) }} + load := func() *model.Model { _, m, _ := st.Read(); return m } + n := len(load().People[who].Devices) + ask := func(method, path, body, remote string, https bool) (int, map[string]any) { + q := PortalRequest{Method: method, Path: "/" + code + path, Host: "vpn.example.org:4500", HTTPS: https, Remote: remote} + if !https { + q.Host = "203.0.113.7:4501" + } + if method == "POST" { + q.ContentType, q.Origin, q.Body, q.ContentLength = "application/json", "https://"+q.Host, strings.NewReader(body), int64(len(body)) + if !https { + q.Origin = "http://" + q.Host + } + } + a := Portal(d, q) + var out map[string]any + json.Unmarshal(a.Body, &out) + return a.Status, out + } + // a new device: theirs, made by the portal, its configuration in the answer and the state after + status, res := ask("POST", "/api/devices", `{"name":"Tablet","kind":"tablet","lan_bypass":true}`, "198.51.100.9", true) + id, _ := res["id"].(string) + dev := load().Devices[id] + if status != 200 || dev == nil || dev.Person != who || dev.CreatedBy != "portal" || !dev.LanBypass || dev.Kind != "tablet" { + t.Fatalf("a new device: %d %v", status, res["error"]) + } + cfg, _ := res["config"].(map[string]any) + state, _ := res["state"].(map[string]any) + person, _ := state["person"].(map[string]any) + if !strings.Contains(cfg["conf"].(string), "[Interface]") || len(person["devices"].([]any)) != n+1 { + t.Errorf("the answer to a new device: %v", res) + } + // with the browser's own key the private key never reaches the router + const pub = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA=" + status, res = ask("POST", "/api/devices", `{"name":"Desk","kind":"computer","public_key":"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzA="}`, "198.51.100.9", true) + laptop, _ := res["id"].(string) + if dev := load().Devices[laptop]; status != 200 || dev == nil || dev.PublicKey != "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzA=" || dev.PrivateKey != "" { + t.Fatalf("a device with the browser's key: %d %v", status, res["error"]) + } + _ = pub + // the limit holds the portal (the admin is not held to it) + if n != 3 { + t.Fatalf("the household changed: %d devices", n) + } + if status, res = ask("POST", "/api/devices", `{"name":"One more","kind":"phone"}`, "198.51.100.9", true); status != 400 || res["error"] != "Device limit reached (5)." { + t.Errorf("over the limit: %d %v", status, res) + } + if state, _ := ask("GET", "/api/state", "", "198.51.100.9", true); state != 200 { + t.Errorf("the state: %d", state) + } + // a rename, LAN Bypass, and what is somebody else's + if status, _ = ask("POST", "/api/devices/"+id, `{"action":"rename","name":"Big tablet"}`, "198.51.100.9", true); status != 200 || load().Devices[id].Name != "Big tablet" { + t.Errorf("a rename: %d", status) + } + if status, _ = ask("POST", "/api/devices/"+id, `{"action":"bypass","on":false}`, "198.51.100.9", true); status != 200 || load().Devices[id].LanBypass { + t.Errorf("LAN Bypass off: %d", status) + } + if theirs != "" { + if status, res = ask("POST", "/api/devices/"+theirs, `{"action":"delete"}`, "198.51.100.9", true); status != 404 || load().Devices[theirs] == nil { + t.Errorf("another person's device: %d %v", status, res) + } + } + // set up again from the device itself: the keys change now, and are loaded a moment after the answer + was := load().Devices[id].PublicKey + later = nil + status, res = ask("POST", "/api/devices/"+id, `{"action":"reconnect","kind":"phone"}`, load().Devices[id].Address, true) + now := load().Devices[id] + if status != 200 || now.PublicKey == was || now.Kind != "phone" || len(later) != 1 || !strings.Contains(later[0], "dawnline sync") || res["config"] == nil { + t.Errorf("set up again: %d, later %v, %v", status, later, res["error"]) + } + // keys never travel in the clear: the answer names the HTTPS link + status, res = ask("GET", "/api/devices/"+id+"/config", "", "198.51.100.9", false) + if status != 403 || res["https_url"] != "https://203.0.113.7:4500/"+code { + t.Errorf("a configuration over plain HTTP: %d %v", status, res) + } + if status, res = ask("GET", "/api/state", "", "198.51.100.9", false); status != 200 || res["https_url"] != "https://203.0.113.7:4500/"+code { + t.Errorf("the state over plain HTTP: %d %v", status, res["https_url"]) + } + // a device the admin turned off is not the portal's to change + c2, _, _ := st.Read() + c2.Set(id, "disabled", "1") + os.WriteFile(dir+"/dawnline", []byte(c2.Format()), 0o600) + if status, res = ask("POST", "/api/devices/"+id, `{"action":"rename","name":"Mine again"}`, "198.51.100.9", true); status != 400 || res["error"] != "The admin has turned this device off." { + t.Errorf("a device turned off: %d %v", status, res) + } + // a person the admin paused sees their page and changes nothing + c2.Set(who, "paused", "1") + os.WriteFile(dir+"/dawnline", []byte(c2.Format()), 0o600) + if status, res = ask("POST", "/api/devices/"+laptop, `{"action":"delete"}`, "198.51.100.9", true); status != 403 || res["error"] != "Your access is paused." || load().Devices[laptop] == nil { + t.Errorf("a paused person's change: %d %v", status, res) + } + if status, res = ask("GET", "/api/state", "", "198.51.100.9", true); status != 200 || res["locked"] != true { + t.Errorf("a paused person's page: %d %v", status, res["locked"]) + } + c2.Delete(who, "paused") + os.WriteFile(dir+"/dawnline", []byte(c2.Format()), 0o600) + if status, _ = ask("POST", "/api/devices/"+laptop, `{"action":"delete"}`, "198.51.100.9", true); status != 200 || load().Devices[laptop] != nil { + t.Errorf("a delete: %d", status) + } + // the activity log says who did it + raw, _ := os.ReadFile(dir + "/events.json") + if !strings.Contains(string(raw), `"by":"portal"`) || !strings.Contains(string(raw), "device_removed") || strings.Contains(string(raw), `"by":"admin"`) { + t.Errorf("the activity log: %.300s", raw) + } + _ = mine +} + +// Wrong codes are counted a client, and a client over the limit is told nothing new; a link is held to +// forty changes a quarter hour; a valid link always opens. +func TestPortalLimits(t *testing.T) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + c, _ := uci.Parse(string(text)) + who := c.OfType("person")[0].Name + c.Set(who, "code", "kamiro-telosu-bavine") + var dev string + for _, s := range c.OfType("device") { + if p, _ := s.Get("person"); p == who && dev == "" { + dev = s.Name + } + } + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + st := &store.Store{Config: dir + "/dawnline", RunDir: dir} + d := Deps{Store: st, Config: dir + "/dawnline", RunDir: dir, DataDir: dir + "/data", World: func() *view.World { + _, m, _ := st.Read() + return &view.World{M: m, Usage: usage.Empty(), Now: time.Now().Unix()} + }} + get := func(path, remote, cf string) PortalAnswer { + return Portal(d, PortalRequest{Method: "GET", Path: path, Host: "vpn.example.org:4500", HTTPS: true, Remote: remote, CFConnectingIP: cf}) + } + for i := 0; i < 20; i++ { + if a := get("/zzzzzz-zzzzzz-zzzzzz", "2001:db8:1:2:3:4:5:"+string(rune('a'+i%6)), ""); a.Status != 404 || string(a.Body) != "Not found\n" { + t.Fatalf("a wrong code: %d %q", a.Status, a.Body) + } + } + var rates map[string]struct{ Count int } + raw, _ := os.ReadFile(dir + "/portal-rate.json") + json.Unmarshal(raw, &rates) + // one /64 is one client; counted to the limit and no further + if len(rates) != 1 || rates["2001:db8:1:2::/64"].Count != portalFailLimit { + t.Errorf("the count of wrong codes: %s", raw) + } + log, _ := os.ReadFile(dir + "/events.json") + if strings.Count(string(log), "portal_blocked") != 1 || !strings.Contains(string(log), "2001:db8:1:2::/64") { + t.Errorf("a blocked client is told once: %.300s", log) + } + // the link's owner opens it from that very address all the same + if a := get("/kamiro-telosu-bavine", "2001:db8:1:2::9", ""); a.Status != 200 || !strings.Contains(string(a.Body), `data-base="/kamiro-telosu-bavine"`) { + t.Errorf("a valid link from a blocked address: %d", a.Status) + } + // behind Cloudflare the visitor is who it says, and only then + get("/zzzzzz-zzzzzz-zzzzzz", "173.245.48.5", "198.51.100.77") + get("/zzzzzz-zzzzzz-zzzzzz", "198.51.100.200", "198.51.100.78") + raw, _ = os.ReadFile(dir + "/portal-rate.json") + json.Unmarshal(raw, &rates) + if rates["198.51.100.77"].Count != 1 || rates["cloudflare"].Count != 1 || rates["198.51.100.200"].Count != 1 || rates["198.51.100.78"].Count != 0 { + t.Errorf("the buckets: %s", raw) + } + // what is no link at all is not counted, and files never become a redirect + c.Set("settings", "portal_redirect", "https://example.org/") + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + if a := get("/", "203.0.113.50", ""); a.Status != 302 { + t.Errorf("the redirect: %d", a.Status) + } + if a := get("/favicon.ico", "203.0.113.50", ""); a.Status != 404 { + t.Errorf("a file: %d", a.Status) + } + raw, _ = os.ReadFile(dir + "/portal-rate.json") + if strings.Contains(string(raw), "203.0.113.50") { + t.Error("a path that is no link was counted") + } + // plain HTTP only for an address chosen in Settings + plain := func(host string) int { + return Portal(d, PortalRequest{Method: "GET", Path: "/kamiro-telosu-bavine", Host: host, Remote: "203.0.113.50"}).Status + } + if plain("203.0.113.7:4501") != 200 || plain("vpn.example.org:4501") != 302 || plain("198.51.100.1:4501") != 302 { + t.Error("plain HTTP is open for more than the chosen address, or closed for it") + } + // forty changes a quarter hour through one link + last := 0 + for i := 0; i <= portalActionLimit; i++ { + body := `{"action":"bypass","on":` + map[bool]string{true: "true", false: "false"}[i%2 == 0] + `}` + last = Portal(d, PortalRequest{Method: "POST", Path: "/kamiro-telosu-bavine/api/devices/" + dev, Host: "vpn.example.org:4500", HTTPS: true, Remote: "203.0.113.60", + ContentType: "application/json", Origin: "https://vpn.example.org:4500", Body: strings.NewReader(body), ContentLength: int64(len(body))}).Status + if i < portalActionLimit && last != 200 { + t.Fatalf("change %d: %d", i, last) + } + } + if last != 429 { + t.Errorf("the forty-first change: %d", last) + } +} diff --git a/backend/methods/reconnect.lock b/backend/methods/reconnect.lock new file mode 100644 index 0000000..e69de29 diff --git a/backend/methods/save.go b/backend/methods/save.go new file mode 100644 index 0000000..e720901 --- /dev/null +++ b/backend/methods/save.go @@ -0,0 +1,478 @@ +package methods + +import ( + "errors" + "fmt" + "regexp" + "sort" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// spec is one setting of dawnline.schema: its type, its range or choices, and whether the portal must +// restart when it changes. +type spec struct { + kind string + min, max int + values []string + restart bool +} + +var schema = map[string]spec{ + "portal_enabled": {kind: "bool", restart: true}, "portal_host": {kind: "host", restart: true}, "portal_alt": {kind: "hosts", restart: true}, + "portal_port": {kind: "int", min: 1, max: 65535, restart: true}, "portal_redirect": {kind: "url"}, + "portal_cert": {kind: "file", restart: true}, "portal_key": {kind: "file", restart: true}, + "default_device_limit": {kind: "int", min: 1, max: 32}, "hostnames": {kind: "bool"}, "domain": {kind: "domain"}, + "geo_enabled": {kind: "bool"}, "geo_provider": {kind: "enum", values: []string{"ipwho.is", "ipapi.co"}}, + "log_connections": {kind: "bool"}, "log_level": {kind: "enum", values: []string{"error", "warn", "info", "debug"}}, "watchdog": {kind: "bool"}, + "log_keep_days": {kind: "int", min: 0, max: 9999}, "log_max": {kind: "int", min: 100, max: 20000}, + "log_persist": {kind: "enum", values: []string{"10min", "hourly", "off"}}, + "usage_keep_days": {kind: "int", min: 7, max: 1830}, "usage_keep_months": {kind: "int", min: 1, max: 120}, + "home_dns_fallback": {kind: "ipv4"}, "update_check": {kind: "bool"}, "update_interval": {kind: "enum", values: []string{"6h", "12h", "1d", "7d"}}, + "update_auto": {kind: "bool"}, "update_mode": {kind: "enum", values: []string{"immediate", "scheduled"}}, "update_time": {kind: "time"}, + "update_targets": {kind: "targets"}, "update_keep": {kind: "bool"}, "update_mirrors": {kind: "bool"}, +} + +// what the admin is told about a bad value, by setting +var badValue = map[string]string{ + "portal_host": "Public address must be a hostname or IP address.", + "portal_alt": "Other addresses must be hostnames or IP addresses.", + "portal_port": "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).", + "portal_redirect": "Redirect must be a full http:// or https:// address.", + "default_device_limit": "Default device limit must be 1-32.", + "domain": "Domain may use lowercase letters, digits, dashes and dots.", + "geo_provider": "Unknown location service.", + "log_level": "Choose a system log level: errors, warnings, normal or verbose.", + "log_keep_days": "Keep activity for 0 (no age limit) to 9999 days.", + "log_max": "Log size must be 100-20000 events.", + "log_persist": "Save the log every 10min, hourly or off.", + "usage_keep_days": "Daily traffic history must be 7-1830 days.", + "usage_keep_months": "Monthly traffic history must be 1-120 months.", + "home_dns_fallback": "Fallback DNS must be an IPv4 address (or empty for none).", + "update_interval": "Check every 6h, 12h, 1d or 7d.", + "update_mode": "Install updates immediately or scheduled.", + "update_time": "Enter a time as HH:MM, 00:00 to 23:59.", +} + +func bad(key string) error { + if msg, ok := badValue[key]; ok { + return errors.New(msg) + } + return said{"Invalid value for %s.", []any{key}} +} + +var ( + wholeNumber = regexp.MustCompile(`^[0-9]{1,9}$`) + redirectURL = regexp.MustCompile(`^https?://[A-Za-z0-9.-]+(:[0-9]+)?(/[^\s"'<>]*)?$`) + domainName = regexp.MustCompile(`^[a-z0-9-]{1,32}(\.[a-z0-9-]{1,32})*$`) + clockTime = regexp.MustCompile(`^([01]?[0-9]|2[0-3]):[0-5][0-9]$`) +) + +// validate checks a value the admin saves for a setting and returns what to store: a string, a list, or +// nil to remove the option (back to the default). dawnline.schema validate(). +func validate(key string, val any) (any, error) { + sp, known := schema[key] + if !known { + return nil, said{"Unknown setting %s.", []any{key}} + } + list, _ := val.([]any) + switch sp.kind { + case "hosts": + var out []string + for _, x := range list { + s, isString := x.(string) + h := strings.Trim(s, blank) + // a typo must not vanish on Save: refused, like the main address + if !isString || (h != "" && !endpoint.ValidHost(h)) { + return nil, bad(key) + } + dup := false + for _, o := range out { + dup = dup || o == h + } + if h != "" && !dup { + out = append(out, h) + } + } + if len(out) == 0 { + return nil, nil + } + return out, nil + case "targets": + var out []string + for _, x := range list { + s := text(x) + dup := false + for _, o := range out { + dup = dup || o == s + } + if (s == "app" || s == "amneziawg" || s == "packages") && !dup { + out = append(out, s) + } + } + // an empty list is a choice too ("none"), unlike a missing option (the default) + if len(out) == 0 { + return []string{"none"}, nil + } + return out, nil + } + v := "" + switch x := val.(type) { + case bool: + v = "0" + if x { + v = "1" + } + case string: + v = strings.Trim(x, blank) + case nil: + default: + v = str(num(val)) + } + if sp.kind == "ipv4" && v == "" { + return "none", nil + } + if v == "" { + return nil, nil + } + switch sp.kind { + case "bool": + if v != "0" && v != "1" { + return nil, said{"%s is 0 or 1.", []any{key}} + } + case "int": + n, _ := strconv.Atoi(v) + if !wholeNumber.MatchString(v) || n < sp.min || n > sp.max { + return nil, bad(key) + } + v = strconv.Itoa(n) + case "enum": + ok := false + for _, c := range sp.values { + ok = ok || c == v + } + if !ok { + return nil, bad(key) + } + case "host": + if !endpoint.ValidHost(v) { + return nil, bad(key) + } + case "url": + if len(v) > 300 || !redirectURL.MatchString(v) { + return nil, bad(key) + } + case "file": + if !strings.HasPrefix(v, "/") || !exists(v) { + return nil, said{"File %s does not exist.", []any{v}} + } + case "domain": + if !domainName.MatchString(v) { + return nil, bad(key) + } + case "ipv4": + if _, ok := ipnet.IP(v); !ok { + return nil, bad(key) + } + case "time": + if !clockTime.MatchString(v) { + return nil, bad(key) + } + } + return v, nil +} + +// flat is a stored or a new value as one string, to tell whether it changed: a list a line an entry. +func flat(v any) string { + switch x := v.(type) { + case string: + return x + case []string: + return strings.Join(x, "\n") + } + return "" +} + +// shownValue is a value as the syslog line of a change says it. +func shownValue(v any) string { + switch x := v.(type) { + case string: + if x != "" { + return x + } + case []string: + var kept []string + for _, e := range x { + if e != "" { + kept = append(kept, e) + } + } + if len(kept) == 0 { + return "none" + } + return strings.Join(kept, " ") + } + return "default" +} + +func isReserved(port int) bool { + for _, r := range Reserved { + if r == port { + return true + } + } + return false +} + +func plainHTTP(s model.Settings) bool { + for _, h := range append([]string{s.PortalHost}, s.PortalAlt...) { + if _, ip := ipnet.IP(h); ip { + return true + } + } + return false +} + +// checkPortal refuses a portal whose ports cannot be taken: its HTTPS port and, when links on IP addresses +// use plain HTTP, the next one. Neither may be the router's own, another program's, or forwarded away. +func checkPortal(now, was *model.Model, progs []held, fw *uci.Config) error { + s := now.Settings + if !s.PortalEnabled { + return nil + } + port := s.PortalPort + if port < 1 || port > 65535 || isReserved(port) { + return errors.New("Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).") + } + ports := []int{port} + if plainHTTP(s) { + hp := port + 1 + if hp < 1 || hp > 65535 || isReserved(hp) { + return said{"Links on IP addresses use plain HTTP on the next port (%d), which the portal cannot take. Choose another portal port.", []any{hp}} + } + ports = append(ports, hp) + } + // only ports the portal does not hold already + var mine []int + if was.Settings.PortalEnabled { + mine = append(mine, was.Settings.PortalPort) + if plainHTTP(was.Settings) { + mine = append(mine, was.Settings.PortalPort+1) + } + } + for _, p := range ports { + kept := false + for _, h := range mine { + kept = kept || h == p + } + if kept { + continue + } + var owners []string + for _, h := range progs { + if h.port == p { + owners = append(owners, h.name) + } + } + if len(owners) > 0 { + msg := "TCP %d is already used by %s. Choose another portal port." + if p != port { + msg = "TCP %d is already used by %s. Links on IP addresses use plain HTTP on the port after the portal's. Choose another portal port." + } + return said{msg, []any{p, strings.Join(owners, ", ")}} + } + } + // a forwarded port never reaches the router: the portal would be unreachable + zones := []string{"wan"} + for _, id := range now.ServerIDs() { + z, dup := now.Servers[id].WanZone, false + for _, o := range zones { + dup = dup || o == z + } + if !dup { + zones = append(zones, z) + } + } + for _, p := range ports { + for _, z := range zones { + for _, f := range forwards(fw, z, "tcp") { + if f.from <= p && p <= f.to { + return said{"TCP %d is sent on by port forward “%s”. Choose another portal port.", []any{p, f.name}} + } + } + } + } + return nil +} + +// settingsUpdate saves settings (`values`: key to value, "" back to the default); the portal is checked as +// it will be. The settings are taken in the schema's order, whatever order they came in. +func settingsUpdate(d Deps, a map[string]any) (map[string]any, error) { + values, isObject := a["values"].(map[string]any) + // no values at all is nothing to change, and no refusal; anything but an object is + if a["values"] == nil { + values, isObject = map[string]any{}, true + } + if !isObject { + return nil, errors.New("Nothing to save.") + } + var unknown []string + for k := range values { + if _, known := schema[k]; !known && k != "log_category" { + unknown = append(unknown, k) + } + } + if len(unknown) > 0 { + sort.Strings(unknown) + return nil, said{"Unknown setting %s.", []any{unknown[0]}} + } + type change_ struct { + key string + from, to any + } + var diff []change_ + restart := false + var was, now *model.Model + err := write(d, func(c *uci.Config, m *model.Model) error { + was = m + section := c.Add("settings", "settings") + current := func(k string) any { + v, has := section.Values[k] + if !has { + return nil + } + if v.IsList { + return v.List + } + return v.Str + } + put := func(k string, to any) { + if from := current(k); flat(to) != flat(from) { + diff = append(diff, change_{k, from, to}) + } + switch x := to.(type) { + case nil: + c.Delete("settings", k) + case string: + // an empty string is no value to a cursor: the option goes + c.Set("settings", k, x) + case []string: + c.SetList("settings", k, x) + } + } + for _, k := range Settings { + val, given := values[k] + if !given { + continue + } + nv, err := validate(k, val) + if err != nil { + return err + } + if schema[k].restart && flat(nv) != flat(current(k)) { + restart = true + } + put(k, nv) + } + if val, given := values["log_category"]; given { + list, _ := val.([]any) + var cats []string + for _, x := range list { + for _, known := range journal.Categories { + if text(x) == known { + cats = append(cats, known) + } + } + } + if len(cats) == 0 { + cats = []string{""} + } + put("log_category", cats) + // superseded by the category list + c.Delete("settings", "log_connections") + } + var blocked map[string]any + files.ReadJSON(d.RunDir+"/netifd-blocked.json", &blocked) + now = model.Load(c, blocked) + return checkPortal(now, m, listening("tcp"), parseFile("/etc/config/firewall")) + }) + if err != nil { + return nil, err + } + // every setting that changed, in syslog + if len(diff) > 0 && d.Log != nil { + var parts []string + for _, x := range diff { + parts = append(parts, x.key+": "+shownValue(x.from)+" → "+shownValue(x.to)) + } + d.Log.Say("info", "settings", "admin changed settings · "+strings.Join(parts, ", ")) + } + var warning any + if restart { + if d.Reload != nil { + d.Reload() + } + } else if d.Sync != nil { + warning = d.Sync(text(a["lang"])) + } + // the changes worth a line: the portal and the watchdog + if d.Log != nil { + n, w := now.Settings, was.Settings + if n.PortalEnabled != w.PortalEnabled { + if n.PortalEnabled { + d.Log.Admin("portal", "turned on", "", "the personal portal", fmt.Sprintf("port %d", n.PortalPort)) + } else { + d.Log.Admin("portal", "turned off", "", "the personal portal", "") + } + } else if n.PortalEnabled { + var what []string + if n.PortalPort != w.PortalPort { + what = append(what, fmt.Sprintf("port %d", n.PortalPort)) + } + if n.PortalHost != w.PortalHost { + what = append(what, "address "+n.PortalHost) + } + if strings.Join(n.PortalAlt, " ") != strings.Join(w.PortalAlt, " ") { + what = append(what, "other addresses") + } + if n.PortalCert != w.PortalCert || n.PortalKey != w.PortalKey { + what = append(what, "certificate") + } + if n.PortalRedirect != w.PortalRedirect { + what = append(what, "redirect") + } + if len(what) > 0 { + d.Log.Admin("portal", "changed", "", "the personal portal", strings.Join(what, ", ")) + } + } + if n.Watchdog != w.Watchdog { + if n.Watchdog { + d.Log.Admin("dawnline", "turned on", "", "the watchdog", "") + } else { + d.Log.Admin("dawnline", "turned off", "", "the watchdog", "problems are only logged, nothing is repaired") + } + } + } + if d.Told != nil { + d.Told() + } + out := map[string]any{} + if w := d.World(); w != nil && w.M != nil { + out = settingsGet(w, i18n.Use(d.Catalogs, text(a["lang"])), d) + } + if warning != nil && warning != "" { + out["warning"] = warning + } + return out, nil +} + +var _ = view.World{} diff --git a/backend/methods/server.go b/backend/methods/server.go new file mode 100644 index 0000000..58f451f --- /dev/null +++ b/backend/methods/server.go @@ -0,0 +1,874 @@ +package methods + +import ( + "errors" + "fmt" + "net" + "os" + "os/exec" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/disguise" + "github.com/tickcount/luci-app-dawnline/backend/endpoint" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +var ( + meshWords = map[string]string{"off": "devices kept apart", "all": "devices reach each other", "circles": "devices reach each other in circles"} + keepaliveArg = regexp.MustCompile(`^[0-9]{1,3}$`) + mtuArg = regexp.MustCompile(`^[0-9]{1,4}$`) +) + +// on tells a switch as a page sends it: true or "1". +func on(v any) bool { return v == true || v == "1" || num(v) == 1 } + +// asString is a value as ucode writes it into a string, trimmed. +func asString(v any) string { + switch x := v.(type) { + case string: + return strings.Trim(x, blank) + case nil: + return "" + case bool: + if x { + return "true" + } + return "false" + } + return str(num(v)) +} + +// dnsList is a list of DNS servers as typed (a list, or "a, b"): each an IPv4 or IPv6 address. +func dnsList(v any) ([]string, error) { + var parts []string + if list, isList := v.([]any); isList { + for _, x := range list { + parts = append(parts, asString(x)) + } + } else { + parts = regexp.MustCompile(`[ ,]+`).Split(asString(v), -1) + } + out := []string{} + for _, d := range parts { + if d == "" { + continue + } + if _, v4 := ipnet.IP(d); !v4 && (net.ParseIP(d) == nil || !strings.Contains(d, ":")) { + return nil, said{"%s is not an IP address.", []any{d}} + } + out = append(out, d) + } + return out, nil +} + +// privateNet tells a network that lies inside one of the private ranges. +func privateNet(n ipnet.Net) bool { + for _, p := range []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"} { + r, _ := ipnet.Any(p) + if uint64(n.Base) >= uint64(r.Base) && uint64(n.Base)+n.Size() <= uint64(r.Base)+r.Size() { + return true + } + } + return false +} + +// udpHeld is the UDP ports a server cannot take, read on the router. +func udpHeld(m *model.Model, srv *model.Server, t *i18n.Catalog) []map[string]any { + udp, _ := os.ReadFile("/proc/net/udp") + udp6, _ := os.ReadFile("/proc/net/udp6") + return udpTaken(m, srv, t, parseFile("/etc/config/network"), parseFile("/etc/config/firewall"), udpBound(string(udp), string(udp6)), listening("udp")) +} + +// serverUpdate saves a server's settings from the General and Network tabs and applies them at once +// (dawnline.rpc.servers server_update). It answers what the apply came to. +func serverUpdate(d Deps, a map[string]any) (map[string]any, error) { + id := text(a["id"]) + v, _ := a["values"].(map[string]any) + if v == nil { + v = map[string]any{} + } + if v["device_mesh"] != nil && v["mesh"] == nil { + v["mesh"] = "off" + if on(v["device_mesh"]) { + v["mesh"] = "all" + } + } + t := i18n.Use(d.Catalogs, text(a["lang"])) + var was model.Server + var newDNS []string + err := write(d, func(c *uci.Config, m *model.Model) error { + srv := m.Servers[id] + if srv == nil { + return errors.New("Unknown server.") + } + was = *srv + set := func(k, val string) { + if val == "" { + c.Delete(id, k) + } else { + c.Set(id, k, val) + } + } + if v["name"] != nil { + if !ValidName(asString(v["name"])) { + return errors.New(`Server: Enter a name: up to 48 characters, without < > " or \.`) + } + set("name", asString(v["name"])) + } + // empty: the portal's address, as at creation + if v["endpoint"] != nil { + if e := asString(v["endpoint"]); e != "" && !endpoint.ValidHost(e) { + return errors.New("Public address must be a hostname or IP address.") + } + set("endpoint", asString(v["endpoint"])) + } + if v["port"] != nil { + if !ValidPort(asString(v["port"])) { + return errors.New("UDP port must be 1-65535.") + } + n, _ := strconv.Atoi(asString(v["port"])) + if n != srv.Port { + for _, h := range udpHeld(m, srv, t) { + if h["from"].(int) <= n && n <= h["to"].(int) { + return said{"UDP %d is used by %s. Choose another port.", []any{n, h["who"]}} + } + } + } + set("port", strconv.Itoa(n)) + } + if v["enabled"] != nil { + if on(v["enabled"]) { + set("enabled", "1") + } else { + set("enabled", "0") + } + } + if v["mesh"] != nil { + mesh := text(v["mesh"]) + if _, known := meshWords[mesh]; !known { + return errors.New("Unknown choice for devices reaching each other.") + } + set("mesh", mesh) + set("device_mesh", "") + } + // what people may do about routers on their own pages; "ask" is what an unset one means + for k, choices := range map[string][]string{"portal_routers": model.PortalRouters, "portal_nets": model.PortalNets} { + if v[k] == nil { + continue + } + pick, known := text(v[k]), false + for _, x := range choices { + known = known || x == pick + } + if !known { + return errors.New("Unknown choice for routers on people's pages.") + } + if pick == "ask" { + pick = "" + } + set(k, pick) + } + if v["mtu"] != nil { + s := asString(v["mtu"]) + if n, _ := strconv.Atoi(s); s != "" && (!mtuArg.MatchString(s) || n < 1280 || n > 1500) { + return errors.New("MTU must be 1280-1500.") + } + set("mtu", s) + } + if v["keepalive"] != nil { + s := asString(v["keepalive"]) + if n, _ := strconv.Atoi(s); s != "" && (!keepaliveArg.MatchString(s) || n > 600) { + return errors.New("Keep-alive must be 0-600 seconds.") + } + set("keepalive", s) + } + if v["dns"] != nil { + list, err := dnsList(v["dns"]) + if err != nil { + return err + } + newDNS = list + if len(list) > 0 { + c.SetList(id, "dns", list) + } else { + c.Delete(id, "dns") + } + } + // a new tunnel network: private, free, and every device renumbered into it + if sub := asString(v["subnet"]); v["subnet"] != nil && sub != "" && sub != srv.Subnet { + pc, ok := ipnet.Subnet(sub) + if !ok { + return errors.New("Subnet must look like 10.77.0.0/24.") + } + if !privateNet(pc) { + return errors.New("Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.") + } + var addrs []Address + if d.Addresses != nil { + addrs = d.Addresses() + } + for _, n := range takenNetworks(m, addrs) { + if n["cidr"] == srv.Subnet || n["name"] == srv.Name { + continue + } + if o, ok := ipnet.Subnet(n["cidr"].(string)); ok && uint64(pc.Base) < uint64(o.Base)+o.Size() && uint64(o.Base) < uint64(pc.Base)+pc.Size() { + return said{"Subnet overlaps %s.", []any{n["cidr"]}} + } + } + // every device on the server gets an address in it, lowest first + moved := map[string]string{} + here := map[string]bool{} + for _, pid := range m.PersonIDs() { + if p := m.People[pid]; p.Server == id { + for _, did := range p.Devices { + here[did] = true + } + } + } + to := *srv + to.Subnet = pc.String() + for _, pid := range m.PersonIDs() { + p := m.People[pid] + if p.Server != id { + continue + } + for _, did := range p.Devices { + addr := allocAddress(m, &to, func(q *model.Person) string { return q.Server }, func(x *model.Device) string { + if here[x.ID] { + return moved[x.ID] + } + return x.Address + }) + if addr == "" { + return said{"%s has no room for every device on %s.", []any{pc.String(), srv.Name}} + } + moved[did] = addr + c.Set(did, "address", addr) + } + } + c.Set(id, "subnet", pc.String()) + } + return nil + }) + if err != nil { + return nil, err + } + // for the log: what changed, in words; turning on or off is its own line + var what []string + for _, k := range []struct{ key, label string }{{"name", "name"}, {"endpoint", "public address"}, {"port", "AmneziaWG port"}, {"mtu", "MTU"}, + {"keepalive", "keep-alive"}, {"dns", "DNS"}, {"subnet", "tunnel network"}} { + if v[k.key] == nil { + continue + } + before, now := "", asString(v[k.key]) + switch k.key { + case "name": + before = was.Name + case "endpoint": + before = was.Endpoint + case "port": + before = strconv.Itoa(was.Port) + case "mtu": + if was.MTU != 0 { + before = strconv.Itoa(was.MTU) + } + case "keepalive": + before = strconv.Itoa(was.Keepalive) + case "dns": + before, now = strings.Join(was.DNS, " "), strings.Join(newDNS, " ") + case "subnet": + before = was.Subnet + } + if strings.Trim(before, blank) != strings.Trim(now, blank) { + what = append(what, k.label) + } + } + name := was.Name + if v["name"] != nil { + name = asString(v["name"]) + } + var applied map[string]any + if d.Apply != nil { + applied = d.Apply(text(a["lang"])) + } + if d.Log != nil { + line := func(msg, note string) { + d.Log.Write("dawnline", "info", msg, "", name, servicelog.Extra{By: "admin", Kind: "server", Note: note, SID: id}) + } + if v["enabled"] != nil && on(v["enabled"]) != was.Enabled { + if on(v["enabled"]) { + line("turned on", "") + } else { + line("turned off", "") + } + } + if len(what) > 0 { + line("changed", strings.Join(what, ", ")) + } + if v["mesh"] != nil && text(v["mesh"]) != was.Mesh { + line("changed", meshWords[text(v["mesh"])]) + } + if v["portal_routers"] != nil && text(v["portal_routers"]) != was.PortalRouters { + line("changed", "routers on people's pages: "+text(v["portal_routers"])) + } + if v["portal_nets"] != nil && text(v["portal_nets"]) != was.PortalNets { + line("changed", "networks behind routers on people's pages: "+text(v["portal_nets"])) + } + } + if d.Told != nil { + d.Told() + } + if applied == nil { + applied = map[string]any{} + } + return applied, nil +} + +// serverDelete removes a server with its people, their devices and its circles; a backup is made first. +func serverDelete(d Deps, id, lang string) (map[string]any, error) { + if d.Store == nil { + return nil, errors.New("The router is still starting. Try again in a moment.") + } + if _, m, err := d.Store.Read(); err != nil || m.Servers[id] == nil { + return nil, errors.New("Unknown server.") + } + if _, err := backupCreate(d, "pre-delete"); err != nil { + return nil, err + } + name, gone := "", 0 + err := write(d, func(c *uci.Config, m *model.Model) error { + srv := m.Servers[id] + if srv == nil { + return errors.New("Unknown server.") + } + for _, pid := range m.PersonIDs() { + if p := m.People[pid]; p.Server == id { + for _, dev := range p.Devices { + c.DeleteSection(dev) + } + c.DeleteSection(pid) + gone++ + } + } + for _, cid := range m.CircleIDs() { + if m.Circles[cid].Server == id { + c.DeleteSection(cid) + } + } + c.DeleteSection(id) + name = srv.Name + return nil + }) + if err != nil { + return nil, err + } + var applied map[string]any + if d.Apply != nil { + applied = d.Apply(lang) + } + if d.Log != nil { + note := "" + if gone == 1 { + note = "with 1 person" + } else if gone > 1 { + note = "with " + strconv.Itoa(gone) + " people" + } + d.Log.Write("awg", "info", "removed", "", name, servicelog.Extra{By: "admin", Kind: "server", Note: note, SID: id}) + } + if d.Told != nil { + d.Told() + } + if applied == nil { + applied = map[string]any{} + } + return applied, nil +} + +// off tells a switch a page turned off: false or "0". +func off(v any) bool { return v == false || v == "0" } + +// serverInterfaces saves which interfaces a server uses (its WAN, its home networks), whether its traffic +// leaves like a home device's and who reaches whom, and applies it (dawnline.rpc.servers server_interfaces). +// It answers the interfaces as the page shows them, and whether the home networks changed. +func serverInterfaces(d Deps, a map[string]any) (map[string]any, error) { + if d.Snapshot == nil { + return nil, errors.New("The router is still starting. Try again in a moment.") + } + id := text(a["id"]) + snap := d.Snapshot() + autoWan, autoLan := !off(a["auto_wan"]), !off(a["auto_lan"]) + wanDev := asString(a["wan_device"]) + var was, now model.Server + mesh := "" + err := write(d, func(c *uci.Config, m *model.Model) error { + srv := m.Servers[id] + if srv == nil { + return errors.New("Unknown server.") + } + was = *srv + if !autoWan { + dev := snap.Devices[wanDev] + if dev == nil { + return errors.New("Choose the interface that leads to the internet.") + } + if dev.Zone == "" { + return said{"%s is not in a firewall zone, so the server port cannot be opened on it.", []any{wanDev}} + } + } + wan := wanDev + if autoWan { + wan = snap.WAN + } + var lans []string + list, _ := a["lan_devices"].([]any) + for _, x := range list { + name := asString(x) + saved := false + for _, o := range srv.LanDevices { + saved = saved || o == name + } + dev := snap.Devices[name] + // unknown names are kept only if they were saved before (an interface down right now) + if name == "" || name == srv.Ifname || (dev == nil && !saved) { + continue + } + if dev != nil && dev.Master != "" { + return said{"%s is part of %s; choose %s instead.", []any{name, dev.Master, dev.Master}} + } + if name == wan { + return said{"%s is the WAN.", []any{name}} + } + dup := false + for _, o := range lans { + dup = dup || o == name + } + if !dup { + lans = append(lans, name) + } + } + if a["lan_like"] != nil { + if off(a["lan_like"]) { + c.Set(id, "lan_like", "0") + } else { + c.Set(id, "lan_like", "1") + } + } + mesh = srv.Mesh + if _, known := meshWords[text(a["mesh"])]; known { + mesh = text(a["mesh"]) + } else if a["device_mesh"] != nil { + mesh = "all" + if off(a["device_mesh"]) { + mesh = "off" + } + } + c.Set(id, "mesh", mesh) + c.Delete(id, "device_mesh") + flag := func(k string, v bool) { + if v { + c.Set(id, k, "1") + } else { + c.Set(id, k, "0") + } + } + flag("auto_wan", autoWan) + flag("auto_lan", autoLan) + if autoWan || wanDev == "" { + c.Delete(id, "wan_device") + } else { + c.Set(id, "wan_device", wanDev) + } + if len(lans) > 0 { + c.SetList(id, "lan_device", lans) + } else { + c.Delete(id, "lan_device") + } + // what was detected, as the fallback while an interface is down + if snap.WAN != "" { + c.Set(id, "detected_wan", snap.WAN) + } + if snap.LAN != "" { + c.Set(id, "detected_lan", snap.LAN) + } + // the older zone options kept in step + var blocked map[string]any + files.ReadJSON(d.RunDir+"/netifd-blocked.json", &blocked) + wanNet, _, _, zones := snap.ServerNet(model.Load(c, blocked).Servers[id]) + if wanNet.Zone != "" { + c.Set(id, "wan_zone", wanNet.Zone) + } + if len(zones) > 0 { + c.Set(id, "lan_zone", zones[0]) + } + now = *model.Load(c, blocked).Servers[id] + return nil + }) + if err != nil { + return nil, err + } + sig := func(x model.Server) (string, string) { + wan, _, nets, _ := snap.ServerNet(&x) + return strings.Join(nets, ","), strings.Join(nets, ",") + "|" + wan.Dev + "|" + strconv.FormatBool(x.LanLike) + } + before, sigWas := sig(was) + _, sigNow := sig(now) + var what []string + if sigNow != sigWas { + what = append(what, "home network and internet path") + } + if mesh != was.Mesh { + what = append(what, meshWords[mesh]) + } + if len(what) > 0 && d.Log != nil { + d.Log.Write("awg", "info", "changed", "", was.Name, servicelog.Extra{By: "admin", Kind: "server", Note: strings.Join(what, ", "), SID: id}) + } + if d.Apply != nil { + d.Apply(text(a["lang"])) + } + if d.Told != nil { + d.Told() + } + w := d.World() + if w == nil || w.M == nil { + _, m, _ := d.Store.Read() + w = &view.World{M: m} + } + out, err := interfaces(w, d, id) + if err != nil { + return nil, err + } + eff, _ := out["effective"].(map[string]any) + nets, _ := eff["nets"].([]string) + out["nets_changed"] = before != strings.Join(nets, ",") + return out, nil +} + +// caps is what the installed AmneziaWG can do. +func caps(d Deps) awg.Caps { + if d.Caps != nil { + return d.Caps() + } + return awg.SystemCaps(d.DataDir) +} + +// defaultMethod is the disguise a new server gets: the strongest this router can run. +func defaultMethod(d Deps) string { + switch c := caps(d); { + case c.V3: + return "max" + case c.V2: + return "balanced" + } + return "off" +} + +// checkMethod refuses a disguise the installed AmneziaWG cannot run, in the admin's words. +func checkMethod(d Deps, name string) error { + if name != "off" && name != "balanced" && name != "max" { + return errors.New("Unknown disguise method.") + } + c := caps(d) + installed := true + if d.AWG != nil { + st := d.AWG() + installed = st["tools"] == true && st["kmod"] == true + } + if name == "max" && !c.V3 { + if installed { + return errors.New("Maximum needs AmneziaWG 3.1 on the router (kmod-amneziawg, amneziawg-tools 3.1): install a 3.1 build in Dawnline → Components.") + } + return errors.New("AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum.") + } + if name == "balanced" && !c.V2 { + if installed { + return errors.New("Balanced needs AmneziaWG 2.0 or newer on the router: install a current build in Dawnline → Components.") + } + return errors.New("AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced.") + } + return nil +} + +// serverObfuscation gives a server a new disguise of a method (the strongest the router runs when none is +// named): its old values go, the new ones are made here, and it is applied. +func serverObfuscation(d Deps, id, preset, lang string) (map[string]any, error) { + if preset == "" { + preset = defaultMethod(d) + } + if err := checkMethod(d, preset); err != nil { + return nil, err + } + values := disguise.Preset(preset) + // a cheap self-check: new values pass what a restore would be held to + o := map[string]string{} + for _, p := range values { + o[p.Key] = p.Value + } + if errs := disguise.Errors(o); len(errs) > 0 { + return nil, errors.New(strings.Join(errs, " ")) + } + name := "" + err := write(d, func(c *uci.Config, m *model.Model) error { + srv := m.Servers[id] + if srv == nil { + return errors.New("Unknown server.") + } + name = srv.Name + for _, k := range model.ObfKeys { + c.Delete(id, k) + } + for _, p := range values { + c.Set(id, p.Key, p.Value) + } + c.Set(id, "preset", preset) + return nil + }) + if err != nil { + return nil, err + } + var applied map[string]any + if d.Apply != nil { + applied = d.Apply(lang) + } + if d.Log != nil { + d.Log.Write("awg", "info", "changed", "", name, servicelog.Extra{By: "admin", Kind: "server", Note: "disguise: " + preset, SID: id}) + } + if d.Told != nil { + d.Told() + } + if applied == nil { + applied = map[string]any{} + } + return applied, nil +} + +// needLoaded: a server is made only where AmneziaWG is installed and its module loads. The golden's test +// turns it off, as the copy of ucode its golden ran on has that one check taken out. +var needLoaded = true + +var serverID = regexp.MustCompile(`^[a-z][a-z0-9_]{0,23}$`) + +// serverCreate sets a server up (the wizard's last step): its section with keys made here and the disguise +// of its method, the portal as asked, then ucode's full apply and the service turned on and restarted. +func serverCreate(d Deps, a map[string]any) (map[string]any, error) { + if needLoaded { + if err := needAWG(d); err != nil { + return nil, err + } + } + // an installed module that is not loaded yet is loaded: nothing loads it before the first tunnel comes up + if needLoaded && d.AWG != nil && d.AWG()["loaded"] != true { + exec.Command("modprobe", "amneziawg").Run() + if d.AWG()["loaded"] != true { + return nil, errors.New("AmneziaWG's kernel module doesn't load on this firmware: reinstall a build for this kernel in Components.") + } + } + if d.Snapshot == nil { + return nil, errors.New("The router is still starting. Try again in a moment.") + } + snap := d.Snapshot() + var routerNets []string + if d.Addresses != nil { + for _, x := range d.Addresses() { + routerNets = append(routerNets, x.CIDR) + } + } + t := i18n.Use(d.Catalogs, text(a["lang"])) + id, name, port := asString(a["id"]), "", 0 + if id == "" { + id = "home" + } + err := write(d, func(c *uci.Config, m *model.Model) error { + // a section's name: a dash would make uci drop it silently + if !serverID.MatchString(id) { + return errors.New("Server ID may use lowercase letters, digits and underscores.") + } + if idTaken(m, id) { + return said{`"%s" is already taken.`, []any{id}} + } + network := parseFile("/etc/config/network") + ifname := asString(a["ifname"]) + if ifname == "" { + ifname = freeIfname(m, network) + } + free := (network == nil || network.Section(ifname) == nil) && ifname != "dlx0" && ifname != "dll0" + for _, s := range m.Servers { + free = free && s.Ifname != ifname + } + if !free { + return said{"Network interface %s already exists.", []any{ifname}} + } + wanZone := asString(a["wan_zone"]) + if wanZone == "" { + wanZone = "wan" + } + udp := udpHeld(m, &model.Server{WanZone: wanZone}, t) + port = freePort(udp) + if p := asString(a["port"]); a["port"] != nil && p != "" && p != "0" { + if !ValidPort(p) { + return errors.New("UDP port must be 1-65535.") + } + port, _ = strconv.Atoi(p) + } + for _, h := range udp { + if h["from"].(int) <= port && port <= h["to"].(int) { + return said{"UDP %d is used by %s. Choose another port.", []any{port, h["who"]}} + } + } + mtu := asString(a["mtu"]) + if mtu == "0" { + mtu = "" + } + if n, _ := strconv.Atoi(mtu); mtu != "" && (!mtuArg.MatchString(mtu) || n < 1280 || n > 1500) { + return errors.New("MTU must be 1280-1500.") + } + preset := asString(a["preset"]) + if preset == "" { + preset = defaultMethod(d) + } + if err := checkMethod(d, preset); err != nil { + return err + } + values := disguise.Preset(preset) + subnet := asString(a["subnet"]) + pc, isNet := ipnet.Subnet(subnet) + if isNet { + subnet = pc.String() + // public addresses inside the tunnel would hide the real hosts behind them + if !privateNet(pc) { + return errors.New("Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.") + } + } + endpointHost := asString(a["endpoint"]) + // the definition against the rest of the router, every fault at once + var errs []string + if !model.ValidIfname(ifname) { + errs = append(errs, t.T("Interface name: 1-12 lowercase letters, digits or _.")) + } + if port < 1 || port > 65535 { + errs = append(errs, t.T("Port must be 1-65535.")) + } + if !isNet { + errs = append(errs, t.T("Subnet must look like 10.77.0.0/24.")) + } else { + taken := append([]string{}, routerNets...) + for _, sid := range m.ServerIDs() { + taken = append(taken, m.Servers[sid].Subnet) + } + for _, o := range taken { + if oc, ok := ipnet.Subnet(o); ok && uint64(pc.Base) < uint64(oc.Base)+oc.Size() && uint64(oc.Base) < uint64(pc.Base)+pc.Size() { + errs = append(errs, fmt.Sprintf(t.T("Subnet overlaps %s."), o)) + } + } + } + if endpointHost != "" && !endpoint.ValidHost(endpointHost) { + errs = append(errs, t.T("Endpoint must be a hostname or IP address.")) + } + o := map[string]string{} + for _, p := range values { + o[p.Key] = p.Value + } + errs = append(errs, disguise.Errors(o)...) + if len(errs) > 0 { + return said{"%s", []any{strings.Join(errs, " ")}} + } + name = asString(a["name"]) + if name == "" { + name = "Home" + } + if !ValidName(name) { + return errors.New(`Server: Enter a name: up to 48 characters, without < > " or \.`) + } + keys := newKeys() + if !awg.ValidKey(keys.Public) || keys.Private == "" { + return errors.New("Key generation failed (is amneziawg-tools installed?).") + } + c.Add("settings", "settings") + c.Add("server", id) + set := func(k, v string) { c.Set(id, k, v) } + set("name", name) + set("ifname", ifname) + set("port", strconv.Itoa(port)) + set("subnet", subnet) + set("endpoint", endpointHost) + set("mtu", mtu) + set("keepalive", "25") + set("private_key", keys.Private) + set("public_key", keys.Public) + set("preset", preset) + for _, p := range values { + set(p.Key, p.Value) + } + zone := func(k string) { + z := asString(a[k]) + if z == "" { + z = strings.TrimSuffix(k, "_zone") + } + set(k, z) + } + zone("lan_zone") + zone("wan_zone") + set("auto_wan", "1") + set("auto_lan", "1") + set("detected_wan", snap.WAN) + set("detected_lan", snap.LAN) + // off unless asked for: the loop through the LAN costs speed + if on(a["lan_like"]) { + set("lan_like", "1") + } else { + set("lan_like", "0") + } + set("enabled", "1") + if a["portal_enabled"] != nil { + if on(a["portal_enabled"]) { + c.Set("settings", "portal_enabled", "1") + } else { + c.Set("settings", "portal_enabled", "0") + } + if p := asString(a["portal_port"]); a["portal_port"] != nil && p != "" && p != "0" { + if !ValidPort(p) { + return errors.New("Portal port must be 1-65535.") + } + n, _ := strconv.Atoi(p) + c.Set("settings", "portal_port", strconv.Itoa(n)) + } + } + if host, _ := c.Section("settings").Get("portal_host"); endpointHost != "" && host == "" && endpoint.ValidHost(endpointHost) { + c.Set("settings", "portal_host", endpointHost) + } + // the portal as it will be, whatever this call changed + var blocked map[string]any + files.ReadJSON(d.RunDir+"/netifd-blocked.json", &blocked) + return checkPortal(model.Load(c, blocked), m, listening("tcp"), parseFile("/etc/config/firewall")) + }) + if err != nil { + return nil, err + } + var applied map[string]any + if d.Apply != nil { + applied = d.Apply(text(a["lang"])) + } + if d.Log != nil { + d.Log.Write("dawnline", "info", "created", "", name, servicelog.Extra{By: "admin", Kind: "server", Note: "UDP " + strconv.Itoa(port), SID: id}) + } + // netifd reads its protocol handlers when it starts: AmneziaWG installed after that needs a network restart + networkRestart := d.AWG != nil && d.AWG()["handler"] != true + if d.Restart != nil { + d.Restart(networkRestart) + } + if d.Told != nil { + d.Told() + } + if applied == nil { + applied = map[string]any{} + } + return map[string]any{"id": id, "applied": applied, "network_restart": networkRestart, "warning": applied["warning"]}, nil +} diff --git a/backend/methods/settings.go b/backend/methods/settings.go new file mode 100644 index 0000000..4bc491e --- /dev/null +++ b/backend/methods/settings.go @@ -0,0 +1,565 @@ +package methods + +import ( + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "fmt" + "os" + "os/exec" + "regexp" + "sort" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// Settings is every setting dawnline.schema knows, in its order: what settings_get shows as written. +var Settings = []string{"portal_enabled", "portal_host", "portal_alt", "portal_port", "portal_redirect", "portal_cert", "portal_key", + "default_device_limit", "hostnames", "domain", "geo_enabled", "geo_provider", "log_connections", "log_level", "watchdog", "log_keep_days", + "log_max", "log_persist", "usage_keep_days", "usage_keep_months", "home_dns_fallback", "update_check", "update_interval", "update_auto", + "update_mode", "update_time", "update_targets", "update_keep", "update_mirrors"} + +// Reserved are the ports the router itself holds: nothing of Dawnline's may take them. +var Reserved = []int{22, 53, 80, 443} + +func exists(path string) bool { + _, err := os.Stat(path) + return err == nil +} + +func size(path string) int64 { + st, err := os.Stat(path) + if err != nil { + return 0 + } + return st.Size() +} + +// luciACME is what tells luci-app-acme is there: its menu file, which every version names after the package, and +// its view where each version put it (view/acme.js before 25.12, view/acme/acme.js since). Looking for the old view +// alone said «not installed» of an installed one (the owner's screenshot, 2026-11-12). +var luciACME = []string{ + "/usr/share/luci/menu.d/luci-app-acme.json", + "/www/luci-static/resources/view/acme/acme.js", + "/www/luci-static/resources/view/acme.js", +} + +// anyExists tells whether one of the paths exists. +func anyExists(paths ...string) bool { + for _, p := range paths { + if exists(p) { + return true + } + } + return false +} + +// Needs is the packages a feature needs that are missing, by feature (dawnline.health needs()): checked by +// files, so cheap enough for every page load. +func Needs() map[string][]string { + tls := false + for _, d := range []string{"/lib", "/usr/lib"} { + entries, _ := os.ReadDir(d) + for _, e := range entries { + tls = tls || strings.HasPrefix(e.Name(), "libustream-ssl.s") + } + } + rel, _ := os.ReadFile("/proc/sys/kernel/osrelease") + kver := strings.TrimSpace(string(rel)) + kmod := func(name string) bool { + return exists("/sys/module/"+name) || exists("/lib/modules/"+kver+"/"+name+".ko") + } + type need struct { + has bool + pkg string + } + miss := func(list ...need) []string { + out := []string{} + for _, n := range list { + if !n.has { + out = append(out, n.pkg) + } + } + return out + } + return map[string][]string{ + "https": miss(need{exists("/usr/bin/openssl"), "openssl-util"}, need{tls, "libustream-openssl"}), + "acme": miss(need{exists("/usr/lib/acme/client/acme.sh"), "acme"}, need{exists("/usr/lib/acme/client/dnsapi/dns_cf.sh"), "acme-acmesh-dnsapi"}, + need{anyExists(luciACME...), "luci-app-acme"}), + "home": miss(need{exists("/usr/libexec/ip-full"), "ip-full"}, need{kmod("veth"), "kmod-veth"}), + "awg": miss(need{exists("/usr/bin/awg") && exists("/lib/netifd/proto/amneziawg.sh"), "amneziawg-tools"}, need{kmod("amneziawg"), "kmod-amneziawg"}), + } +} + +func certOf(path string) *x509.Certificate { + raw, err := os.ReadFile(path) + if err != nil { + return nil + } + block, _ := pem.Decode(raw) + if block == nil { + return nil + } + c, _ := x509.ParseCertificate(block.Bytes) + return c +} + +// covers tells a certificate name that covers host: the same name, or a wildcard one level up. +func covers(name, host string) bool { + if name == host { + return true + } + dot := strings.Index(host, ".") + return strings.HasPrefix(name, "*.") && dot > 0 && host[dot:] == name[1:] +} + +// PortalCert is the certificate the portal uses (dawnline.portalcert portal_cert): the one set, an ACME one +// for its address, or Dawnline's self-signed one (made by the service when it starts the portal). +func PortalCert(s model.Settings, dataDir string) (cert string, selfSigned bool) { + if s.PortalCert != "" && s.PortalKey != "" && exists(s.PortalCert) && exists(s.PortalKey) { + return s.PortalCert, false + } + if h := s.PortalHost; h != "" { + for _, base := range []string{"/etc/ssl/acme/" + h, "/etc/acme/" + h + "_ecc/" + h} { + if exists(base+".fullchain.crt") && exists(base+".key") { + return base + ".fullchain.crt", false + } + } + // an ACME certificate issued for several names, the portal's among them + entries, _ := os.ReadDir("/etc/ssl/acme") + for _, e := range entries { + base, is := strings.CutSuffix(e.Name(), ".fullchain.crt") + if !is || base == "" || !exists("/etc/ssl/acme/"+base+".key") { + continue + } + if c := certOf("/etc/ssl/acme/" + e.Name()); c != nil { + for _, n := range c.DNSNames { + if covers(n, h) { + return "/etc/ssl/acme/" + e.Name(), false + } + } + } + } + } + return dataDir + "/portal.crt", true +} + +// PortalCertAndKey is the certificate and the key the portal serves with. Dawnline's own self-signed pair +// is made here when it is not there yet (run: a command runner, as the service has openssl for it). +func PortalCertAndKey(s model.Settings, dataDir string, run func(name string, args ...string) (string, int)) (cert, key string) { + cert, self := PortalCert(s, dataDir) + switch base, acme := strings.CutSuffix(cert, ".fullchain.crt"); { + case !self && cert == s.PortalCert: + return cert, s.PortalKey + case !self && acme: + return cert, base + ".key" + } + key = dataDir + "/portal.key" + if !exists(cert) || !exists(key) { + os.MkdirAll(dataDir, 0o700) + cn := s.PortalHost + if cn == "" { + cn = "dawnline" + } + run("openssl", "req", "-x509", "-newkey", "ec", "-pkeyopt", "ec_paramgen_curve:prime256v1", "-nodes", "-days", "3650", "-subj", "/CN="+cn, "-keyout", key, "-out", cert) + os.Chmod(key, 0o600) + } + return cert, key +} + +var ( + blanks = regexp.MustCompile(`[ \t]+`) + portSuffix = regexp.MustCompile(`:([0-9]+)$`) + portRange = regexp.MustCompile(`^(\d+)([-:](\d+))?$`) + listSep = regexp.MustCompile(`[ ,]+`) +) + +// ourPortal tells a command line that is our own portal's: its uhttpd, or this backend told to serve it. +func ourPortal(cmd string) bool { + return strings.Contains(cmd, "/usr/share/dawnline/portal") || + (strings.Contains(cmd, "/usr/libexec/dawnline/dawnlined") && strings.Contains(cmd, "-portal-port")) +} + +type held struct { + port int + name string +} + +// programs is who listens on which port of a protocol ("tcp", "udp"), in netstat's order, our own portal left out. +func programs(netstat, proto string, cmdline func(pid string) string) []held { + var out []held + seen := map[int]bool{} + for _, line := range strings.Split(netstat, "\n") { + f := blanks.Split(strings.TrimSpace(line), -1) + if len(f) < 4 || (f[0] != proto && f[0] != proto+"6") { + continue + } + m := portSuffix.FindStringSubmatch(f[3]) + pid, name, has := strings.Cut(f[len(f)-1], "/") + if m == nil || !has || name == "" { + continue + } + port, _ := strconv.Atoi(m[1]) + if seen[port] || ourPortal(cmdline(pid)) { + continue + } + seen[port] = true + out = append(out, held{port, name}) + } + return out +} + +type forward struct { + from, to int + name string +} + +// forwards is the port forwards of a protocol from a zone that are not Dawnline's (dawnline.core +// wan_forwards): a forwarded port never reaches the router itself. +func forwards(fw *uci.Config, zone, want string) []forward { + var out []forward + if fw == nil { + return nil + } + for _, r := range fw.OfType("redirect") { + get := func(k string) string { v, _ := r.Get(k); return v } + target := get("target") + if target == "" { + target = "DNAT" + } + if strings.HasPrefix(r.Name, "dawnline_") || get("enabled") == "0" || target != "DNAT" || get("src") != zone { + continue + } + // fw4's default is "tcp udp" + proto := "tcp udp" + if v, ok := r.Values["proto"]; ok { + proto = v.Str + if v.IsList { + proto = strings.Join(v.List, " ") + } + } + takes := false + for _, p := range listSep.Split(proto, -1) { + takes = takes || p == want || p == "all" || p == "any" + } + if !takes { + continue + } + name := get("name") + if _, named := r.Values["name"]; !named { + name = r.Name + } + for _, p := range listSep.Split(get("src_dport"), -1) { + if m := portRange.FindStringSubmatch(p); m != nil { + from, _ := strconv.Atoi(m[1]) + to := from + if m[3] != "" { + to, _ = strconv.Atoi(m[3]) + } + out = append(out, forward{from, to, name}) + } + } + } + return out +} + +// tcpTaken is the TCP ports the portal cannot take and who holds them: the router's own, other programs, +// port forwards from WAN (dawnline.rpc.common tcp_taken). `who` in the page's language. +func tcpTaken(m *model.Model, t *i18n.Catalog, progs []held, fw *uci.Config) []map[string]any { + out := []map[string]any{} + seen := map[int]bool{} + hold := func(p int, who string) { + if !seen[p] { + seen[p] = true + out = append(out, map[string]any{"from": p, "to": p, "who": who}) + } + } + for _, p := range Reserved { + hold(p, t.T("the router itself")) + } + for _, p := range progs { + hold(p.port, fmt.Sprintf(t.T("%s on this router"), p.name)) + } + zones := []string{"wan"} + for _, id := range m.ServerIDs() { + z, dup := m.Servers[id].WanZone, false + for _, o := range zones { + dup = dup || o == z + } + if !dup { + zones = append(zones, z) + } + } + for _, z := range zones { + for _, f := range forwards(fw, z, "tcp") { + out = append(out, map[string]any{"from": f.from, "to": f.to, "who": fmt.Sprintf(t.T("port forward “%s”"), f.name)}) + } + } + return out +} + +func parseFile(path string) *uci.Config { + raw, err := os.ReadFile(path) + if err != nil { + return nil + } + c, _ := uci.Parse(string(raw)) + return c +} + +// logsInfo is what the log and the traffic history hold right now (Settings → Logs & history). +func logsInfo(w *view.World, d Deps) map[string]any { + var ev []map[string]any + if !files.ReadJSON(d.RunDir+"/events.json", &ev) { + files.ReadJSON(d.DataDir+"/events.json", &ev) + } + by := map[string]int{} + for _, c := range journal.Categories { + by[c] = 0 + } + for _, e := range ev { + by[journal.CategoryOf(text(e["type"]))]++ + } + days := map[string]bool{} + for _, group := range []map[string]*usage.Record{w.Usage.Devices, w.Usage.People} { + for _, rec := range group { + if rec != nil { + for k := range rec.Days { + days[k] = true + } + } + } + } + keys := make([]string, 0, len(days)) + for k := range days { + keys = append(keys, k) + } + sort.Strings(keys) + since := "" + if len(keys) > 0 { + since = keys[0] + } + var oldest any = 0 + if len(ev) > 0 { + oldest = ev[0]["ts"] + } + return map[string]any{ + "policy": policy(w), "events": len(ev), "oldest": oldest, "by_category": by, + "log_ram": size(d.RunDir + "/events.json"), "log_flash": size(d.DataDir + "/events.json"), "usage_flash": size(d.DataDir + "/usage.json"), + "usage_since": since, "usage_days": len(keys), "geo_flash": size(d.DataDir + "/geo.json"), + } +} + +// policy is what the log and the traffic history keep (dawnline.live policy()). +func policy(w *view.World) map[string]any { + pol, keep := journal.PolicyOf(w.M.Settings.Retention), usage.PolicyOf(w.M.Settings.Retention) + cats := pol.Categories + if cats == nil { + cats = []string{} + } + return map[string]any{"keep_days": pol.KeepDays, "max": pol.Max, "categories": cats, "persist": pol.Persist, "usage_days": keep.Days, "usage_months": keep.Months} +} + +// settingsGet is the Settings page's data: the settings as written and as they take effect, and what the +// page shows beside them. +func settingsGet(w *view.World, t *i18n.Catalog, d Deps) map[string]any { + out := map[string]any{} + var section *uci.Section + if c := parseFile(d.Config); c != nil { + section = c.Section("settings") + } + for _, k := range Settings { + out[k] = "" + if section != nil { + if v, ok := section.Values[k]; ok { + out[k] = v.Str + if v.IsList { + out[k] = v.List + } + } + } + } + pol := policy(w) + out["log_category"] = pol["categories"] + var cert any + if s := w.M.Settings; s.PortalEnabled { + path, self := PortalCert(s, d.DataDir) + expires := "" + if c := certOf(path); c != nil { + // as `openssl x509 -enddate` writes it + expires = c.NotAfter.UTC().Format("Jan _2 15:04:05 2006") + " GMT" + } + cert = map[string]any{"path": path, "self_signed": self, "expires": expires} + } + services := []any{} + for _, id := range w.M.ServiceIDs() { + services = append(services, w.M.Services[id]) + } + var geo struct { + IPs map[string]json.RawMessage `json:"ips"` + } + if !files.ReadJSON(d.RunDir+"/geo.json", &geo) { + files.ReadJSON(d.DataDir+"/geo.json", &geo) + } + return map[string]any{ + "settings": out, "needs": Needs(), "effective": w.M.Settings, "services": services, "cert": cert, + "tcp_taken": tcpTaken(w.M, t, listening("tcp"), parseFile("/etc/config/firewall")), + "portal_public_port": w.M.Settings.PortalPort, "geo_cached": len(geo.IPs), "logs": logsInfo(w, d), + } +} + +var backupFile = regexp.MustCompile(`^dawnline-([0-9]{8}-[0-9]{6})(-([a-z0-9-]+))?\.tar\.gz$`) + +// backupRead is a backup's file, in base64 (the page saves it). +func backupRead(dir, name string) (map[string]any, error) { + if !backupFile.MatchString(name) { + return nil, errors.New("Invalid backup name.") + } + raw, err := os.ReadFile(dir + "/" + name) + if err != nil { + return nil, errors.New("Backup not found.") + } + return map[string]any{"data": base64.StdEncoding.EncodeToString(raw)}, nil +} + +// listening is the programs that listen on the router now, by netstat. +func listening(proto string) []held { + flag := "-lntp" + if proto == "udp" { + flag = "-lnup" + } + netstat, _ := exec.Command("netstat", flag).Output() + return programs(string(netstat), proto, func(pid string) string { + raw, _ := os.ReadFile("/proc/" + pid + "/cmdline") + return string(raw) + }) +} + +// " 12: 00000000:1194 00000000:0000 07 …": the local address, then the remote one (none). +var udpUnconnected = regexp.MustCompile(`^ *[0-9]+: [0-9A-F]+:([0-9A-F]{4}) [0-9A-F]+:0000 `) + +// udpBound is the UDP ports an unconnected socket is bound to, as /proc/net/udp and udp6 list them: nothing +// else can listen there. +func udpBound(tables ...string) []int { + var out []int + seen := map[int]bool{} + for _, t := range tables { + for _, line := range strings.Split(t, "\n") { + if m := udpUnconnected.FindStringSubmatch(line); m != nil { + p, _ := strconv.ParseInt(m[1], 16, 32) + if !seen[int(p)] { + seen[int(p)] = true + out = append(out, int(p)) + } + } + } + } + return out +} + +// udpTaken is the UDP ports a server cannot listen on and who holds them: other servers, tunnel interfaces, +// programs on the router and port forwards from its WAN zone (dawnline.rpc.servers udp_taken). Its own port +// is not counted. +func udpTaken(m *model.Model, srv *model.Server, t *i18n.Catalog, network, fw *uci.Config, bound []int, progs []held) []map[string]any { + out := []map[string]any{} + seen := map[int]bool{} + hold := func(p int, who string) { + if p > 0 && !seen[p] { + seen[p] = true + out = append(out, map[string]any{"from": p, "to": p, "who": who}) + } + } + for _, id := range m.ServerIDs() { + if o := m.Servers[id]; id != srv.ID { + hold(o.Port, fmt.Sprintf(t.T("server “%s”"), o.Name)) + } + } + if network != nil { + for _, s := range network.OfType("interface") { + if lp, _ := s.Get("listen_port"); lp != "" && s.Name != srv.Ifname { + p, _ := strconv.Atoi(strings.TrimSpace(lp)) + hold(p, fmt.Sprintf(t.T("interface %s"), s.Name)) + } + } + } + names := map[int]string{} + for _, p := range progs { + names[p.port] = p.name + } + for _, p := range bound { + if p == srv.Port { + continue + } + if n := names[p]; n != "" { + hold(p, fmt.Sprintf(t.T("%s on this router"), n)) + } else { + hold(p, t.T("another program on this router")) + } + } + for _, f := range forwards(fw, srv.WanZone, "udp") { + out = append(out, map[string]any{"from": f.from, "to": f.to, "who": fmt.Sprintf(t.T("port forward “%s”"), f.name)}) + } + return out +} + +// Address is one IPv4 address of a netifd interface, with its prefix ("192.168.1.1/24"). +type Address struct { + Iface, CIDR string +} + +// takenNetworks is the networks a tunnel network must not overlap, by name: the router's and the servers'. +func takenNetworks(m *model.Model, addrs []Address) []map[string]any { + out := []map[string]any{} + seen := map[string]bool{} + add := func(name, cidr string) { + if n, ok := ipnet.Subnet(cidr); ok && !seen[n.String()] { + seen[n.String()] = true + out = append(out, map[string]any{"name": name, "cidr": n.String()}) + } + } + for _, a := range addrs { + add(a.Iface, a.CIDR) + } + for _, id := range m.ServerIDs() { + add(m.Servers[id].Name, m.Servers[id].Subnet) + } + return out +} + +// serverPorts is what the ports and the network of an existing server must avoid (the AmneziaWG card checks +// as you type). +func serverPorts(w *view.World, t *i18n.Catalog, d Deps, id string) map[string]any { + srv := w.M.Servers[id] + if srv == nil { + return map[string]any{"error": t.T("Unknown server.")} + } + fw := parseFile("/etc/config/firewall") + udp, _ := os.ReadFile("/proc/net/udp") + udp6, _ := os.ReadFile("/proc/net/udp6") + var addrs []Address + if d.Addresses != nil { + addrs = d.Addresses() + } + networks := []map[string]any{} + for _, n := range takenNetworks(w.M, addrs) { + // everything but this server's own + if n["cidr"] != srv.Subnet { + networks = append(networks, n) + } + } + return map[string]any{ + "udp_taken": udpTaken(w.M, srv, t, parseFile("/etc/config/network"), fw, udpBound(string(udp), string(udp6)), listening("udp")), + "tcp_taken": tcpTaken(w.M, t, listening("tcp"), fw), "networks": networks, + } +} diff --git a/backend/methods/setup.go b/backend/methods/setup.go new file mode 100644 index 0000000..e30a48c --- /dev/null +++ b/backend/methods/setup.go @@ -0,0 +1,258 @@ +package methods + +import ( + "fmt" + "math/rand/v2" + "os" + "os/exec" + "sort" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/roster" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// DefaultPort is the usual AmneziaWG port. +const DefaultPort = 4500 + +// ReservedIDs may name nothing in the settings; portalPaths are the portal's own, which a server's id (the +// first part of nothing else) must not be either. +var ( + ReservedIDs = []string{"settings", "main", "global", "defaults"} + portalPaths = []string{"api", "assets", "cgi-bin"} +) + +func within(taken []map[string]any, p int) bool { + for _, t := range taken { + if t["from"].(int) <= p && p <= t["to"].(int) { + return true + } + } + return false +} + +// randPort draws a high port. A test puts its own in its place. +var randPort = func() int { return 40000 + rand.IntN(20001) } + +// freePort is the usual port when free, otherwise a random high one. +func freePort(taken []map[string]any) int { + if !within(taken, DefaultPort) { + return DefaultPort + } + for i := 0; i < 50; i++ { + if p := randPort(); !within(taken, p) { + return p + } + } + return 51830 +} + +// freeSubnet is a /24 that overlaps none of the networks taken: 10.x first, past 200 tries the 172.16-31 range. +func freeSubnet(taken []string) string { + for i := 0; i < 300; i++ { + cand := fmt.Sprintf("10.%d.%d.0/24", 60+rand.IntN(191), rand.IntN(251)) + if i >= 200 { + cand = fmt.Sprintf("172.%d.%d.0/24", 16+rand.IntN(16), rand.IntN(251)) + } + c, _ := ipnet.Subnet(cand) + bad := false + for _, t := range taken { + if n, ok := ipnet.Subnet(t); ok && uint64(c.Base) < uint64(n.Base)+n.Size() && uint64(n.Base) < uint64(c.Base)+c.Size() { + bad = true + break + } + } + if !bad { + return c.String() + } + } + return "10.77.0.0/24" +} + +// freePortalPort is a portal port free together with the next one (plain HTTP for IP links): first (the +// server's UDP number) before the usual ones. +func freePortalPort(first, cur int, taken []map[string]any) int { + if cur == 0 { + cur = 8443 + } + for _, p := range []int{first, cur, 8443, 9443, 10443, 7443, 4443} { + if !within(taken, p) && !within(taken, p+1) { + return p + } + } + return 9443 +} + +func idTaken(m *model.Model, id string) bool { + for _, r := range append(append([]string{}, ReservedIDs...), portalPaths...) { + if r == id { + return true + } + } + return m.Servers[id] != nil || m.People[id] != nil || m.Devices[id] != nil || m.Services[id] != nil || m.Circles[id] != nil +} + +// freeServerID is home, then server2, server3, … (never an id anything else has). +func freeServerID(m *model.Model) string { + if !idTaken(m, "home") { + return "home" + } + for n := 2; ; n++ { + if id := fmt.Sprintf("server%d", n); !idTaken(m, id) { + return id + } + } +} + +// freeIfname is a network section name nothing uses: not the router's, not Dawnline's own links, not another server's. +func freeIfname(m *model.Model, network *uci.Config) string { + for i := 0; i < 10; i++ { + n := fmt.Sprintf("dawn%d", i) + free := network == nil || network.Section(n) == nil + for _, s := range m.Servers { + free = free && s.Ifname != n + } + if free { + return n + } + } + return "dawnx" +} + +// wanKind is what kind of IPv4 the WAN has: public, cgnat (100.64/10), private (behind another router), none. +func wanKind(wan string) string { + n, ok := ipnet.IP(wan) + if !ok { + return "none" + } + for i, p := range []string{"100.64.0.0/10", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"} { + if r, _ := ipnet.Any(p); r.Holds(n) { + if i == 0 { + return "cgnat" + } + return "private" + } + } + return "public" +} + +// setupDefaults is what a new server starts from (dawnline.rpc.servers setup_defaults): a free id, name, +// interface, port and network, the address to reach the router by and where it came from, the zones. +func setupDefaults(w *view.World, t *i18n.Catalog, d Deps) map[string]any { + m := w.M + var addrs []Address + if d.Addresses != nil { + addrs = d.Addresses() + } + networks := takenNetworks(m, addrs) + fw := parseFile("/etc/config/firewall") + zones := []any{} + names := []string{} + if fw != nil { + for _, z := range fw.OfType("zone") { + // as ucode lists them: a zone with no name is a null in the list + if n, ok := z.Get("name"); ok { + zones = append(zones, n) + names = append(names, n) + } else { + zones = append(zones, nil) + names = append(names, "") + } + } + } + has := func(n string) bool { + for _, z := range names { + if z == n { + return true + } + } + return false + } + snap := d.Snapshot() + wanIP := "" + if dev := snap.Devices[snap.WAN]; dev != nil && len(dev.Addrs) > 0 { + wanIP = strings.SplitN(dev.Addrs[0], "/", 2)[0] + } + kind := wanKind(wanIP) + host, from := m.Settings.PortalHost, "" + if host != "" { + from = "portal" + } else { + // a DDNS name, then an ACME certificate's, then the WAN address, but never a private or CGNAT one + if ddns := parseFile("/etc/config/ddns"); ddns != nil { + for _, s := range ddns.OfType("service") { + lookup, _ := s.Get("lookup_host") + if on, _ := s.Get("enabled"); host == "" && lookup != "" && on == "1" { + host, from = lookup, "ddns" + } + } + } + if host == "" { + entries, _ := os.ReadDir("/etc/ssl/acme") + var certs []string + for _, e := range entries { + if base, is := strings.CutSuffix(e.Name(), ".fullchain.crt"); is { + certs = append(certs, base) + } + } + sort.Strings(certs) + if len(certs) > 0 && certs[0] != "" { + host, from = certs[0], "cert" + } + } + if host == "" && kind == "public" { + host, from = wanIP, "wan" + } + } + // the zones the WAN and LAN devices are in, whatever they are called + zoneOf := func(dev, usual string, fallback int) any { + if x := snap.Devices[dev]; x != nil && x.Zone != "" { + return x.Zone + } + if has(usual) { + return usual + } + if fallback < len(zones) { + return zones[fallback] + } + return nil + } + wanZone, lanZone := zoneOf(snap.WAN, "wan", 1), zoneOf(snap.LAN, "lan", 0) + network := parseFile("/etc/config/network") + udp, _ := os.ReadFile("/proc/net/udp") + udp6, _ := os.ReadFile("/proc/net/udp6") + // no server is being edited: every server's port counts + wz, _ := wanZone.(string) + udpHeld := udpTaken(m, &model.Server{WanZone: wz}, t, network, fw, udpBound(string(udp), string(udp6)), listening("udp")) + tcpHeld := tcpTaken(m, t, listening("tcp"), fw) + port := freePort(udpHeld) + name := t.T("Home") + if n := len(m.Servers); n > 0 { + name = fmt.Sprintf(t.T("Server %d"), n+1) + } + cidrs := []string{} + for _, n := range networks { + cidrs = append(cidrs, n["cidr"].(string)) + } + portal := m.Settings.PortalPort + if !m.Settings.PortalEnabled { + portal = freePortalPort(port, m.Settings.PortalPort, tcpHeld) + } + // an installed module that is not loaded yet is loaded: nothing loads it before the first tunnel comes up + state := roster.AwgState(d.Handler) + if state["kmod"] == true && state["loaded"] == false { + exec.Command("modprobe", "amneziawg").Run() + state = roster.AwgState(d.Handler) + } + return map[string]any{ + "id": freeServerID(m), "name": name, "ifname": freeIfname(m, network), "port": port, "subnet": freeSubnet(cidrs), + "endpoint": host, "endpoint_from": from, "wan_kind": kind, "wan_ip": orNull(wanIP), "mtu": 0, + "zones": zones, "lan_zone": lanZone, "wan_zone": wanZone, "portal_port": portal, + "awg": awg.SystemCaps(d.DataDir), "awg_state": state, "networks": networks, "udp_taken": udpHeld, "tcp_taken": tcpHeld, + } +} diff --git a/backend/methods/testdata/backup.json b/backend/methods/testdata/backup.json new file mode 100644 index 0000000..afe1e5d --- /dev/null +++ b/backend/methods/testdata/backup.json @@ -0,0 +1,13 @@ +{ + "config": "config settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n", + "archives": [ + { + "name": "dawnline-20261112-050743.tar.gz", + "data": "H4sIAAAAAAAAA+1ZTW/bOBD1tfkVgi+6dBXJku14gR7S9CNts8kCe9jDYmFQFG2zpkhBkp01gvz3pWypJilS4hbeFAX8LpLJ0cybEYePUVAJLyGjC7y8TMAjJZiiwanhc0yiaH/lUK5BMAnDQTAeTcejKJqE04EfhGEUDhz/5Ew02BQlyB1nkDNWdtn1zf+kOLx7p0BliemycNzmzr14xbISM+pkLC8BmSMKYoISxw1aU9XFcaOx77emVqzgU9uMeugfkGYEeSxfciuC+XhtAwg3Gfmh53tBEHpT9+LiG618i3LHXbEUHV1TkCLHvZXG8OIwWi1ihYXKrNjEFPHRwPemUx7TvxxFwhM53oISzddo57jAGtdvBBebmGB48BBbQ/QANiWbE0Ad129qxX/NE7TFsEqS1AVpzcT5L/zn0VGKipXjQpxDgoRXWj1C8Brt/avFhiDGVK32jTwoljtolXtiKvdVd7mhNUzlTqzxPeWWisoWi3btWIZapXuQxsTKjVqVm5oqN+uuHLKGqXILa/yHyumXIyDkWLnD2uTxQSpk3tH3H0CKya7t4JHlazsPf+4txVe3J0tBoVreX/8h5JokOSr4FhnMRl4wuap2j7G4lfGpKFJHgnCmiQXFbJsOS1EOOsKNfS8U2jVDecHNXEApsMv7WrIEEO7dx6xcHUel16GGilmOC7tYb2XT7wgGCcgtE7uRTZtgmJYo5x3U9p3g1NL1O8my8XxY1PvXXD0037dps02owdDWMtb7bXcoZaXKY1BXwwVKWG7ZVrJp9wt7lDqoibYkKLYL9lGy1MfKwKaojxtqoBXQLXmtbt0C85pX3fL9lFq6/SSZdrtdY9061inFF6xbxnqvBG3tnN6Jht0+KbPtuHtmZqrtbrVZGmVoKDSKka0YFaLpN7kDh99l0+N+WZ/rRHUVhO6tNSqhU/kRkJUssyN4p9i2GIZ6hjfWEKW40t14l4F9gOPwGlPeRJCl2Ybvhu2EGEnssnkQDVupRPpU3llDTCXBxfFvDZVwbFgiijjVMpT1LJKxnvd7a+gWCTRQVCStFq8+ihM9xQ/W0FFMDBRlZaw1sI/hVM/wozV0DJGBoSSntXD2EbzSE7y1ho7gwkBQEd1aXvsozvQUP1lDR3FpoCgrda3JfQwDX0/xszV0FFcGirLG12LeRfHKvOV/sYaOITYwlI8L9bmgj6Fhy7+zho7h2sBQPnnUZ4wuhjNzDX+zhlY2DQylU0ytmn0EDSW8t4aOIDUQlI9E9eGnt1MCPcUHa1QUX+T7Hyrhtw+/l5sCLJH3lSd+0hjd3385xpHy/TcKovH5++9L4Gl46IBi+OvT8+thhlhG0OE+BQm/G8Y7ZwMZv33+0VzPOD2k/kdbRMvi5BtAb/+3/v8ThdHo3P8vgb+ehiXv/fHrYbnLqnbnukgRLIfPf/9oamecccYZZ/yP+BdCElAAACIAAA==" + }, + { + "name": "dawnline-20261112-050743-pre-update.tar.gz", + "data": "H4sIAAAAAAAAA+2YwXKbMBCGfW2eghunOmCwHR96SNM2SZsmnemhR48A2dZYSIzATvP2FTbUkpBgm8lMp538FydivftpkfQrwVV6nnK2IuvzDD0yShgevbQCqVkcHz6ljM8wnEXRKJxO5tNJHM+i+SgIoyiORl7w4iQW7coKCc8bCc6rvrih5/+oju/eK3FVEbYuPb/9yT97w4uKcOYVXFSILjFDCcWZ54edR/WH58fTIOg82vBSPtoXbIx/orygeMzFWkZRIsebGERlyCSIxsE4DKPx3D87+40l9lh4/obn+JSaoRx7/o02RlbH0XoRGxQmWblLGJajYTCez2XN4HwSK98QZI8qvNziJ89HYF2+U1LsEkrSY4YELDUD2lV8SRHz/KDtlfxtmeE9SetJ0qYhnSeJeCt/PSXKcbnx/JSIlGLlldZfoWSLD/nNZqcoIczs9pU+qLY77LR75mr3RX+7U7Bc7c7Aek67taby1arbO17gTusetDG1c5NO5+auzi36O4fBcnVuBdYfdM6+HBGlp84d16asj3Jl5j37/hPKCX3qJnjkYgvL8OMQqb66AyxDpRl5f/ldmWuWCVzKIzJcTMbh7KI+PabqUSYfxbE5EkYLS61UnW27w3IsUE+5aTCOlO1aYFHKMB8xhmDzvtQiUZoe0ie82pxGtddhlkq4ICWs1ns99BnFUooEcGJXemhbjLAKC7mDurkzkgNTf9Ai28zHRX14zfWXlodt2h4TZjG8B9b6uO8vZaxUfSy19XCFMy6A20oP7X9hj9oOaqutKU5gxa61SHutAu3K5rphFtog25K3+tYNcq95M608Txkw7a0W2p92S2zr2OYUX4htGduzUryHJb1TA/tzMg7dcffcTWrd3eZmaZ2hRWgdo9hwplSzH3JHhm966Om8bO51qrsqRvcerNroTD6KiooXMMA7I7ZDGNkJr8BSrbj23eSpQIcCp+EtYXITpTwvdvI07E6I0ww2mwc1sDOV2D6VD2CpU8lIefpbwwROHEvEMKfGhoqBRTK1c38Ey7ZIUgeiYWmNeQ0hzuyIn8CyIWYORN0ZGw8cIpzbCa/BshFiB6Fmp41xDgFe2AFvwLIBrhyAhuk29jqEuLAj3oJlQ1w7EHWnbjx5iDAM7IifwbIhbhyIusc3Zt6HeOE+8r+AZSMkDkL9utDcC4YIHUf+HVg2wq2DUL95NHeMPsKFu4dfwbLapoNQu8U0rjkE6GjhPVg2QOYA1K9EzeVncKeEdsQHsGrEv/2vwVe96lX/uX4BGc9cFAAaAAA=" + } + ] +} diff --git a/backend/methods/testdata/write.json b/backend/methods/testdata/write.json new file mode 100644 index 0000000..b3f4aa2 --- /dev/null +++ b/backend/methods/testdata/write.json @@ -0,0 +1,2982 @@ +{ + "steps": [ + { + "method": "service_set", + "args": { + "id": "tv", + "name": "TV", + "address": "192.168.77.40", + "ports": [ + "8009", + " 443 " + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'TV'\n\toption address '192.168.77.40'\n\tlist port '8009'\n\tlist port '443'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "web", + "name": " Web server ", + "address": " 192.168.77.41 ", + "ports": "80, 443 8080" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'TV'\n\toption address '192.168.77.40'\n\tlist port '8009'\n\tlist port '443'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "tv", + "name": "Television", + "address": "192.168.77.42", + "ports": [ + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "nas", + "name": "NAS", + "address": "192.168.77.5", + "ports": [ + "445" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "bad", + "name": "", + "address": "192.168.77.5" + }, + "error": "Service: Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "bad", + "name": "A ", + "address": "192.168.77.5" + }, + "error": "Service: Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "bad", + "name": "Fine", + "address": "192.168.77.500" + }, + "error": "Address must be an IPv4 address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "bad", + "name": "Fine", + "address": "192.168.77.5", + "ports": [ + "70000" + ] + }, + "error": "Invalid port 70000.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "bad id", + "name": "Fine", + "address": "192.168.77.5" + }, + "error": "Invalid service id.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "anna", + "name": "Fine", + "address": "192.168.77.5" + }, + "error": "That id is taken.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_set", + "args": { + "id": "settings", + "name": "Fine", + "address": "192.168.77.5" + }, + "error": "That id is taken.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_delete", + "args": { + "id": "nothing" + }, + "error": "Unknown service.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_delete", + "args": { + "id": "anna" + }, + "error": "Unknown service.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig service 'cam'\n\toption name 'Camera'\n\toption address '192.168.50.30'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\tlist service 'cam'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_delete", + "args": { + "id": "cam" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.77.5'\n\tlist ports '445'\n\tlist ports '139'\n\tlist port '445'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\tlist service 'nas'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_delete", + "args": { + "id": "nas" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig service 'web'\n\toption name 'Web server'\n\toption address '192.168.77.41'\n\tlist port '80'\n\tlist port '443'\n\tlist port '8080'\n\n" + }, + { + "method": "service_delete", + "args": { + "id": "web" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\n" + }, + { + "method": "circle_set", + "args": { + "server": "home", + "name": "Friends", + "color": 11, + "members": [ + "clara", + "gleb", + "hana", + "nobody" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'Family'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\toption circle 'fam'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\n" + }, + { + "method": "circle_set", + "args": { + "id": "fam", + "name": "The family", + "color": -3, + "members": [ + "anna", + "clara" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\n" + }, + { + "method": "circle_set", + "args": { + "id": "work", + "name": "Work", + "color": 2 + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\n" + }, + { + "method": "circle_set", + "args": { + "id": "work", + "name": "the FAMILY" + }, + "error": "the FAMILY already exists.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\n" + }, + { + "method": "circle_set", + "args": { + "server": "cabin", + "name": "The family" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_set", + "args": { + "server": "nowhere", + "name": "Lost" + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_set", + "args": { + "id": "nothing", + "name": "Lost" + }, + "error": "Unknown circle.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_set", + "args": { + "server": "home", + "name": "" + }, + "error": "Enter a circle name: up to 32 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_set", + "args": { + "server": "home", + "name": "A name that is far longer than thirty-two characters" + }, + "error": "Enter a circle name: up to 32 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_delete", + "args": { + "id": "nothing" + }, + "error": "Unknown circle.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'fam'\n\toption server 'home'\n\toption name 'The family'\n\toption color '5'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption circle 'fam'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption circle 'fam'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_delete", + "args": { + "id": "fam" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig circle 'work'\n\toption server 'home'\n\toption name 'Work'\n\toption color '2'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption circle 'work'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "circle_delete", + "args": { + "id": "work" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_pause", + "args": { + "id": "anna", + "paused": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_pause", + "args": { + "id": "anna", + "paused": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption paused '1'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_pause", + "args": { + "id": "gleb", + "paused": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption paused '1'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_pause", + "args": { + "id": "anna", + "paused": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_pause", + "args": { + "id": "nobody", + "paused": true + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig person 'nora'\n\toption server 'home'\n\toption name 'Nora'\n\toption access 'both'\n\tlist home_net 'br-lan'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig device 'nphone'\n\toption person 'nora'\n\toption name 'Nphone'\n\toption address '10.77.0.11'\n\toption public_key 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_delete", + "args": { + "id": "nora" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'phone'\n\toption person 'anna'\n\toption name 'Phone'\n\toption address '10.77.0.2'\n\toption public_key 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA='\n\nconfig device 'laptop'\n\toption person 'anna'\n\toption name 'Laptop'\n\toption address '10.77.0.3'\n\toption public_key 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA='\n\toption lan_bypass '1'\n\toption kind 'computer'\n\nconfig device 'old'\n\toption person 'anna'\n\toption name 'Old'\n\toption address '10.77.0.4'\n\toption public_key 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDA='\n\toption disabled '1'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_delete", + "args": { + "id": "anna" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_delete", + "args": { + "id": "nora" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_delete", + "args": { + "id": "phone" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_delete", + "args": { + "id": "home" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "name": " Boris the Second " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "name": "B<" + }, + "error": "Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'both'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "access": "lan" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "access": "everything" + }, + "error": "Access must be lan, internet or both.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "5" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '5'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": " 7 " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '7'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "3.9" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '3'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "1e1" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '10'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "0x10" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "33" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "0" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "many" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "device_limit": "" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "expires": "2030-02-28" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2030-02-28'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "expires": "2030-02-30" + }, + "error": "End date must be YYYY-MM-DD.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2030-02-28'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "expires": "soon" + }, + "error": "End date must be YYYY-MM-DD.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2030-02-28'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "expires": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "dns_mode": "home" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption dns_mode 'home'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "dns_mode": "device" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "dns_mode": "other" + }, + "error": "Unknown DNS choice.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "2.50", + "quota_period": "total" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '2.5'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "100000" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '100000'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "100001" + }, + "error": "Data limit must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '100000'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "-1" + }, + "error": "Data limit must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '100000'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "lots" + }, + "error": "Data limit must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '100000'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "0.00001" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '1e-05'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": " 3 " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption quota_gb '3'\n\toption quota_period 'total'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "0", + "quota_period": "month" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "quota_gb": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "bonus_gb": "0" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "bonus_gb": "-2" + }, + "error": "Extra data must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "bonus_gb": "" + }, + "error": "Extra data must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "note": " a note\twith a tab and Кириллица " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption note 'a note\twith a tab and Кириллица'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "note": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "paused": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris", + "paused": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "eva", + "services": [ + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "fedor", + "circle": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "fedor", + "circle": "nothing" + }, + "error": "Unknown circle.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "fedor", + "home_nets": [ + " dlhome ", + "dlhome", + "bad name!", + "", + "br-lan" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\tlist home_net 'dlhome'\n\tlist home_net 'br-lan'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "fedor", + "home_nets": [ + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'lan'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "dima", + "home_nets": [ + "dlhome" + ], + "access": "both", + "name": "Dima", + "device_limit": "2" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "dima", + "access": "lan", + "device_limit": "99" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.77.0.6'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "clara", + "server": "cabin" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "clara", + "server": "cabin" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "clara", + "server": "nowhere" + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "clara", + "server": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'cabin'\n\toption name 'Hana'\n\toption access 'both'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.78.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "hana", + "server": "home", + "access": "lan" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "nobody", + "name": "X" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_update", + "args": { + "id": "boris" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "expires": "2031-01-01", + "paused": true + } + }, + { + "id": "fedor", + "patch": { + "expires": "2031-01-01", + "quota_gb": 5 + } + } + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "paused": false + } + }, + { + "id": "fedor", + "patch": { + "expires": "never" + } + } + ] + }, + "error": "End date must be YYYY-MM-DD.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "name": "New" + } + } + ] + }, + "error": "name cannot be changed for several people at once.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "server": "cabin" + } + } + ] + }, + "error": "server cannot be changed for several people at once.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "paused": "yes" + } + } + ] + }, + "error": "Paused must be true or false.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "colour": "red" + } + } + ] + }, + "error": "colour cannot be changed for several people at once.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "expires": [ + "2030-01-01" + ] + } + } + ] + }, + "error": "expires must be a value, not a list.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + } + } + ] + }, + "error": "Nothing to change for boris.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "paused": false + } + }, + { + "id": "boris", + "patch": { + "paused": true + } + } + ] + }, + "error": "boris is in the list twice.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "patch": { + "paused": false + } + } + ] + }, + "error": "Each change needs the id of a person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + ] + }, + "error": "Nothing to change.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "nobody", + "patch": { + "paused": true + } + } + ] + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption expires '2031-01-01'\n\toption paused '1'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "people_update", + "args": { + "list": [ + { + "id": "boris", + "patch": { + "paused": false, + "expires": "" + } + } + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Zoya" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": " Мама Таня ", + "access": "both", + "device_limit": "3", + "expires": "2030-01-01", + "quota_gb": "10", + "quota_period": "total", + "server": "cabin" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Clara" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Clara", + "quota_gb": "2.5", + "quota_period": "month" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "!!!" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "With an id", + "slug": "my-id" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "With an id", + "slug": "Bad Id" + }, + "error": "The id may use lowercase letters, digits and underscores.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "A name that is long enough to be cut where an id ends" + }, + "error": "Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "" + }, + "error": "Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Nowhere", + "server": "nowhere" + }, + "error": "Set up a server first.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "No access", + "access": "" + }, + "error": "Access must be lan, internet or both.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Too many", + "device_limit": "0" + }, + "error": "Device limit must be between 1 and 32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Odd limit", + "device_limit": "many" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Ends never", + "expires": "2030-13-01" + }, + "error": "End date must be YYYY-MM-DD.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Negative", + "quota_gb": "-1" + }, + "error": "Monthly data must be a positive number of GB.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_create", + "args": { + "name": "Home", + "access": "lan" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_regen", + "args": { + "id": "boris" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'kphone'\n\toption person 'kira'\n\toption name 'Kphone'\n\toption address '10.79.0.2'\n\toption public_key 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_regen", + "args": { + "id": "kira", + "remove": [ + "kphone", + "lphone", + "nothing", + "kphone" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "person_regen", + "args": { + "id": "nobody" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Bphone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": " Boris phone " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Boris phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "Boris phone" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Boris phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "Телефон Бориса" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "A name longer than twenty" + }, + "error": "Enter a device name: up to 20 letters, digits, spaces and - _ .", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "Phone/2" + }, + "error": "Enter a device name: up to 20 letters, digits, spaces and - _ .", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "Phone ★" + }, + "error": "Enter a device name: up to 20 letters, digits, spaces and - _ .", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "name": "" + }, + "error": "Enter a device name: up to 20 letters, digits, spaces and - _ .", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Hphone'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "hphone", + "name": "Twin" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "disabled": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Телефон Бориса'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption disabled '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "disabled": true, + "name": "Off phone" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption disabled '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "disabled": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "1400", + "keepalive": "25", + "lan_bypass": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1400'\n\toption keepalive '25'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "1400", + "keepalive": "0", + "lan_bypass": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1400'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": " 1300 " + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1300'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "1279" + }, + "error": "MTU must be 1280-1500.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1300'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "1e3" + }, + "error": "MTU must be 1280-1500.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1300'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "keepalive": "601" + }, + "error": "Keep-alive must be 0-600 seconds.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1300'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "keepalive": "-1" + }, + "error": "Keep-alive must be 0-600 seconds.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\toption mtu '1300'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "", + "keepalive": "", + "lan_bypass": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "bphone", + "mtu": "", + "keepalive": "" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "nothing", + "name": "X" + }, + "error": "Unknown device.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_update", + "args": { + "id": "boris", + "name": "X" + }, + "error": "Unknown device.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'bphone'\n\toption person 'boris'\n\toption name 'Off phone'\n\toption address '10.77.0.5'\n\toption public_key 'EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEA='\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_delete", + "args": { + "id": "bphone" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_delete", + "args": { + "id": "bphone" + }, + "error": "Unknown device.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "device_delete", + "args": { + "id": "boris" + }, + "error": "Unknown device.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": " New phone ", + "kind": "phone", + "key": "P" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": "Thing", + "kind": "fridge", + "lan_bypass": true, + "key": "Q" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": "new PHONE", + "kind": "phone", + "key": "R" + }, + "error": "\"new PHONE\" already exists.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": "Bad/name", + "kind": "phone", + "key": "R" + }, + "error": "Enter a device name: up to 20 letters, digits, spaces and - _ .", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": "Same key", + "kind": "phone", + "key": "P" + }, + "error": "This key is already in use.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "boris", + "name": "Server key", + "kind": "phone", + "key": "b" + }, + "error": "This key is already in use.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "nobody", + "name": "Lost", + "kind": "phone", + "key": "S" + }, + "error": "Unknown person.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\n" + }, + { + "method": "x_device_create", + "args": { + "person": "hana", + "name": "Tablet", + "kind": "tablet", + "key": "T" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_rotate", + "args": { + "id": "hphone", + "key": "U" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUA='\n\toption private_key 'UxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxUxA='\n\toption preshared_key 'UyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyUyA='\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_rotate", + "args": { + "id": "hphone", + "kind": "computer", + "lan_bypass": true, + "key": "V" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVA='\n\toption private_key 'VxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxVxA='\n\toption preshared_key 'VyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyVyA='\n\toption kind 'computer'\n\toption lan_bypass '1'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_rotate", + "args": { + "id": "hphone", + "kind": "computer", + "lan_bypass": false, + "key": "W" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_rotate", + "args": { + "id": "hphone", + "kind": "spaceship", + "key": "X" + }, + "error": "Unknown device type.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "x_device_rotate", + "args": { + "id": "nothing", + "key": "Y" + }, + "error": "Unknown device.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": "5" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption default_device_limit '5'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": " 007 " + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption default_device_limit '7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": 9 + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption default_device_limit '9'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": "33" + } + }, + "error": "Default device limit must be 1-32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption default_device_limit '9'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": "1e1" + } + }, + "error": "Default device limit must be 1-32.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption default_device_limit '9'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "default_device_limit": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "hostnames": false + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '0'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "hostnames": "1" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "hostnames": "yes" + } + }, + "error": "hostnames is 0 or 1.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "domain": "home.arpa" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "domain": "Home" + } + }, + "error": "Domain may use lowercase letters, digits, dashes and dots.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "geo_enabled": true, + "geo_provider": "ipapi.co" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "geo_provider": "other" + } + }, + "error": "Unknown location service.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "log_level": "debug", + "log_keep_days": "0", + "log_max": "100", + "log_persist": "10min" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "log_max": "99" + } + }, + "error": "Log size must be 100-20000 events.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "log_persist": "daily" + } + }, + "error": "Save the log every 10min, hourly or off.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "usage_keep_days": "6" + } + }, + "error": "Daily traffic history must be 7-1830 days.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "usage_keep_months": "121" + } + }, + "error": "Monthly traffic history must be 1-120 months.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "home_dns_fallback": "9.9.9.9" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback '9.9.9.9'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "home_dns_fallback": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "home_dns_fallback": "dns.example" + } + }, + "error": "Fallback DNS must be an IPv4 address (or empty for none).", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_interval": "7d", + "update_mode": "immediate", + "update_time": "4:05" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_time": "24:00" + } + }, + "error": "Enter a time as HH:MM, 00:00 to 23:59.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_interval": "2d" + } + }, + "error": "Check every 6h, 12h, 1d or 7d.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_targets": [ + "packages", + "app", + "other", + "app" + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'packages'\n\tlist update_targets 'app'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_targets": [ + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'none'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "update_targets": [ + "amneziawg" + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "watchdog": false + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '0'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "watchdog": true + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "log_category": [ + "people", + "gossip", + "problems" + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category 'people'\n\tlist log_category 'problems'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "log_category": [ + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_redirect": "https://example.org/path?x=1" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\toption portal_redirect 'https://example.org/path?x=1'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_redirect": "example.org" + } + }, + "error": "Redirect must be a full http:// or https:// address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\toption portal_redirect 'https://example.org/path?x=1'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_redirect": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_cert": "/etc/passwd", + "portal_key": "/etc/passwd" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\toption portal_cert '/etc/passwd'\n\toption portal_key '/etc/passwd'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_cert": "/no/such/file" + } + }, + "error": "File /no/such/file does not exist.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\toption portal_cert '/etc/passwd'\n\toption portal_key '/etc/passwd'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_cert": "relative" + } + }, + "error": "File relative does not exist.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\toption portal_cert '/etc/passwd'\n\toption portal_key '/etc/passwd'\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_cert": "", + "portal_key": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_host": "vpn2.example.org" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_host": "bad host" + } + }, + "error": "Public address must be a hostname or IP address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt '203.0.113.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_alt": [ + " a.example.org ", + "a.example.org", + "", + "198.51.100.7" + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_alt": [ + "ok.example.org", + "not ok" + ] + } + }, + "error": "Other addresses must be hostnames or IP addresses.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "443" + } + }, + "error": "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "442" + } + }, + "error": "Links on IP addresses use plain HTTP on the next port (443), which the portal cannot take. Choose another portal port.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "0" + } + }, + "error": "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "65535" + } + }, + "error": "Links on IP addresses use plain HTTP on the next port (65536), which the portal cannot take. Choose another portal port.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '4500'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "8443" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '8443'\n\toption portal_host 'vpn2.example.org'\n\tlist portal_alt 'a.example.org'\n\tlist portal_alt '198.51.100.7'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_alt": [ + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '8443'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "65535" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '65535'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_enabled": false + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_port '65535'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "80" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_port '80'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_enabled": true + } + }, + "error": "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_port '80'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "portal_port": "", + "portal_enabled": true + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + "colour": "red" + } + }, + "error": "Unknown setting colour.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": { + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + "values": "everything" + }, + "error": "Nothing to save.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "settings_update", + "args": { + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\nconfig server 'home'\n\toption name 'Home'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "name": " The house " + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "name": "<" + } + }, + "error": "Server: Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "endpoint": "vpn.example.org" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption endpoint 'vpn.example.org'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "endpoint": "bad host" + } + }, + "error": "Public address must be a hostname or IP address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption endpoint 'vpn.example.org'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "endpoint": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "port": "4600" + } + }, + "error": "UDP 4600 is used by server “Cabin”. Choose another port.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "port": 4500 + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '4500'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "port": "41234" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "port": "0" + } + }, + "error": "UDP port must be 1-65535.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "enabled": false + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "enabled": "1" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "mesh": "all" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "mesh": "sometimes" + } + }, + "error": "Unknown choice for devices reaching each other.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "device_mesh": false, + "mesh": "off" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'off'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "device_mesh": "1", + "mesh": "all" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "mtu": "1400", + "keepalive": "0" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\toption mtu '1400'\n\toption keepalive '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "mtu": "1501" + } + }, + "error": "MTU must be 1280-1500.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\toption mtu '1400'\n\toption keepalive '0'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "mtu": "", + "keepalive": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "keepalive": "601" + } + }, + "error": "Keep-alive must be 0-600 seconds.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "keepalive": "1e2" + } + }, + "error": "Keep-alive must be 0-600 seconds.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "dns": [ + "9.9.9.9", + " 2001:db8::53 ", + "" + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\tlist dns '9.9.9.9'\n\tlist dns '2001:db8::53'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "dns": "1.1.1.1, 8.8.8.8" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\tlist dns '1.1.1.1'\n\tlist dns '8.8.8.8'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "dns": "dns.example" + } + }, + "error": "dns.example is not an IP address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\tlist dns '1.1.1.1'\n\tlist dns '8.8.8.8'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "dns": [ + ] + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.77.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.77.0.7'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.77.0.8'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.77.0.9'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.77.0.10'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.77.0.2'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.77.0.3'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.77.0.4'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.77.0.5'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "10.90.0.7/24" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "10.90.0.0/24" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "10.78.0.128/25" + } + }, + "error": "Subnet overlaps 10.78.0.0/24.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "8.8.8.0/24" + } + }, + "error": "Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "ten" + } + }, + "error": "Subnet must look like 10.77.0.0/24.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "10.91.0.0/30" + } + }, + "error": "10.91.0.0/30 has no room for every device on The house.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home", + "values": { + "subnet": "" + } + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "nowhere", + "values": { + "name": "X" + } + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_update", + "args": { + "id": "home" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": true, + "auto_lan": false, + "lan_devices": [ + "dlhome" + ], + "mesh": "all" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\tlist lan_device 'dlhome'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": true, + "auto_lan": false, + "lan_devices": [ + "ghost", + "dawn0", + "", + " br-lan ", + "br-lan", + "dlhome" + ], + "lan_like": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\toption mesh 'all'\n\toption lan_like '1'\n\toption enabled '1'\n\toption auto_wan '1'\n\tlist lan_device 'br-lan'\n\tlist lan_device 'dlhome'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": true, + "auto_lan": true, + "lan_devices": [ + ], + "device_mesh": false + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'off'\n\toption lan_like '1'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": true, + "auto_lan": "0", + "lan_devices": [ + "lanp1" + ] + }, + "error": "lanp1 is part of br-lan; choose br-lan instead.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'off'\n\toption lan_like '1'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": false, + "wan_device": "nothing", + "auto_lan": true, + "lan_devices": [ + ] + }, + "error": "Choose the interface that leads to the internet.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'off'\n\toption lan_like '1'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": false, + "wan_device": "wg9", + "auto_lan": true, + "lan_devices": [ + ] + }, + "error": "wg9 is not in a firewall zone, so the server port cannot be opened on it.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'off'\n\toption lan_like '1'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'wan'\n\toption lan_zone 'home'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": false, + "wan_device": "dlguest", + "auto_lan": false, + "lan_devices": [ + "dlhome" + ], + "lan_like": false, + "device_mesh": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '0'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\toption wan_device 'dlguest'\n\tlist lan_device 'dlhome'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": false, + "wan_device": "dlguest", + "auto_lan": false, + "lan_devices": [ + "dlhome", + "dlguest" + ] + }, + "error": "dlguest is the WAN.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\toption mesh 'all'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '0'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\toption wan_device 'dlguest'\n\tlist lan_device 'dlhome'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": "0", + "wan_device": "dlguest", + "auto_lan": false, + "lan_devices": [ + "wg9" + ], + "mesh": "circles" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '0'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '0'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\toption wan_device 'dlguest'\n\tlist lan_device 'wg9'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "home", + "auto_wan": true, + "auto_lan": true, + "lan_devices": [ + "dlhome" + ] + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_interfaces", + "args": { + "id": "nowhere", + "auto_wan": true, + "auto_lan": true, + "lan_devices": [ + ] + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "home", + "preset": "off" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption preset 'off'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "home", + "preset": "balanced" + }, + "error": "AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption preset 'off'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "home", + "preset": "max" + }, + "error": "AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption preset 'off'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "home", + "preset": "stealth" + }, + "error": "Unknown disguise method.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption preset 'off'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "home" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_obfuscation", + "args": { + "id": "nowhere", + "preset": "off" + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_delete", + "args": { + "id": "nowhere" + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig server 'open'\n\toption name 'Open'\n\toption ifname 'dawn2'\n\toption port '4700'\n\toption subnet '10.79.0.0/24'\n\toption private_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA='\n\toption public_key 'ffffffffffffffffffffffffffffffffffffffffffA='\n\toption auto_lan '0'\n\tlist lan_device 'br-lan'\n\toption mesh 'all'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig person 'kira'\n\toption server 'open'\n\toption name 'Kira'\n\toption access 'both'\n\toption code 'sanebu-tigagu-mopuze'\n\toption code_set '1794460077'\n\nconfig person 'lev'\n\toption server 'open'\n\toption name 'Lev'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig device 'lphone'\n\toption person 'lev'\n\toption name 'Lphone'\n\toption address '10.79.0.3'\n\toption public_key 'NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_delete", + "args": { + "id": "open" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig server 'cabin'\n\toption name 'Cabin'\n\toption ifname 'dawn1'\n\toption port '4600'\n\toption subnet '10.78.0.0/24'\n\toption private_key 'ccccccccccccccccccccccccccccccccccccccccccA='\n\toption public_key 'ddddddddddddddddddddddddddddddddddddddddddA='\n\toption auto_lan '0'\n\tlist lan_device 'dlhome'\n\toption mesh 'off'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'clara'\n\toption server 'cabin'\n\toption name 'Clara'\n\toption access 'internet'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig person 'ivan'\n\toption server 'cabin'\n\toption name 'Ivan'\n\toption access 'both'\n\nconfig device 'cphone'\n\toption person 'clara'\n\toption name 'Cphone'\n\toption address '10.78.0.4'\n\toption public_key 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA='\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig device 'iphone'\n\toption person 'ivan'\n\toption name 'Iphone'\n\toption address '10.78.0.3'\n\toption public_key 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLA='\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig circle 'c_b2253b7f'\n\toption server 'cabin'\n\toption name 'The family'\n\toption color '0'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'mama_tanya'\n\toption server 'cabin'\n\toption name 'Мама Таня'\n\toption access 'both'\n\toption device_limit '3'\n\toption code 'dubore-noviko-malamo'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption expires '2030-01-01'\n\toption quota_gb '10'\n\toption quota_period 'total'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_delete", + "args": { + "id": "cabin" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_delete", + "args": { + "id": "cabin" + }, + "error": "Unknown server.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "second", + "name": " Second ", + "subnet": "10.99.0.9/24", + "endpoint": "second.example.org", + "port": 4800, + "preset": "off", + "lan_like": true + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "third", + "subnet": "10.98.0.0/24", + "mtu": 1400, + "portal_enabled": false, + "portal_port": 9443, + "lan_zone": "home", + "wan_zone": "guest" + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "Bad", + "subnet": "10.97.0.0/24" + }, + "error": "Server ID may use lowercase letters, digits and underscores.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "home", + "subnet": "10.97.0.0/24" + }, + "error": "\"home\" is already taken.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "api", + "subnet": "10.97.0.0/24" + }, + "error": "\"api\" is already taken.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "ifname": "dawn0", + "subnet": "10.97.0.0/24" + }, + "error": "Network interface dawn0 already exists.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "ifname": "Way-too-long-a-name", + "subnet": "10.97.0.0/24" + }, + "error": "Interface name: 1-12 lowercase letters, digits or _.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "port": 4800, + "subnet": "10.97.0.0/24" + }, + "error": "UDP 4800 is used by server “Second”. Choose another port.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "port": 70000, + "subnet": "10.97.0.0/24" + }, + "error": "UDP port must be 1-65535.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "8.8.8.0/24" + }, + "error": "Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.99.0.128/25" + }, + "error": "Subnet overlaps 10.99.0.0/24.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "ten", + "endpoint": "bad host" + }, + "error": "Subnet must look like 10.77.0.0/24. Endpoint must be a hostname or IP address.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "name": "<" + }, + "error": "Server: Enter a name: up to 48 characters, without < > \" or \\.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "mtu": 99 + }, + "error": "MTU must be 1280-1500.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "preset": "max" + }, + "error": "AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "portal_enabled": true, + "portal_port": 70000 + }, + "error": "Portal port must be 1-65535.", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "portal_enabled": true, + "portal_port": 443 + }, + "error": "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).", + "file": "\nconfig settings 'settings'\n\toption portal_enabled '0'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + }, + { + "method": "server_create", + "args": { + "id": "fourth", + "subnet": "10.97.0.0/24", + "endpoint": "198.51.100.9", + "portal_enabled": true, + "portal_port": 9443 + }, + "error": null, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_host 'vpn2.example.org'\n\toption hostnames '1'\n\toption domain 'home.arpa'\n\toption geo_enabled '1'\n\toption geo_provider 'ipapi.co'\n\toption log_level 'debug'\n\toption log_keep_days '0'\n\toption log_max '100'\n\toption log_persist '10min'\n\toption home_dns_fallback 'none'\n\toption update_interval '7d'\n\toption update_mode 'immediate'\n\toption update_time '4:05'\n\tlist update_targets 'amneziawg'\n\toption watchdog '1'\n\tlist log_category ''\n\tlist migrated 'auto_mtu'\n\toption portal_port '9443'\n\nconfig server 'home'\n\toption name 'The house'\n\toption ifname 'dawn0'\n\toption port '41234'\n\toption subnet '10.90.0.0/24'\n\toption private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA='\n\toption public_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA='\n\toption auto_lan '1'\n\toption mesh 'circles'\n\toption lan_like '0'\n\toption enabled '1'\n\toption auto_wan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption wan_zone 'guest'\n\toption lan_zone 'home'\n\tlist lan_device 'dlhome'\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\nconfig person 'boris'\n\toption server 'home'\n\toption name 'Boris the Second'\n\toption access 'lan'\n\toption device_limit '16'\n\toption code 'pakave-fikena-rizezo'\n\toption code_set '1794460077'\n\nconfig person 'dima'\n\toption server 'home'\n\toption name 'Dima'\n\toption access 'both'\n\toption device_limit '2'\n\tlist home_net 'dlhome'\n\nconfig person 'eva'\n\toption server 'home'\n\toption name 'Eva'\n\toption access 'lan'\n\nconfig person 'fedor'\n\toption server 'home'\n\toption name 'Fedor'\n\toption access 'both'\n\toption expires '2031-01-01'\n\toption quota_gb '5'\n\nconfig person 'gleb'\n\toption server 'home'\n\toption name 'Gleb'\n\toption access 'both'\n\toption circle 'c_4e6e4a1c'\n\nconfig person 'hana'\n\toption server 'home'\n\toption name 'Hana'\n\toption access 'lan'\n\nconfig device 'dphone'\n\toption person 'dima'\n\toption name 'Dphone'\n\toption address '10.90.0.4'\n\toption public_key 'GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGA='\n\nconfig device 'ephone'\n\toption person 'eva'\n\toption name 'Ephone'\n\toption address '10.90.0.5'\n\toption public_key 'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHA='\n\nconfig device 'fphone'\n\toption person 'fedor'\n\toption name 'Fphone'\n\toption address '10.90.0.6'\n\toption public_key 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA='\n\nconfig device 'gphone'\n\toption person 'gleb'\n\toption name 'Gphone'\n\toption address '10.90.0.7'\n\toption public_key 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJA='\n\nconfig device 'hphone'\n\toption person 'hana'\n\toption name 'Twin'\n\toption address '10.90.0.8'\n\toption public_key 'WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWA='\n\toption private_key 'WxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxWxA='\n\toption preshared_key 'WyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyWyA='\n\toption kind 'computer'\n\nconfig service 'tv'\n\toption name 'Television'\n\toption address '192.168.77.42'\n\nconfig circle 'c_4e6e4a1c'\n\toption server 'home'\n\toption name 'Friends'\n\toption color '3'\n\nconfig person 'zoya'\n\toption server 'home'\n\toption name 'Zoya'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'godadi-kizeba-pivari'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_2'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'domofo-bobiso-mibotu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'clara_3'\n\toption server 'home'\n\toption name 'Clara'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'gogeko-pivari-lotomu'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\toption quota_gb '2.5'\n\toption quota_period 'month'\n\nconfig person 'user'\n\toption server 'home'\n\toption name '!!!'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'pirira-sefegu-dazure'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'my_id'\n\toption server 'home'\n\toption name 'With an id'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'vetepi-defozo-mafisa'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'odd_limit'\n\toption server 'home'\n\toption name 'Odd limit'\n\toption access 'internet'\n\toption device_limit '3'\n\toption code 'zadasi-kavodi-katabi'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig person 'home_2'\n\toption server 'home'\n\toption name 'Home'\n\toption access 'lan'\n\toption device_limit '3'\n\toption code 'sogefu-rosula-mupode'\n\toption code_set '1794460077'\n\toption created '1794460077'\n\nconfig device 'd_e0182f62'\n\toption person 'boris'\n\toption name 'New phone'\n\toption kind 'phone'\n\toption address '10.90.0.2'\n\toption public_key 'PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPA='\n\toption private_key 'PxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxPxA='\n\toption preshared_key 'PyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyPyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig device 'd_8469ddca'\n\toption person 'boris'\n\toption name 'Thing'\n\toption kind 'other'\n\toption address '10.90.0.3'\n\toption public_key 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQA='\n\toption private_key 'QxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxQxA='\n\toption preshared_key 'QyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyQyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\toption lan_bypass '1'\n\nconfig device 'd_bc5ca857'\n\toption person 'hana'\n\toption name 'Tablet'\n\toption kind 'tablet'\n\toption address '10.90.0.9'\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption private_key 'TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxA='\n\toption preshared_key 'TyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyTyA='\n\toption created '1794460080'\n\toption created_by 'admin'\n\nconfig server 'second'\n\toption name 'Second'\n\toption ifname 'dawn1'\n\toption port '4800'\n\toption subnet '10.99.0.0/24'\n\toption endpoint 'second.example.org'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '1'\n\toption enabled '1'\n\nconfig server 'third'\n\toption name 'Home'\n\toption ifname 'dawn2'\n\toption port '4500'\n\toption subnet '10.98.0.0/24'\n\toption mtu '1400'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'home'\n\toption wan_zone 'guest'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\nconfig server 'fourth'\n\toption name 'Home'\n\toption ifname 'dawn3'\n\toption port '55673'\n\toption subnet '10.97.0.0/24'\n\toption endpoint '198.51.100.9'\n\toption keepalive '25'\n\toption private_key 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA='\n\toption public_key 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTA='\n\toption preset 'off'\n\toption jc '0'\n\toption jmin '0'\n\toption jmax '0'\n\toption s1 '0'\n\toption s2 '0'\n\toption h1 '1'\n\toption h2 '2'\n\toption h3 '3'\n\toption h4 '4'\n\toption lan_zone 'lan'\n\toption wan_zone 'wan'\n\toption auto_wan '1'\n\toption auto_lan '1'\n\toption detected_wan 'eth0'\n\toption detected_lan 'br-lan'\n\toption lan_like '0'\n\toption enabled '1'\n\n" + } + ] +} diff --git a/backend/methods/uninstall.go b/backend/methods/uninstall.go new file mode 100644 index 0000000..c94402a --- /dev/null +++ b/backend/methods/uninstall.go @@ -0,0 +1,55 @@ +package methods + +import ( + "errors" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// uninstall removes Dawnline's state from the router (the package is removed by the page afterwards): a +// backup first, then the settings emptied but for the settings section, then everything Dawnline made on +// the router taken away, then the service stopped. +// +// The settings go first: whatever applies in between (the agent's tick) then works from settings with +// nothing in them, and puts nothing back. The service stops last, once the answer is out: this process is +// part of it. +func uninstall(d Deps, confirm string) (map[string]any, error) { + if confirm != "remove" { + return nil, errors.New(`Type "remove" to confirm.`) + } + // not in the middle of an update (the package manager may be installing Dawnline itself) + if updating(d.RunDir) { + return nil, errors.New("An update is running: wait for it to finish, then remove Dawnline.") + } + if d.Teardown == nil || d.Store == nil { + return nil, errors.New("Dawnline cannot be removed from here.") + } + backupCreate(d, "pre-remove") + var was *model.Model + err := d.Store.Transact(func(c *uci.Config, m *model.Model) error { + was = m + var rm []string + for _, s := range c.Sections { + if s.Type != "settings" { + rm = append(rm, s.Name) + } + } + for _, n := range rm { + c.DeleteSection(n) + } + if c.Section("settings") == nil { + c.Add("settings", "settings") + } + c.Set("settings", "portal_enabled", "0") + return nil + }) + if err != nil { + return nil, err + } + d.Teardown(was) + if d.Stop != nil { + d.Stop() + } + return map[string]any{"ok": true}, nil +} diff --git a/backend/methods/uninstall_test.go b/backend/methods/uninstall_test.go new file mode 100644 index 0000000..60189f1 --- /dev/null +++ b/backend/methods/uninstall_test.go @@ -0,0 +1,53 @@ +package methods + +import ( + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// Removing Dawnline: only on the word, a backup first, the settings left with their own section alone, +// the router cleaned from the settings as they were, the service stopped last. +func TestUninstall(t *testing.T) { + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + os.WriteFile(dir+"/dawnline", text, 0o600) + var order []string + var servers int + d := Deps{World: func() *view.World { return &view.World{} }, Store: &store.Store{Config: dir + "/dawnline", RunDir: dir}, Config: dir + "/dawnline", RunDir: dir, DataDir: dir + "/data", + Teardown: func(m *model.Model) { + servers = len(m.Servers) + now, _ := os.ReadFile(dir + "/dawnline") + if strings.Contains(string(now), "config server") { + t.Error("the router is cleaned while the settings still hold servers") + } + order = append(order, "teardown") + }, + Stop: func() { order = append(order, "stop") }} + if res := ask(t, d, "uninstall", map[string]any{"confirm": "yes"}); res["error"] != `Type "remove" to confirm.` || len(order) != 0 { + t.Fatalf("removed without the word: %v", res) + } + if now, _ := os.ReadFile(dir + "/dawnline"); string(now) != string(text) { + t.Fatal("the settings changed without the word") + } + res := ask(t, d, "uninstall", map[string]any{"confirm": "remove"}) + if res["ok"] != true || strings.Join(order, " ") != "teardown stop" || servers != 3 { + t.Fatalf("not removed as it should be: %v, %v, %d servers", res, order, servers) + } + now, _ := os.ReadFile(dir + "/dawnline") + if strings.Count(string(now), "\nconfig ") != 1 || !strings.Contains(string(now), "config settings 'settings'") || !strings.Contains(string(now), "option portal_enabled '0'") { + t.Errorf("the settings after:\n%s", now) + } + backups, _ := os.ReadDir(dir + "/data/backups") + found := false + for _, b := range backups { + found = found || strings.Contains(b.Name(), "pre-remove") + } + if !found { + t.Errorf("no backup before the removal: %v", backups) + } +} diff --git a/backend/methods/updates.go b/backend/methods/updates.go new file mode 100644 index 0000000..c0eb790 --- /dev/null +++ b/backend/methods/updates.go @@ -0,0 +1,233 @@ +package methods + +import ( + "errors" + "os" + "regexp" + "sort" + "strings" + "syscall" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// Repo is where Dawnline's releases are. +const Repo = "tickcount/luci-app-dawnline" + +var ( + releaseLine = regexp.MustCompile(`^DISTRIB_(RELEASE|TARGET|ARCH)='([^']*)'`) + catalogFile = regexp.MustCompile(`^dawnline\.([A-Za-z_-]+)\.lmo$`) +) + +// updating tells whether an update job runs: its worker holds the update lock for the whole job. +func updating(run string) bool { + f, err := os.OpenFile(run+"/update.lock", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o644) + if err != nil { + return true + } + defer f.Close() + if syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB) != nil { + return true + } + syscall.Flock(int(f.Fd()), syscall.LOCK_UN) + return false +} + +// kept is the version a component had before its last update, when its files are still there. +func kept(dir, component, firmware string) any { + var k struct { + Version string `json:"version"` + Build any `json:"build"` + Firmware string `json:"firmware"` + Files []string `json:"files"` + Saved any `json:"saved"` + } + if !files.ReadJSON(dir+"/"+component+"/meta.json", &k) || k.Version == "" || len(k.Files) == 0 { + return nil + } + for _, f := range k.Files { + if !exists(f) { + return nil + } + } + // a kept AmneziaWG build is for one firmware only + if component == "amneziawg" && k.Firmware != "" && firmware != "" && k.Firmware != firmware { + return nil + } + return map[string]any{"version": k.Version, "build": k.Build, "saved": k.Saved} +} + +// updatesStatus is the Components tab's data (dawnline.rpc.updates status): what is installed, the last +// check and job, the policy, what is kept for a rollback. +func updatesStatus(w *view.World, t *i18n.Catalog, d Deps) map[string]any { + rel := map[string]string{} + release, _ := os.ReadFile("/etc/openwrt_release") + for _, line := range strings.Split(string(release), "\n") { + if m := releaseLine.FindStringSubmatch(line); m != nil { + rel[strings.ToLower(m[1])] = m[2] + } + } + home := false + for _, s := range w.M.Servers { + home = home || s.LanLike + } + var check, job any + files.ReadJSON(d.RunDir+"/update-check.json", &check) + files.ReadJSON(d.RunDir+"/update-job.json", &job) + // a running job whose worker is gone reads as failed + if j, ok := job.(map[string]any); ok && j["state"] == "running" && !updating(d.RunDir) { + j["state"], j["error"] = "failed", t.T("The update stopped unexpectedly.") + if j["finished"] == nil { + j["finished"] = time.Now().Unix() + } + } + auto := map[string]any{} + files.ReadJSON(d.DataDir+"/update-auto.json", &auto) + var history []any + files.ReadJSON(d.DataDir+"/update-history.json", &history) + if history == nil { + history = []any{} + } + if len(history) > 12 { + history = history[:12] + } + // this firmware as the AmneziaWG builds name it + firmware := "" + if d.Board != nil { + r, _ := d.Board()["release"].(map[string]any) + target := strings.Split(text(r["target"]), "/") + arch := text(r["arch"]) + if arch == "" { + arch = rel["arch"] + } + if v := text(r["version"]); v != "" && len(target) == 2 && arch != "" { + firmware = "_v" + v + "_" + arch + "_" + target[0] + "_" + target[1] + } + } + langs := []string{} + entries, _ := os.ReadDir(d.Catalogs) + for _, e := range entries { + if m := catalogFile.FindStringSubmatch(e.Name()); m != nil { + langs = append(langs, m[1]) + } + } + sort.Strings(langs) + tunnels := []string{} + if network := parseFile("/etc/config/network"); network != nil { + for _, s := range network.OfType("interface") { + proto, _ := s.Get("proto") + if off, _ := s.Get("disabled"); proto != "amneziawg" || off == "1" { + continue + } + name := s.Name + if n, ok := s.Get("_dawnline_name"); ok { + name = n + } + tunnels = append(tunnels, name) + } + } + return map[string]any{ + "version": backend.Version, + "firmware": map[string]any{"version": rel["release"], "target": rel["target"], "arch": rel["arch"]}, + "portal": w.M.Settings.PortalEnabled, "home": home, "needs": Needs(), "check": check, "job": job, "now": time.Now().Unix(), "repo": Repo, + "policy": w.M.Settings.Updates, "auto": auto, + "kept": map[string]any{"app": kept(d.DataDir+"/keep", "app", firmware), "amneziawg": kept(d.DataDir+"/keep", "amneziawg", firmware)}, + "translations": langs, "history": history, "tunnels": tunnels, + } +} + +// The AmneziaWG builds' repositories (dawnline.awg_builds SOURCES). +var awgRepos = map[string]string{"slava": "Slava-Shchipunov/awg-openwrt", "grey": "2Grey/awg-openwrt"} + +var tagName = regexp.MustCompile(`^v?[0-9][0-9A-Za-z.+~-]{0,40}$`) + +// shown is a release as the page gets it: what only the updater needs is left out. +func shown(r map[string]any, more map[string]any) map[string]any { + out := map[string]any{} + for k, v := range r { + out[k] = v + } + out["digests"], out["ids"] = nil, nil + for k, v := range more { + out[k] = v + } + return out +} + +// releases is Dawnline's releases for the Versions list, five a page. +func releases(gh *github.Client, page any) (map[string]any, error) { + n := 1.0 + if page != nil { + n = num(page) + } + if n != float64(int(n)) || n < 1 || n > 50 { + return nil, errors.New("Unknown page.") + } + list, err := gh.Releases(Repo, int(n)) + if err != nil { + return nil, err + } + out := []any{} + for _, r := range list { + m, _ := r.(map[string]any) + out = append(out, shown(m, map[string]any{"body": nil})) + } + return map[string]any{"releases": out, "page": int(n)}, nil +} + +// notes is a release's notes for What's new: Dawnline's by tag, or an AmneziaWG build's. +func notes(gh *github.Client, component, tag, build string) (map[string]any, error) { + repo := Repo + if component == "amneziawg" { + if build == "" { + build = "slava" + } + repo = awgRepos[build] + } + if repo == "" || !tagName.MatchString(tag) { + return nil, errors.New("Unknown release.") + } + r, err := gh.Release(repo, tag) + if err == nil && r == nil && component != "amneziawg" && !strings.HasPrefix(tag, "v") { + r, err = gh.Release(repo, "v"+tag) + } + if err != nil { + return nil, err + } + if r == nil { + return nil, said{"No release %s in %s.", []any{tag, repo}} + } + return shown(r, map[string]any{"repo": repo}), nil +} + +// changes is what changed between the installed Dawnline and a release, as points. +func changes(gh *github.Client, from, to string) (map[string]any, error) { + if !tagName.MatchString(to) || (from != "" && !tagName.MatchString(from)) { + return nil, errors.New("Unknown release.") + } + // the installed version as a tag when it was released (a build ahead of the releases has none) + base := "" + if from != "" { + bare := strings.TrimPrefix(from, "v") + for _, t := range []string{"v" + bare, bare} { + if r, err := gh.Release(Repo, t); err != nil { + return nil, err + } else if base == "" && r != nil { + base = t + } + } + } + items, err := gh.Changes(Repo, base, to) + if err != nil { + return nil, err + } + return map[string]any{"items": items}, nil +} + +// Updating tells whether an update job runs. +func Updating(run string) bool { return updating(run) } diff --git a/backend/methods/watchdog.go b/backend/methods/watchdog.go new file mode 100644 index 0000000..290521c --- /dev/null +++ b/backend/methods/watchdog.go @@ -0,0 +1,115 @@ +package methods + +import ( + "os" + "os/exec" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/apply" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/roster" + "github.com/tickcount/luci-app-dawnline/backend/watchdog" +) + +// sysSaid is the last lines of syslog that explain a failure of something. +func sysSaid(pattern, only string, n string) string { + out, _ := exec.Command("sh", "-c", "logread -l 400 2>/dev/null | grep -E "+shq(pattern)+" | grep -iE "+shq(only)+" | tail -n "+n).Output() + return strings.Trim(string(out), " \t\r\n\v\f") +} + +func shq(s string) string { return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" } + +// WatchdogFacts reads the router for the watchdog's probes (package watchdog): r is the router an apply +// works on, reapply the full apply. +func WatchdogFacts(d Deps, m *model.Model, r *apply.Router, reapply func()) watchdog.Facts { + st := roster.AwgState(d.Handler) + f := watchdog.Facts{Tools: st["tools"] == true, Kmod: st["kmod"] == true, Loaded: st["loaded"] == true, Handler: st["handler"] == true} + for _, p := range st["missing"].([]any) { + f.Missing = append(f.Missing, p.(string)) + } + f.Owner = r.NetifdOwner + f.Iface = func(ifname string) watchdog.Iface { + if d.Bus == nil { + return watchdog.Iface{} + } + s := d.Bus("network.interface."+ifname, "status", nil) + return watchdog.Iface{Exists: s != nil, Up: s != nil && s["up"] == true} + } + f.IfaceErrors = func(ifname string) string { + var parts []string + if d.Bus != nil { + var errs []string + list, _ := d.Bus("network.interface."+ifname, "status", nil)["errors"].([]any) + for _, e := range list { + if em, ok := e.(map[string]any); ok { + one := text(em["code"]) + if data, _ := em["data"].([]any); len(data) > 0 { + var words []string + for _, w := range data { + words = append(words, text(w)) + } + one += " (" + strings.Join(words, " ") + ")" + } + errs = append(errs, one) + } + } + if len(errs) > 0 { + parts = append(parts, "netifd: "+strings.Join(errs, ", ")) + } + } + // only what explains a failure, not the ordinary "is now up/down" lines + if lines := sysSaid(ifname+"|amneziawg", "error|fail|invalid|unrecogni|cannot|unable|not found|refused|denied", "6"); lines != "" { + parts = append(parts, lines) + } + return strings.Join(parts, "\n") + } + udp, _ := os.ReadFile("/proc/net/udp") + udp6, _ := os.ReadFile("/proc/net/udp6") + bound := udpBound(string(udp), string(udp6)) + f.UDPListening = func(port int) bool { + for _, p := range bound { + if p == port { + return true + } + } + return false + } + if f.Tools && f.Kmod && f.Loaded && f.Handler { + f.Drift = r.NetifdDrift(m) + } + f.NftPresent = r.Present() + keyed := false + for _, srv := range m.Servers { + keyed = keyed || srv.PrivateKey != "" + } + if keyed { + f.Firewall = r.FirewallDrift(m) + } + if s := m.Settings; s.PortalEnabled { + others := false + for _, h := range listening("tcp") { + others = others || h.port == s.PortalPort + } + tcp, _ := os.ReadFile("/proc/net/tcp") + tcp6, _ := os.ReadFile("/proc/net/tcp6") + f.PortalCan, f.PortalListening = !others, tcpListening(s.PortalPort, string(tcp), string(tcp6)) + } + f.ResolverConf = exists("/var/etc/dawnline-dns.conf") + f.ResolverRunning = r.ResolverRunning() + f.Said = func(what string) string { + switch what { + case "modprobe": + out, _ := exec.Command("sh", "-c", "modprobe amneziawg 2>&1; dmesg 2>/dev/null | grep -i amneziawg | grep -iE 'error|fail|invalid|unknown|disagrees|taint' | tail -n 4").Output() + return strings.Trim(string(out), " \t\r\n\v\f") + case "portal": + return sysSaid("dawnline", "portal.*(error|fail|cert|key|bind|address)", "4") + } + return "" + } + f.Reapply = reapply + f.Run = func(name string, args ...string) { exec.Command(name, args...).Run() } + // procd keeps unchanged instances and starts missing ones + f.StartServices = func() { exec.Command("/etc/init.d/dawnline", "start").Run() } + f.BlockedNote, f.BlockedFix = apply.BlockedNote, apply.BlockedFix + return f +} diff --git a/backend/methods/words.go b/backend/methods/words.go new file mode 100644 index 0000000..a110575 --- /dev/null +++ b/backend/methods/words.go @@ -0,0 +1,31 @@ +package methods + +import ( + "unicode" + "unicode/utf8" + + "github.com/tickcount/luci-app-dawnline/backend/i18n" +) + +// Unworded is what a person is told for a failure that has no sentence of its own. +const Unworded = "Something went wrong on the router. Try again; if it goes on, look at the Log." + +// Worded tells whether a failure's text is a sentence for a person: one of ours begins with a capital letter, an +// error Go wrote for programmers never does (Go's own convention: "open /etc/config/dawnline: no such file"). +func Worded(msg string) bool { + r, _ := utf8.DecodeRuneInString(msg) + return unicode.IsUpper(r) +} + +// wordsOf is what a failure says to a person, in their language: its own sentence, or, for an error that is not +// one, the plain sentence, the error itself going to the system log (`say`, nil: nowhere). +func wordsOf(t *i18n.Catalog, err error, say func(line string)) string { + msg := err.Error() + if Worded(msg) { + return t.T(msg) + } + if say != nil { + say(msg) + } + return t.T(Unworded) +} diff --git a/backend/methods/words_test.go b/backend/methods/words_test.go new file mode 100644 index 0000000..6cbf8fe --- /dev/null +++ b/backend/methods/words_test.go @@ -0,0 +1,27 @@ +package methods + +import ( + "errors" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/i18n" +) + +func TestWordsOf(t *testing.T) { + none := i18n.Use("", "") + var logged []string + say := func(line string) { logged = append(logged, line) } + if got := wordsOf(none, errors.New("Port 51820 is already taken."), say); got != "Port 51820 is already taken." || len(logged) != 0 { + t.Fatalf("a sentence is said as it is: %q, logged %v", got, logged) + } + if got := wordsOf(none, errors.New("Порт занят."), say); got != "Порт занят." { + t.Fatalf("a sentence in another script too: %q", got) + } + raw := "open /etc/config/dawnline: no such file or directory" + if got := wordsOf(none, errors.New(raw), say); got != Unworded || len(logged) != 1 || logged[0] != raw { + t.Fatalf("Go's own error is not said, it is logged: %q, logged %v", got, logged) + } + if got := wordsOf(none, errors.New(""), nil); got != Unworded { + t.Fatalf("nothing to say is not a sentence: %q", got) + } +} diff --git a/backend/methods/write.go b/backend/methods/write.go new file mode 100644 index 0000000..bd6bbb9 --- /dev/null +++ b/backend/methods/write.go @@ -0,0 +1,399 @@ +package methods + +import ( + crand "crypto/rand" + "encoding/hex" + "errors" + "fmt" + "math/rand/v2" + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +const blank = " \t\r\n\v\f" + +// trimmed is an argument as a trimmed string ("" for none). +func trimmed(v any) string { + switch x := v.(type) { + case string: + return strings.Trim(x, blank) + case nil: + return "" + } + return strings.Trim(fmt.Sprint(v), blank) +} + +// ValidName tells a name people see: 1 to 48 characters (not bytes), none of < > " \ or a control character. +func ValidName(s string) bool { + n := 0 + for _, r := range s { + if r == '<' || r == '>' || r == '"' || r == '\\' || r < 0x20 || r == 0x7f { + return false + } + n++ + } + return n <= 48 && strings.Trim(s, blank) != "" +} + +var portDigits = regexp.MustCompile(`^[0-9]{1,5}$`) + +// ValidPort tells a TCP or UDP port as typed: 1 to 65535. +func ValidPort(s string) bool { + s = strings.Trim(s, blank) + n, _ := strconv.Atoi(s) + return portDigits.MatchString(s) && n >= 1 && n <= 65535 +} + +// taken tells an id anything in the settings has, or that is reserved. +func taken(m *model.Model, id string) bool { + for _, r := range ReservedIDs { + if r == id { + return true + } + } + return m.Servers[id] != nil || m.People[id] != nil || m.Devices[id] != nil || m.Services[id] != nil || m.Circles[id] != nil +} + +// newID is an id from make() that no section has yet. +func newID(m *model.Model, make func() string) (string, error) { + for i := 0; i < 20; i++ { + if id := make(); !taken(m, id) { + return id, nil + } + } + return "", errors.New("Could not find a free id, try again.") +} + +// write runs a change of the settings: written, and not yet put into effect. +func write(d Deps, fn func(c *uci.Config, m *model.Model) error) error { + if d.Store == nil { + return errors.New("The router is still starting. Try again in a moment.") + } + if err := d.Store.Transact(fn); err != nil { + if u, unsaved := err.(store.Unsaved); unsaved { + return said{"Couldn't save /etc/config/dawnline: %s. Is the flash full?", []any{u.Why}} + } + return err + } + return nil +} + +// change runs a change of the settings and has the ucode backend put it into effect; the warning is that +// sync's, for the admin. +func change(d Deps, lang string, fn func(c *uci.Config, m *model.Model) error) (warning any, err error) { + if err := write(d, fn); err != nil { + return nil, err + } + if d.Sync != nil { + warning = d.Sync(lang) + } + if d.Told != nil { + d.Told() + } + return warning, nil +} + +var serviceID = regexp.MustCompile(`^[A-Za-z0-9_]{1,32}$`) + +// serviceSet adds a home service or changes one (dawnline.rpc.home service_set). +func serviceSet(d Deps, a map[string]any) (map[string]any, error) { + name := trimmed(a["name"]) + if !ValidName(name) { + return nil, errors.New(`Service: Enter a name: up to 48 characters, without < > " or \.`) + } + address := trimmed(a["address"]) + if _, ok := ipnet.IP(address); !ok { + return nil, errors.New("Address must be an IPv4 address.") + } + var ports []string + if list, isList := a["ports"].([]any); isList { + for _, p := range list { + ports = append(ports, trimmed(p)) + } + } else { + ports = regexp.MustCompile(`[ ,]+`).Split(trimmed(a["ports"]), -1) + } + kept := ports[:0] + for _, p := range ports { + if p == "" { + continue + } + if !ValidPort(p) { + return nil, said{"Invalid port %s.", []any{p}} + } + kept = append(kept, p) + } + id := trimmed(a["id"]) + warning, err := change(d, text(a["lang"]), func(c *uci.Config, m *model.Model) error { + switch { + case id == "": + var err error + if id, err = newID(m, func() string { return fmt.Sprintf("svc_%d", 100000+rand.IntN(900000)) }); err != nil { + return err + } + case !serviceID.MatchString(id): + return errors.New("Invalid service id.") + // never turn a person, device, server, circle or the settings into a service + case m.Services[id] == nil && taken(m, id): + return errors.New("That id is taken.") + } + c.Add("service", id) + c.Set(id, "name", name) + c.Set(id, "address", address) + if len(kept) > 0 { + c.SetList(id, "port", kept) + } else { + c.Delete(id, "port") + } + return nil + }) + if err != nil { + return nil, err + } + return map[string]any{"id": id, "warning": warning}, nil +} + +// serviceDelete removes a home service and takes it from everyone who had it. +func serviceDelete(d Deps, id, lang string) (map[string]any, error) { + warning, err := change(d, lang, func(c *uci.Config, m *model.Model) error { + if m.Services[id] == nil { + return errors.New("Unknown service.") + } + c.DeleteSection(id) + for _, pid := range m.PersonIDs() { + p := m.People[pid] + var rest []string + had := false + for _, s := range p.Services { + if s == id { + had = true + } else { + rest = append(rest, s) + } + } + if !had { + continue + } + if len(rest) > 0 { + c.SetList(pid, "service", rest) + } else { + c.Delete(pid, "service") + } + } + return nil + }) + if err != nil { + return nil, err + } + return map[string]any{"ok": true, "warning": warning}, nil +} + +// randHex is n random bytes as hex: an id's tail. A test puts its own in its place. +var randHex = func(n int) string { + b := make([]byte, n) + crand.Read(b) + return hex.EncodeToString(b) +} + +// lower is s with its ASCII letters in lower case, as ucode's lc() leaves it. +func lower(s string) string { + b := []byte(s) + for i, c := range b { + if c >= 'A' && c <= 'Z' { + b[i] = c + 32 + } + } + return string(b) +} + +const circleColors = 8 + +// circles is the circles as the settings hold them now, for a page to show after its change. +func circles(d Deps) []any { + out := []any{} + if _, m, err := d.Store.Read(); err == nil { + for _, id := range m.CircleIDs() { + out = append(out, m.Circles[id]) + } + } + return out +} + +// circleSet creates a circle or edits one; `members` (person ids), when given, replaces who is in it +// (dawnline.rpc.home circle_set). +func circleSet(d Deps, a map[string]any) (map[string]any, error) { + name := trimmed(a["name"]) + if !ValidName(name) || len([]rune(name)) > 32 { + return nil, errors.New(`Enter a circle name: up to 32 characters, without < > " or \.`) + } + id := text(a["id"]) + edit, serverName := false, "" + warning, err := change(d, text(a["lang"]), func(c *uci.Config, m *model.Model) error { + ci := m.Circles[id] + if id != "" && ci == nil { + return errors.New("Unknown circle.") + } + server := text(a["server"]) + if ci != nil { + server = ci.Server + } + if m.Servers[server] == nil { + return errors.New("Unknown server.") + } + for _, oid := range m.CircleIDs() { + if o := m.Circles[oid]; oid != id && o.Server == server && lower(o.Name) == lower(name) { + return said{"%s already exists.", []any{name}} + } + } + if ci == nil { + var err error + if id, err = newID(m, func() string { return "c_" + randHex(4) }); err != nil { + return err + } + } + color := ((int(num(a["color"])) % circleColors) + circleColors) % circleColors + c.Add("circle", id) + c.Set(id, "server", server) + c.Set(id, "name", name) + c.Set(id, "color", strconv.Itoa(color)) + if list, given := a["members"].([]any); given { + want := map[string]bool{} + for _, pid := range list { + if p := m.People[text(pid)]; p != nil && p.Server == server { + want[text(pid)] = true + } + } + for _, pid := range m.PersonIDs() { + if want[pid] { + c.Set(pid, "circle", id) + } else if m.People[pid].Circle == id { + c.Delete(pid, "circle") + } + } + } + edit, serverName = ci != nil, m.Servers[server].Name + return nil + }) + if err != nil { + return nil, err + } + if d.Log != nil { + msg := "added" + if edit { + msg = "changed" + } + d.Log.Admin("awg", msg, "circle", name, serverName) + } + return map[string]any{"id": id, "circles": circles(d), "warning": warning}, nil +} + +// circleDelete removes a circle and takes everyone out of it. +func circleDelete(d Deps, id, lang string) (map[string]any, error) { + name, serverName := "", "" + warning, err := change(d, lang, func(c *uci.Config, m *model.Model) error { + ci := m.Circles[id] + if ci == nil { + return errors.New("Unknown circle.") + } + c.DeleteSection(id) + for _, pid := range m.PersonIDs() { + if m.People[pid].Circle == id { + c.Delete(pid, "circle") + } + } + name = ci.Name + if srv := m.Servers[ci.Server]; srv != nil { + serverName = srv.Name + } + return nil + }) + if err != nil { + return nil, err + } + if d.Log != nil { + d.Log.Admin("awg", "removed", "circle", name, serverName) + } + return map[string]any{"circles": circles(d), "warning": warning}, nil +} + +// logged puts events in the activity log and, those about the system, in syslog (dawnline.live add_events): +// each with the names it carries, as the settings have them now. +func logged(d Deps, events ...journal.Event) { + if d.Store == nil { + return + } + _, m, err := d.Store.Read() + if err != nil { + return + } + names := journal.NamesOf(m) + for _, e := range events { + journal.Named(e, names) + if lvl := journal.Level(e); lvl != "" && d.Log != nil { + kind, _ := e["type"].(string) + d.Log.Say(lvl, journal.CategoryOf(kind), journal.Line(e)) + } + } + journal.Log{Run: d.RunDir, Data: d.DataDir}.Add(events, journal.PolicyOf(m.Settings.Retention), names, time.Now().Unix()) +} + +// personPause pauses a person, or lets them on again. +func personPause(d Deps, id string, paused bool, lang string) (map[string]any, error) { + warning, err := change(d, lang, func(c *uci.Config, m *model.Model) error { + if m.People[id] == nil { + return errors.New("Unknown person.") + } + if paused { + c.Set(id, "paused", "1") + } else { + c.Delete(id, "paused") + } + return nil + }) + if err != nil { + return nil, err + } + kind := "resumed" + if paused { + kind = "paused" + } + logged(d, journal.Event{"type": kind, "person": id, "by": "admin"}) + if d.Told != nil { + d.Told() + } + return map[string]any{"warning": warning}, nil +} + +// personDelete removes a person and their devices. The event carries their name: the log still reads well +// once they are gone. +func personDelete(d Deps, id, lang string) (map[string]any, error) { + name := "" + warning, err := change(d, lang, func(c *uci.Config, m *model.Model) error { + p := m.People[id] + if p == nil { + return errors.New("Unknown person.") + } + for _, dev := range p.Devices { + c.DeleteSection(dev) + } + c.DeleteSection(id) + name = p.Name + return nil + }) + if err != nil { + return nil, err + } + logged(d, journal.Event{"type": "person_removed", "person": id, "detail": name, "pname": name, "by": "admin"}) + if d.Told != nil { + d.Told() + } + return map[string]any{"warning": warning}, nil +} diff --git a/backend/methods/write_test.go b/backend/methods/write_test.go new file mode 100644 index 0000000..5d276aa --- /dev/null +++ b/backend/methods/write_test.go @@ -0,0 +1,173 @@ +package methods + +import ( + "encoding/json" + "os" + "regexp" + "strconv" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// A row of changes to access's household: after each, the settings file is the one the ucode backend's +// own method leaves, and a refusal has its words (testdata/write.uc, scripts/ucode-golden.sh). +func TestChangesAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/write.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Steps []struct { + Method string `json:"method"` + Args map[string]any `json:"args"` + Error *string `json:"error"` + File string `json:"file"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + if len(golden.Steps) < 287 { + t.Fatal("the golden is too small") + } + dir := t.TempDir() + text, _ := os.ReadFile("../access/testdata/access.uci") + // as libuci keeps it: the golden's first commit rewrites the file whole + c, _ := uci.Parse(string(text)) + os.WriteFile(dir+"/dawnline", []byte(c.Format()), 0o600) + // the router the golden ran on: what its container said of itself (netview's golden, the same run) + raw, err = os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + fw, _ := uci.Parse(router.Firewall) + snapshot := func() *netview.Snapshot { + return netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + } + installed := true + d := Deps{World: func() *view.World { return &view.World{} }, Store: &store.Store{Config: dir + "/dawnline", RunDir: dir}, Snapshot: snapshot, + Config: dir + "/dawnline", RunDir: dir, DataDir: dir + "/data", + // as in the golden's container: no AmneziaWG at all + Caps: func() awg.Caps { return awg.Caps{} }, AWG: func() map[string]any { + // the made-up device steps stand for a router that has it (they pass ucode's check by going around it) + return map[string]any{"tools": installed, "kmod": installed, "loaded": installed, "handler": true, "missing": []any{"kmod-amneziawg", "amneziawg-tools"}} + }} + changed, refused := 0, 0 + before := c.Format() + made := regexp.MustCompile(`config circle 'c_([0-9a-f]+)'`) + codeOf := regexp.MustCompile(`option code '([a-z]{6}-[a-z]{6}-[a-z]{6})'`) + momentOf := regexp.MustCompile(`option (?:code_set|created) '([0-9]+)'`) + device := regexp.MustCompile(`config device 'd_([0-9a-f]+)'`) + portOf := regexp.MustCompile(`option port '([0-9]+)'`) + for i, step := range golden.Steps { + // an id made at random is the one ucode's dice gave: the golden's file names it + randHex = func(int) string { + for _, m := range made.FindAllStringSubmatch(step.File, -1) { + if !strings.Contains(before, "config circle 'c_"+m[1]+"'") { + return m[1] + } + } + return "none" + } + // a code and a moment likewise: the ones the golden's file has and the file before did not + newCode = func() string { + for _, m := range codeOf.FindAllStringSubmatch(step.File, -1) { + if !strings.Contains(before, "'"+m[1]+"'") { + return m[1] + } + } + return "none" + } + clock = func() int64 { + var latest int64 + for _, m := range momentOf.FindAllStringSubmatch(step.File, -1) { + if n, _ := strconv.ParseInt(m[1], 10, 64); n > latest { + latest = n + } + } + return latest + } + // the keys the golden made up, and the device id its dice gave + method := strings.TrimPrefix(step.Method, "x_") + installed = step.Method != "server_obfuscation" && step.Method != "server_create" + needLoaded = step.Method != "server_create" + // a port drawn when the usual one is taken is ucode's dice too + randPort = func() int { + for _, m := range portOf.FindAllStringSubmatch(step.File, -1) { + if !strings.Contains(before, "option port '"+m[1]+"'") { + n, _ := strconv.Atoi(m[1]) + return n + } + } + return 51830 + } + if step.Method == "server_create" { + // the keys the golden's stand-in tool gives + newKeys = func() Keys { + return Keys{Private: strings.Repeat("S", 42) + "A=", Public: strings.Repeat("T", 42) + "A="} + } + } + if k, _ := step.Args["key"].(string); k != "" { + key := func(c string) string { return strings.Repeat(c, 42)[:42*len(c)] + "A=" } + newKeys = func() Keys { return Keys{Private: key(k + "x"), Public: key(k), Preshared: key(k + "y")} } + randHex = func(int) string { + for _, m := range device.FindAllStringSubmatch(step.File, -1) { + if !strings.Contains(before, "config device 'd_"+m[1]+"'") { + return m[1] + } + } + return "none" + } + } + res := ask(t, d, method, step.Args) + got, _ := os.ReadFile(dir + "/dawnline") + // ucode's full apply, which the server methods end with, notes a migration in the settings the first + // time it runs; here nothing applies, so the note is put where that apply puts it + const note = "\tlist migrated 'auto_mtu'\n" + if strings.Contains(step.File, note) && !strings.Contains(string(got), note) { + c, _ := uci.Parse(string(got)) + c.SetList("settings", "migrated", []string{"auto_mtu"}) + got = []byte(c.Format()) + os.WriteFile(dir+"/dawnline", got, 0o600) + } + if string(got) != step.File { + t.Fatalf("step %d %s %v: the file differs\n%s\n--- ucode:\n%s", i, step.Method, step.Args, got, step.File) + } + if string(got) == before { + // nothing was written: a refusal in the same words, or a change that changes nothing + var want any + if step.Error != nil { + want = *step.Error + refused++ + } + if res["error"] != want { + t.Errorf("step %d %s %v: refused with %v, ucode %v", i, step.Method, step.Args, res["error"], want) + } + } else { + changed++ + if res["error"] != nil { + t.Errorf("step %d %s %v: written, and yet %v", i, step.Method, step.Args, res["error"]) + } + } + before = string(got) + } + if changed < 115 || refused < 106 { + t.Fatalf("the golden exercises too little: %d changes, %d refusals", changed, refused) + } +} diff --git a/backend/migrate/migrate.go b/backend/migrate/migrate.go new file mode 100644 index 0000000..9f43581 --- /dev/null +++ b/backend/migrate/migrate.go @@ -0,0 +1,208 @@ +// Package migrate is the one-time steps for routers set up by older versions (dawnline.migrate). Each one +// checks first and writes nothing when there is nothing to do; a full apply runs them before it takes its +// own lock (changes to the settings go through the store and its config lock). +package migrate + +import ( + "os" + "regexp" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/store" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Router is where the steps work. +type Router struct { + Store store.Store + // NewCode draws a personal code of words. + NewCode func() string + // Uhttpd is the LuCI web server's configuration, CGI the portal's old script under it. + Uhttpd, CGI string + // ReloadUhttpd has the web server read its configuration again. + ReloadUhttpd func() + Log *servicelog.Log +} + +var wordCode = regexp.MustCompile(`^[a-z]{6}-[a-z]{6}-[a-z]{6}$`) + +const cgiURL = "/cgi-bin/dawnline-portal" + +func (r Router) settings() *uci.Config { + c, _, err := r.Store.Read() + if err != nil { + return nil + } + return c +} + +func (r Router) note(msg, who string) { + if r.Log != nil { + r.Log.Write("dawnline", "info", msg, "", who, servicelog.Extra{}) + } +} + +// wordCodes: every personal code is a word code; older random ones are replaced (their links stop working). +func (r Router) wordCodes() { + old := func(s *uci.Section) bool { + code, has := s.Get("code") + return has && !wordCode.MatchString(code) + } + c := r.settings() + if c == nil { + return + } + any := false + for _, s := range c.OfType("person") { + any = any || old(s) + } + if !any { + return + } + err := r.Store.Transact(func(w *uci.Config, _ *model.Model) error { + for _, s := range w.OfType("person") { + if old(s) { + w.Set(s.Name, "code", r.NewCode()) + w.Delete(s.Name, "words") + } + } + return nil + }) + if err == nil { + r.note("moved to word codes", "Personal links") + } +} + +// uhttpd: older versions answered on 443 at home through LuCI's web server (its error page ran the +// portal's CGI). The portal keeps its own port now: that is removed, with the old setting itself. +func (r Router) uhttpd() { + if raw, err := os.ReadFile(r.Uhttpd); err == nil { + if c, err := uci.Parse(string(raw)); err == nil { + if page, _ := c.Section("main").Get("error_page"); c.Section("main") != nil && page == cgiURL { + c.Delete("main", "error_page") + mode := os.FileMode(0o644) + if st, err := os.Stat(r.Uhttpd); err == nil { + mode = st.Mode().Perm() + } + tmp := r.Uhttpd + ".dl-new" + if os.WriteFile(tmp, []byte(c.Format()), mode) == nil && os.Rename(tmp, r.Uhttpd) == nil { + if r.ReloadUhttpd != nil { + r.ReloadUhttpd() + } + if r.Log != nil { + r.Log.Say("info", "portal", "portal removed from the LuCI web server") + } + } else { + os.Remove(tmp) + } + } + } + } + if r.CGI != "" { + os.Remove(r.CGI) + } + r.dropSetting("portal_443") +} + +func (r Router) dropSetting(key string) { + c := r.settings() + if c == nil || c.Section("settings") == nil { + return + } + if _, has := c.Section("settings").Values[key]; !has { + return + } + r.Store.Transact(func(w *uci.Config, _ *model.Model) error { + w.Delete("settings", key) + return nil + }) +} + +// dropPersonOption removes an option older versions kept on a person, from everyone who still has it. +func (r Router) dropPersonOption(key string) { + c := r.settings() + if c == nil { + return + } + has := func(s *uci.Section) bool { + _, kept := s.Values[key] + return kept + } + any := false + for _, s := range c.OfType("person") { + any = any || has(s) + } + if !any { + return + } + r.Store.Transact(func(w *uci.Config, _ *model.Model) error { + for _, s := range w.OfType("person") { + if has(s) { + w.Delete(s.Name, key) + } + } + return nil + }) +} + +// done lists the steps that cannot tell from the settings whether they ran (settings.migrated). +func done(c *uci.Config) []string { + s := c.Section("settings") + if s == nil { + return nil + } + v := s.Values["migrated"] + if v.IsList { + return v.List + } + if v.Str != "" { + return []string{v.Str} + } + return nil +} + +// autoMTU: 1380 was every server's stored MTU before it became automatic (by device type and disguise). +// Once only: an admin may choose 1380 again on purpose. +func (r Router) autoMTU() { + c := r.settings() + if c == nil { + return + } + for _, d := range done(c) { + if d == "auto_mtu" { + return + } + } + any := false + err := r.Store.Transact(func(w *uci.Config, _ *model.Model) error { + for _, s := range w.OfType("server") { + if mtu, _ := s.Get("mtu"); mtu == "1380" { + w.Delete(s.Name, "mtu") + any = true + } + } + if w.Section("settings") == nil { + w.Add("settings", "settings") + } + w.SetList("settings", "migrated", append(append([]string{}, done(w)...), "auto_mtu")) + return nil + }) + if err == nil && any { + r.note("MTU is now automatic", "Servers") + } +} + +// Run is all of them, in order. +func (r Router) Run() { + r.wordCodes() + r.uhttpd() + r.autoMTU() + // the portal names itself after the server now: its own title setting is gone + r.dropSetting("portal_title") + // nobody is limited by the time of day any more: the hours older versions kept for a person are gone + r.dropPersonOption("hours") +} + +// UhttpdOnly is the uhttpd step alone (an uninstall runs it too). +func (r Router) UhttpdOnly() { r.uhttpd() } diff --git a/backend/migrate/migrate_test.go b/backend/migrate/migrate_test.go new file mode 100644 index 0000000..83e207a --- /dev/null +++ b/backend/migrate/migrate_test.go @@ -0,0 +1,81 @@ +package migrate + +import ( + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/store" +) + +// The one-time steps change what they must the first time and nothing the second. +func TestRun(t *testing.T) { + dir := t.TempDir() + conf := dir + "/dawnline" + os.WriteFile(conf, []byte(` +config settings 'settings' + option portal_title 'My VPN' + option portal_443 '1' + option domain 'vpn' + +config server 'main' + option mtu '1380' + option subnet '10.9.0.0/29' + +config server 'side' + option mtu '1400' + +config person 'alice' + option code 'abcdef-ghijkl-mnopqr' + option hours '07:00-23:00' + +config person 'bob' + option code 'XyZ12345' + option words 'old words' +`), 0o600) + os.WriteFile(dir+"/uhttpd", []byte("\nconfig uhttpd 'main'\n\toption home '/www'\n\toption error_page '/cgi-bin/dawnline-portal'\n"), 0o644) + os.WriteFile(dir+"/cgi", []byte("#!/bin/sh\n"), 0o755) + reloads := 0 + r := Router{Store: store.Store{Config: conf, RunDir: dir + "/run"}, NewCode: func() string { return "kamiro-telosu-bavine" }, + Uhttpd: dir + "/uhttpd", CGI: dir + "/cgi", ReloadUhttpd: func() { reloads++ }} + r.Run() + raw, _ := os.ReadFile(conf) + got := string(raw) + for _, want := range []string{"option code 'kamiro-telosu-bavine'", "option code 'abcdef-ghijkl-mnopqr'", "option subnet '10.9.0.0/29'", "option mtu '1400'", + "list migrated 'auto_mtu'", "option domain 'vpn'"} { + if !strings.Contains(got, want) { + t.Errorf("%s is not there:\n%s", want, got) + } + } + for _, gone := range []string{"XyZ12345", "old words", "1380", "portal_443", "portal_title", "option hours"} { + if strings.Contains(got, gone) { + t.Errorf("%s stays:\n%s", gone, got) + } + } + if st, _ := os.Stat(conf); st.Mode().Perm() != 0o600 { + t.Errorf("the settings are no longer private: %v", st.Mode().Perm()) + } + web, _ := os.ReadFile(dir + "/uhttpd") + if strings.Contains(string(web), "error_page") || !strings.Contains(string(web), "option home '/www'") || reloads != 1 { + t.Errorf("the web server's configuration (%d reloads):\n%s", reloads, web) + } + if _, err := os.Stat(dir + "/cgi"); err == nil { + t.Error("the old script stays") + } + // again: nothing is drawn or written + r.NewCode = func() string { t.Error("a code drawn again"); return "x" } + st, _ := os.Stat(conf) + r.Run() + if again, _ := os.Stat(conf); !again.ModTime().Equal(st.ModTime()) || reloads != 1 { + t.Error("written again with nothing to do") + } + if raw, _ := os.ReadFile(conf); string(raw) != got { + t.Error("the settings changed the second time") + } + // an admin's own 1380 after the step stays + os.WriteFile(conf, []byte(strings.Replace(got, "option mtu '1400'", "option mtu '1380'", 1)), 0o600) + r.Run() + if raw, _ := os.ReadFile(conf); !strings.Contains(string(raw), "option mtu '1380'") { + t.Error("an MTU chosen on purpose was taken away") + } +} diff --git a/backend/model/behind.go b/backend/model/behind.go new file mode 100644 index 0000000..2fca50a --- /dev/null +++ b/backend/model/behind.go @@ -0,0 +1,146 @@ +// The networks behind people's routers (site to site): a router that connects as a device may have a +// network of its own behind it, which the tunnel then carries both ways. The settings keep them on the +// device (`list behind_net`); what may be one and which of them are in effect is decided here, for the +// methods that take them and for everything that is made from them. Pure. + +package model + +import "github.com/tickcount/luci-app-dawnline/backend/ipnet" + +const ( + // BehindMost is how many networks one router may have behind it. + BehindMost = 8 + // BehindWidest is the shortest prefix one may have: a site's own network, never a whole private range. + BehindWidest = 16 +) + +// Only private ranges stand behind a router: a public one would take that part of the internet away from +// everyone who reaches the network. +var behindRanges = []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"} + +// BehindNet reads a network as one may stand behind a router: "a.b.c.d/len" inside a private range, from +// /16 to /30. It is told from its first address ("192.168.2.7/24" is 192.168.2.0/24). why is "" for one +// that will do, else what is wrong with it: "form" (no network written out), "wide" (wider than /16) or +// "public" (outside the private ranges). +func BehindNet(s string) (n ipnet.Net, why string) { + n, ok := ipnet.Subnet(s) + if !ok { + return ipnet.Net{}, "form" + } + if n.Prefix < BehindWidest { + return ipnet.Net{}, "wide" + } + for _, r := range behindRanges { + if in, _ := ipnet.Any(r); in.Holds(n.Base) { + return n, "" + } + } + return ipnet.Net{}, "public" +} + +// Clash is what a network behind a device runs into: Net is the other network, which is a server's own +// subnet (Server), one of the router's own networks (neither), or behind another device (Device). +type Clash struct { + Net string + Server, Device string +} + +// BehindClash is what a network behind a device shares addresses with, or nil: a tunnel's subnet, one of +// the router's own networks (own: nil when they are not known) or a network behind another device. Two +// ends of a tunnel with the same addresses reach neither. +func (m *Model) BehindClash(n ipnet.Net, device string, own []string) *Clash { + for _, id := range m.serverIDs { + if s, ok := ipnet.Subnet(m.Servers[id].Subnet); ok && s.Overlaps(n) { + return &Clash{Net: s.String(), Server: id} + } + } + for _, o := range own { + if x, ok := ipnet.Any(o); ok && x.Prefix >= 1 && x.Overlaps(n) { + return &Clash{Net: x.String()} + } + } + for _, id := range m.deviceIDs { + if id == device { + continue + } + for _, o := range m.Devices[id].Behind { + if x, why := BehindNet(o); why == "" && x.Overlaps(n) { + return &Clash{Net: x.String(), Device: id} + } + } + } + return nil +} + +// BehindOf is the networks behind each router that are in effect, by the device's id: what the tunnels' +// peers, the routes, the access rules and other devices' configurations are made from. Only a router has +// any. A line that is no such network, one over BehindMost, and one that shares addresses with a tunnel, +// with the router's own networks (own: nil when they are not known) or with a network already counted (an +// earlier device's in the settings' order, or an earlier one of its own) is left out: a bad line in the +// file never takes a route away from the router or from another site. What is asked for and not answered +// is in effect nowhere. +func (m *Model) BehindOf(own []string) map[string][]string { + out := map[string][]string{} + var counted []ipnet.Net + for _, id := range m.deviceIDs { + d := m.Devices[id] + // a router that waits for the admin's answer is no device of the tunnel yet + if d.Kind != "router" || d.Waiting { + continue + } + for _, s := range d.Behind { + n, why := BehindNet(s) + if why != "" || len(out[id]) >= BehindMost { + continue + } + taken := false + for _, c := range counted { + taken = taken || c.Overlaps(n) + } + if c := m.BehindClash(n, id, own); taken || (c != nil && c.Device == "") { + continue + } + counted = append(counted, n) + out[id] = append(out[id], n.String()) + } + } + return out +} + +// HomeAccess tells whether a person is part of home: all of it or the networks picked for them, and the +// devices the server lets reach each other. Not someone held to a few home services. +func (p *Person) HomeAccess() bool { + return p.Access == "both" || (p.Access == "lan" && len(p.Services) == 0) +} + +// MeshGroup is whom a person's devices reach directly where the server keeps devices within circles: the +// person's circle on that server, else the person's own devices. +func (m *Model) MeshGroup(p *Person) string { + if c := m.Circles[p.Circle]; c != nil && c.Server == p.Server { + return "c:" + c.ID + } + return "p:" + p.ID +} + +// BehindReach is the networks behind other routers that a person's device reaches through the tunnel, in +// the settings' order: those of the devices it reaches itself (everyone's on the server, or its circle's, +// where their owners are part of home too). behind is the networks in effect (BehindOf); device is the +// device's id, "" for a configuration that is nobody's yet. +func (m *Model) BehindReach(p *Person, device string, behind map[string][]string) []string { + srv := m.Servers[p.Server] + if srv == nil || srv.Mesh == "off" || !p.HomeAccess() { + return nil + } + var out []string + for _, id := range m.deviceIDs { + q := m.People[m.Devices[id].Person] + if id == device || len(behind[id]) == 0 || q == nil || q.Server != p.Server || !q.HomeAccess() { + continue + } + if srv.Mesh == "circles" && m.MeshGroup(p) != m.MeshGroup(q) { + continue + } + out = append(out, behind[id]...) + } + return out +} diff --git a/backend/model/behind_test.go b/backend/model/behind_test.go new file mode 100644 index 0000000..db9abb7 --- /dev/null +++ b/backend/model/behind_test.go @@ -0,0 +1,261 @@ +package model + +import ( + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +func TestWhatMayStandBehindARouter(t *testing.T) { + for _, c := range []struct{ in, net, why string }{ + {"192.168.2.0/24", "192.168.2.0/24", ""}, + {"192.168.2.7/24", "192.168.2.0/24", ""}, + {"10.5.0.0/16", "10.5.0.0/16", ""}, + {"172.31.255.0/30", "172.31.255.0/30", ""}, + {"192.168.2.0", "", "form"}, + {"192.168.2.0/31", "", "form"}, + {"192.168.2.0/24 ", "", "form"}, + {"home", "", "form"}, + {"", "", "form"}, + {"10.0.0.0/8", "", "wide"}, + {"10.4.0.0/15", "", "wide"}, + {"8.8.8.0/24", "", "public"}, + {"172.32.0.0/24", "", "public"}, + {"100.64.0.0/24", "", "public"}, + {"169.254.1.0/24", "", "public"}, + } { + n, why := BehindNet(c.in) + if why != c.why || (why == "" && n.String() != c.net) { + t.Errorf("%q: %s %q, want %s %q", c.in, n, why, c.net, c.why) + } + } +} + +// A household for the networks behind routers: two servers, one that keeps devices within circles. +const sites = ` +config server 'home' + option subnet '10.77.0.0/24' + option mesh 'all' + +config server 'cabin' + option subnet '10.78.0.0/24' + option mesh 'circles' + +config circle 'fam' + option server 'cabin' + +config person 'anna' + option server 'home' + option access 'both' + +config person 'boris' + option server 'home' + option access 'lan' + +config person 'clara' + option server 'home' + option access 'internet' + +config person 'eva' + option server 'home' + option access 'lan' + list service 'nas' + +config person 'hana' + option server 'cabin' + option access 'both' + option circle 'fam' + +config person 'ivan' + option server 'cabin' + option access 'both' + option circle 'fam' + +config person 'kira' + option server 'cabin' + option access 'both' + +config device 'r1' + option person 'anna' + option kind 'router' + option address '10.77.0.2' + list behind_net '192.168.2.9/24' + list behind_net '10.77.0.128/25' + list behind_net 'the garage' + list behind_net '192.168.2.128/25' + list behind_net '192.168.50.0/24' + list behind_net '10.78.0.0/16' + +config device 'phone' + option person 'anna' + option address '10.77.0.3' + list behind_net '192.168.9.0/24' + +config device 'r2' + option person 'boris' + option kind 'router' + option address '10.77.0.4' + list behind_net '192.168.2.0/23' + list behind_net '172.16.9.0/24' + +config device 'r3' + option person 'clara' + option kind 'router' + option address '10.77.0.5' + option behind_net '192.168.30.0/24' + +config device 'r4' + option person 'eva' + option kind 'router' + option address '10.77.0.6' + list behind_net '192.168.40.0/24' + +config device 'r5' + option person 'hana' + option kind 'router' + option address '10.78.0.2' + list behind_net '192.168.60.0/24' + +config device 'iphone' + option person 'ivan' + option address '10.78.0.3' + +config device 'kphone' + option person 'kira' + option address '10.78.0.4' +` + +func household(t *testing.T, text string) *Model { + t.Helper() + c, err := uci.Parse(text) + if err != nil { + t.Fatal(err) + } + return Load(c, nil) +} + +func TestNetworksInEffect(t *testing.T) { + m := household(t, sites) + // the router has 192.168.50.0/24 itself; a tunnel's subnet is never behind anyone; r1 came first + got := m.BehindOf([]string{"192.168.50.0/24", "192.168.77.0/24"}) + want := map[string][]string{"r1": {"192.168.2.0/24"}, "r2": {"172.16.9.0/24"}, "r3": {"192.168.30.0/24"}, "r4": {"192.168.40.0/24"}, "r5": {"192.168.60.0/24"}} + if !reflect.DeepEqual(got, want) { + t.Errorf("in effect: %v, want %v", got, want) + } + // what the router has itself is not known: only the settings speak + if got := m.BehindOf(nil)["r1"]; !reflect.DeepEqual(got, []string{"192.168.2.0/24", "192.168.50.0/24"}) { + t.Errorf("r1 with nothing known of the router: %v", got) + } + // more than a router may have: the first BehindMost count + many := "config server 's'\n\toption subnet '10.77.0.0/24'\n\nconfig person 'p'\n\toption server 's'\n\nconfig device 'r'\n\toption person 'p'\n\toption kind 'router'\n" + for i := 0; i < BehindMost+3; i++ { + many += "\tlist behind_net '192.168." + string(rune('0'+i/10)) + string(rune('0'+i%10)) + ".0/24'\n" + } + if got := household(t, many).BehindOf(nil)["r"]; len(got) != BehindMost || got[BehindMost-1] != "192.168.7.0/24" { + t.Errorf("over the most: %v", got) + } +} + +func TestWhatANetworkRunsInto(t *testing.T) { + m := household(t, sites) + own := []string{"192.168.50.0/24"} + for _, c := range []struct { + net, device string + want *Clash + }{ + {"192.168.70.0/24", "", nil}, + {"10.77.0.0/25", "", &Clash{Net: "10.77.0.0/24", Server: "home"}}, + {"10.78.0.0/16", "", &Clash{Net: "10.78.0.0/24", Server: "cabin"}}, + {"192.168.50.128/25", "", &Clash{Net: "192.168.50.0/24"}}, + {"192.168.60.0/24", "", &Clash{Net: "192.168.60.0/24", Device: "r5"}}, + // its own network is no clash + {"192.168.60.0/24", "r5", nil}, + {"172.16.0.0/16", "r5", &Clash{Net: "172.16.9.0/24", Device: "r2"}}, + } { + n, _ := ipnet.Any(c.net) + if got := m.BehindClash(n, c.device, own); !reflect.DeepEqual(got, c.want) { + t.Errorf("%s for %q: %+v, want %+v", c.net, c.device, got, c.want) + } + } +} + +func TestWhoReachesWhatIsBehind(t *testing.T) { + m := household(t, sites) + behind := m.BehindOf([]string{"192.168.50.0/24"}) + for _, c := range []struct { + person, device string + want []string + }{ + // everyone reaches everyone on the server: every network of people who are part of home, but its own + {"anna", "phone", []string{"192.168.2.0/24", "172.16.9.0/24"}}, + {"anna", "r1", []string{"172.16.9.0/24"}}, + {"boris", "r2", []string{"192.168.2.0/24"}}, + // the internet alone, or a few home services: no part of home + {"clara", "r3", nil}, + {"eva", "r4", nil}, + // within circles: the circle's router, and nobody else's + {"ivan", "iphone", []string{"192.168.60.0/24"}}, + {"kira", "kphone", nil}, + {"hana", "r5", nil}, + } { + if got := m.BehindReach(m.People[c.person], c.device, behind); !reflect.DeepEqual(got, c.want) { + t.Errorf("%s's %s reaches %v, want %v", c.person, c.device, got, c.want) + } + } + m.Servers["home"].Mesh = "off" + if got := m.BehindReach(m.People["anna"], "phone", behind); got != nil { + t.Errorf("devices do not reach each other, yet anna's phone reaches %v", got) + } +} + +// What a router's owner asked for is read with the router, means nothing on another kind of device, and is +// in effect nowhere while the router waits. +func TestRequestsAsWritten(t *testing.T) { + m := household(t, sites+` +config device 'r6' + option person 'kira' + option kind 'router' + option address '10.78.0.5' + option waiting '1' + option asked '1700000000' + list ask_net '192.168.61.0/24' + list behind_net '192.168.62.0/24' + +config device 'r7' + option person 'kira' + option kind 'router' + option address '10.78.0.6' + option declined 'because' + list declined_net '192.168.63.0/24' + +config device 'tablet' + option person 'kira' + option kind 'tablet' + option address '10.78.0.7' + option waiting '1' + option declined 'talk' + list ask_net '192.168.64.0/24' +`) + r6, r7, tablet := m.Devices["r6"], m.Devices["r7"], m.Devices["tablet"] + if !r6.Waiting || r6.Asked != 1700000000 || !reflect.DeepEqual(r6.Ask, []string{"192.168.61.0/24"}) || r6.Declined != "" { + t.Errorf("a router that waits: %+v", r6) + } + if r7.Waiting || r7.Declined != "plain" || !reflect.DeepEqual(r7.DeclinedNets, []string{"192.168.63.0/24"}) || r7.Asked != 0 { + t.Errorf("a network turned down for a reason nobody knows: %+v", r7) + } + if tablet.Waiting || tablet.Ask != nil || tablet.Declined != "" { + t.Errorf("a tablet asks for nothing: %+v", tablet) + } + if got := m.BehindOf(nil)["r6"]; got != nil { + t.Errorf("a waiting router's network is in effect: %v", got) + } + if m.Servers["home"].PortalRouters != "ask" || m.Servers["home"].PortalNets != "ask" { + t.Errorf("the rules a server starts with: %q, %q", m.Servers["home"].PortalRouters, m.Servers["home"].PortalNets) + } + set := household(t, "config server 's'\n\toption portal_routers 'free'\n\toption portal_nets 'free'\n\nconfig server 'o'\n\toption portal_routers 'off'\n\toption portal_nets 'never'\n") + if s, o := set.Servers["s"], set.Servers["o"]; s.PortalRouters != "free" || s.PortalNets != "free" || o.PortalRouters != "off" || o.PortalNets != "ask" { + t.Errorf("the rules as set: %+v, %+v", s, o) + } +} diff --git a/backend/model/derived.go b/backend/model/derived.go new file mode 100644 index 0000000..bbb137e --- /dev/null +++ b/backend/model/derived.go @@ -0,0 +1,105 @@ +// What follows from the settings about a server's addresses and a device's link, as dawnline.core works +// them out (server_address, tunnel_mtu, device_mtu, endpoint_host, dns_list, client_dns). Pure. + +package model + +import "github.com/tickcount/luci-app-dawnline/backend/ipnet" + +const ( + // autoMTU is a tunnel's MTU when none is set, before its disguise's padding; mobileMTU what a phone + // or a tablet gets at the most, and the least a tunnel has. + autoMTU = 1380 + mobileMTU = 1280 + // A device's own MTU is taken within this range. + mtuMin, mtuMax = 1280, 1500 +) + +// ToInt is a value as a whole number as ucode reads one (what is after the point is dropped), or dflt +// when it is empty or no number. +func ToInt(v string, dflt int) int { + if v == "" { + return dflt + } + n, ok := number(v) + if !ok { + return dflt + } + return int(n) +} + +// Number is a value as ucode's unary plus reads it; ok is false for what is no number. +func Number(v string) (float64, bool) { return number(v) } + +// ServerAddress is the router's address inside a server's subnet (its first host), or "". +func ServerAddress(srv *Server) string { + n, ok := ipnet.Subnet(srv.Subnet) + if !ok { + return "" + } + return ipnet.String(n.First()) +} + +// TunnelMTU is the server's tunnel MTU: the one set, or the automatic one for its disguise. +func TunnelMTU(srv *Server) int { + if srv.MTU != 0 { + return srv.MTU + } + return max(mobileMTU, autoMTU-ToInt(srv.Obf["s4"], 0)) +} + +// DeviceMTU is the MTU a device's configuration carries: its own when the admin set one, else the +// tunnel's, at most 1280 for phones and tablets. +func DeviceMTU(srv *Server, dev *Device) int { + if dev.MTU >= mtuMin && dev.MTU <= mtuMax { + return dev.MTU + } + mtu := TunnelMTU(srv) + if dev.Kind == "phone" || dev.Kind == "tablet" { + return min(mtu, mobileMTU) + } + return mtu +} + +// EndpointHost is the address devices connect to: the server's own, else the portal's. +func (m *Model) EndpointHost(srv *Server) string { + if srv.Endpoint != "" { + return srv.Endpoint + } + return m.Settings.PortalHost +} + +// DNSList is the DNS a server's clients are given: the servers set for it, else the router's address in +// its subnet (which never changes after setup; the router forwards each query where it belongs). +func DNSList(srv *Server) []string { + if srv == nil { + return []string{} + } + if len(srv.DNS) > 0 { + return srv.DNS + } + if a := ServerAddress(srv); a != "" { + return []string{a} + } + return []string{} +} + +// ClientDNS is the DNS a person's devices use. Home-only people keep their device's DNS unless they chose +// home names; then the first server is Dawnline's resolver (reached through the tunnel) and the second +// the fallback the device uses when the tunnel is down. +func (m *Model) ClientDNS(srv *Server, p *Person) []string { + if p == nil || p.Access != "lan" { + return DNSList(srv) + } + if p.DNSMode != "home" { + return []string{} + } + out := []string{} + a := ServerAddress(srv) + if a != "" { + out = append(out, a) + } + if f := m.Settings.HomeDNSFallback; f != "" && f != a { + out = append(out, f) + } + return out +} diff --git a/backend/model/model.go b/backend/model/model.go new file mode 100644 index 0000000..fd5b1d6 --- /dev/null +++ b/backend/model/model.go @@ -0,0 +1,478 @@ +// Package model is Dawnline's settings as the backend works with them: the servers, the people, their +// devices, the circles and the home services, read from /etc/config/dawnline with every default filled in +// and every value brought to its type. +// +// It reads exactly what the ucode model reads (dawnline.core load(), dawnline.schema get()): the same +// defaults, the same leniency with what older versions and hands have written. testdata holds the two to +// each other: each *.json is what ucode made of the *.uci beside it (scripts/ucode-golden.sh). +// +// Reading only, and no state of the router: who is online, what is used, which tunnel is up live elsewhere. +package model + +import ( + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// What a value may be (dawnline.core). +var ( + Access = []string{"lan", "internet", "both"} + Kinds = []string{"computer", "phone", "tablet", "router", "other"} + MobileKinds = []string{"phone", "tablet"} + Mesh = []string{"off", "all", "circles"} + // PortalRouters is what a person may do about a router on their own page: nothing (the admin adds + // it), ask for one, or add one at once. PortalNets: ask for a network behind it, or add one at once. + PortalRouters = []string{"off", "ask", "free"} + PortalNets = []string{"ask", "free"} + // Declined is why the admin turned a person's request down, as the settings keep it: the networks + // share addresses with one here, they are not needed here, the person should talk to the admin + // first, or no reason given. Each page words it in its reader's language. + Declined = []string{"overlap", "unneeded", "talk", "plain"} + // ObfKeys are the AmneziaWG disguise options a server stores. + ObfKeys = []string{"jc", "jmin", "jmax", "s1", "s2", "s3", "s4", "h1", "h2", "h3", "h4", "i1", "i2", "i3", "i4", "i5", + "header_protection_key", "content_padding_addition", "rekey_after_time", "rekey_timeout", "reject_after_time", + "keepalive_timeout", "max_handshake_attempts", "random_trailers", "disable_cookies"} +) + +// circleColors is how many colours a circle may have. +const circleColors = 8 + +// Model is the whole of the settings. +type Model struct { + Settings Settings `json:"settings"` + Servers map[string]*Server `json:"servers"` + People map[string]*Person `json:"people"` + Devices map[string]*Device `json:"devices"` + Services map[string]*Service `json:"services"` + Circles map[string]*Circle `json:"circles"` + + // The ids in the file's order: what is done for each server, person or device is done in the order the + // admin made them, the same on every run. + serverIDs, personIDs, deviceIDs []string + circleIDs, serviceIDs []string +} + +// ServerIDs, PersonIDs and DeviceIDs are the ids in the file's order. +func (m *Model) ServerIDs() []string { return m.serverIDs } +func (m *Model) PersonIDs() []string { return m.personIDs } +func (m *Model) DeviceIDs() []string { return m.deviceIDs } + +// WithoutServers is the same settings with no server at all (what a teardown works from). +func (m *Model) WithoutServers() *Model { + out := *m + out.Servers, out.serverIDs = map[string]*Server{}, nil + return &out +} + +// CircleIDs and ServiceIDs are the circles and the services in the file's order: the order they are listed in. +func (m *Model) CircleIDs() []string { return m.circleIDs } +func (m *Model) ServiceIDs() []string { return m.serviceIDs } + +// Settings is the `settings` section. +type Settings struct { + PortalEnabled bool `json:"portal_enabled"` + PortalPort int `json:"portal_port"` + PortalHost string `json:"portal_host"` + PortalAlt []string `json:"portal_alt"` + PortalCert string `json:"portal_cert"` + PortalKey string `json:"portal_key"` + PortalRedirect string `json:"portal_redirect"` + DefaultDeviceLimit int `json:"default_device_limit"` + GeoEnabled bool `json:"geo_enabled"` + GeoProvider string `json:"geo_provider"` + Hostnames bool `json:"hostnames"` + Domain string `json:"domain"` + LogConnections bool `json:"log_connections"` + LogLevel string `json:"log_level"` + Watchdog bool `json:"watchdog"` + HomeDNSFallback string `json:"home_dns_fallback"` + Updates Updates `json:"updates"` + Retention Retention `json:"retention"` +} + +// Updates is when and what Dawnline updates on its own. +type Updates struct { + Check bool `json:"check"` + Interval string `json:"interval"` + Auto bool `json:"auto"` + Mode string `json:"mode"` + Time string `json:"time"` + Targets []string `json:"targets"` + Keep bool `json:"keep"` + Mirrors bool `json:"mirrors"` +} + +// Retention is how long the log and the traffic history are kept, as written: who applies it reads the +// values by their own rules. A value is a string, a list of strings, or nil when it is not set. +type Retention struct { + LogKeepDays any `json:"log_keep_days"` + LogMax any `json:"log_max"` + LogCategory any `json:"log_category"` + LogConnections any `json:"log_connections"` + LogPersist any `json:"log_persist"` + UsageKeepDays any `json:"usage_keep_days"` + UsageKeepMonths any `json:"usage_keep_months"` +} + +// Server is one AmneziaWG server. +type Server struct { + ID string `json:"id"` + Name string `json:"name"` + Ifname string `json:"ifname"` + Port int `json:"port"` + Subnet string `json:"subnet"` + Endpoint string `json:"endpoint"` + MTU int `json:"mtu"` // 0: worked out + DNS []string `json:"dns"` + Keepalive int `json:"keepalive"` + PrivateKey string `json:"private_key"` + PublicKey string `json:"public_key"` + Preset string `json:"preset"` + LanZone string `json:"lan_zone"` + WanZone string `json:"wan_zone"` + AutoWan bool `json:"auto_wan"` + WanDevice string `json:"wan_device"` + AutoLan bool `json:"auto_lan"` + LanDevices []string `json:"lan_devices"` + DetectedWan string `json:"detected_wan"` + DetectedLan string `json:"detected_lan"` + LanLike bool `json:"lan_like"` + Mesh string `json:"mesh"` + // PortalRouters and PortalNets are what people may do about routers on their own pages (see the lists). + PortalRouters string `json:"portal_routers"` + PortalNets string `json:"portal_nets"` + Enabled bool `json:"enabled"` + Obf map[string]string `json:"obf"` + DeviceMesh bool `json:"device_mesh"` + // Blocked: why the server is kept down (another tunnel has its interface's name), when it is. + Blocked any `json:"blocked,omitempty"` +} + +// Person is someone with access. +type Person struct { + ID string `json:"id"` + Server string `json:"server"` + Name string `json:"name"` + Access string `json:"access"` + DeviceLimit int `json:"device_limit"` + Code string `json:"code"` + CodeSet int `json:"code_set"` + Expires string `json:"expires"` + QuotaGB float64 `json:"quota_gb"` + QuotaPeriod string `json:"quota_period"` + Paused bool `json:"paused"` + DNSMode string `json:"dns_mode"` + BonusGB float64 `json:"bonus_gb"` + BonusUntil int `json:"bonus_until"` + Services []string `json:"services"` + HomeNets []string `json:"home_nets"` + Circle string `json:"circle"` + Note string `json:"note"` + Created int `json:"created"` + // Devices are the ids of the person's devices, in the file's order. + Devices []string `json:"devices"` +} + +// Device is one device of a person. +type Device struct { + ID string `json:"id"` + Person string `json:"person"` + Name string `json:"name"` + Kind string `json:"kind"` + Address string `json:"address"` + PublicKey string `json:"public_key"` + PrivateKey string `json:"private_key"` + PresharedKey string `json:"preshared_key"` + Created int `json:"created"` + CreatedBy string `json:"created_by"` + Disabled bool `json:"disabled"` + MTU int `json:"mtu"` // 0: the server's + // Keepalive is nil for the server's. + Keepalive *int `json:"keepalive"` + LanBypass bool `json:"lan_bypass"` + // Behind is the networks behind a router, as written: BehindOf tells which of them are in effect. + Behind []string `json:"behind,omitempty"` + // What its owner asked for on their own page and the admin has not answered: Waiting, the router itself + // (added there, it is no device of the tunnel until the admin takes it); Ask, networks behind it + // besides the ones it has; Asked, when (the later of the two). + Waiting bool `json:"waiting,omitempty"` + Ask []string `json:"ask,omitempty"` + Asked int `json:"asked,omitempty"` + // Declined is why the admin turned the last of that down ("": nothing is turned down), DeclinedNets + // the networks it was about (none: the router itself). The owner reads it until they clear it or ask again. + Declined string `json:"declined,omitempty"` + DeclinedNets []string `json:"declined_nets,omitempty"` +} + +// Circle is a group of people whose devices reach each other. +type Circle struct { + ID string `json:"id"` + Server string `json:"server"` + Name string `json:"name"` + Color int `json:"color"` +} + +// Service is something at home a person may be let reach. +type Service struct { + ID string `json:"id"` + Name string `json:"name"` + Address string `json:"address"` + Ports []string `json:"ports"` +} + +// Load builds the model from the parsed file. `blocked` is which servers are kept down and why +// (/var/run/dawnline/netifd-blocked.json: nil when there is none). +func Load(c *uci.Config, blocked map[string]any) *Model { + set := c.Section("settings") + if set == nil { + set = &uci.Section{Values: map[string]uci.Value{}} + } + m := &Model{ + Settings: settings(set), + Servers: map[string]*Server{}, People: map[string]*Person{}, Devices: map[string]*Device{}, + Services: map[string]*Service{}, Circles: map[string]*Circle{}, + } + for _, r := range c.OfType("server") { + id := r.Name + srv := &Server{ + ID: id, Name: text(r, "name", id), Ifname: text(r, "ifname", id), + Port: toInt(r, "port", 51820), Subnet: text(r, "subnet", ""), Endpoint: text(r, "endpoint", ""), + MTU: toInt(r, "mtu", 0), DNS: list(r, "dns"), Keepalive: toInt(r, "keepalive", 25), + PrivateKey: text(r, "private_key", ""), PublicKey: text(r, "public_key", ""), + Preset: text(r, "preset", "standard"), LanZone: text(r, "lan_zone", "lan"), WanZone: text(r, "wan_zone", "wan"), + AutoWan: truth(r, "auto_wan", true), WanDevice: text(r, "wan_device", ""), + AutoLan: truth(r, "auto_lan", true), LanDevices: list(r, "lan_device"), + DetectedWan: text(r, "detected_wan", ""), DetectedLan: text(r, "detected_lan", ""), + LanLike: truth(r, "lan_like", true), Enabled: truth(r, "enabled", true), Obf: map[string]string{}, + } + // Older files: device_mesh 0/1. + if mesh, _ := r.Get("mesh"); has(Mesh, mesh) { + srv.Mesh = mesh + } else if truth(r, "device_mesh", true) { + srv.Mesh = "all" + } else { + srv.Mesh = "off" + } + // a router and its networks are asked of the admin unless the admin said otherwise + srv.PortalRouters, srv.PortalNets = "ask", "ask" + if v, _ := r.Get("portal_routers"); has(PortalRouters, v) { + srv.PortalRouters = v + } + if v, _ := r.Get("portal_nets"); has(PortalNets, v) { + srv.PortalNets = v + } + for _, k := range ObfKeys { + if v, ok := r.Get(k); ok && v != "" { + srv.Obf[k] = v + } + } + srv.DeviceMesh = srv.Mesh != "off" + if why, kept := blocked[id]; kept && why != nil && why != false { + srv.Blocked = why + } + if _, twice := m.Servers[id]; !twice { + m.serverIDs = append(m.serverIDs, id) + } + m.Servers[id] = srv + } + for _, r := range c.OfType("person") { + id := r.Name + p := &Person{ + ID: id, Server: text(r, "server", ""), Name: text(r, "name", id), Access: "internet", + DeviceLimit: toInt(r, "device_limit", m.Settings.DefaultDeviceLimit), + Code: text(r, "code", ""), CodeSet: toInt(r, "code_set", 0), Expires: text(r, "expires", ""), + QuotaGB: num(r, "quota_gb", 0), QuotaPeriod: "month", Paused: truth(r, "paused", false), + DNSMode: "device", BonusGB: num(r, "bonus_gb", 0), + BonusUntil: toInt(r, "bonus_until", 0), Services: list(r, "service"), HomeNets: list(r, "home_net"), + Circle: text(r, "circle", ""), Note: text(r, "note", ""), Created: toInt(r, "created", 0), Devices: []string{}, + } + if a, _ := r.Get("access"); has(Access, a) { + p.Access = a + } + if v, _ := r.Get("quota_period"); v == "total" { + p.QuotaPeriod = "total" + } + if v, _ := r.Get("dns_mode"); v == "home" { + p.DNSMode = "home" + } + // Extra data from before limit months lasted until the 1st of the month after the one it was given in. + if p.BonusUntil == 0 { + month, _ := r.Get("bonus_month") + p.BonusUntil = monthEnd(month) + } + if _, twice := m.People[id]; !twice { + m.personIDs = append(m.personIDs, id) + } + m.People[id] = p + } + for _, r := range c.OfType("device") { + id := r.Name + d := &Device{ + ID: id, Person: text(r, "person", ""), Name: text(r, "name", id), Kind: "other", + Address: text(r, "address", ""), PublicKey: text(r, "public_key", ""), PrivateKey: text(r, "private_key", ""), + PresharedKey: text(r, "preshared_key", ""), Created: toInt(r, "created", 0), CreatedBy: text(r, "created_by", "admin"), + Disabled: truth(r, "disabled", false), MTU: toInt(r, "mtu", 0), LanBypass: truth(r, "lan_bypass", false), + } + if k, _ := r.Get("kind"); has(Kinds, k) { + d.Kind = k + } + if nets := list(r, "behind_net"); len(nets) > 0 { + d.Behind = nets + } + // a request is a router's: on anything else the lines mean nothing + if d.Kind == "router" { + d.Waiting = truth(r, "waiting", false) + if nets := list(r, "ask_net"); len(nets) > 0 { + d.Ask = nets + } + if d.Waiting || d.Ask != nil { + d.Asked = toInt(r, "asked", 0) + } + if v, _ := r.Get("declined"); v != "" { + d.Declined = "plain" + if has(Declined, v) { + d.Declined = v + } + if nets := list(r, "declined_net"); len(nets) > 0 { + d.DeclinedNets = nets + } + } + } + // Its own keep-alive, when it has one that is a number. + if v, ok := r.Get("keepalive"); ok && v != "" { + if n, isNumber := number(v); isNumber { + k := int(n) + d.Keepalive = &k + } + } + if _, twice := m.Devices[id]; !twice { + m.deviceIDs = append(m.deviceIDs, id) + } + m.Devices[id] = d + if p := m.People[d.Person]; p != nil { + p.Devices = append(p.Devices, id) + } + } + for _, r := range c.OfType("circle") { + id := r.Name + m.circleIDs = append(m.circleIDs, id) + m.Circles[id] = &Circle{ID: id, Server: text(r, "server", ""), Name: text(r, "name", id), Color: toInt(r, "color", 0) % circleColors} + } + for _, r := range c.OfType("service") { + id := r.Name + m.serviceIDs = append(m.serviceIDs, id) + m.Services[id] = &Service{ID: id, Name: text(r, "name", id), Address: text(r, "address", ""), Ports: list(r, "port")} + } + return m +} + +/* ---------- values, read as dawnline.core reads them ---------- */ + +func has(set []string, v string) bool { + for _, x := range set { + if x == v { + return true + } + } + return false +} + +// text is an option's string, or the default when it is not set. +func text(r *uci.Section, key, dflt string) string { + if v, ok := r.Get(key); ok { + return v + } + return dflt +} + +// A number as ucode reads one from a string: spaces round it, a sign, then a decimal (which begins with a +// digit) or 0x, 0b, 0o and their digits. Empty is zero. +var numeric = regexp.MustCompile(`^[+-]?(0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?)$`) + +func number(s string) (float64, bool) { + t := strings.TrimSpace(s) + if t == "" { + return 0, true + } + if !numeric.MatchString(t) { + return 0, false + } + sign, digits := 1.0, strings.TrimLeft(t, "+-") + if strings.HasPrefix(t, "-") { + sign = -1 + } + if len(digits) > 1 && digits[0] == '0' && strings.ContainsRune("xXbBoO", rune(digits[1])) { + base := map[byte]int{'x': 16, 'X': 16, 'b': 2, 'B': 2, 'o': 8, 'O': 8}[digits[1]] + n, err := strconv.ParseInt(digits[2:], base, 64) + return sign * float64(n), err == nil + } + f, err := strconv.ParseFloat(strings.TrimSuffix(digits, "."), 64) + return sign * f, err == nil +} + +// toInt is an option as a whole number (what is after the point is dropped), or the default when it is +// not set, empty or no number. +func toInt(r *uci.Section, key string, dflt int) int { + v, ok := r.Get(key) + if !ok || v == "" { + return dflt + } + n, isNumber := number(v) + if !isNumber { + return dflt + } + return int(n) +} + +func num(r *uci.Section, key string, dflt float64) float64 { + v, ok := r.Get(key) + if !ok || v == "" { + return dflt + } + n, isNumber := number(v) + if !isNumber { + return dflt + } + return n +} + +// truth is an option as yes or no: 1, true, yes and on are yes, anything else that is written is no. +func truth(r *uci.Section, key string, dflt bool) bool { + v, ok := r.Get(key) + if !ok || v == "" { + return dflt + } + return v == "1" || v == "true" || v == "yes" || v == "on" +} + +var separators = regexp.MustCompile(`[\s,]+`) + +// list is a list option's entries, or an option's string cut at spaces and commas. +func list(r *uci.Section, key string) []string { + v, ok := r.Values[key] + if !ok { + return []string{} + } + if v.IsList { + return append([]string{}, v.List...) + } + return separators.Split(strings.TrimSpace(v.Str), -1) +} + +var yearMonth = regexp.MustCompile(`^([0-9]{4})-([0-9]{2})$`) + +// monthEnd is the first moment after a calendar month ("YYYY-MM") in the router's time; 0 for anything else. +func monthEnd(month string) int { + g := yearMonth.FindStringSubmatch(month) + if g == nil { + return 0 + } + y, _ := strconv.Atoi(g[1]) + mon, _ := strconv.Atoi(g[2]) + return int(time.Date(y, time.Month(mon)+1, 1, 0, 0, 0, 0, zone.Local()).Unix()) +} diff --git a/backend/model/model_test.go b/backend/model/model_test.go new file mode 100644 index 0000000..6c6ba13 --- /dev/null +++ b/backend/model/model_test.go @@ -0,0 +1,103 @@ +package model + +import ( + "encoding/json" + "os" + "path/filepath" + "reflect" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// Each fixture read by this model is what the ucode model read of it (the *.json beside it, written by +// scripts/ucode-golden.sh in an OpenWrt container whose clock is UTC). +func TestHeldToUcode(t *testing.T) { + zone.Set(time.UTC) + files, _ := filepath.Glob("testdata/*.uci") + if len(files) < 2 { + t.Fatalf("fixtures: %v", files) + } + for _, f := range files { + text, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatalf("%s: %v", f, err) + } + mine, err := json.Marshal(Load(c, nil)) + if err != nil { + t.Fatal(err) + } + theirs, err := os.ReadFile(strings.TrimSuffix(f, ".uci") + ".json") + if err != nil { + t.Fatal(err) + } + var got, want any + json.Unmarshal(mine, &got) + if err := json.Unmarshal(theirs, &want); err != nil { + t.Fatalf("%s: the golden is not JSON: %v", f, err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: read differently than ucode reads it:\n%s", f, strings.Join(differ("", got, want), "\n")) + } + } +} + +// differ names where two documents part, so a failure says which field. +func differ(path string, got, want any) []string { + g, gok := got.(map[string]any) + w, wok := want.(map[string]any) + if gok && wok { + var out []string + for k := range w { + if _, has := g[k]; !has { + out = append(out, path+"."+k+": missing, ucode has "+show(w[k])) + } + } + for k, v := range g { + if _, has := w[k]; !has { + out = append(out, path+"."+k+": "+show(v)+", ucode has none") + continue + } + out = append(out, differ(path+"."+k, v, w[k])...) + } + return out + } + if reflect.DeepEqual(got, want) { + return nil + } + return []string{path + ": " + show(got) + ", ucode has " + show(want)} +} + +func show(v any) string { + b, _ := json.Marshal(v) + return string(b) +} + +func TestNumbersAsUcodeReadsThem(t *testing.T) { + for s, want := range map[string]float64{" 90 ": 90, "0x10": 16, "1e3": 1000, "1.9": 1.9, "-3": -3, "": 0, "010": 10, "+5": 5, "5.": 5, "0b11": 3, "0o17": 15, "-1.9": -1.9} { + if got, ok := number(s); !ok || got != want { + t.Errorf("%q: %v %v, want %v", s, got, ok, want) + } + } + for _, s := range []string{"12abc", "1 2", ".5", "Infinity", "auto"} { + if _, ok := number(s); ok { + t.Errorf("%q read as a number", s) + } + } +} + +// A server another tunnel keeps down says why. +func TestBlocked(t *testing.T) { + c, _ := uci.Parse("config server 'home'\nconfig server 'cabin'\n") + m := Load(c, map[string]any{"cabin": "another tunnel has its name"}) + if m.Servers["home"].Blocked != nil || m.Servers["cabin"].Blocked != "another tunnel has its name" { + t.Fatalf("blocked: %v %v", m.Servers["home"].Blocked, m.Servers["cabin"].Blocked) + } +} diff --git a/backend/model/settings.go b/backend/model/settings.go new file mode 100644 index 0000000..cace5ff --- /dev/null +++ b/backend/model/settings.go @@ -0,0 +1,179 @@ +// The `settings` section read by its schema (dawnline.schema SETTINGS and get()): each setting has a type, +// a default and, for a number, a range; a value that is missing or not of its type reads as the default. +// The words the admin is told about a bad value stay with whoever saves settings; this only reads. + +package model + +import ( + "net/netip" + "regexp" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The update policy's choices (dawnline.updates). +var ( + updateIntervals = []string{"6h", "12h", "1d", "7d"} + updateTargets = []string{"app", "amneziawg", "packages"} +) + +func settings(s *uci.Section) Settings { + return Settings{ + PortalEnabled: flag(s, "portal_enabled", false), + PortalPort: ranged(s, "portal_port", 8443, 1, 65535), + PortalHost: word(s, "portal_host", ""), + PortalAlt: words(s, "portal_alt", []string{}), + PortalCert: word(s, "portal_cert", ""), + PortalKey: word(s, "portal_key", ""), + PortalRedirect: word(s, "portal_redirect", ""), + DefaultDeviceLimit: ranged(s, "default_device_limit", 3, 1, 32), + // Off until the admin turns it on: lookups send people's addresses to a third party. + GeoEnabled: flag(s, "geo_enabled", false), + GeoProvider: choice(s, "geo_provider", "ipwho.is", []string{"ipwho.is", "ipapi.co"}), + Hostnames: flag(s, "hostnames", true), + Domain: word(s, "domain", "lan"), + LogConnections: flag(s, "log_connections", true), + LogLevel: choice(s, "log_level", "info", []string{"error", "warn", "info", "debug"}), + Watchdog: flag(s, "watchdog", true), + // Written as "none" for no fallback; not set means the default. + HomeDNSFallback: fallbackDNS(s), + Updates: updates(s), + Retention: Retention{ + LogKeepDays: raw(s, "log_keep_days"), LogMax: raw(s, "log_max"), LogCategory: raw(s, "log_category"), + LogConnections: raw(s, "log_connections"), LogPersist: raw(s, "log_persist"), + UsageKeepDays: raw(s, "usage_keep_days"), UsageKeepMonths: raw(s, "usage_keep_months"), + }, + } +} + +// raw is a value as it is written: a string, a list, or nil. +func raw(s *uci.Section, key string) any { + v, ok := s.Values[key] + switch { + case !ok: + return nil + case v.IsList: + return append([]string{}, v.List...) + } + return v.Str +} + +// flag is a yes or no (schema's: 1 on true yes enabled, 0 off false no disabled, any case; else the default). +func flag(s *uci.Section, key string, dflt bool) bool { + v, _ := s.Get(key) + switch strings.ToLower(strings.TrimSpace(v)) { + case "1", "on", "true", "yes", "enabled": + return true + case "0", "off", "false", "no", "disabled": + return false + } + return dflt +} + +var wholeNumber = regexp.MustCompile(`^-?[0-9]{1,9}$`) + +// ranged is a whole number within its range, or the default. +func ranged(s *uci.Section, key string, dflt, lo, hi int) int { + v, _ := s.Get(key) + v = strings.TrimSpace(v) + if !wholeNumber.MatchString(v) { + return dflt + } + n, _ := strconv.Atoi(v) + if n < lo || n > hi { + return dflt + } + return n +} + +// word is a string setting, or the default when it is not set or empty. +func word(s *uci.Section, key, dflt string) string { + if v, ok := s.Get(key); ok && v != "" { + return v + } + return dflt +} + +// words is a list setting without its empty entries (one written as an option is a list of one). +func words(s *uci.Section, key string, dflt []string) []string { + v, ok := s.Values[key] + if !ok { + return dflt + } + in := v.List + if !v.IsList { + in = []string{v.Str} + } + out := []string{} + for _, x := range in { + if x != "" { + out = append(out, x) + } + } + return out +} + +func choice(s *uci.Section, key, dflt string, values []string) string { + if v, ok := s.Get(key); ok && has(values, v) { + return v + } + return dflt +} + +func fallbackDNS(s *uci.Section) string { + v, ok := s.Get("home_dns_fallback") + switch { + case !ok || v == "": + return "1.1.1.1" + case v == "none": + return "" + } + if a, err := netip.ParseAddr(v); err == nil && a.Is4() { + return v + } + return "1.1.1.1" +} + +// on is the update policy's yes or no (dawnline.updates: 1 true on yes; anything else written is no). +func on(s *uci.Section, key string, dflt bool) bool { + v, ok := s.Get(key) + if !ok || v == "" { + return dflt + } + return v == "1" || v == "true" || v == "on" || v == "yes" +} + +var clock = regexp.MustCompile(`^([01]?[0-9]|2[0-3]):[0-5][0-9]$`) + +func updates(s *uci.Section) Updates { + u := Updates{ + Check: on(s, "update_check", true), Interval: "1d", Auto: on(s, "update_auto", true), Mode: "scheduled", + Time: "04:00", Keep: on(s, "update_keep", false), Mirrors: on(s, "update_mirrors", true), + // AmneziaWG is left out by default: a new kernel module restarts every tunnel. + Targets: []string{"app", "packages"}, + } + if v, _ := s.Get("update_interval"); has(updateIntervals, v) { + u.Interval = v + } + if v, _ := s.Get("update_mode"); v == "immediate" { + u.Mode = "immediate" + } + if v, _ := s.Get("update_time"); clock.MatchString(v) { + u.Time = v + } + if v, ok := s.Values["update_targets"]; ok && (v.IsList || v.Str != "") { + in := v.List + if !v.IsList { + in = []string{v.Str} + } + u.Targets = []string{} + for _, x := range in { + if has(updateTargets, x) { + u.Targets = append(u.Targets, x) + } + } + } + return u +} diff --git a/backend/model/testdata/rich.json b/backend/model/testdata/rich.json new file mode 100644 index 0000000..151d38f --- /dev/null +++ b/backend/model/testdata/rich.json @@ -0,0 +1,288 @@ +{ + "settings": { + "portal_enabled": true, + "portal_port": 8443, + "portal_host": "vpn.example.com", + "portal_alt": [ + "alt.example.com", + "203.0.113.7" + ], + "portal_cert": "", + "portal_key": "", + "portal_redirect": "https://example.com/", + "default_device_limit": 5, + "geo_enabled": true, + "geo_provider": "ipwho.is", + "hostnames": false, + "domain": "home.arpa", + "log_connections": true, + "log_level": "debug", + "watchdog": false, + "home_dns_fallback": "", + "updates": { + "check": false, + "interval": "12h", + "auto": true, + "mode": "immediate", + "time": "04:00", + "targets": [ + "app", + "amneziawg" + ], + "keep": true, + "mirrors": true + }, + "retention": { + "log_keep_days": "14", + "log_max": "50", + "log_category": [ + "connections", + "problems" + ], + "log_connections": null, + "log_persist": "10min", + "usage_keep_days": " 90 ", + "usage_keep_months": "many" + } + }, + "servers": { + "home": { + "id": "home", + "name": "Home", + "ifname": "dawn0", + "port": 4500, + "subnet": "10.77.0.0/24", + "endpoint": "vpn.example.com", + "mtu": 0, + "dns": [ + "10.77.0.1", + "1.1.1.1" + ], + "keepalive": 0, + "private_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "public_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "preset": "quiet", + "lan_zone": "lan", + "wan_zone": "wan", + "auto_wan": false, + "wan_device": "pppoe-wan", + "auto_lan": true, + "lan_devices": [ + "br-lan", + "br-guest" + ], + "detected_wan": "", + "detected_lan": "", + "lan_like": false, + "mesh": "circles", + "portal_routers": "ask", + "portal_nets": "ask", + "enabled": true, + "obf": { + "jc": "5", + "jmin": "11", + "jmax": "42", + "s1": "12", + "h1": "1", + "i1": "", + "header_protection_key": "yvVKA41To0000000000000000000IUdcl4ZiyFE=", + "rekey_after_time": "100-120", + "random_trailers": "on" + }, + "device_mesh": true + }, + "cabin": { + "id": "cabin", + "name": "cabin", + "ifname": "cabin", + "port": 51820, + "subnet": "", + "endpoint": "", + "mtu": 0, + "dns": [ + "9.9.9.9", + "149.112.112.112" + ], + "keepalive": 25, + "private_key": "", + "public_key": "", + "preset": "standard", + "lan_zone": "lan", + "wan_zone": "wan", + "auto_wan": true, + "wan_device": "", + "auto_lan": true, + "lan_devices": [ + ], + "detected_wan": "", + "detected_lan": "", + "lan_like": true, + "mesh": "off", + "portal_routers": "ask", + "portal_nets": "ask", + "enabled": false, + "obf": { + }, + "device_mesh": false + } + }, + "people": { + "anna": { + "id": "anna", + "server": "home", + "name": "Anna", + "access": "both", + "device_limit": 2, + "code": "abcdef-ghijkl-mnopqr", + "code_set": 1790000000, + "expires": "2026-12-31", + "quota_gb": 1.5, + "quota_period": "total", + "paused": false, + "dns_mode": "home", + "bonus_gb": 20, + "bonus_until": 1795000000, + "services": [ + "nas" + ], + "home_nets": [ + "br-lan" + ], + "circle": "family", + "note": "A note, with a comma", + "created": 1780000000, + "devices": [ + "d_1", + "d_2" + ] + }, + "boris": { + "id": "boris", + "server": "cabin", + "name": "boris", + "access": "internet", + "device_limit": 5, + "code": "", + "code_set": 0, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "paused": true, + "dns_mode": "device", + "bonus_gb": 0, + "bonus_until": 1798761600, + "services": [ + "nas", + "printer" + ], + "home_nets": [ + ], + "circle": "", + "note": "", + "created": 0, + "devices": [ + ] + }, + "nobody": { + "id": "nobody", + "server": "", + "name": "nobody", + "access": "internet", + "device_limit": 5, + "code": "", + "code_set": 0, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "paused": false, + "dns_mode": "device", + "bonus_gb": 0, + "bonus_until": 0, + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "note": "", + "created": 0, + "devices": [ + ] + } + }, + "devices": { + "d_1": { + "id": "d_1", + "person": "anna", + "name": "Phone", + "kind": "phone", + "address": "10.77.0.2", + "public_key": "u4pL0000000000000000000000000000DyRrogDM=", + "private_key": "", + "preshared_key": "Yc0000000000000000000000000000bRABGUovbrNy4=", + "created": 1780000100, + "created_by": "portal", + "disabled": false, + "mtu": 1280, + "keepalive": 0, + "lan_bypass": true + }, + "d_2": { + "id": "d_2", + "person": "anna", + "name": "d_2", + "kind": "other", + "address": "", + "public_key": "", + "private_key": "", + "preshared_key": "", + "created": 0, + "created_by": "admin", + "disabled": true, + "mtu": 0, + "keepalive": null, + "lan_bypass": false + }, + "d_3": { + "id": "d_3", + "person": "gone", + "name": "Orphan", + "kind": "router", + "address": "", + "public_key": "", + "private_key": "", + "preshared_key": "", + "created": 0, + "created_by": "admin", + "disabled": false, + "mtu": 0, + "keepalive": 60, + "lan_bypass": false + } + }, + "services": { + "nas": { + "id": "nas", + "name": "NAS", + "address": "192.168.1.10", + "ports": [ + "445", + "8080-8090" + ] + }, + "printer": { + "id": "printer", + "name": "printer", + "address": "192.168.1.20", + "ports": [ + ] + } + }, + "circles": { + "family": { + "id": "family", + "server": "home", + "name": "Family", + "color": 3 + } + } +} diff --git a/backend/model/testdata/rich.uci b/backend/model/testdata/rich.uci new file mode 100644 index 0000000..916fa1a --- /dev/null +++ b/backend/model/testdata/rich.uci @@ -0,0 +1,139 @@ +# A fuller installation, with what older versions wrote and what a hand has broken: the Go model +# (backend/model) must read it exactly as the ucode one does (scripts/ucode-golden.sh writes rich.json). + +config settings 'settings' + option portal_enabled 'yes' + option portal_port '99999' + option portal_host 'vpn.example.com' + list portal_alt 'alt.example.com' + list portal_alt '' + list portal_alt '203.0.113.7' + option portal_redirect 'https://example.com/' + option default_device_limit '5' + option hostnames 'off' + option domain 'home.arpa' + option geo_enabled 'TRUE' + option geo_provider 'nowhere' + option log_level 'debug' + option watchdog '0' + option log_keep_days '14' + option log_max '50' + option log_persist '10min' + list log_category 'connections' + list log_category 'problems' + option usage_keep_days ' 90 ' + option usage_keep_months 'many' + option home_dns_fallback 'none' + option update_check '0' + option update_interval '12h' + option update_auto 'on' + option update_mode 'immediate' + option update_time '25:00' + list update_targets 'app' + list update_targets 'firmware' + list update_targets 'amneziawg' + option update_keep '1' + +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option endpoint 'vpn.example.com' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' + option mtu 'auto' + list dns '10.77.0.1' + list dns '1.1.1.1' + option keepalive '0' + option preset 'quiet' + option auto_wan '0' + option wan_device 'pppoe-wan' + list lan_device 'br-lan' + list lan_device 'br-guest' + option lan_like '0' + option mesh 'circles' + option jc '5' + option jmin '11' + option jmax '42' + option s1 '12' + option h1 '1' + option i1 '' + option header_protection_key 'yvVKA41To0000000000000000000IUdcl4ZiyFE=' + option rekey_after_time '100-120' + option random_trailers 'on' + +config server 'cabin' + option port 'x' + option dns '9.9.9.9, 149.112.112.112' + option device_mesh '0' + option enabled '0' + option mesh 'everyone' + +config person 'anna' + option server 'home' + option name 'Anna' + option access 'both' + option device_limit '2' + option code 'abcdef-ghijkl-mnopqr' + option code_set '1790000000' + option expires '2026-12-31' + option quota_gb '1.5' + option quota_period 'total' + option dns_mode 'home' + option bonus_gb '20' + option bonus_until '1795000000' + list service 'nas' + list home_net 'br-lan' + option circle 'family' + option note 'A note, with a comma' + option created '1780000000' + +config person 'boris' + option server 'cabin' + option access 'everything' + option paused '1' + option quota_gb 'lots' + option bonus_month '2026-12' + option service 'nas printer' + +config person 'nobody' + +config device 'd_1' + option person 'anna' + option name 'Phone' + option kind 'phone' + option address '10.77.0.2' + option public_key 'u4pL0000000000000000000000000000DyRrogDM=' + option preshared_key 'Yc0000000000000000000000000000bRABGUovbrNy4=' + option created '1780000100' + option created_by 'portal' + option mtu '1280' + option keepalive '0' + option lan_bypass '1' + +config device 'd_2' + option person 'anna' + option kind 'toaster' + option disabled 'yes' + option keepalive 'often' + +config device 'd_3' + option person 'gone' + option name 'Orphan' + option kind 'router' + option keepalive '60' + +config circle 'family' + option server 'home' + option name 'Family' + option color '11' + +config service 'nas' + option name 'NAS' + option address '192.168.1.10' + list port '445' + list port '8080-8090' + +config service 'printer' + option address '192.168.1.20' diff --git a/backend/model/testdata/small.json b/backend/model/testdata/small.json new file mode 100644 index 0000000..3196cd6 --- /dev/null +++ b/backend/model/testdata/small.json @@ -0,0 +1,155 @@ +{ + "settings": { + "portal_enabled": true, + "portal_port": 8443, + "portal_host": "vpn.example.com", + "portal_alt": [ + ], + "portal_cert": "", + "portal_key": "", + "portal_redirect": "", + "default_device_limit": 3, + "geo_enabled": false, + "geo_provider": "ipwho.is", + "hostnames": true, + "domain": "lan", + "log_connections": false, + "log_level": "info", + "watchdog": true, + "home_dns_fallback": "1.1.1.1", + "updates": { + "check": true, + "interval": "7d", + "auto": true, + "mode": "scheduled", + "time": "04:00", + "targets": [ + "app" + ], + "keep": false, + "mirrors": true + }, + "retention": { + "log_keep_days": null, + "log_max": null, + "log_category": null, + "log_connections": "0", + "log_persist": null, + "usage_keep_days": null, + "usage_keep_months": null + } + }, + "servers": { + "main": { + "id": "main", + "name": "Main", + "ifname": "awgmain", + "port": 51820, + "subnet": "10.9.0.0/29", + "endpoint": "", + "mtu": 1380, + "dns": [ + ], + "keepalive": 25, + "private_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=", + "public_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=", + "preset": "standard", + "lan_zone": "lan", + "wan_zone": "wan", + "auto_wan": true, + "wan_device": "", + "auto_lan": true, + "lan_devices": [ + ], + "detected_wan": "", + "detected_lan": "", + "lan_like": true, + "mesh": "all", + "portal_routers": "ask", + "portal_nets": "ask", + "enabled": true, + "obf": { + "jc": "4", + "jmin": "64", + "jmax": "128", + "s4": "12" + }, + "device_mesh": true + } + }, + "people": { + "alice": { + "id": "alice", + "server": "main", + "name": "Alice", + "access": "both", + "device_limit": 3, + "code": "abcdef-ghijkl-mnopqr", + "code_set": 0, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "paused": false, + "dns_mode": "device", + "bonus_gb": 0, + "bonus_until": 0, + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "note": "", + "created": 0, + "devices": [ + "alice_phone" + ] + }, + "bob": { + "id": "bob", + "server": "main", + "name": "Bob", + "access": "internet", + "device_limit": 3, + "code": "XyZ12345", + "code_set": 0, + "expires": "", + "quota_gb": 2, + "quota_period": "month", + "paused": false, + "dns_mode": "device", + "bonus_gb": 0, + "bonus_until": 0, + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "note": "", + "created": 0, + "devices": [ + ] + } + }, + "devices": { + "alice_phone": { + "id": "alice_phone", + "person": "alice", + "name": "Phone", + "kind": "phone", + "address": "10.9.0.2", + "public_key": "AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8=", + "private_key": "", + "preshared_key": "", + "created": 0, + "created_by": "admin", + "disabled": false, + "mtu": 0, + "keepalive": null, + "lan_bypass": false + } + }, + "services": { + }, + "circles": { + } +} diff --git a/tests/ucode/fixtures/config/dawnline b/backend/model/testdata/small.uci similarity index 100% rename from tests/ucode/fixtures/config/dawnline rename to backend/model/testdata/small.uci diff --git a/backend/model/timing.go b/backend/model/timing.go new file mode 100644 index 0000000..ae77d97 --- /dev/null +++ b/backend/model/timing.go @@ -0,0 +1,174 @@ +// What follows from the settings about time and tunnels: a device's keep-alive, how long it may go +// between two handshakes, how long after one it still counts as online, and which tunnel a server has. +// As dawnline.core, dawnline.awg and dawnline.live work them out (tests/ucode/awg.test.uc has the cases +// these are held to). Pure: the settings in, numbers out. + +package model + +import ( + "net/netip" + "regexp" + "strconv" + "strings" +) + +const ( + // OnlineWindow is how long after its handshake a device counts as online, at the least: a WireGuard + // session is dropped 180 s after its handshake and a device that is there renews it every 2 minutes + // (a little slack for a renewal that needs a retry). + OnlineWindow = 190 + // SleepWindow is the same for a phone or a tablet: asleep, its system holds the tunnel's timers and its + // session lapses for minutes and comes back by itself. That silence is sleep, not leaving. + SleepWindow = 600 + // A device's own keep-alive is taken within this range (seconds; 0 is off). + keepaliveMax = 600 +) + +// DeviceKeepalive is the keep-alive a device's configuration carries, in seconds (0: off): its own when the +// admin set one, else the server's. +func DeviceKeepalive(srv *Server, dev *Device) int { + if dev != nil && dev.Keepalive != nil && *dev.Keepalive >= 0 && *dev.Keepalive <= keepaliveMax { + return *dev.Keepalive + } + return srv.Keepalive +} + +// KeepaliveRange is that keep-alive as the device sends it, lo to hi seconds; ok is false when it is off. +// With header protection (AmneziaWG 3.1, whose apps take ranges) it is jittered over ten seconds, since a +// fixed beat would be the one regular thing left. +func KeepaliveRange(srv *Server, dev *Device) (lo, hi int, ok bool) { + k := DeviceKeepalive(srv, dev) + if k <= 0 { + return 0, 0, false + } + if srv.Obf["header_protection_key"] != "" { + return k, k + 10, true + } + return k, k, true +} + +// IdleHandshake is the longest an idle device goes between two handshakes, in seconds; ok is false when +// its keep-alive is off (an idle device then sends nothing at all). Its keep-alives are what it sends, and +// the first one after its key's rekey time (WireGuard's 120 s; past 180 s the key is refused anyway) +// starts a handshake: up to one keep-alive past that time, or each keep-alive once they are further apart. +func IdleHandshake(srv *Server, dev *Device) (int, bool) { + lo, hi, ok := KeepaliveRange(srv, dev) + if !ok { + return 0, false + } + rekey := 120 + if _, top, given := uintRange(srv.Obf["rekey_after_time"], 65535); given && top != 0 { + rekey = top + } + rekey = min(rekey, 180) + if lo > rekey { + return hi, true + } + return rekey + hi, true +} + +// OnlineWindowOf is how long after its last handshake a device still counts as online, in seconds: +// OnlineWindow, or 30 s more than an idle device goes between handshakes when that is longer (it renews +// its session only with its keep-alive, and a fixed window would see it leave and come back between two). +// A phone or a tablet never less than SleepWindow. +func OnlineWindowOf(srv *Server, dev *Device) int { + w := OnlineWindow + if srv != nil { + if h, ok := IdleHandshake(srv, dev); ok { + w = max(w, h+30) + } + } + if dev != nil && has(MobileKinds, dev.Kind) { + w = max(w, SleepWindow) + } + return w +} + +// uintOf is a whole number as AmneziaWG writes one, up to top. +func uintOf(s string, top int) (int, bool) { + if s == "" || len(s) > 10 { + return 0, false + } + for i := 0; i < len(s); i++ { + if s[i] < '0' || s[i] > '9' { + return 0, false + } + } + n, err := strconv.Atoi(s) + return n, err == nil && n <= top +} + +// uintRange is a number or a range as AmneziaWG writes them ("5", "5-15"), each end up to top. +func uintRange(v string, top int) (lo, hi int, ok bool) { + p := strings.Split(strings.TrimSpace(v), "-") + if len(p) > 2 { + return 0, 0, false + } + lo, ok = uintOf(p[0], top) + if !ok { + return 0, 0, false + } + hi = lo + if len(p) == 2 { + if hi, ok = uintOf(p[1], top); !ok { + return 0, 0, false + } + } + return lo, hi, lo <= hi +} + +// Tunnel is a server's link. +type Tunnel struct { + Ifname string + Subnet string + // Address is the router's own in the tunnel: the subnet's first. + Address string +} + +var ifname = regexp.MustCompile(`^[a-z][a-z0-9_]{0,11}$`) + +// ValidIfname tells a server's interface name: also a netifd section and an nftables string, so nothing else. +func ValidIfname(s string) bool { return ifname.MatchString(s) } + +// TunnelOf is the server's tunnel: it has one when it has its keys, is not kept down, and its interface's +// name and subnet are usable. +func TunnelOf(srv *Server) (Tunnel, bool) { + if srv == nil || srv.PrivateKey == "" || srv.Blocked != nil || !ValidIfname(srv.Ifname) { + return Tunnel{}, false + } + p, ok := parseCIDR(srv.Subnet) + if !ok { + return Tunnel{}, false + } + return Tunnel{Ifname: srv.Ifname, Subnet: srv.Subnet, Address: p.Masked().Addr().Next().String()}, true +} + +// TunnelIfnames is the interfaces of the servers that run: turned on, with a tunnel that is Dawnline's. +// What the tunnels' reader is asked for. +func (m *Model) TunnelIfnames() []string { + out := []string{} + for _, id := range m.serverIDs { + srv := m.Servers[id] + if !srv.Enabled { + continue + } + if t, ok := TunnelOf(srv); ok { + out = append(out, t.Ifname) + } + } + return out +} + +var cidr = regexp.MustCompile(`^[0-9.]+/[0-9]+$`) + +// parseCIDR reads "a.b.c.d/len" with a prefix a tunnel can have (8 to 30). +func parseCIDR(s string) (netip.Prefix, bool) { + if !cidr.MatchString(s) { + return netip.Prefix{}, false + } + p, err := netip.ParsePrefix(s) + if err != nil || !p.Addr().Is4() || p.Bits() < 8 || p.Bits() > 30 { + return netip.Prefix{}, false + } + return p, true +} diff --git a/backend/model/timing_test.go b/backend/model/timing_test.go new file mode 100644 index 0000000..25bad49 --- /dev/null +++ b/backend/model/timing_test.go @@ -0,0 +1,90 @@ +package model + +import "testing" + +func ka(n int) *Device { return &Device{Keepalive: &n} } + +// The cases of tests/ucode/awg.test.uc («keepalive_range and idle_handshake») and live.test.uc's windows. +func TestKeepaliveAndIdleHandshake(t *testing.T) { + srv := &Server{Keepalive: 25, Obf: map[string]string{}} + jittered := &Server{Keepalive: 25, Obf: map[string]string{"header_protection_key": "k", "rekey_after_time": "100-120"}} + rng := func(s *Server, d *Device) [3]int { + lo, hi, ok := KeepaliveRange(s, d) + if !ok { + return [3]int{-1, -1, 0} + } + return [3]int{lo, hi, 1} + } + for name, c := range map[string]struct { + got, want [3]int + }{ + "the server's, no range": {rng(srv, &Device{}), [3]int{25, 25, 1}}, + "the device's own": {rng(srv, ka(120)), [3]int{120, 120, 1}}, + "off for the device": {rng(srv, ka(0)), [3]int{-1, -1, 0}}, + "off on the server": {rng(&Server{Obf: map[string]string{}}, &Device{}), [3]int{-1, -1, 0}}, + "jittered with 3.1": {rng(jittered, &Device{}), [3]int{25, 35, 1}}, + "the device's own, jittered": {rng(jittered, ka(60)), [3]int{60, 70, 1}}, + "out of range: the server's own": {rng(srv, ka(9999)), [3]int{25, 25, 1}}, + } { + if c.got != c.want { + t.Errorf("%s: %v, want %v", name, c.got, c.want) + } + } + idle := func(s *Server, d *Device) int { + h, ok := IdleHandshake(s, d) + if !ok { + return -1 + } + return h + } + for name, c := range map[string][2]int{ + "within the rekey time: up to one keep-alive past it": {idle(srv, &Device{}), 145}, + "Maximum: RekeyAfterTime 100-120, keep-alive up to 35": {idle(jittered, &Device{}), 155}, + "every second keep-alive": {idle(srv, ka(100)), 220}, + "every keep-alive once they are further apart": {idle(srv, ka(300)), 300}, + "past 180 s the key is refused anyway": {idle(&Server{Keepalive: 25, Obf: map[string]string{"rekey_after_time": "200-400"}}, &Device{}), 205}, + "keep-alive off": {idle(srv, ka(0)), -1}, + } { + if c[0] != c[1] { + t.Errorf("%s: %d, want %d", name, c[0], c[1]) + } + } +} + +func TestOnlineWindow(t *testing.T) { + srv := &Server{Keepalive: 25, Obf: map[string]string{}} + for name, c := range map[string][2]int{ + "a computer with the usual keep-alive": {OnlineWindowOf(srv, &Device{Kind: "computer"}), 190}, + "a long keep-alive: 30 s past its next handshake": {OnlineWindowOf(srv, &Device{Kind: "computer", Keepalive: ka(300).Keepalive}), 330}, + "a phone sleeps": {OnlineWindowOf(srv, &Device{Kind: "phone"}), 600}, + "a tablet too": {OnlineWindowOf(srv, &Device{Kind: "tablet"}), 600}, + "no server": {OnlineWindowOf(nil, &Device{Kind: "router"}), 190}, + } { + if c[0] != c[1] { + t.Errorf("%s: %d, want %d", name, c[0], c[1]) + } + } +} + +func TestTunnels(t *testing.T) { + good := &Server{ID: "home", Ifname: "dawn0", Subnet: "10.77.0.0/24", PrivateKey: "k", Enabled: true} + if tn, ok := TunnelOf(good); !ok || tn.Address != "10.77.0.1" || tn.Ifname != "dawn0" { + t.Fatalf("tunnel: %+v %v", tn, ok) + } + for name, s := range map[string]*Server{ + "no keys": {Ifname: "dawn0", Subnet: "10.77.0.0/24"}, + "kept down": {Ifname: "dawn0", Subnet: "10.77.0.0/24", PrivateKey: "k", Blocked: "taken"}, + "a bad name": {Ifname: "Dawn-0", Subnet: "10.77.0.0/24", PrivateKey: "k"}, + "no subnet": {Ifname: "dawn0", PrivateKey: "k"}, + "a host, not a net": {Ifname: "dawn0", Subnet: "10.77.0.1", PrivateKey: "k"}, + "too small a subnet": {Ifname: "dawn0", Subnet: "10.77.0.0/31", PrivateKey: "k"}, + } { + if _, ok := TunnelOf(s); ok { + t.Errorf("%s: has a tunnel", name) + } + } + m := &Model{Servers: map[string]*Server{"home": good, "off": {Ifname: "dawn1", Subnet: "10.78.0.0/24", PrivateKey: "k"}}, serverIDs: []string{"off", "home"}} + if got := m.TunnelIfnames(); len(got) != 1 || got[0] != "dawn0" { + t.Fatalf("ifnames: %v", got) + } +} diff --git a/backend/netview/netview.go b/backend/netview/netview.go new file mode 100644 index 0000000..a90ad44 --- /dev/null +++ b/backend/netview/netview.go @@ -0,0 +1,524 @@ +// Package netview is the router's own networks: which interfaces there are, which is the WAN, which the +// LAN, and what a server's and a person's "home" reaches. As dawnline.net (snapshot, server_net) and +// dawnline.core (person_home) work them out: a device's configuration lists these networks, so the two +// backends must name the same ones. +// +// What it reads of the system comes through Sources, so a test hands in what a router said. +package netview + +import ( + "encoding/json" + "os" + "os/exec" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Links Dawnline makes itself: never interfaces to offer. +const transit, inner = "dlx0", "dll0" + +var ( + vpnProtos = []string{"amneziawg", "wireguard", "openvpn", "openconnect", "vpnc", "pptp", "l2tp", "gre", "gretap", "vti", "xfrm"} + vpnNames = regexp.MustCompile(`^(wg|awg|tun|tap|ovpn|ipsec|vti|xfrm)`) + notWanProto = []string{"amneziawg", "wireguard", "openvpn", "openconnect", "vpnc"} + notWanNames = regexp.MustCompile(`^(wg|awg|tun|tap|ovpn)`) + noise = regexp.MustCompile(`^(ifb|teql|sit|ip6tnl|gre|gretap|erspan|ip6gre|ip6gretap|ip_vti|ip6_vti|tunl|bond)[0-9]*$`) + private = []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10"} +) + +// Link is what the system says of one interface. +type Link struct { + Flags int64 `json:"flags"` + Type int `json:"type"` + Master string `json:"master"` + Bridge bool `json:"bridge"` + Wifi bool `json:"wifi"` +} + +// Logical is a netifd interface on a device. +type Logical struct { + Name string `json:"name"` + Proto string `json:"proto"` +} + +// Sources is where a snapshot reads the system. +type Sources struct { + // Routes is `ip -j -4 route show table main`'s answer. + Routes func() []byte + // Addrs is `ip -j -4 addr show`'s answer (nil: no addresses are read). + Addrs func() []byte + // Links is every interface by name; Logical the netifd interface on each device. + Links func() map[string]Link + Logical func() map[string]Logical + // Zones is the firewall's zones (nil: none are read). + Zones func() Zones +} + +// Device is an interface as Dawnline sees it. +type Device struct { + Name string `json:"name"` + // Category is what it is to the admin: wan (the one the default route leaves by), wifi, vpn, ethernet, + // other. Kind is the same but for a bridge, which is "bridge", and for the WAN, which keeps its own. + Category string `json:"category"` + Kind string `json:"kind"` + Up bool `json:"up"` + // Master is the bridge it is a port of; Members a bridge's ports. + Master string `json:"master"` + Members []string `json:"members"` + Nets []string `json:"nets"` + // Addrs is its IPv4 addresses ("192.0.2.7/24"), when they were read. + Addrs []string `json:"addrs"` + // Logical is the netifd interface on it and Proto that one's protocol; Zone its firewall zone ("": none). + Logical string `json:"logical"` + Proto string `json:"proto"` + Zone string `json:"zone"` +} + +// Zones is the firewall's zones: every name, and the zone of each network and each device named in one. +type Zones struct { + Names []string + ByNet, ByDev map[string]string +} + +// ZonesOf reads the zones of a firewall configuration, the first zone that names a network or device winning. +func ZonesOf(fw *uci.Config) Zones { + z := Zones{ByNet: map[string]string{}, ByDev: map[string]string{}} + if fw == nil { + return z + } + for _, s := range fw.OfType("zone") { + name, _ := s.Get("name") + if name == "" { + continue + } + z.Names = append(z.Names, name) + for key, into := range map[string]map[string]string{"network": z.ByNet, "device": z.ByDev} { + v := s.Values[key] + list := v.List + if !v.IsList { + list = strings.Fields(v.Str) + } + for _, n := range list { + if _, has := into[n]; n != "" && !has { + into[n] = name + } + } + } + } + return z +} + +// Snapshot is one consistent look at the router's interfaces. +type Snapshot struct { + Devices map[string]*Device + WAN string + LAN string + // Zones is every firewall zone's name. + Zones []string +} + +// Names is the interfaces' names, sorted: the order ucode lists them in. +func (s *Snapshot) Names() []string { + out := make([]string, 0, len(s.Devices)) + for n := range s.Devices { + out = append(out, n) + } + sort.Strings(out) + return out +} + +func has(list []string, v string) bool { + for _, x := range list { + if x == v { + return true + } + } + return false +} + +func isPrivate(cidr string) bool { + n, ok := ipnet.Any(cidr) + if !ok || n.Prefix < 1 { + return false + } + for _, p := range private { + if r, _ := ipnet.Any(p); r.Holds(n.Base) { + return true + } + } + return false +} + +// Take looks at the router. +func Take(src Sources) *Snapshot { + var routes []struct { + Dst string `json:"dst"` + Dev string `json:"dev"` + Metric *int `json:"metric"` + } + json.Unmarshal(src.Routes(), &routes) + logical := map[string]Logical{} + if src.Logical != nil { + logical = src.Logical() + } + byDev := map[string][]string{} + vpn := func(dev string) bool { return has(notWanProto, logical[dev].Proto) || notWanNames.MatchString(dev) } + // The WAN: the default route with the lowest metric that does not go into a VPN client; only VPN + // routes: the lowest of them. + wan, wanMetric, wanVPN := "", 0, true + for _, r := range routes { + if r.Dev == "" { + continue + } + if r.Dst != "default" { + byDev[r.Dev] = append(byDev[r.Dev], r.Dst) + continue + } + v, metric := vpn(r.Dev), 0 + if r.Metric != nil { + metric = *r.Metric + } + if wan == "" || (wanVPN && !v) || (wanVPN == v && metric < wanMetric) { + wan, wanMetric, wanVPN = r.Dev, metric, v + } + } + addrs := map[string][]string{} + if src.Addrs != nil { + var list []struct { + Ifname string `json:"ifname"` + Info []struct { + Family string `json:"family"` + Local string `json:"local"` + Prefix int `json:"prefixlen"` + } `json:"addr_info"` + } + json.Unmarshal(src.Addrs(), &list) + for _, l := range list { + for _, a := range l.Info { + if a.Family == "inet" { + addrs[l.Ifname] = append(addrs[l.Ifname], a.Local+"/"+strconv.Itoa(a.Prefix)) + } + } + } + } + links := src.Links() + names := make([]string, 0, len(links)) + for n := range links { + names = append(names, n) + } + sort.Strings(names) + zones := Zones{} + if src.Zones != nil { + zones = src.Zones() + } + s := &Snapshot{Devices: map[string]*Device{}, WAN: wan, Zones: zones.Names} + if s.Zones == nil { + s.Zones = []string{} + } + var order []string + for _, dev := range names { + if dev == "lo" || dev == transit || dev == inner { + continue + } + l := links[dev] + nets := []string{} + if byDev[dev] != nil { + nets = ipnet.Collapse(byDev[dev]) + } + if noise.MatchString(dev) && len(nets) == 0 { + continue + } + lg, known := logical[dev] + cat := "other" + switch { + case l.Wifi: + cat = "wifi" + case (known && has(vpnProtos, lg.Proto)) || l.Type == 65534 || (l.Flags&0x10 != 0 && l.Type != 1) || vpnNames.MatchString(dev): + cat = "vpn" + case l.Type == 1 || l.Bridge: + cat = "ethernet" + } + d := &Device{Name: dev, Category: cat, Kind: cat, Up: l.Flags&1 != 0, Master: l.Master, Members: []string{}, Nets: nets, Addrs: addrs[dev], + Logical: lg.Name, Proto: lg.Proto, Zone: zones.ByDev[dev]} + if l.Bridge { + d.Kind = "bridge" + } + if dev == wan { + d.Category = "wan" + } + if d.Addrs == nil { + d.Addrs = []string{} + } + if d.Zone == "" && known { + d.Zone = zones.ByNet[lg.Name] + } + s.Devices[dev] = d + order = append(order, dev) + } + for _, dev := range order { + if m := s.Devices[s.Devices[dev].Master]; m != nil { + m.Members = append(m.Members, dev) + } + } + // The LAN: netifd's "lan" if present, otherwise the first bridge (then ethernet device) carrying a + // private network. + for dev, lg := range logical { + if lg.Name == "lan" && s.Devices[dev] != nil { + s.LAN = dev + } + } + for _, pass := range []string{"bridge", "ethernet"} { + for _, dev := range order { + d := s.Devices[dev] + if s.LAN != "" || dev == wan || d.Kind != pass || d.Master != "" { + continue + } + for _, n := range d.Nets { + if isPrivate(n) { + s.LAN = dev + break + } + } + } + } + return s +} + +// WanAddress is the address of the interface a server's devices come in on, or "". +func (s *Snapshot) WanAddress(srv *model.Server) string { + wan := srv.WanDevice + if srv.AutoWan { + wan = s.WAN + if wan == "" { + wan = srv.DetectedWan + } + } + if d := s.Devices[wan]; d != nil && len(d.Addrs) > 0 { + return strings.SplitN(d.Addrs[0], "/", 2)[0] + } + return "" +} + +// Home is one interface of a server's home network. +type Home struct { + Dev string + Nets []string +} + +// ServerHome is the interfaces that make up a server's home network and what they reach together. +func (s *Snapshot) ServerHome(srv *model.Server) (home []Home, nets []string) { + wan := srv.WanDevice + if srv.AutoWan { + wan = s.WAN + if wan == "" { + wan = srv.DetectedWan + } + } + var picked []string + auto := "" + if srv.AutoLan { + auto = s.LAN + if auto == "" { + auto = srv.DetectedLan + } + } + if auto != "" { + picked = append(picked, auto) + } + for _, d := range srv.LanDevices { + if d != auto { + picked = append(picked, d) + } + } + var all []string + for _, dev := range picked { + d := s.Devices[dev] + // Never the WAN, the tunnel itself, or a bridge port (routing only sees the bridge). + if dev == wan || dev == srv.Ifname || (d != nil && d.Master != "") { + continue + } + h := Home{Dev: dev, Nets: []string{}} + if d != nil { + h.Nets = d.Nets + } + home = append(home, h) + all = append(all, h.Nets...) + } + return home, ipnet.Collapse(all) +} + +// PersonHome is the home networks a person reaches: all of the server's, or only the interfaces ticked on +// their page. +func (s *Snapshot) PersonHome(srv *model.Server, p *model.Person) []string { + home, nets := s.ServerHome(srv) + if p == nil || len(p.HomeNets) == 0 { + return nets + } + var picked []string + for _, h := range home { + if has(p.HomeNets, h.Dev) { + picked = append(picked, h.Nets...) + } + } + return ipnet.Collapse(picked) +} + +// System reads the router itself: `ip` for the routes, /sys/class/net for the interfaces. logical is asked +// of netifd by the caller (it holds the bus). +func System(logical func() map[string]Logical) Sources { + const sys = "/sys/class/net" + read := func(dev, f string) string { + b, _ := os.ReadFile(filepath.Join(sys, dev, f)) + return strings.TrimSpace(string(b)) + } + return Sources{ + Routes: func() []byte { + out, _ := exec.Command("ip", "-j", "-4", "route", "show", "table", "main").Output() + return out + }, + Addrs: func() []byte { + out, _ := exec.Command("ip", "-j", "-4", "addr", "show").Output() + return out + }, + Links: func() map[string]Link { + out := map[string]Link{} + entries, _ := os.ReadDir(sys) + for _, e := range entries { + dev := e.Name() + l := Link{} + l.Flags, _ = strconv.ParseInt(strings.TrimPrefix(read(dev, "flags"), "0x"), 16, 64) + l.Type, _ = strconv.Atoi(read(dev, "type")) + if m, err := os.Readlink(filepath.Join(sys, dev, "master")); err == nil { + l.Master = filepath.Base(m) + } + _, err := os.Stat(filepath.Join(sys, dev, "bridge")) + l.Bridge = err == nil + _, e1 := os.Stat(filepath.Join(sys, dev, "phy80211")) + _, e2 := os.Stat(filepath.Join(sys, dev, "wireless")) + l.Wifi = e1 == nil || e2 == nil + out[dev] = l + } + return out + }, + Logical: logical, + Zones: func() Zones { + raw, err := os.ReadFile("/etc/config/firewall") + if err != nil { + return Zones{} + } + fw, _ := uci.Parse(string(raw)) + return ZonesOf(fw) + }, + } +} + +// Wan is the interface a server's devices come in on; HomeOf one interface of its home network. +type Wan struct { + Dev string + Auto bool + Zone string + Missing bool +} + +type HomeOf struct { + Dev string + Auto bool + Nets []string + Zone string + Missing bool +} + +// ServerNet is what a server uses right now (dawnline.net server_net): its WAN, the interfaces of its home +// Own is the router's own networks: every route of its main table but the ones through Dawnline's own +// tunnels, which Dawnline puts there itself (a tunnel's subnet, the networks behind people's routers). +func (s *Snapshot) Own(m *model.Model) []string { + ours := map[string]bool{} + for _, srv := range m.Servers { + ours[srv.Ifname] = true + } + var nets []string + for _, name := range s.Names() { + if !ours[name] { + nets = append(nets, s.Devices[name].Nets...) + } + } + return ipnet.Collapse(nets) +} + +// Behind is the networks behind each router that are in effect on this router, by the device's id: none +// that shares addresses with a network the router has itself. +func (s *Snapshot) Behind(m *model.Model) map[string][]string { return m.BehindOf(s.Own(m)) } + +// network, what those reach together, and their firewall zones. +func (s *Snapshot) ServerNet(srv *model.Server) (wan Wan, home []HomeOf, nets, zones []string) { + wan = Wan{Dev: srv.WanDevice, Auto: srv.AutoWan} + if srv.AutoWan { + if wan.Dev = s.WAN; wan.Dev == "" { + wan.Dev = srv.DetectedWan + } + } + wan.Zone = srv.WanZone + if d := s.Devices[wan.Dev]; d != nil && d.Zone != "" { + wan.Zone = d.Zone + } + if wan.Zone == "" { + wan.Zone = "wan" + } + wan.Missing = wan.Dev != "" && s.Devices[wan.Dev] == nil + type pick struct { + dev string + auto bool + } + var picked []pick + auto := "" + if srv.AutoLan { + if auto = s.LAN; auto == "" { + auto = srv.DetectedLan + } + } + if auto != "" { + picked = append(picked, pick{auto, true}) + } + for _, d := range srv.LanDevices { + if d != auto { + picked = append(picked, pick{d, false}) + } + } + home, zones = []HomeOf{}, []string{} + var all []string + zone := func(z string) { + if z != "" && !has(zones, z) { + zones = append(zones, z) + } + } + for _, p := range picked { + d := s.Devices[p.dev] + // Never the WAN, the tunnel itself, or a bridge port (routing only sees the bridge). + if p.dev == wan.Dev || p.dev == srv.Ifname || (d != nil && d.Master != "") { + continue + } + // The detected LAN missing for a moment (bridge recreated) keeps its zone. + h := HomeOf{Dev: p.dev, Auto: p.auto, Nets: []string{}, Missing: d == nil} + if d != nil { + h.Nets, h.Zone = d.Nets, d.Zone + } + if h.Zone == "" && p.auto { + h.Zone = srv.LanZone + } + home = append(home, h) + all = append(all, h.Nets...) + zone(h.Zone) + } + // Older configs and routers where nothing could be resolved: the zone set at setup. + if len(home) == 0 && srv.AutoLan { + zone(srv.LanZone) + } + return wan, home, ipnet.Collapse(all), zones +} diff --git a/backend/netview/netview_test.go b/backend/netview/netview_test.go new file mode 100644 index 0000000..20152f0 --- /dev/null +++ b/backend/netview/netview_test.go @@ -0,0 +1,122 @@ +package netview + +import ( + "encoding/json" + "os" + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// From what the golden's router said, the same interfaces, WAN, LAN and home networks as ucode found +// (scripts/ucode-golden.sh writes trace.json from dawnline.net and dawnline.core). +func TestHeldToUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Zones []string `json:"zones"` + Servers map[string]struct { + Wan struct { + Dev string `json:"dev"` + Auto bool `json:"auto"` + Zone string `json:"zone"` + Missing bool `json:"missing"` + } `json:"wan"` + Home []struct { + Dev string `json:"dev"` + Auto bool `json:"auto"` + Nets []string `json:"nets"` + Zone string `json:"zone"` + Missing bool `json:"missing"` + } `json:"home"` + Nets []string `json:"nets"` + Zones []string `json:"zones"` + } `json:"servers"` + Links map[string]Link `json:"links"` + Devices map[string]*Device `json:"devices"` + WAN *string `json:"wan"` + LAN *string `json:"lan"` + Homes map[string][]string `json:"homes"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + fw, err := uci.Parse(golden.Firewall) + if err != nil { + t.Fatal(err) + } + s := Take(Sources{Routes: func() []byte { return golden.Routes }, Addrs: func() []byte { return golden.Addrs }, + Links: func() map[string]Link { return golden.Links }, Zones: func() Zones { return ZonesOf(fw) }}) + if !reflect.DeepEqual(s.Zones, golden.Zones) || len(s.Zones) < 2 { + t.Fatalf("zones %v, ucode has %v", s.Zones, golden.Zones) + } + if !reflect.DeepEqual(s.Devices, golden.Devices) { + g, _ := json.MarshalIndent(s.Devices, "", " ") + w, _ := json.MarshalIndent(golden.Devices, "", " ") + t.Fatalf("the interfaces differ\nGo: %s\nucode: %s", g, w) + } + str := func(p *string) string { + if p == nil { + return "" + } + return *p + } + if s.WAN != str(golden.WAN) || s.LAN != str(golden.LAN) { + t.Fatalf("WAN %q, LAN %q; ucode has %q, %q", s.WAN, s.LAN, str(golden.WAN), str(golden.LAN)) + } + if s.LAN == "" || len(golden.Devices) < 5 { + t.Fatalf("the golden's router is too bare to hold anything to: %d interfaces, LAN %q", len(golden.Devices), s.LAN) + } + text, err := os.ReadFile("../handout/testdata/conf.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + zoned := 0 + for id, want := range golden.Servers { + wan, home, nets, zones := s.ServerNet(m.Servers[id]) + got, _ := json.Marshal(map[string]any{"wan": wan, "home": home, "nets": nets, "zones": zones}) + type w = map[string]any + homes := []any{} + for _, h := range want.Home { + homes = append(homes, HomeOf{h.Dev, h.Auto, h.Nets, h.Zone, h.Missing}) + if h.Zone != "" { + zoned++ + } + } + exp, _ := json.Marshal(w{"wan": Wan{want.Wan.Dev, want.Wan.Auto, want.Wan.Zone, want.Wan.Missing}, "home": homes, "nets": want.Nets, "zones": want.Zones}) + if string(got) != string(exp) { + t.Errorf("server %s uses\n Go: %s\n ucode: %s", id, got, exp) + } + } + if len(golden.Servers) == 0 || zoned == 0 { + t.Fatalf("the golden holds no server's home in a zone: %d servers", len(golden.Servers)) + } + reached := 0 + for id, want := range golden.Homes { + p := m.People[id] + srv := m.Servers[p.Server] + if srv == nil { + continue + } + got := s.PersonHome(srv, p) + reached += len(got) + if len(got) != len(want) || (len(got) > 0 && !reflect.DeepEqual(got, want)) { + t.Errorf("%s reaches %v, ucode has %v", id, got, want) + } + } + if reached == 0 { + t.Fatal("nobody reaches a home network in the golden") + } +} diff --git a/backend/netview/testdata/trace.json b/backend/netview/testdata/trace.json new file mode 100644 index 0000000..7972d20 --- /dev/null +++ b/backend/netview/testdata/trace.json @@ -0,0 +1,605 @@ +{ + "routes": [ + { + "dst": "default", + "gateway": "172.17.0.1", + "dev": "eth0", + "flags": [ + ] + }, + { + "dst": "10.20.4.0/22", + "dev": "dlguest", + "protocol": "kernel", + "scope": "link", + "prefsrc": "10.20.4.1", + "flags": [ + ] + }, + { + "dst": "10.66.0.0/24", + "dev": "wg9", + "protocol": "kernel", + "scope": "link", + "prefsrc": "10.66.0.2", + "flags": [ + ] + }, + { + "dst": "172.17.0.0/16", + "dev": "eth0", + "protocol": "kernel", + "scope": "link", + "prefsrc": "172.17.0.2", + "flags": [ + ] + }, + { + "dst": "192.168.50.0/24", + "dev": "dlhome", + "protocol": "kernel", + "scope": "link", + "prefsrc": "192.168.50.1", + "flags": [ + ] + }, + { + "dst": "192.168.77.0/24", + "dev": "br-lan", + "protocol": "kernel", + "scope": "link", + "prefsrc": "192.168.77.1", + "flags": [ + ] + } + ], + "addrs": [ + { + "ifindex": 1, + "ifname": "lo", + "flags": [ + "LOOPBACK", + "UP", + "LOWER_UP" + ], + "mtu": 65536, + "qdisc": "noqueue", + "operstate": "UNKNOWN", + "group": "default", + "txqlen": 1000, + "addr_info": [ + { + "family": "inet", + "local": "127.0.0.1", + "prefixlen": 8, + "scope": "host", + "label": "lo", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 11, + "link_index": 243, + "ifname": "eth0", + "flags": [ + "BROADCAST", + "MULTICAST", + "UP", + "LOWER_UP" + ], + "mtu": 65535, + "qdisc": "noqueue", + "operstate": "UP", + "group": "default", + "link_netnsid": 0, + "addr_info": [ + { + "family": "inet", + "local": "172.17.0.2", + "prefixlen": 16, + "broadcast": "172.17.255.255", + "scope": "global", + "label": "eth0", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 12, + "ifname": "dlhome", + "flags": [ + "BROADCAST", + "NOARP", + "UP", + "LOWER_UP" + ], + "mtu": 1500, + "qdisc": "noqueue", + "operstate": "UNKNOWN", + "group": "default", + "txqlen": 1000, + "addr_info": [ + { + "family": "inet", + "local": "192.168.50.1", + "prefixlen": 24, + "scope": "global", + "label": "dlhome", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 13, + "ifname": "dlguest", + "flags": [ + "BROADCAST", + "NOARP", + "UP", + "LOWER_UP" + ], + "mtu": 1500, + "qdisc": "noqueue", + "operstate": "UNKNOWN", + "group": "default", + "txqlen": 1000, + "addr_info": [ + { + "family": "inet", + "local": "10.20.4.1", + "prefixlen": 22, + "scope": "global", + "label": "dlguest", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 14, + "ifname": "br-lan", + "flags": [ + "BROADCAST", + "MULTICAST", + "UP", + "LOWER_UP" + ], + "mtu": 1500, + "qdisc": "noqueue", + "operstate": "UP", + "group": "default", + "txqlen": 1000, + "addr_info": [ + { + "family": "inet", + "local": "192.168.77.1", + "prefixlen": 24, + "scope": "global", + "label": "br-lan", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 17, + "ifname": "wg9", + "flags": [ + "BROADCAST", + "NOARP", + "UP", + "LOWER_UP" + ], + "mtu": 1500, + "qdisc": "noqueue", + "operstate": "UNKNOWN", + "group": "default", + "txqlen": 1000, + "addr_info": [ + { + "family": "inet", + "local": "10.66.0.2", + "prefixlen": 24, + "scope": "global", + "label": "wg9", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + } + ], + "firewall": "config defaults\n\toption syn_flood\t1\n\toption input\t\tREJECT\n\toption output\t\tACCEPT\n\toption forward\t\tREJECT\n# Uncomment this line to disable ipv6 rules\n#\toption disable_ipv6\t1\n\nconfig zone\n\toption name\t\tlan\n\tlist network\t\t'lan'\n\toption input\t\tACCEPT\n\toption output\t\tACCEPT\n\toption forward\t\tACCEPT\n\nconfig zone\n\toption name\t\twan\n\tlist network\t\t'wan'\n\tlist network\t\t'wan6'\n\toption input\t\tREJECT\n\toption output\t\tACCEPT\n\toption forward\t\tDROP\n\toption masq\t\t1\n\toption mtu_fix\t\t1\n\nconfig forwarding\n\toption src\t\tlan\n\toption dest\t\twan\n\n# We need to accept udp packets on port 68,\n# see https://dev.openwrt.org/ticket/4108\nconfig rule\n\toption name\t\tAllow-DHCP-Renew\n\toption src\t\twan\n\toption proto\t\tudp\n\toption dest_port\t68\n\toption target\t\tACCEPT\n\toption family\t\tipv4\n\n# Allow IPv4 ping\nconfig rule\n\toption name\t\tAllow-Ping\n\toption src\t\twan\n\toption proto\t\ticmp\n\toption icmp_type\techo-request\n\toption family\t\tipv4\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-IGMP\n\toption src\t\twan\n\toption proto\t\tigmp\n\toption family\t\tipv4\n\toption target\t\tACCEPT\n\n# Allow DHCPv6 replies\n# see https://github.com/openwrt/openwrt/issues/5066\nconfig rule\n\toption name\t\tAllow-DHCPv6\n\toption src\t\twan\n\toption proto\t\tudp\n\toption dest_port\t546\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-MLD\n\toption src\t\twan\n\toption proto\t\ticmp\n\toption src_ip\t\tfe80::/10\n\tlist icmp_type\t\t'130/0'\n\tlist icmp_type\t\t'131/0'\n\tlist icmp_type\t\t'132/0'\n\tlist icmp_type\t\t'143/0'\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\n# Allow essential incoming IPv6 ICMP traffic\nconfig rule\n\toption name\t\tAllow-ICMPv6-Input\n\toption src\t\twan\n\toption proto\ticmp\n\tlist icmp_type\t\techo-request\n\tlist icmp_type\t\techo-reply\n\tlist icmp_type\t\tdestination-unreachable\n\tlist icmp_type\t\tpacket-too-big\n\tlist icmp_type\t\ttime-exceeded\n\tlist icmp_type\t\tbad-header\n\tlist icmp_type\t\tunknown-header-type\n\tlist icmp_type\t\trouter-solicitation\n\tlist icmp_type\t\tneighbour-solicitation\n\tlist icmp_type\t\trouter-advertisement\n\tlist icmp_type\t\tneighbour-advertisement\n\toption limit\t\t1000/sec\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\n# Allow essential forwarded IPv6 ICMP traffic\nconfig rule\n\toption name\t\tAllow-ICMPv6-Forward\n\toption src\t\twan\n\toption dest\t\t*\n\toption proto\t\ticmp\n\tlist icmp_type\t\techo-request\n\tlist icmp_type\t\techo-reply\n\tlist icmp_type\t\tdestination-unreachable\n\tlist icmp_type\t\tpacket-too-big\n\tlist icmp_type\t\ttime-exceeded\n\tlist icmp_type\t\tbad-header\n\tlist icmp_type\t\tunknown-header-type\n\toption limit\t\t1000/sec\n\toption family\t\tipv6\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-IPSec-ESP\n\toption src\t\twan\n\toption dest\t\tlan\n\toption proto\t\tesp\n\toption target\t\tACCEPT\n\nconfig rule\n\toption name\t\tAllow-ISAKMP\n\toption src\t\twan\n\toption dest\t\tlan\n\toption dest_port\t500\n\toption proto\t\tudp\n\toption target\t\tACCEPT\n\n\n### EXAMPLE CONFIG SECTIONS\n# do not allow a specific ip to access wan\n#config rule\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption dest\t\twan\n#\toption proto\ttcp\n#\toption target\tREJECT\n\n# block a specific mac on wan\n#config rule\n#\toption dest\t\twan\n#\toption src_mac\t00:11:22:33:44:66\n#\toption target\tREJECT\n\n# block incoming ICMP traffic on a zone\n#config rule\n#\toption src\t\tlan\n#\toption proto\tICMP\n#\toption target\tDROP\n\n# port redirect port coming in on wan to lan\n#config redirect\n#\toption src\t\t\twan\n#\toption src_dport\t80\n#\toption dest\t\t\tlan\n#\toption dest_ip\t\t192.168.16.235\n#\toption dest_port\t80\n#\toption proto\t\ttcp\n\n# port redirect of remapped ssh port (22001) on wan\n#config redirect\n#\toption src\t\twan\n#\toption src_dport\t22001\n#\toption dest\t\tlan\n#\toption dest_port\t22\n#\toption proto\t\ttcp\n\n### FULL CONFIG SECTIONS\n#config rule\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption src_mac\t00:11:22:33:44:55\n#\toption src_port\t80\n#\toption dest\t\twan\n#\toption dest_ip\t194.25.2.129\n#\toption dest_port\t120\n#\toption proto\ttcp\n#\toption target\tREJECT\n\n#config redirect\n#\toption src\t\tlan\n#\toption src_ip\t192.168.45.2\n#\toption src_mac\t00:11:22:33:44:55\n#\toption src_port\t\t1024\n#\toption src_dport\t80\n#\toption dest_ip\t194.25.2.129\n#\toption dest_port\t120\n#\toption proto\ttcp\n\nconfig zone\n\toption name 'guest'\n\tlist device 'dlguest'\n\nconfig zone\n\toption name 'home'\n\toption device 'br-lan dlhome'\n", + "links": { + "bonding_masters": { + "flags": 0, + "type": 0, + "master": "", + "bridge": false, + "wifi": false + }, + "br-lan": { + "flags": 4099, + "type": 1, + "master": "", + "bridge": true, + "wifi": false + }, + "dlguest": { + "flags": 131, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "dlhome": { + "flags": 131, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "erspan0": { + "flags": 4098, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "eth0": { + "flags": 4099, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "gre0": { + "flags": 128, + "type": 778, + "master": "", + "bridge": false, + "wifi": false + }, + "gretap0": { + "flags": 4098, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "ifb7": { + "flags": 130, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + }, + "ip6_vti0": { + "flags": 128, + "type": 769, + "master": "", + "bridge": false, + "wifi": false + }, + "ip6gre0": { + "flags": 128, + "type": 823, + "master": "", + "bridge": false, + "wifi": false + }, + "ip6tnl0": { + "flags": 128, + "type": 769, + "master": "", + "bridge": false, + "wifi": false + }, + "ip_vti0": { + "flags": 128, + "type": 768, + "master": "", + "bridge": false, + "wifi": false + }, + "lanp1": { + "flags": 899, + "type": 1, + "master": "br-lan", + "bridge": false, + "wifi": false + }, + "lanp2": { + "flags": 899, + "type": 1, + "master": "br-lan", + "bridge": false, + "wifi": false + }, + "lo": { + "flags": 9, + "type": 772, + "master": "", + "bridge": false, + "wifi": false + }, + "sit0": { + "flags": 128, + "type": 776, + "master": "", + "bridge": false, + "wifi": false + }, + "tunl0": { + "flags": 128, + "type": 768, + "master": "", + "bridge": false, + "wifi": false + }, + "wg9": { + "flags": 131, + "type": 1, + "master": "", + "bridge": false, + "wifi": false + } + }, + "devices": { + "bonding_masters": { + "name": "bonding_masters", + "category": "other", + "kind": "other", + "up": false, + "master": "", + "members": [ + ], + "nets": [ + ], + "addrs": [ + ], + "logical": "", + "proto": "", + "zone": "" + }, + "br-lan": { + "name": "br-lan", + "category": "ethernet", + "kind": "bridge", + "up": true, + "master": "", + "members": [ + "lanp1", + "lanp2" + ], + "nets": [ + "192.168.77.0/24" + ], + "addrs": [ + "192.168.77.1/24" + ], + "logical": "", + "proto": "", + "zone": "home" + }, + "dlguest": { + "name": "dlguest", + "category": "ethernet", + "kind": "ethernet", + "up": true, + "master": "", + "members": [ + ], + "nets": [ + "10.20.4.0/22" + ], + "addrs": [ + "10.20.4.1/22" + ], + "logical": "", + "proto": "", + "zone": "guest" + }, + "dlhome": { + "name": "dlhome", + "category": "ethernet", + "kind": "ethernet", + "up": true, + "master": "", + "members": [ + ], + "nets": [ + "192.168.50.0/24" + ], + "addrs": [ + "192.168.50.1/24" + ], + "logical": "", + "proto": "", + "zone": "home" + }, + "eth0": { + "name": "eth0", + "category": "wan", + "kind": "ethernet", + "up": true, + "master": "", + "members": [ + ], + "nets": [ + "172.17.0.0/16" + ], + "addrs": [ + "172.17.0.2/16" + ], + "logical": "", + "proto": "", + "zone": "" + }, + "lanp1": { + "name": "lanp1", + "category": "ethernet", + "kind": "ethernet", + "up": true, + "master": "br-lan", + "members": [ + ], + "nets": [ + ], + "addrs": [ + ], + "logical": "", + "proto": "", + "zone": "" + }, + "lanp2": { + "name": "lanp2", + "category": "ethernet", + "kind": "ethernet", + "up": true, + "master": "br-lan", + "members": [ + ], + "nets": [ + ], + "addrs": [ + ], + "logical": "", + "proto": "", + "zone": "" + }, + "wg9": { + "name": "wg9", + "category": "vpn", + "kind": "vpn", + "up": true, + "master": "", + "members": [ + ], + "nets": [ + "10.66.0.0/24" + ], + "addrs": [ + "10.66.0.2/24" + ], + "logical": "", + "proto": "", + "zone": "" + } + }, + "wan": "eth0", + "lan": "br-lan", + "zones": [ + "lan", + "wan", + "guest", + "home" + ], + "servers": { + "junk": { + "wan": { + "dev": "eth0", + "auto": true, + "zone": "wan", + "missing": false + }, + "home": [ + { + "dev": "dlhome", + "auto": false, + "nets": [ + "192.168.50.0/24" + ], + "zone": "home", + "missing": false + } + ], + "nets": [ + "192.168.50.0/24" + ], + "zones": [ + "home" + ] + }, + "max": { + "wan": { + "dev": "eth0", + "auto": true, + "zone": "wan", + "missing": false + }, + "home": [ + ], + "nets": [ + ], + "zones": [ + ] + }, + "plain": { + "wan": { + "dev": "eth0", + "auto": true, + "zone": "wan", + "missing": false + }, + "home": [ + { + "dev": "dlhome", + "auto": false, + "nets": [ + "192.168.50.0/24" + ], + "zone": "home", + "missing": false + }, + { + "dev": "dlguest", + "auto": false, + "nets": [ + "10.20.4.0/22" + ], + "zone": "guest", + "missing": false + } + ], + "nets": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "zones": [ + "home", + "guest" + ] + } + }, + "homes": { + "j_both": [ + "192.168.50.0/24" + ], + "j_lan": [ + "192.168.50.0/24" + ], + "lost": null, + "m_net": [ + ], + "p_both": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "p_lan": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "p_lanhome": [ + "10.20.4.0/22", + "192.168.50.0/24" + ], + "p_net": [ + "10.20.4.0/22", + "192.168.50.0/24" + ] + } +} diff --git a/backend/nft/behind_test.go b/backend/nft/behind_test.go new file mode 100644 index 0000000..f0b6657 --- /dev/null +++ b/backend/nft/behind_test.go @@ -0,0 +1,144 @@ +package nft + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// sitesOf is access's household on the golden's router, with routers that have networks behind them: +// Boris's in Anna's circle (devices within circles), Kira's where everyone reaches everyone, Clara's with +// the internet alone, Dima's with one home network, Eva's with home services, and Hana's whose network is +// one the router has itself. +func sitesOf(t *testing.T) (*model.Model, *netview.Snapshot) { + t.Helper() + text, err := os.ReadFile("../access/testdata/access.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + for id, net := range map[string]string{"bphone": "192.168.2.0/24", "kphone": "192.168.3.0/24", "cphone": "192.168.4.0/24", + "dphone": "192.168.5.0/24", "ephone": "192.168.6.0/24", "hphone": "192.168.50.0/24"} { + c.Set(id, "kind", "router") + c.SetList(id, "behind_net", []string{net}) + } + raw, err := os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Links map[string]netview.Link `json:"links"` + } + if err := json.Unmarshal(raw, &router); err != nil { + t.Fatal(err) + } + snap := netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }}) + return model.Load(c, nil), snap +} + +// A router stands for the networks behind it: they are wherever its address is, and nowhere else. +func TestNetworksBehindRoutersInTheSets(t *testing.T) { + m, snap := sitesOf(t) + states := map[string]string{} + for _, id := range m.PersonIDs() { + states[id] = "active" + } + sets := AccessSets(m, states, snap) + in := func(set, member string) bool { + for _, x := range sets[set] { + if x == member { + return true + } + } + return false + } + for _, c := range []struct { + set, member string + want bool + }{ + // part of home: with home, with the internet, and with the circle (never with itself) + {"lan_ok", "192.168.2.0/24", true}, + {"lan_all", "192.168.2.0/24", true}, + {"inet_ok", "192.168.2.0/24", true}, + {"mesh_pairs", "10.77.0.2 . 192.168.2.0/24", true}, + {"mesh_pairs", "192.168.2.0/24 . 10.77.0.2", true}, + {"mesh_pairs", "10.77.0.5 . 192.168.2.0/24", false}, + {"mesh_pairs", "192.168.2.0/24 . 10.77.0.5", false}, + // another circle's phone does not reach it + {"mesh_pairs", "10.77.0.9 . 192.168.2.0/24", false}, + // where everyone reaches everyone the pairs are not kept: being part of home is enough + {"lan_ok", "192.168.3.0/24", true}, + // the internet alone + {"inet_ok", "192.168.4.0/24", true}, + {"lan_ok", "192.168.4.0/24", false}, + {"lan_all", "192.168.4.0/24", false}, + // one home network: only that one + {"lan_part", "192.168.5.0/24 . 192.168.50.0/24", true}, + {"lan_all", "192.168.5.0/24", false}, + // home services: what the owner's own devices reach of them + {"svc_host", "192.168.6.0/24 . 192.168.50.20", in("svc_host", "10.77.0.8 . 192.168.50.20")}, + {"lan_ok", "192.168.6.0/24", false}, + // a network the router has itself is behind nobody + {"lan_ok", "192.168.50.0/24", false}, + {"lan_all", "192.168.50.0/24", false}, + {"inet_ok", "192.168.50.0/24", false}, + } { + if in(c.set, c.member) != c.want { + t.Errorf("%s has %q: %v, want %v\n%v", c.set, c.member, !c.want, c.want, sets[c.set]) + } + } + // Eva's services reach the network as they reach her phone: member for member + for _, set := range []string{"svc_ok", "svc_host"} { + phone, site := 0, 0 + for _, x := range sets[set] { + if strings.HasPrefix(x, "10.77.0.8 . ") { + phone++ + } + if strings.HasPrefix(x, "192.168.6.0/24 . ") { + site++ + } + } + if phone != site { + t.Errorf("%s: %d for the phone, %d for the network behind it", set, phone, site) + } + } + // someone paused takes their network with them + states["boris"] = "paused" + for _, set := range Names { + for _, x := range AccessSets(m, states, snap)[set] { + if strings.Contains(x, "192.168.2.0/24") { + t.Errorf("%s still has %q with its owner paused", set, x) + } + } + } + // a router that waits for the admin's answer is nowhere: neither its address nor what is behind it + m.Devices["kphone"].Waiting = true + for _, set := range Names { + for _, x := range AccessSets(m, states, snap)[set] { + if strings.Contains(x, "192.168.3.0/24") || strings.Contains(x, "10.79.0.2") { + t.Errorf("%s has %q of a router that waits", set, x) + } + } + } + m.Devices["kphone"].Waiting = false + // every set that holds people's sources takes a network + table := Render(m, sets, Ctx{Snap: snap, ResolverPort: 5354}) + for _, name := range Names { + for _, l := range strings.Split(table, "\n") { + if strings.HasPrefix(l, "\tset "+name+" ") && !strings.Contains(l, "flags interval;") { + t.Errorf("set %s takes no network: %s", name, l) + } + } + } +} diff --git a/backend/nft/nft.go b/backend/nft/nft.go new file mode 100644 index 0000000..3efba43 --- /dev/null +++ b/backend/nft/nft.go @@ -0,0 +1,399 @@ +// Package nft makes the table `inet dawnline` as dawnline.nft does: each person's access, enforced on the +// tunnel interfaces before anything else on the router sees the traffic, and where tunnel DNS goes. Its +// shape follows the servers and their home networks (Render); who is in which set follows people's state +// and changes often (Sets, Update: one atomic transaction). +// +// What is loaded decides who reaches what, so the text is held to ucode's byte for byte on a household made +// up for it (testdata/trace.uc, scripts/ucode-golden.sh). +package nft + +import ( + "fmt" + "regexp" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" +) + +// Private4 is the private IPv4 ranges: internet people never reach them. +var Private4 = []string{"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10", "169.254.0.0/16", "224.0.0.0/3"} + +// Names is the sets whose members change at run time (Update replaces them together), in the table's order. +var Names = []string{"lan_ok", "lan_all", "lan_part", "mesh_pairs", "inet_ok", "svc_ok", "svc_host", "dns_real"} + +// Sets is the members of each run-time set. +type Sets map[string][]string + +func ip4(a string) bool { + _, ok := ipnet.IP(a) + return ok +} + +var digits = regexp.MustCompile(`^[0-9]+$`) + +// tunnel is a server's own link: its interface, its network and the router's address in it. ok is false +// for a server without keys, kept down, or with an interface name or a network that will not do. +func tunnel(srv *model.Server) (ifname, subnet, address string, ok bool) { + if srv == nil || srv.PrivateKey == "" || srv.Blocked != nil || !model.ValidIfname(srv.Ifname) { + return "", "", "", false + } + n, isNet := ipnet.Subnet(srv.Subnet) + if !isNet { + return "", "", "", false + } + return srv.Ifname, srv.Subnet, ipnet.String(n.First()), true +} + +// AccessSets is who is in which set: which tunnel addresses may reach what, by each person's state. A +// router stands for the networks behind it: wherever its address is, they are too, so a host there has +// exactly its owner's access and is reached by exactly those who reach the router. +// +// lan_ok home access (the router itself, the mesh) +// lan_all every home network +// lan_part device . network for people limited to some networks +// mesh_pairs device . device within a circle (or one person's own devices) +// inet_ok the internet +// svc_ok device . service . port; svc_host: device . service with no ports (all of them) +// dns_real home names from the plain resolver +func AccessSets(m *model.Model, states map[string]string, snap *netview.Snapshot) Sets { + sets := Sets{} + for _, k := range Names { + sets[k] = []string{} + } + homes := map[string]home{} + // a circle's (or one person's) devices, each with the networks behind it + groups := map[string][][]string{} + var order []string + behind := snap.Behind(m) + for _, id := range m.DeviceIDs() { + d := m.Devices[id] + p := m.People[d.Person] + // off: paused, ended or over quota, or a router that waits for the admin's answer; addresses go into + // nft as they are: IPv4 only + if p == nil || d.Disabled || d.Waiting || !ip4(d.Address) || states[p.ID] != "active" { + continue + } + // the device as the rules see it: its address, then the networks behind it + for _, from := range append([]string{d.Address}, behind[id]...) { + member(sets, m, p, from, homes, snap) + } + if p.HomeAccess() { + srv := m.Servers[p.Server] + // who this device may reach directly: its circle, or at least its owner's devices + if srv != nil && srv.Mesh == "circles" { + g := m.MeshGroup(p) + if _, seen := groups[g]; !seen { + order = append(order, g) + } + groups[g] = append(groups[g], append([]string{d.Address}, behind[id]...)) + } + } + } + // every device of a group with every other, never with itself (what is behind a router reaches the + // router without the tunnel) + for _, g := range order { + for i, one := range groups[g] { + for j, other := range groups[g] { + if i == j || one[0] == other[0] { + continue + } + for _, a := range one { + for _, b := range other { + sets["mesh_pairs"] = append(sets["mesh_pairs"], a+" . "+b) + } + } + } + } + } + return sets +} + +type home struct { + all bool + nets []string +} + +// member puts one source of a person's (a device's address, or a network behind their router) into the +// sets the person's access names; homes keeps what each person's home is from one device to the next. +func member(sets Sets, m *model.Model, p *model.Person, from string, homes map[string]home, snap *netview.Snapshot) { + if p.Access == "lan" && p.DNSMode == "home" { + sets["dns_real"] = append(sets["dns_real"], from) + } + if p.Access == "internet" || p.Access == "both" { + sets["inet_ok"] = append(sets["inet_ok"], from) + } + if p.HomeAccess() { + sets["lan_ok"] = append(sets["lan_ok"], from) + h, known := homes[p.ID] + if !known { + h = home{all: true} + if srv := m.Servers[p.Server]; srv != nil { + h = home{all: len(p.HomeNets) == 0, nets: snap.PersonHome(srv, p)} + } + homes[p.ID] = h + } + if h.all { + sets["lan_all"] = append(sets["lan_all"], from) + return + } + for _, n := range h.nets { + sets["lan_part"] = append(sets["lan_part"], from+" . "+n) + } + return + } + if p.Access != "lan" { + return + } + for _, sid := range p.Services { + s := m.Services[sid] + if s == nil || !ip4(s.Address) { + continue + } + if len(s.Ports) == 0 { + sets["svc_host"] = append(sets["svc_host"], from+" . "+s.Address) + } + for _, port := range s.Ports { + if digits.MatchString(port) { + sets["svc_ok"] = append(sets["svc_ok"], from+" . "+s.Address+" . "+port) + } + } + } +} + +func uniq(list []string) []string { + out := make([]string, 0, len(list)) + seen := map[string]bool{} + for _, x := range list { + if !seen[x] { + seen[x] = true + out = append(out, x) + } + } + return out +} + +// elems is a set's members as its declaration holds them; duplicate members (two devices with one address) +// would make the whole load fail. +func elems(list []string) string { + if list = uniq(list); len(list) > 0 { + return "elements = { " + strings.Join(list, ", ") + " }" + } + return "" +} + +// Ctx is what the table is made from besides the settings, read from the router: the netns's DNS address +// ("" none), where the Home-only resolver runs (in the netns at an address on port 53, or on the router at +// a port), the LAN's DNS ("" none) and the interfaces. +type Ctx struct { + DNSAddr string + ResolverNS string + ResolverPort int + LanDNS string + Snap *netview.Snapshot +} + +// Render is the table as text. +func Render(m *model.Model, sets Sets, ctx Ctx) string { + var ifs, tun []string + dnsAddr := ctx.DNSAddr + if !ip4(dnsAddr) { + dnsAddr = "" + } + // each server's home networks are its own: with several servers, "all home" on one never reaches the + // other's networks (set home_) + type served struct { + id, ifname, address string + nets []string + } + var homes []served + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + ifname, subnet, address, ok := tunnel(srv) + if !ok { + continue + } + ifs = append(ifs, `"`+ifname+`"`) + tun = append(tun, subnet) + _, _, nets, _ := ctx.Snap.ServerNet(srv) + homes = append(homes, served{id, ifname, address, ipnet.Collapse(nets)}) + } + tun = ipnet.Collapse(tun) + var t []string + add := func(format string, args ...any) { t = append(t, fmt.Sprintf(format, args...)) } + add("table inet dawnline {") + for _, h := range homes { + add("\tset home_%s { type ipv4_addr; flags interval; %s }", h.id, elems(h.nets)) + } + // tunnel subnets are never "home", even inside a wider route to the LAN + add("\tset tun_nets { type ipv4_addr; flags interval; %s }", elems(tun)) + // who is in a set is an address or, for a router, a network behind it: every one takes intervals + add("\tset lan_ok { type ipv4_addr; flags interval; %s }", elems(sets["lan_ok"])) + add("\tset lan_all { type ipv4_addr; flags interval; %s }", elems(sets["lan_all"])) + add("\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; %s }", elems(sets["lan_part"])) + add("\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; %s }", elems(sets["mesh_pairs"])) + add("\tset inet_ok { type ipv4_addr; flags interval; %s }", elems(sets["inet_ok"])) + add("\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; %s }", elems(sets["svc_ok"])) + add("\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; %s }", elems(sets["svc_host"])) + add("\tset dns_real { type ipv4_addr; flags interval; %s }", elems(sets["dns_real"])) + add("\tchain pre {") + // ahead of mangle-priority hooks (transparent proxies mark at -150) + add("\t\ttype filter hook prerouting priority -160; policy accept;") + if len(ifs) > 0 { + add("\t\tiifname { %s } jump guard", strings.Join(ifs, ", ")) + } + add("\t}") + add("\tchain guard {") + add("\t\tmeta nfproto ipv6 drop") + // Every packet is judged by the rules below, not only the first of a connection: a change of access cuts + // open connections too. Only what has no rule of its own passes on its connection: errors and the like, + // answers to the admin's port forwards, and the router's own pings. + add("\t\tct state related accept") + add("\t\tct status dnat accept") + add("\t\ticmp type { echo-request, echo-reply } fib daddr type local accept") + add("\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept") + if pp := portalPorts(m); len(pp) > 0 { + // their own portal, also with the VPN on (the address may be this router's) + add("\t\tfib daddr type local tcp dport { %s } accept", strings.Join(pp, ", ")) + } + // the router itself is part of home: for everyone with all of it, and for people limited to some + // networks only on the addresses in those + add("\t\tfib daddr type local ip saddr @lan_all accept") + add("\t\tfib daddr type local ip saddr . ip daddr @lan_part accept") + add("\t\tfib daddr type local counter drop") + if dnsAddr != "" { + // DNS through the netns (it forwards to the LAN's DNS), for everyone + add("\t\tip daddr %s meta l4proto { tcp, udp } th dport 53 accept", dnsAddr) + } + for _, h := range homes { + add("\t\tiifname \"%s\" ip daddr @home_%s ip daddr != @tun_nets ip saddr @lan_all accept", h.ifname, h.id) + } + add("\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept") + // Devices with home access are part of home: they reach each other, where the server allows it + // (everyone, or within circles). Within one server: the firewall has no forwarding between servers' zones. + for _, h := range homes { + switch m.Servers[h.id].Mesh { + case "all": + add("\t\tiifname \"%s\" ip saddr @lan_ok ip daddr @lan_ok accept", h.ifname) + case "circles": + add("\t\tiifname \"%s\" ip saddr . ip daddr @mesh_pairs accept", h.ifname) + } + } + add("\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept") + add("\t\tip saddr . ip daddr @svc_host accept") + add("\t\tip daddr { %s } counter drop", strings.Join(Private4, ", ")) + add("\t\tip saddr @inet_ok accept") + add("\t\tcounter drop") + add("\t}") + // The other way: fw4 lets the server's home zones reach the tunnel; here only connections from its home + // networks to people with home access pass. The admin's own port forwards (DNAT) stay with fw4. + add("\tchain inbound {") + add("\t\ttype filter hook forward priority filter - 5; policy accept;") + if len(ifs) > 0 { + add("\t\toifname { %s } iifname != { %s } ct state new jump to_device", strings.Join(ifs, ", "), strings.Join(ifs, ", ")) + } + add("\t}") + add("\tchain to_device {") + add("\t\tmeta nfproto ipv6 drop") + add("\t\tct status dnat accept") + for _, h := range homes { + add("\t\toifname \"%s\" ip saddr @home_%s ip saddr != @tun_nets ip daddr @lan_all accept", h.ifname, h.id) + } + add("\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept") + add("\t\tcounter reject with icmpx admin-prohibited") + add("\t}") + // devices ask the tunnel address; send each query where it belongs + toResolver := fmt.Sprintf("redirect to :%d", ctx.ResolverPort) + if ip4(ctx.ResolverNS) { + toResolver = "dnat ip to " + ctx.ResolverNS + ":53" + } + lanDNS := ctx.LanDNS + if !ip4(lanDNS) { + lanDNS = "" + } + add("\tchain dns {") + add("\t\ttype nat hook prerouting priority dstnat - 5; policy accept;") + if len(ifs) > 0 { + // home names (and no LAN DNS at all): the plain resolver, whatever address was asked + add("\t\tiifname { %s } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 %s", strings.Join(ifs, ", "), toResolver) + } + add("\t}") + // After the LAN's own DNS interceptors (transparent proxies redirect port 53 at dstnat - 1): only the + // first NAT of a connection counts. When none of them takes the tunnel, this sends it to the LAN's DNS. + add("\tchain dns_lan {") + add("\t\ttype nat hook prerouting priority dstnat + 5; policy accept;") + for _, h := range homes { + // everyone else: the LAN's DNS, through the netns (from the LAN side) when internet goes that way + target := toResolver + if m.Servers[h.id].LanLike && dnsAddr != "" { + target = "dnat ip to " + dnsAddr + ":53" + } else if lanDNS != "" { + target = "dnat ip to " + lanDNS + ":53" + } + add("\t\tiifname \"%s\" ip daddr %s meta l4proto { tcp, udp } th dport 53 %s", h.ifname, h.address, target) + } + add("\t}") + add("}") + return strings.Join(t, "\n") + "\n" +} + +// portalPorts is the portal's TCP ports people may reach through the tunnel (never SSH, DNS or LuCI, +// whatever is stored). +func portalPorts(m *model.Model) []string { + s := m.Settings + if !s.PortalEnabled { + return nil + } + ok := func(p int) bool { return p >= 1 && p <= 65535 && p != 22 && p != 53 && p != 80 && p != 443 } + var out []string + if ok(s.PortalPort) { + out = append(out, fmt.Sprint(s.PortalPort)) + } + plain := false + for _, h := range append([]string{s.PortalHost}, s.PortalAlt...) { + plain = plain || ip4(h) + } + if plain && ok(s.PortalPort+1) { + out = append(out, fmt.Sprint(s.PortalPort+1)) + } + return out +} + +// Rebuild is the script that puts a whole table in place of the one there (one transaction). +func Rebuild(table string) string { + return "table inet dawnline\ndelete table inet dawnline\n" + table +} + +// Update is the script that replaces the members of every run-time set at once. It fails as a whole when +// the table or one of its sets is missing: the caller then rebuilds. +func Update(sets Sets) string { + var b strings.Builder + for _, name := range Names { + b.WriteString("flush set inet dawnline " + name + "\n") + if members := uniq(sets[name]); len(members) > 0 { + b.WriteString("add element inet dawnline " + name + " { " + strings.Join(members, ", ") + " }\n") + } + } + return b.String() +} + +// Shape counts what a table's text holds: its chains, its sets and the rules in its chains (for a log line). +func Shape(table string) (chains, sets, rules int) { + in := false + for _, l := range strings.Split(table, "\n") { + l = strings.TrimSpace(l) + switch { + case strings.HasPrefix(l, "chain "): + chains++ + in = true + case strings.HasPrefix(l, "set "): + sets++ + case in && l == "}": + in = false + case in && l != "" && !strings.HasPrefix(l, "type ") && !strings.HasPrefix(l, "policy ") && !strings.HasPrefix(l, "#"): + rules++ + } + } + return +} diff --git a/backend/nft/nft_test.go b/backend/nft/nft_test.go new file mode 100644 index 0000000..6ea4bae --- /dev/null +++ b/backend/nft/nft_test.go @@ -0,0 +1,141 @@ +package nft + +import ( + "encoding/json" + "os" + "reflect" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/netview" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// The access table for access's household, byte for byte the one ucode makes, for every row of states and +// of what is read from the router (testdata/trace.uc, scripts/ucode-golden.sh). +func TestTableAsUcode(t *testing.T) { + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + type oneCase = struct { + States map[string]string `json:"states"` + Ctx struct { + DNSAddr *string `json:"dns_addr"` + Resolver struct { + Mode string `json:"mode"` + Address string `json:"address"` + Port int `json:"port"` + } `json:"resolver"` + LanDNS *string `json:"lan_dns"` + } `json:"ctx"` + Sets Sets `json:"sets"` + Table string `json:"table"` + Shape struct{ Chains, Sets, Rules int } + } + var trace struct { + Cases []oneCase `json:"cases"` + Extra []oneCase `json:"extra"` + } + if err := json.Unmarshal(raw, &trace); err != nil { + t.Fatal(err) + } + if len(trace.Cases) != 16 || len(trace.Extra) != 3 { + t.Fatalf("%d and %d cases", len(trace.Cases), len(trace.Extra)) + } + load := func(path string) *model.Model { + text, _ := os.ReadFile(path) + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + return model.Load(c, nil) + } + m, m2 := load("../access/testdata/access.uci"), load("testdata/extra.uci") + raw, err = os.ReadFile("../netview/testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var router struct { + Routes json.RawMessage `json:"routes"` + Addrs json.RawMessage `json:"addrs"` + Firewall string `json:"firewall"` + Links map[string]netview.Link `json:"links"` + } + json.Unmarshal(raw, &router) + fw, _ := uci.Parse(router.Firewall) + snap := netview.Take(netview.Sources{Routes: func() []byte { return router.Routes }, Addrs: func() []byte { return router.Addrs }, + Links: func() map[string]netview.Link { return router.Links }, Zones: func() netview.Zones { return netview.ZonesOf(fw) }}) + members := 0 + filled := map[string]bool{} + for i, want := range append(trace.Cases, trace.Extra...) { + m := m + if i >= len(trace.Cases) { + m = m2 + } + sets := AccessSets(m, want.States, snap) + for _, name := range Names { + filled[name] = filled[name] || len(sets[name]) > 0 + } + for _, name := range Names { + members += len(sets[name]) + } + if !reflect.DeepEqual(sets, want.Sets) { + for _, name := range Names { + if !reflect.DeepEqual(sets[name], want.Sets[name]) { + t.Errorf("case %d: set %s\n go: %v\n ucode: %v", i, name, sets[name], want.Sets[name]) + } + } + continue + } + str := func(p *string) string { + if p == nil { + return "" + } + return *p + } + ctx := Ctx{DNSAddr: str(want.Ctx.DNSAddr), LanDNS: str(want.Ctx.LanDNS), ResolverPort: want.Ctx.Resolver.Port, Snap: snap} + if want.Ctx.Resolver.Mode == "ns" { + ctx.ResolverNS = want.Ctx.Resolver.Address + } + got := Render(m, sets, ctx) + if got != want.Table { + g, w := strings.Split(got, "\n"), strings.Split(want.Table, "\n") + for n := 0; n < len(g) && n < len(w); n++ { + if g[n] != w[n] { + t.Errorf("case %d: line %d\n go: %s\n ucode: %s", i, n+1, g[n], w[n]) + break + } + } + if len(g) != len(w) { + t.Errorf("case %d: %d lines, ucode %d", i, len(g), len(w)) + } + continue + } + if chains, nsets, rules := Shape(got); chains != want.Shape.Chains || nsets != want.Shape.Sets || rules != want.Shape.Rules { + t.Errorf("case %d: shape %d %d %d, ucode %+v", i, chains, nsets, rules, want.Shape) + } + } + for _, name := range Names { + if !filled[name] { + t.Errorf("no case fills %s", name) + } + } + if members < 200 { + t.Fatalf("the household fills the sets too little: %d members", members) + } +} + +func TestUpdateScript(t *testing.T) { + got := Update(Sets{"lan_ok": {"10.77.0.2", "10.77.0.2", "10.77.0.3"}, "svc_ok": {"10.77.0.8 . 192.168.77.5 . 445"}}) + want := "flush set inet dawnline lan_ok\nadd element inet dawnline lan_ok { 10.77.0.2, 10.77.0.3 }\nflush set inet dawnline lan_all\nflush set inet dawnline lan_part\n" + + "flush set inet dawnline mesh_pairs\nflush set inet dawnline inet_ok\nflush set inet dawnline svc_ok\nadd element inet dawnline svc_ok { 10.77.0.8 . 192.168.77.5 . 445 }\n" + + "flush set inet dawnline svc_host\nflush set inet dawnline dns_real\n" + if got != want { + t.Fatalf("the update:\n%s", got) + } + if !strings.HasPrefix(Rebuild("table inet dawnline {\n}\n"), "table inet dawnline\ndelete table inet dawnline\ntable inet dawnline {") { + t.Fatal("a rebuild does not replace the table in one transaction") + } +} diff --git a/backend/nft/testdata/extra.uci b/backend/nft/testdata/extra.uci new file mode 100644 index 0000000..63a6b47 --- /dev/null +++ b/backend/nft/testdata/extra.uci @@ -0,0 +1,136 @@ +config settings 'settings' + option portal_enabled '1' + option portal_port '443' + option portal_host '203.0.113.7' + +config server 'home' + option name 'Home' + option ifname 'dawn0' + option port '4500' + option subnet '10.77.0.0/24' + option private_key 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaA=' + option auto_lan '0' + list lan_device 'br-lan' + option mesh 'all' + option lan_like '1' + +config server 'guest' + option name 'Guest' + option ifname 'dawn1' + option port '4600' + option subnet '10.78.0.0/24' + option private_key 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA=' + option auto_lan '0' + list lan_device 'dlhome' + list lan_device 'dlguest' + option mesh 'off' + +config server 'keyless' + option name 'Keyless' + option ifname 'dawn2' + option port '4700' + option subnet '10.79.0.0/24' + +config server 'badname' + option name 'Bad name' + option ifname 'Not-A-Name' + option port '4800' + option subnet '10.80.0.0/24' + option private_key 'ccccccccccccccccccccccccccccccccccccccccccA=' + +config service 'nas' + option name 'NAS' + option address '192.168.77.5' + list port '445' + list port '139' + list port 'smb' + +config service 'cam' + option name 'Camera' + option address '192.168.50.30' + +config service 'v6' + option name 'Six' + option address '2001:db8::5' + list port '80' + +config person 'anna' + option server 'home' + option name 'Anna' + option access 'both' + +config person 'eva' + option server 'home' + option name 'Eva' + option access 'lan' + option dns_mode 'home' + list service 'nas' + list service 'cam' + list service 'v6' + list service 'gone' + +config person 'dima' + option server 'guest' + option name 'Dima' + option access 'lan' + option dns_mode 'home' + list home_net 'dlguest' + +config person 'kira' + option server 'keyless' + option name 'Kira' + option access 'both' + +config person 'lost' + option server 'nowhere' + option name 'Lost' + option access 'both' + +config device 'aphone' + option person 'anna' + option name 'Phone' + option address '10.77.0.2' + option public_key 'ddddddddddddddddddddddddddddddddddddddddddA=' + +config device 'atwin' + option person 'anna' + option name 'Twin' + option address '10.77.0.2' + option public_key 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeA=' + +config device 'aoff' + option person 'anna' + option name 'Off' + option address '10.77.0.3' + option public_key 'ffffffffffffffffffffffffffffffffffffffffffA=' + option disabled '1' + +config device 'av6' + option person 'anna' + option name 'Six' + option address 'fd00::2' + option public_key 'ggggggggggggggggggggggggggggggggggggggggggA=' + +config device 'ephone' + option person 'eva' + option name 'Phone' + option address '10.77.0.8' + option public_key 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhA=' + +config device 'dphone' + option person 'dima' + option name 'Phone' + option address '10.78.0.2' + option public_key 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiA=' + +config device 'kphone' + option person 'kira' + option name 'Phone' + option address '10.79.0.2' + option public_key 'jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjA=' + +config device 'lphone' + option person 'lost' + option name 'Phone' + option address '10.81.0.2' + option public_key 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkA=' diff --git a/backend/nft/testdata/trace.json b/backend/nft/testdata/trace.json new file mode 100644 index 0000000..f8cbfff --- /dev/null +++ b/backend/nft/testdata/trace.json @@ -0,0 +1,1311 @@ +{ + "cases": [ + { + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": null + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": "192.168.77.9", + "resolver": { + "mode": "ns", + "address": "169.254.7.2", + "port": 53 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tip daddr 192.168.77.9 meta l4proto { tcp, udp } th dport 53 accept\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.7.2:53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 34 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "clara": "active", + "dima": "active", + "eva": "active", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": "not an address", + "resolver": { + "mode": "ns", + "address": "nor this", + "port": 53 + }, + "lan_dns": "fe80::1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "paused", + "boris": "active", + "clara": "active", + "dima": "expired", + "eva": "quota", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": null + }, + "sets": { + "lan_ok": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "paused", + "boris": "active", + "clara": "active", + "dima": "expired", + "eva": "quota", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": "192.168.77.9", + "resolver": { + "mode": "ns", + "address": "169.254.7.2", + "port": 53 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tip daddr 192.168.77.9 meta l4proto { tcp, udp } th dport 53 accept\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.7.2:53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 34 + } + }, + { + "states": { + "anna": "paused", + "boris": "active", + "clara": "active", + "dima": "expired", + "eva": "quota", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "paused", + "boris": "active", + "clara": "active", + "dima": "expired", + "eva": "quota", + "fedor": "active", + "gleb": "active", + "hana": "active", + "ivan": "active", + "kira": "active", + "lev": "active", + "nora": "active" + }, + "ctx": { + "dns_addr": "not an address", + "resolver": { + "mode": "ns", + "address": "nor this", + "port": 53 + }, + "lan_dns": "fe80::1" + }, + "sets": { + "lan_ok": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.5", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3" + ], + "lan_part": [ + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.5", + "10.77.0.6", + "10.77.0.9", + "10.77.0.10", + "10.78.0.2", + "10.78.0.3", + "10.79.0.2", + "10.79.0.3", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.5, 10.77.0.6, 10.77.0.9, 10.77.0.10, 10.78.0.2, 10.78.0.3, 10.79.0.2, 10.79.0.3, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": null + }, + "sets": { + "lan_ok": [ + ], + "lan_all": [ + ], + "lan_part": [ + ], + "mesh_pairs": [ + ], + "inet_ok": [ + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; }\n\tset lan_all { type ipv4_addr; flags interval; }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + }, + "ctx": { + "dns_addr": "192.168.77.9", + "resolver": { + "mode": "ns", + "address": "169.254.7.2", + "port": 53 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + ], + "lan_all": [ + ], + "lan_part": [ + ], + "mesh_pairs": [ + ], + "inet_ok": [ + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; }\n\tset lan_all { type ipv4_addr; flags interval; }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tip daddr 192.168.77.9 meta l4proto { tcp, udp } th dport 53 accept\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.7.2:53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 34 + } + }, + { + "states": { + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + ], + "lan_all": [ + ], + "lan_part": [ + ], + "mesh_pairs": [ + ], + "inet_ok": [ + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; }\n\tset lan_all { type ipv4_addr; flags interval; }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + }, + "ctx": { + "dns_addr": "not an address", + "resolver": { + "mode": "ns", + "address": "nor this", + "port": 53 + }, + "lan_dns": "fe80::1" + }, + "sets": { + "lan_ok": [ + ], + "lan_all": [ + ], + "lan_part": [ + ], + "mesh_pairs": [ + ], + "inet_ok": [ + ], + "svc_ok": [ + ], + "svc_host": [ + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; }\n\tset lan_all { type ipv4_addr; flags interval; }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "fedor": "active", + "nora": "active", + "eva": "active", + "dima": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": null + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "fedor": "active", + "nora": "active", + "eva": "active", + "dima": "active" + }, + "ctx": { + "dns_addr": "192.168.77.9", + "resolver": { + "mode": "ns", + "address": "169.254.7.2", + "port": 53 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tip daddr 192.168.77.9 meta l4proto { tcp, udp } th dport 53 accept\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.7.2:53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 34 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "fedor": "active", + "nora": "active", + "eva": "active", + "dima": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + }, + { + "states": { + "anna": "active", + "boris": "active", + "fedor": "active", + "nora": "active", + "eva": "active", + "dima": "active" + }, + "ctx": { + "dns_addr": "not an address", + "resolver": { + "mode": "ns", + "address": "nor this", + "port": 53 + }, + "lan_dns": "fe80::1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.7", + "10.77.0.9", + "10.77.0.11" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9" + ], + "lan_part": [ + "10.77.0.7 . 192.168.50.0/24", + "10.77.0.11 . 192.168.77.0/24" + ], + "mesh_pairs": [ + "10.77.0.2 . 10.77.0.3", + "10.77.0.2 . 10.77.0.5", + "10.77.0.2 . 10.77.0.11", + "10.77.0.3 . 10.77.0.2", + "10.77.0.3 . 10.77.0.5", + "10.77.0.3 . 10.77.0.11", + "10.77.0.5 . 10.77.0.2", + "10.77.0.5 . 10.77.0.3", + "10.77.0.5 . 10.77.0.11", + "10.77.0.11 . 10.77.0.2", + "10.77.0.11 . 10.77.0.3", + "10.77.0.11 . 10.77.0.5" + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.3", + "10.77.0.5", + "10.77.0.9", + "10.77.0.11" + ], + "svc_ok": [ + ], + "svc_host": [ + "10.77.0.8 . 192.168.77.5", + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.50.0/24, 192.168.77.0/24 } }\n\tset home_cabin { type ipv4_addr; flags interval; elements = { 192.168.50.0/24 } }\n\tset home_open { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24, 10.79.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.7, 10.77.0.9, 10.77.0.11 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.7 . 192.168.50.0/24, 10.77.0.11 . 192.168.77.0/24 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.2 . 10.77.0.3, 10.77.0.2 . 10.77.0.5, 10.77.0.2 . 10.77.0.11, 10.77.0.3 . 10.77.0.2, 10.77.0.3 . 10.77.0.5, 10.77.0.3 . 10.77.0.11, 10.77.0.5 . 10.77.0.2, 10.77.0.5 . 10.77.0.3, 10.77.0.5 . 10.77.0.11, 10.77.0.11 . 10.77.0.2, 10.77.0.11 . 10.77.0.3, 10.77.0.11 . 10.77.0.5 } }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.77.0.3, 10.77.0.5, 10.77.0.9, 10.77.0.11 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.77.5, 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 4500, 4501 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_cabin ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn2\" ip daddr @home_open ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr . ip daddr @mesh_pairs accept\n\t\tiifname \"dawn2\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\", \"dawn2\" } iifname != { \"dawn0\", \"dawn1\", \"dawn2\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_cabin ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn2\" ip saddr @home_open ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\", \"dawn2\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t\tiifname \"dawn2\" ip daddr 10.79.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 12, + "rules": 33 + } + } + ], + "extra": [ + { + "states": { + "anna": "active", + "eva": "active", + "dima": "active", + "kira": "active", + "lost": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": null + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.78.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_part": [ + "10.78.0.2 . 10.20.4.0/22" + ], + "mesh_pairs": [ + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "svc_ok": [ + "10.77.0.8 . 192.168.77.5 . 445", + "10.77.0.8 . 192.168.77.5 . 139" + ], + "svc_host": [ + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + "10.77.0.8", + "10.78.0.2" + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset home_guest { type ipv4_addr; flags interval; elements = { 10.20.4.0/22, 192.168.50.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.78.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.78.0.2 . 10.20.4.0/22 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; elements = { 10.77.0.8 . 192.168.77.5 . 445, 10.77.0.8 . 192.168.77.5 . 139 } }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; elements = { 10.77.0.8, 10.78.0.2 } }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 444 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_guest ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\" } iifname != { \"dawn0\", \"dawn1\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_guest ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 11, + "rules": 29 + } + }, + { + "states": { + "anna": "active", + "eva": "active", + "dima": "active", + "kira": "active", + "lost": "active" + }, + "ctx": { + "dns_addr": "192.168.77.9", + "resolver": { + "mode": "ns", + "address": "169.254.7.2", + "port": 53 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.78.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_part": [ + "10.78.0.2 . 10.20.4.0/22" + ], + "mesh_pairs": [ + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "svc_ok": [ + "10.77.0.8 . 192.168.77.5 . 445", + "10.77.0.8 . 192.168.77.5 . 139" + ], + "svc_host": [ + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + "10.77.0.8", + "10.78.0.2" + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset home_guest { type ipv4_addr; flags interval; elements = { 10.20.4.0/22, 192.168.50.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.78.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.78.0.2 . 10.20.4.0/22 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; elements = { 10.77.0.8 . 192.168.77.5 . 445, 10.77.0.8 . 192.168.77.5 . 139 } }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; elements = { 10.77.0.8, 10.78.0.2 } }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 444 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tip daddr 192.168.77.9 meta l4proto { tcp, udp } th dport 53 accept\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_guest ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\" } iifname != { \"dawn0\", \"dawn1\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_guest ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.7.2:53\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.9:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 11, + "rules": 30 + } + }, + { + "states": { + "anna": "active", + "eva": "active", + "dima": "active", + "kira": "active", + "lost": "active" + }, + "ctx": { + "dns_addr": null, + "resolver": { + "mode": "root", + "port": 5354 + }, + "lan_dns": "192.168.77.1" + }, + "sets": { + "lan_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.78.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_all": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "lan_part": [ + "10.78.0.2 . 10.20.4.0/22" + ], + "mesh_pairs": [ + ], + "inet_ok": [ + "10.77.0.2", + "10.77.0.2", + "10.79.0.2", + "10.81.0.2" + ], + "svc_ok": [ + "10.77.0.8 . 192.168.77.5 . 445", + "10.77.0.8 . 192.168.77.5 . 139" + ], + "svc_host": [ + "10.77.0.8 . 192.168.50.30" + ], + "dns_real": [ + "10.77.0.8", + "10.78.0.2" + ] + }, + "table": "table inet dawnline {\n\tset home_home { type ipv4_addr; flags interval; elements = { 192.168.77.0/24 } }\n\tset home_guest { type ipv4_addr; flags interval; elements = { 10.20.4.0/22, 192.168.50.0/24 } }\n\tset tun_nets { type ipv4_addr; flags interval; elements = { 10.77.0.0/24, 10.78.0.0/24 } }\n\tset lan_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.78.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_all { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset lan_part { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.78.0.2 . 10.20.4.0/22 } }\n\tset mesh_pairs { type ipv4_addr . ipv4_addr; flags interval; }\n\tset inet_ok { type ipv4_addr; flags interval; elements = { 10.77.0.2, 10.79.0.2, 10.81.0.2 } }\n\tset svc_ok { type ipv4_addr . ipv4_addr . inet_service; flags interval; elements = { 10.77.0.8 . 192.168.77.5 . 445, 10.77.0.8 . 192.168.77.5 . 139 } }\n\tset svc_host { type ipv4_addr . ipv4_addr; flags interval; elements = { 10.77.0.8 . 192.168.50.30 } }\n\tset dns_real { type ipv4_addr; flags interval; elements = { 10.77.0.8, 10.78.0.2 } }\n\tchain pre {\n\t\ttype filter hook prerouting priority -160; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } jump guard\n\t}\n\tchain guard {\n\t\tmeta nfproto ipv6 drop\n\t\tct state related accept\n\t\tct status dnat accept\n\t\ticmp type { echo-request, echo-reply } fib daddr type local accept\n\t\tfib daddr type local meta l4proto { tcp, udp } th dport 53 accept\n\t\tfib daddr type local tcp dport { 444 } accept\n\t\tfib daddr type local ip saddr @lan_all accept\n\t\tfib daddr type local ip saddr . ip daddr @lan_part accept\n\t\tfib daddr type local counter drop\n\t\tiifname \"dawn0\" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tiifname \"dawn1\" ip daddr @home_guest ip daddr != @tun_nets ip saddr @lan_all accept\n\t\tip saddr . ip daddr @lan_part ip daddr != @tun_nets accept\n\t\tiifname \"dawn0\" ip saddr @lan_ok ip daddr @lan_ok accept\n\t\tmeta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept\n\t\tip saddr . ip daddr @svc_host accept\n\t\tip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop\n\t\tip saddr @inet_ok accept\n\t\tcounter drop\n\t}\n\tchain inbound {\n\t\ttype filter hook forward priority filter - 5; policy accept;\n\t\toifname { \"dawn0\", \"dawn1\" } iifname != { \"dawn0\", \"dawn1\" } ct state new jump to_device\n\t}\n\tchain to_device {\n\t\tmeta nfproto ipv6 drop\n\t\tct status dnat accept\n\t\toifname \"dawn0\" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept\n\t\toifname \"dawn1\" ip saddr @home_guest ip saddr != @tun_nets ip daddr @lan_all accept\n\t\tip daddr . ip saddr @lan_part ip saddr != @tun_nets accept\n\t\tcounter reject with icmpx admin-prohibited\n\t}\n\tchain dns {\n\t\ttype nat hook prerouting priority dstnat - 5; policy accept;\n\t\tiifname { \"dawn0\", \"dawn1\" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 redirect to :5354\n\t}\n\tchain dns_lan {\n\t\ttype nat hook prerouting priority dstnat + 5; policy accept;\n\t\tiifname \"dawn0\" ip daddr 10.77.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t\tiifname \"dawn1\" ip daddr 10.78.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.77.1:53\n\t}\n}\n", + "shape": { + "chains": 6, + "sets": 11, + "rules": 29 + } + } + ] +} diff --git a/backend/pkgmgr/pkgmgr.go b/backend/pkgmgr/pkgmgr.go new file mode 100644 index 0000000..c02c843 --- /dev/null +++ b/backend/pkgmgr/pkgmgr.go @@ -0,0 +1,359 @@ +// Package pkgmgr is one interface over the router's package manager: opkg on OpenWrt 24.10, apk on 25.12 +// (dawnline.pkg). Commands that change packages take a log(line) callback, which gets what they say. +package pkgmgr + +import ( + "fmt" + "os" + "regexp" + "strconv" + "strings" +) + +// Manager is the router's package manager. +type Manager struct { + // Run runs a shell command: what it said (both streams) and its exit code. + Run func(cmd string) (out string, code int) + // Apk tells whether this router has apk (else opkg). + Apk bool + // T puts a sentence in the job's language (nil: as it is). + T func(msg string) string +} + +// Failure is a refusal with its words (already in the job's language). +type Failure struct{ Msg string } + +func (f Failure) Error() string { return f.Msg } + +// System is the router's own, by what is installed. +func System(run func(cmd string) (string, int)) *Manager { + st, err := os.Stat("/usr/bin/apk") + return &Manager{Run: run, Apk: err == nil && st.Mode()&0o111 != 0} +} + +func (m *Manager) t(msg string) string { + if m.T != nil { + return m.T(msg) + } + return msg +} + +// Q quotes a word for the shell. +func Q(s string) string { return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" } + +func qAll(list []string) string { + q := make([]string, len(list)) + for i, s := range list { + q[i] = Q(s) + } + return strings.Join(q, " ") +} + +const blank = " \t\r\n\v\f" + +func (m *Manager) logged(cmd string, log func(string)) (string, int) { + out, code := m.Run(cmd) + if log != nil { + for _, line := range strings.Split(strings.Trim(out, blank), "\n") { + if strings.Trim(line, blank) != "" { + log(" " + line) + } + } + } + return out, code +} + +// Ext is the package files' extension here. +func (m *Manager) Ext() string { + if m.Apk { + return "apk" + } + return "ipk" +} + +// Version is the installed version of a package, or "". +func (m *Manager) Version(name string) string { + esc := regexp.QuoteMeta(name) + if m.Apk { + out, _ := m.Run("apk list --installed " + Q(name)) + if f := regexp.MustCompile(`^` + esc + `-([^ ]+) `).FindStringSubmatch(out); f != nil { + return f[1] + } + // a name another package provides (OpenWrt 25.12: «acme» is acme-acmesh's): that package's version + out, _ = m.Run("apk list --installed --providers " + Q(name)) + if f := regexp.MustCompile(`(?m)^<` + esc + `> \S+?-(\d[^ ]*) `).FindStringSubmatch(out); f != nil { + return f[1] + } + return "" + } + // libraries carry their ABI in the name (libustream-openssl20201210) + re := regexp.MustCompile(`^` + esc + `([0-9]+)? - (.+)$`) + out, _ := m.Run("opkg list-installed") + found, exact := "", false + for _, line := range strings.Split(out, "\n") { + if f := re.FindStringSubmatch(strings.Trim(line, blank)); f != nil && (found == "" || (f[1] == "" && !exact)) { + found, exact = strings.Trim(f[2], blank), f[1] == "" + } + } + return found +} + +var ( + ipkName = regexp.MustCompile(`(^|\n)Package: *([^\n]+)`) + ipkVersion = regexp.MustCompile(`(^|\n)Version: *([^\n]+)`) + apkName = regexp.MustCompile(`\n *name: *([^\n]+)`) + apkVersion = regexp.MustCompile(`\n *version: *([^\n]+)`) +) + +// ControlInfo is the package a control text names (name, version; each "" when it does not say). Pure: an +// ipk's control file, else `apk adbdump` of an apk, whose first name and version are the package's own. +func ControlInfo(text string, ipk bool) (name, version string) { + pick := func(re *regexp.Regexp, i int) string { + if f := re.FindStringSubmatch(text); f != nil { + return f[i] + } + return "" + } + if ipk { + return pick(ipkName, 2), pick(ipkVersion, 2) + } + return pick(apkName, 1), pick(apkVersion, 1) +} + +// FileInfo is the package inside a file. +func (m *Manager) FileInfo(path string) (name, version string) { + if strings.HasSuffix(path, ".ipk") { + out, _ := m.Run("tar -xzOf " + Q(path) + " ./control.tar.gz | tar -xzO ./control") + return ControlInfo(out, true) + } + out, _ := m.Run("apk adbdump " + Q(path)) + return ControlInfo(out, false) +} + +// FileVersion is the version inside a package file, or "". +func (m *Manager) FileVersion(path string) string { + _, v := m.FileInfo(path) + return v +} + +// Cmp compares two package versions the way the package manager does (so -r10 is newer than -r9 and ~rc +// before the release): -1, 0 or 1; ok is false when one is unknown. +func (m *Manager) Cmp(a, b string) (int, bool) { + if a == "" || b == "" { + return 0, false + } + if a == b { + return 0, true + } + if m.Apk { + out, _ := m.Run("apk version -t " + Q(a) + " " + Q(b)) + switch strings.Trim(out, blank) { + case "<": + return -1, true + case ">": + return 1, true + case "=": + return 0, true + } + return 0, false + } + if _, code := m.Run("opkg compare-versions " + Q(a) + " '<<' " + Q(b)); code == 0 { + return -1, true + } + if _, code := m.Run("opkg compare-versions " + Q(a) + " '>>' " + Q(b)); code == 0 { + return 1, true + } + return 0, true +} + +// Refresh updates the package lists. +func (m *Manager) Refresh(log func(string)) bool { + cmd := "opkg update" + if m.Apk { + cmd = "apk update" + } + _, code := m.logged(cmd, log) + return code == 0 +} + +var dfFree = regexp.MustCompile(`\n\S+\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s`) + +// preflight: room for the files (or needKB from the feeds). The package manager unpacks before it removes, +// so a full flash leaves half an install behind. It fails with the numbers. +func (m *Manager) preflight(paths []string, needKB int64, log func(string)) error { + out, _ := m.Run("df -Pk /overlay 2>/dev/null || df -Pk / 2>/dev/null") + f := dfFree.FindStringSubmatch(out) + if f == nil { + return nil + } + free, _ := strconv.ParseInt(f[1], 10, 64) + need := needKB + if need == 0 { + need = 512 + } + for _, p := range paths { + if st, err := os.Stat(p); err == nil { + need += st.Size() * 3 / 1024 + } + } + if free < need { + return Failure{fmt.Sprintf(m.t("Not enough free space on the router: %d MB free, about %d MB needed. Remove old backups or packages first"), free/1024, need/1024+1)} + } + if log != nil { + log(" " + fmt.Sprintf(m.t("%d MB free on the overlay"), free/1024)) + } + return nil +} + +// Dawnline's own package: a file of it tells whether apk really reinstalled it. +const ( + self = "luci-app-dawnline" + selfMarker = "/usr/share/dawnline/version" +) + +// Wanted is a package file and what it holds. +type Wanted struct { + Name, Version, File string +} + +// Mismatched is the packages an apk install did not leave at their file's version: apk takes a given file +// as it is (an older version too, a rollback) but leaves an installed version alone, whatever the file. +// Pure: have is the installed version of each name. +func Mismatched(want []Wanted, have map[string]string) []Wanted { + var bad []Wanted + for _, w := range want { + if w.Name == "" || w.Version == "" || have[w.Name] != w.Version { + bad = append(bad, w) + } + } + return bad +} + +// InstallFiles installs package files (from a release): true when every one is in. force also reinstalls +// the same version or goes back to an older one (opkg; apk takes a file as it is: Dawnline's own package +// is checked by a file of it, any other by its installed version). +func (m *Manager) InstallFiles(paths []string, force bool, log func(string)) (bool, error) { + if err := m.preflight(paths, 0, log); err != nil { + return false, err + } + args := qAll(paths) + if !m.Apk { + flags := "" + if force { + flags = "--force-reinstall --force-downgrade " + } + _, code := m.logged("opkg install "+flags+args, log) + return code == 0, nil + } + var want []Wanted + own := false + for _, f := range paths { + n, v := m.FileInfo(f) + want = append(want, Wanted{n, v, f}) + own = own || n == self + } + // Dawnline's own reinstall that changed nothing is a failure, not a silent "done" + var before int64 + if st, err := os.Stat(selfMarker); own && force && err == nil { + before = st.ModTime().UnixNano() + } + if _, code := m.logged("apk add --allow-untrusted "+args, log); code != 0 { + return false, nil + } + if own { + if st, err := os.Stat(selfMarker); force && before != 0 && err == nil && st.ModTime().UnixNano() == before { + if log != nil { + log(" " + m.t("apk did not reinstall the version that is already installed")) + } + return false, Failure{m.t("apk doesn't reinstall an installed version. Install a different release, or run install.sh on the router")} + } + return true, nil + } + // any other package took when it is at its file's version (the same version again counts) + have := map[string]string{} + for _, w := range want { + if w.Name != "" { + have[w.Name] = m.Version(w.Name) + } + } + bad := Mismatched(want, have) + for _, w := range bad { + name, version, got := w.Name, w.Version, have[w.Name] + if name == "" { + name = w.File + } + if version == "" { + version = "?" + } + if got == "" { + got = "-" + } + if log != nil { + log(" " + fmt.Sprintf(m.t("apk did not install %s %s (installed: %s)"), name, version, got)) + } + } + return len(bad) == 0, nil +} + +func (m *Manager) feeds(apk, opkg string, names []string, log func(string)) (bool, error) { + if err := m.preflight(nil, 2048, log); err != nil { + return false, err + } + cmd := opkg + if m.Apk { + cmd = apk + } + _, code := m.logged(cmd+" "+qAll(names), log) + return code == 0, nil +} + +// Add installs packages by name from the feeds; Upgrade updates them. +func (m *Manager) Add(names []string, log func(string)) (bool, error) { + return m.feeds("apk add", "opkg install", names, log) +} + +func (m *Manager) Upgrade(names []string, log func(string)) (bool, error) { + return m.feeds("apk upgrade", "opkg upgrade", names, log) +} + +// Remove takes packages away. +func (m *Manager) Remove(names []string, log func(string)) bool { + cmd := "opkg remove" + if m.Apk { + cmd = "apk del" + } + _, code := m.logged(cmd+" "+qAll(names), log) + return code == 0 +} + +var ( + // "name-version-rN < newer": the version is what follows the last dash before the release suffix (a + // name may hold digits, a version no dash) + apkNewer = regexp.MustCompile(`^(\S+)-([^- ]+-r[0-9]+)\s+<\s+(\S+)`) + opkgNewer = regexp.MustCompile(`^(\S+) - (\S+) - (\S+)`) +) + +// ParseUpgradable reads the package manager's list of what the feeds have newer: the latest by name. Pure. +func ParseUpgradable(out string, apk bool) map[string]string { + up := map[string]string{} + re := opkgNewer + if apk { + re = apkNewer + } + for _, line := range strings.Split(out, "\n") { + if f := re.FindStringSubmatch(line); f != nil { + up[f[1]] = f[3] + } + } + return up +} + +// Upgradable is the installed packages with a newer version in the feeds. +func (m *Manager) Upgradable() map[string]string { + cmd := "opkg list-upgradable" + if m.Apk { + cmd = `apk version -l "<"` + } + out, _ := m.Run(cmd) + return ParseUpgradable(out, m.Apk) +} diff --git a/backend/pkgmgr/pkgmgr_test.go b/backend/pkgmgr/pkgmgr_test.go new file mode 100644 index 0000000..c3096f7 --- /dev/null +++ b/backend/pkgmgr/pkgmgr_test.go @@ -0,0 +1,27 @@ +package pkgmgr + +import ( + "strings" + "testing" +) + +func TestVersionApk(t *testing.T) { + m := &Manager{Apk: true, Run: func(cmd string) (string, int) { + switch { + case cmd == "apk list --installed 'ip-full'": + return "ip-full-6.14.0-r1 aarch64_cortex-a53 {feeds/base} (GPL-2.0) [installed]\n", 0 + case strings.HasPrefix(cmd, "apk list --installed --providers 'acme'"): + return " acme-acmesh-3.1.3-r3 noarch {feeds/packages/net/acme-acmesh} (GPL-3.0-only) [installed]\n", 0 + } + return "", 0 + }} + if v := m.Version("ip-full"); v != "6.14.0-r1" { + t.Fatalf("a package by its own name: %q", v) + } + if v := m.Version("acme"); v != "3.1.3-r3" { + t.Fatalf("a name another package provides: %q", v) + } + if v := m.Version("kmod-veth"); v != "" { + t.Fatalf("not installed: %q", v) + } +} diff --git a/backend/portal/bell.go b/backend/portal/bell.go new file mode 100644 index 0000000..73213a8 --- /dev/null +++ b/backend/portal/bell.go @@ -0,0 +1,210 @@ +package portal + +import ( + "context" + "fmt" + "os" + "sync" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// What rang. +type What int + +const ( + // Changed: something the page shows changed (a device came or went, the admin changed something). + Changed What = iota + // Counters: only the traffic counters moved, as they do every minute. + Counters +) + +// Sub is one stream's ear. +type Sub struct { + C chan What + person string +} + +func (s *Sub) drain() { + for { + select { + case <-s.C: + default: + return + } + } +} + +// Bell tells the streams that something changed for their person. +type Bell struct { + mu sync.Mutex + subs map[*Sub]struct{} +} + +// Listen gives an ear for one person's changes. +func (b *Bell) Listen(person string) *Sub { + s := &Sub{C: make(chan What, 4), person: person} + b.mu.Lock() + if b.subs == nil { + b.subs = map[*Sub]struct{}{} + } + b.subs[s] = struct{}{} + b.mu.Unlock() + return s +} + +// Forget takes an ear away. +func (b *Bell) Forget(s *Sub) { + b.mu.Lock() + delete(b.subs, s) + b.mu.Unlock() +} + +// Ring tells a person's streams (everyone's for ""). A stream that has not heard its last rings yet +// misses nothing: it asks for the whole state when it does. +func (b *Bell) Ring(person string, what What) { + b.mu.Lock() + for s := range b.subs { + if person == "" || s.person == person { + select { + case s.C <- what: + default: + } + } + } + b.mu.Unlock() +} + +// Heard tells whether anyone listens. +func (b *Bell) Heard() bool { + b.mu.Lock() + defer b.mu.Unlock() + return len(b.subs) > 0 +} + +// Watch rings the bell from the files the state is made of, looked at every second while someone listens: +// presence.json holds each person's revision (it moves with their devices' connections, their links' +// trouble and what the agent tells of them); the settings, the configurations handed out and a set-up's +// state concern whoever they show for; the counters move for everyone. +func Watch(ctx context.Context, b *Bell, run, data, config string) { + sig := func(path string) string { + st, err := os.Stat(path) + if err != nil { + return "-" + } + return fmt.Sprintf("%d/%d", st.ModTime().UnixNano(), st.Size()) + } + everyone := []string{config, data + "/issued.json", run + "/setup.json", run + "/link.json", run + "/netifd-blocked.json"} + last := map[string]string{} + revs := map[string]int64{} + idle := true + tick := time.NewTicker(time.Second) + defer tick.Stop() + for { + select { + case <-ctx.Done(): + return + case <-tick.C: + } + if !b.Heard() { + idle = true + continue + } + // what changed while nobody listened is no news: a stream opens on the whole state + quiet := idle + idle = false + all := false + for _, p := range everyone { + if s := sig(p); s != last[p] { + last[p] = s + all = true + } + } + presence := run + "/presence.json" + if s := sig(presence); s != last[presence] { + last[presence] = s + var kept struct { + People map[string]int64 `json:"people"` + } + files.ReadJSON(presence, &kept) + for id, rev := range kept.People { + if revs[id] != rev && !quiet && !all { + b.Ring(id, Changed) + } + } + revs = kept.People + if revs == nil { + revs = map[string]int64{} + } + } + usage := run + "/usage.json" + counters := false + if s := sig(usage); s != last[usage] { + last[usage] = s + counters = true + } + if quiet { + continue + } + if all { + b.Ring("", Changed) + } else if counters { + b.Ring("", Counters) + } + } +} + +// Settings reads the settings file for the server, again when it changed. +type Settings struct { + Path string + + mu sync.Mutex + sig string + codes map[string]string + redirect string +} + +func (s *Settings) load() { + sig := "-" + if st, err := os.Stat(s.Path); err == nil { + sig = fmt.Sprintf("%d/%d", st.ModTime().UnixNano(), st.Size()) + } + if sig == s.sig && s.codes != nil { + return + } + text, err := os.ReadFile(s.Path) + if err != nil { + return + } + c, err := uci.Parse(string(text)) + if err != nil { + return + } + m := model.Load(c, nil) + s.codes = map[string]string{} + for id, p := range m.People { + if p.Code != "" { + s.codes[p.Code] = id + } + } + s.redirect, s.sig = m.Settings.PortalRedirect, sig +} + +// PersonByCode is the id of the person a code is the link of, or "". +func (s *Settings) PersonByCode(code string) string { + s.mu.Lock() + defer s.mu.Unlock() + s.load() + return s.codes[code] +} + +// Redirect is where a path that is no link is sent. +func (s *Settings) Redirect() string { + s.mu.Lock() + defer s.mu.Unlock() + s.load() + return s.redirect +} diff --git a/backend/portal/portal.go b/backend/portal/portal.go new file mode 100644 index 0000000..d9c8fbf --- /dev/null +++ b/backend/portal/portal.go @@ -0,0 +1,432 @@ +// Package portal is the personal portal's web server: what a person's link opens. It takes the place of +// the second uhttpd the portal ran under, and adds what that could not give: a stream of the person's own +// page (GET //api/live), so the page follows the router instead of being asked for again. +// +// Until its API is ported (docs/backend.md, stage 5) the answers are still the ucode portal's: a request +// shaped like a personal link is handed to it as CGI, exactly as uhttpd did. What is new here: +// +// the door a path that is no personal link gets the portal's bare answer (a 404, or the redirect from +// Settings) from this process: a scanner or a flood on the root starts nothing +// the stream the person's state as one document: first whole (`put`), then only what changed (`patch`, +// a JSON Merge Patch), the moment something of theirs changes on the router; `gone` when the +// link stops working. The state is the ucode portal's own answer to /api/state, asked for +// the stream's own visitor (the device the page is open on is theirs), and only on a change +// the listener TLS with the portal's certificate, read again when its file changes (a renewal needs no +// restart); plain HTTP beside it only where the init script says an address needs it +// +// A code is never logged. A wrong code on the stream is the CGI's to judge and to count, like any other +// path under it. +package portal + +import ( + "bytes" + "context" + "crypto/tls" + "encoding/json" + "fmt" + "net" + "net/http" + "net/http/cgi" + "os" + "regexp" + "strings" + "sync" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/hub" +) + +const ( + // Queue is how many requests may wait for a CGI process before the next one is refused. + Queue = 64 + // Streams is how many pages may follow at once, and how many of one person's. + Streams = 64 + PersonStreams = 8 + // PingEvery keeps a stream from being taken for dead by what stands between (a proxy, a phone). + PingEvery = 15 * time.Second + // Settle is how long a stream waits after a change before it asks: an event moves the revision twice. + Settle = 300 * time.Millisecond + // CountersEvery is how often a stream asks again when only the traffic counters moved. + CountersEvery = 55 * time.Second +) + +// A personal link's first part: three words of six letters (dawnline.core WORD_CODE). +var code = regexp.MustCompile(`^[a-z]{6}-[a-z]{6}-[a-z]{6}$`) + +// What every answer of the portal carries (dawnline.portal SECURITY_HEADERS). +var security = [][2]string{ + {"X-Content-Type-Options", "nosniff"}, + {"Referrer-Policy", "no-referrer"}, + {"X-Frame-Options", "DENY"}, + {"Cache-Control", "no-store"}, +} + +// People tells what the server needs of the settings, as they are now. +type People interface { + // PersonByCode is the id of the person a code is the link of, or "". + PersonByCode(code string) string + // Redirect is where a path that is no link is sent ("": nowhere, it gets the 404). + Redirect() string +} + +// Server is the portal's web server. +type Server struct { + // TLS and Plain are the addresses to listen on (":4500"); Cert and Key the certificate's files. + TLS, Plain []string + Cert, Key string + // CGI is the command that answers a personal link (ucode with the portal's script); Procs how many + // of it run at once (each loads the whole model). + CGI []string + Procs int + // Native answers a personal link itself (the portal's API in Go); nil: the CGI does. + Native http.Handler + // People reads the settings; Bell rings when something changed for a person. + People People + Bell *Bell + Log func(format string, args ...any) + + sem chan struct{} + waiting chan struct{} + mu sync.Mutex + open map[string]int + total int +} + +// Handler is the server's answer to a request, ready to be served (Run does; a test stands it up itself). +func (s *Server) Handler() http.Handler { + if s.Procs < 1 { + s.Procs = 2 + } + if s.Log == nil { + s.Log = func(string, ...any) {} + } + s.sem = make(chan struct{}, s.Procs) + s.waiting = make(chan struct{}, Queue) + s.open = map[string]int{} + return http.HandlerFunc(s.serve) +} + +// Run serves until ctx ends. A port still held (the portal's old web server on its way out) is tried +// again for half a minute. +func (s *Server) Run(ctx context.Context) { + h := &http.Server{ + Handler: s.Handler(), + ReadHeaderTimeout: 20 * time.Second, + IdleTimeout: 30 * time.Second, + MaxHeaderBytes: 16 << 10, + BaseContext: func(net.Listener) context.Context { return ctx }, + ErrorLog: nil, + } + cert := &keeper{cert: s.Cert, key: s.Key} + h.TLSConfig = &tls.Config{MinVersion: tls.VersionTLS12, GetCertificate: cert.get} + var wg sync.WaitGroup + listen := func(addr string, secure bool) { + defer wg.Done() + var l net.Listener + var err error + for try := 0; ; try++ { + if l, err = net.Listen("tcp", addr); err == nil { + break + } + if try == 30 || ctx.Err() != nil { + s.Log("portal: %s is not ours to listen on: %v", addr, err) + return + } + select { + case <-ctx.Done(): + return + case <-time.After(time.Second): + } + } + if secure { + err = h.ServeTLS(l, "", "") + } else { + err = h.Serve(l) + } + if err != nil && err != http.ErrServerClosed { + s.Log("portal: %s stopped: %v", addr, err) + } + } + for _, a := range s.TLS { + wg.Add(1) + go listen(a, true) + } + for _, a := range s.Plain { + wg.Add(1) + go listen(a, false) + } + <-ctx.Done() + // streams end with ctx (BaseContext); what is being answered gets a moment + end, cancel := context.WithTimeout(context.Background(), 3*time.Second) + h.Shutdown(end) + cancel() + wg.Wait() +} + +// keeper holds the certificate and reads it again when its files changed. +type keeper struct { + cert, key string + mu sync.Mutex + sig string + have *tls.Certificate +} + +func (k *keeper) get(*tls.ClientHelloInfo) (*tls.Certificate, error) { + sig := "" + for _, p := range []string{k.cert, k.key} { + if st, err := os.Stat(p); err == nil { + sig += fmt.Sprintf("%d/%d;", st.ModTime().UnixNano(), st.Size()) + } + } + k.mu.Lock() + defer k.mu.Unlock() + if k.have != nil && sig == k.sig { + return k.have, nil + } + c, err := tls.LoadX509KeyPair(k.cert, k.key) + if err != nil { + // a renewal half written: the one we have serves until the new one reads + if k.have != nil { + return k.have, nil + } + return nil, err + } + k.have, k.sig = &c, sig + return k.have, nil +} + +func (s *Server) serve(w http.ResponseWriter, r *http.Request) { + path := r.URL.Path + first, rest, _ := strings.Cut(strings.TrimPrefix(path, "/"), "/") + if !strings.HasPrefix(path, "/") || !code.MatchString(first) { + s.bare(w, r) + return + } + if rest == "api/live" && r.Method == http.MethodGet { + if person := s.People.PersonByCode(first); person != "" { + s.live(w, r, first, person) + return + } + // a code that is nobody's: the portal's own answer, and its count of wrong guesses + } + s.cgi(w, r) +} + +// bare is the answer for anything that is no personal link: the 404, or the redirect from Settings. +// Byte for byte the ucode portal's not_found() (and the shell door's that stood before it); files always +// get the 404, so a missing asset never turns into someone's website. +func (s *Server) bare(w http.ResponseWriter, r *http.Request) { + path := r.URL.Path + file := strings.Contains(path[strings.LastIndex(path, "/")+1:], ".") + for _, p := range []string{"/luci-static", "/cgi-bin", "/ubus"} { + file = file || path == p || strings.HasPrefix(path, p+"/") + } + head := w.Header() + for _, kv := range security { + head.Set(kv[0], kv[1]) + } + head.Set("Content-Type", "text/plain") + if hsts(r) { + head.Set("Strict-Transport-Security", "max-age=31536000") + } + if to := s.People.Redirect(); to != "" && !file { + head.Set("Location", to) + w.WriteHeader(http.StatusFound) + w.Write([]byte("Moved\n")) + return + } + w.WriteHeader(http.StatusNotFound) + w.Write([]byte("Not found\n")) +} + +// hsts: the visitor is on HTTPS at the standard port (HSTS pins the whole name). +func hsts(r *http.Request) bool { + if r.TLS == nil { + return false + } + _, port, err := net.SplitHostPort(r.Host) + return err != nil || port == "443" +} + +// cgi answers a request under a personal link: this backend's own answer where it has one, else the ucode +// portal's, a few at a time. +func (s *Server) cgi(w http.ResponseWriter, r *http.Request) { + if s.Native != nil { + s.Native.ServeHTTP(w, r) + return + } + select { + case s.waiting <- struct{}{}: + defer func() { <-s.waiting }() + default: + http.Error(w, "Busy\n", http.StatusServiceUnavailable) + return + } + select { + case s.sem <- struct{}{}: + defer func() { <-s.sem }() + case <-r.Context().Done(): + return + } + h := cgi.Handler{ + Path: s.CGI[0], Args: s.CGI[1:], Dir: "/", + // DAWNLINE_LIVE: the page it serves is told that a stream waits for it at /api/live + Env: []string{"PATH=/usr/sbin:/usr/bin:/sbin:/bin", "DAWNLINE_LIVE=1"}, + } + h.ServeHTTP(w, r) +} + +// recorder takes a CGI answer in memory (the state a stream asks for). +type recorder struct { + head http.Header + status int + body bytes.Buffer +} + +func (c *recorder) Header() http.Header { return c.head } +func (c *recorder) WriteHeader(n int) { + if c.status == 0 { + c.status = n + } +} +func (c *recorder) Write(b []byte) (int, error) { + c.WriteHeader(http.StatusOK) + return c.body.Write(b) +} + +// state asks the ucode portal for the page's state as this visitor would: their address tells which of +// the person's devices the page is open on. ok is false when the link works no more. +func (s *Server) state(r *http.Request, link string) (doc any, ok bool, err error) { + ask := r.Clone(r.Context()) + ask.Method, ask.Body, ask.ContentLength = http.MethodGet, http.NoBody, 0 + u := *r.URL + u.Path, u.RawPath, u.RawQuery = "/"+link+"/api/state", "", "" + ask.URL = &u + ask.RequestURI = u.Path + ask.Header = r.Header.Clone() + // the answer is read here, as it is + ask.Header.Del("Accept-Encoding") + rec := &recorder{head: http.Header{}} + s.cgi(rec, ask) + switch { + case rec.status == http.StatusNotFound || rec.status == http.StatusUnauthorized: + return nil, false, nil + case rec.status != http.StatusOK: + return nil, true, fmt.Errorf("the portal answered %d", rec.status) + } + if err := json.Unmarshal(rec.body.Bytes(), &doc); err != nil { + return nil, true, err + } + return doc, true, nil +} + +// live is a page's stream. +func (s *Server) live(w http.ResponseWriter, r *http.Request, link, person string) { + flusher, can := w.(http.Flusher) + if !can || !s.enter(person) { + http.Error(w, "Busy\n", http.StatusServiceUnavailable) + return + } + defer s.leave(person) + sub := s.Bell.Listen(person) + defer s.Bell.Forget(sub) + + doc, ok, err := s.state(r, link) + if !ok { + // the link stopped working between the door and here: the portal's own answer + s.cgi(w, r) + return + } + if err != nil { + http.Error(w, "Error\n", http.StatusBadGateway) + return + } + head := w.Header() + for _, kv := range security { + head.Set(kv[0], kv[1]) + } + head.Set("Content-Type", "text/event-stream") + // nothing between may hold the events back + head.Set("X-Accel-Buffering", "no") + if hsts(r) { + head.Set("Strict-Transport-Security", "max-age=31536000") + } + w.WriteHeader(http.StatusOK) + send := func(event string, data any) bool { + raw, err := json.Marshal(data) + if err != nil { + return false + } + if _, err := fmt.Fprintf(w, "event: %s\ndata: %s\n\n", event, raw); err != nil { + return false + } + flusher.Flush() + return true + } + if !send("put", doc) { + return + } + ping := time.NewTicker(PingEvery) + defer ping.Stop() + asked := time.Now() + for { + select { + case <-r.Context().Done(): + return + case <-ping.C: + if _, err := fmt.Fprint(w, ": ping\n\n"); err != nil { + return + } + flusher.Flush() + continue + case what := <-sub.C: + // the counters alone move every minute for everyone: asked for at their own pace + if what == Counters && time.Since(asked) < CountersEvery { + continue + } + } + // an event moves the revision more than once: asked once it has settled + select { + case <-r.Context().Done(): + return + case <-time.After(Settle): + } + sub.drain() + next, ok, err := s.state(r, link) + asked = time.Now() + if !ok { + send("gone", struct{}{}) + return + } + if err != nil { + // asked again at the next change; what the page shows stays + continue + } + if patch, changed := hub.Diff(doc, next); changed { + if !send("patch", patch) { + return + } + } + doc = next + } +} + +func (s *Server) enter(person string) bool { + s.mu.Lock() + defer s.mu.Unlock() + if s.total >= Streams || s.open[person] >= PersonStreams { + return false + } + s.total++ + s.open[person]++ + return true +} + +func (s *Server) leave(person string) { + s.mu.Lock() + s.total-- + if s.open[person]--; s.open[person] <= 0 { + delete(s.open, person) + } + s.mu.Unlock() +} diff --git a/backend/portal/portal_test.go b/backend/portal/portal_test.go new file mode 100644 index 0000000..af2848f --- /dev/null +++ b/backend/portal/portal_test.go @@ -0,0 +1,235 @@ +package portal + +import ( + "bufio" + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "reflect" + "strings" + "testing" + "time" +) + +const link = "kamiro-telosu-bavine" + +type people struct{ redirect string } + +func (p people) PersonByCode(c string) string { + if c == link { + return "anna" + } + return "" +} +func (p people) Redirect() string { return p.redirect } + +// A portal to ask: the ucode portal is a shell script that says what it was asked and, for the state, +// prints the file the test keeps (no file: the link works no more). +func stand(t *testing.T, p people) (*httptest.Server, *Server, string) { + dir := t.TempDir() + script := dir + "/portal.sh" + os.WriteFile(script, []byte(`#!/bin/sh +case "$REQUEST_URI" in + */api/state) + if [ -f "`+dir+`/state.json" ]; then + printf 'Status: 200 OK\r\nContent-Type: application/json\r\n\r\n' + cat "`+dir+`/state.json" + else + printf 'Status: 404 Not Found\r\nContent-Type: text/plain\r\n\r\nNot found\n' + fi ;; + */api/live) + printf 'Status: 404 Not Found\r\nContent-Type: text/plain\r\nX-Judged: cgi\r\n\r\nNot found\n' ;; + *) + printf 'Status: 201 Created\r\nContent-Type: text/plain\r\nX-Frame-Options: DENY\r\n\r\n' + printf '%s %s from %s https=%s lang=%s body=' "$REQUEST_METHOD" "$REQUEST_URI" "$REMOTE_ADDR" "$HTTPS" "$HTTP_ACCEPT_LANGUAGE" + cat ;; +esac +`), 0o755) + s := &Server{CGI: []string{"/bin/sh", script}, Procs: 2, People: p, Bell: &Bell{}} + web := httptest.NewServer(s.Handler()) + t.Cleanup(web.Close) + return web, s, dir +} + +// The client the tests ask with (a test over TLS puts its server's own here). +var client = http.DefaultClient + +func get(t *testing.T, url string) (*http.Response, string) { + c := *client + c.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } + res, err := c.Get(url) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + body, _ := io.ReadAll(res.Body) + return res, string(body) +} + +func TestTheDoor(t *testing.T) { + web, _, _ := stand(t, people{}) + for _, path := range []string{"/", "/wp-login.php", "/cgi-bin/luci", "/kamiro-telosu", "/KAMIRO-telosu-bavine"} { + res, body := get(t, web.URL+path) + if res.StatusCode != 404 || body != "Not found\n" || res.Header.Get("X-Frame-Options") != "DENY" || + res.Header.Get("Cache-Control") != "no-store" || res.Header.Get("Content-Type") != "text/plain" { + t.Fatalf("%s: %d %q %v", path, res.StatusCode, body, res.Header) + } + } + // a redirect from Settings takes what is no file; a file keeps its 404 + web, _, _ = stand(t, people{redirect: "https://example.org/"}) + if res, body := get(t, web.URL+"/"); res.StatusCode != 302 || res.Header.Get("Location") != "https://example.org/" || body != "Moved\n" { + t.Fatalf("the redirect: %d %q", res.StatusCode, body) + } + for _, path := range []string{"/favicon.ico", "/luci-static/x", "/ubus"} { + if res, _ := get(t, web.URL+path); res.StatusCode != 404 { + t.Fatalf("%s followed the redirect: %d", path, res.StatusCode) + } + } +} + +func TestALinkGoesToThePortal(t *testing.T) { + web, _, _ := stand(t, people{}) + req, _ := http.NewRequest("POST", web.URL+"/"+link+"/api/devices?x=1", strings.NewReader(`{"name":"Phone"}`)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept-Language", "ru") + res, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + body, _ := io.ReadAll(res.Body) + want := "POST /" + link + `/api/devices?x=1 from 127.0.0.1 https= lang=ru body={"name":"Phone"}` + if res.StatusCode != 201 || string(body) != want { + t.Fatalf("%d %q", res.StatusCode, body) + } + // a code that is nobody's is the portal's to judge, on the stream's path too + if res, _ := get(t, web.URL+"/bavine-telosu-kamiro/api/live"); res.StatusCode != 404 || res.Header.Get("X-Judged") != "cgi" { + t.Fatalf("a wrong code on the stream: %d %v", res.StatusCode, res.Header) + } +} + +// events reads a stream's events as they come. +func events(t *testing.T, ctx context.Context, url string) <-chan [2]string { + req, _ := http.NewRequestWithContext(ctx, "GET", url, nil) + res, err := client.Do(req) + if err != nil { + t.Fatal(err) + } + if res.StatusCode != 200 || res.Header.Get("Content-Type") != "text/event-stream" || res.Header.Get("Cache-Control") != "no-store" { + t.Fatalf("the stream: %d %v", res.StatusCode, res.Header) + } + out := make(chan [2]string, 8) + go func() { + defer res.Body.Close() + defer close(out) + name := "" + sc := bufio.NewScanner(res.Body) + for sc.Scan() { + l := sc.Text() + if strings.HasPrefix(l, "event: ") { + name = l[7:] + } else if strings.HasPrefix(l, "data: ") { + out <- [2]string{name, l[6:]} + } + } + }() + return out +} + +func next(t *testing.T, ch <-chan [2]string) (string, map[string]any) { + select { + case e, ok := <-ch: + if !ok { + t.Fatal("the stream ended") + } + var doc map[string]any + json.Unmarshal([]byte(e[1]), &doc) + return e[0], doc + case <-time.After(5 * time.Second): + t.Fatal("nothing came down the stream") + } + return "", nil +} + +func TestTheStream(t *testing.T) { + web, s, dir := stand(t, people{}) + write := func(doc string) { os.WriteFile(dir+"/state.json", []byte(doc), 0o644) } + write(`{"person":{"name":"Anna","online":0,"devices":[{"id":"d1","online":false}]},"here":null,"now":1}`) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + ch := events(t, ctx, web.URL+"/"+link+"/api/live") + if name, doc := next(t, ch); name != "put" || doc["person"].(map[string]any)["name"] != "Anna" { + t.Fatalf("the first event: %s %v", name, doc) + } + // her phone connects: only what changed comes + write(`{"person":{"name":"Anna","online":1,"devices":[{"id":"d1","online":true}]},"here":"d1","now":2}`) + s.Bell.Ring("anna", Changed) + name, doc := next(t, ch) + want := map[string]any{"person": map[string]any{"online": 1.0, "devices": []any{map[string]any{"id": "d1", "online": true}}}, "here": "d1", "now": 2.0} + if name != "patch" || !reflect.DeepEqual(doc, want) { + t.Fatalf("after a change: %s %v", name, doc) + } + // someone else's change is not hers; the counters alone are asked for at their own pace + s.Bell.Ring("boris", Changed) + s.Bell.Ring("", Counters) + select { + case e := <-ch: + t.Fatalf("an event nobody caused: %v", e) + case <-time.After(Settle + 300*time.Millisecond): + } + // the link is taken away: the page is told, and the stream ends + os.Remove(dir + "/state.json") + s.Bell.Ring("", Changed) + if name, _ := next(t, ch); name != "gone" { + t.Fatalf("after the link went: %s", name) + } + if _, open := <-ch; open { + t.Fatal("the stream stays open after gone") + } + if s.total != 0 || len(s.open) != 0 { + t.Fatalf("streams still counted: %d %v", s.total, s.open) + } +} + +func TestWatchRingsForWhoChanged(t *testing.T) { + dir := t.TempDir() + run, data := dir+"/run", dir+"/data" + os.MkdirAll(run, 0o755) + os.MkdirAll(data, 0o755) + os.WriteFile(run+"/presence.json", []byte(`{"rev":4,"people":{"anna":4,"boris":2}}`), 0o600) + b := &Bell{} + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + go Watch(ctx, b, run, data, dir+"/config") + anna, boris := b.Listen("anna"), b.Listen("boris") + heard := func(s *Sub) (What, bool) { + select { + case w := <-s.C: + return w, true + case <-time.After(2500 * time.Millisecond): + return 0, false + } + } + // the first look after someone began to listen is no news + time.Sleep(1200 * time.Millisecond) + os.WriteFile(run+"/presence.json", []byte(`{"rev":5,"people":{"anna":5,"boris":2}}`), 0o600) + if w, ok := heard(anna); !ok || w != Changed { + t.Fatal("anna's change was not rung") + } + select { + case <-boris.C: + t.Fatal("boris heard anna's change") + default: + } + os.WriteFile(run+"/usage.json", []byte(`{}`), 0o600) + if w, ok := heard(boris); !ok || w != Counters { + t.Fatal("the counters were not rung for everyone") + } + os.WriteFile(dir+"/config", []byte("config settings 'settings'\n"), 0o600) + if w, ok := heard(boris); !ok || w != Changed { + t.Fatal("a change of the settings was not rung for everyone") + } +} diff --git a/backend/presence/presence.go b/backend/presence/presence.go new file mode 100644 index 0000000..6c1adda --- /dev/null +++ b/backend/presence/presence.go @@ -0,0 +1,201 @@ +// Package presence tells who is online: from one look at the tunnels to the next, which devices connected, +// left or moved to another address. It is the agent's watcher (libexec/agent watch(), dawnline.live) in Go, +// rule for rule. +// +// Online means the device's WireGuard session lives: a handshake within its online window +// (model.OnlineWindowOf). Traffic silence is no signal; a phone asleep is silent too. +// +// A Watcher holds what it saw last; Look is pure given that: the settings, a look at the tunnels and the +// clock go in, the events and who they concern come out. Whoever runs it publishes them. +package presence + +import ( + "regexp" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +// The events of a look. +const ( + Connect = "connect" + Disconnect = "disconnect" + Roam = "roam" +) + +// RestartGrace is how long a device missing from a tunnel that was just set up again keeps what was known +// of it (seconds). netifd deletes and adds a tunnel's link each time it sets it up: the devices come back +// only with the sync its hotplug starts, and then with no handshake until each makes a new one. Without +// the grace, that is a burst of disconnects and connects for everyone online. +const RestartGrace = 45 + +// Event is a device connecting, leaving or moving. +type Event struct { + Type string `json:"type"` + Person string `json:"person"` + Device string `json:"device"` + // Detail is the address it connected from, or "old → new" for a move. + Detail string `json:"detail,omitempty"` +} + +// Watcher is who was online at the last look. +type Watcher struct { + // Online and Endpoint are what a page is shown: a device's state and the address it last spoke from. + Online map[string]bool + Endpoint map[string]string + + // Per device: its latest real handshake, kept when the tunnel adds the peer again (its counters and + // handshake restart from zero), and the key it was seen with (new keys end the old session, whatever + // its handshake said). + handshake map[string]int64 + key map[string]string + // Per tunnel: the link last seen (0 while it is down), and until when its grace lasts. + link map[string]int + grace map[string]int64 +} + +// New starts from what was kept of the last run (nil for nothing), so a restart does not swallow the +// connects that happened in between. +func New(online map[string]bool, endpoint map[string]string) *Watcher { + w := &Watcher{Online: map[string]bool{}, Endpoint: map[string]string{}, + handshake: map[string]int64{}, key: map[string]string{}, link: map[string]int{}, grace: map[string]int64{}} + for k, v := range online { + w.Online[k] = v + } + for k, v := range endpoint { + w.Endpoint[k] = v + } + return w +} + +// Seen is what a look found. +type Seen struct { + Events []Event + // People are those whose pages changed (someone's device came, went or moved), in the order found. + People []string + // Addresses are those to locate: a connect's and a move's new one. + Addresses []string + // Rekeyed are the devices whose key changed since the last look: what was known of their link is void. + Rekeyed []string +} + +// Link is called for every device of a look, once it is known whether the device is online and before +// anything is concluded from its address: with its peer (nil when it is not in its tunnel) and whether its +// key changed since the last look. It is where the link's history is kept (package link); it returns true +// for a device whose address goes back and forth all the time (one configuration on two devices): that is +// no roaming, nor a reason to tell anyone. +type Link func(device string, peer *awg.Peer, online, rekeyed bool) (shared bool) + +// Look takes one look at the tunnels (link may be nil). A tunnel that could not be read says nothing about +// its devices, which stay as they were. +func (w *Watcher) Look(m *model.Model, d awg.Dump, now int64, link Link) Seen { + var s Seen + told := map[string]bool{} + tell := func(person string) { + if !told[person] { + told[person] = true + s.People = append(s.People, person) + } + } + for ifname, read := range d.Reads { + if read == awg.Failed { + continue + } + index := 0 + if ifc, ok := d.Ifaces[ifname]; ok { + index = ifc.Ifindex + } + if was, seen := w.link[ifname]; seen && was != index { + w.grace[ifname] = now + RestartGrace + } + w.link[ifname] = index + } + for ifname := range w.link { + if _, asked := d.Reads[ifname]; !asked { + delete(w.link, ifname) + delete(w.grace, ifname) + } + } + for _, id := range m.DeviceIDs() { + dev := m.Devices[id] + var srv *model.Server + ifname := "" + if p := m.People[dev.Person]; p != nil { + if srv = m.Servers[p.Server]; srv != nil { + ifname = srv.Ifname + } + } + if d.Reads[ifname] == awg.Failed { + continue + } + // New keys: offline until they shake hands. + rekeyed := false + if was, known := w.key[id]; !known || was != dev.PublicKey { + if known { + w.handshake[id] = 0 + s.Rekeyed = append(s.Rekeyed, id) + rekeyed = true + } + w.key[id] = dev.PublicKey + } + endpoint := "" + peer, there := d.Peers[dev.PublicKey] + if there { + w.handshake[id] = max(w.handshake[id], peer.Handshake) + endpoint = EndpointIP(peer.Endpoint) + } else if !(w.grace[ifname] > now) { + // Not in the tunnel (turned off, paused, out of time or data): offline now, and online again + // only with a new handshake, not the one remembered from before. Unless its tunnel was just + // set up again and the sync has not brought it back yet. + w.handshake[id] = 0 + } + on := w.handshake[id] > 0 && now-w.handshake[id] < int64(model.OnlineWindowOf(srv, dev)) + was := w.Online[id] + last := w.Endpoint[id] + shared := false + if link != nil { + var p *awg.Peer + if there { + p = &peer + } + shared = link(id, p, on, rekeyed) + } + switch { + case on && !was: + s.Events = append(s.Events, Event{Type: Connect, Person: dev.Person, Device: id, Detail: endpoint}) + s.Addresses = append(s.Addresses, endpoint) + case !on && was: + s.Events = append(s.Events, Event{Type: Disconnect, Person: dev.Person, Device: id}) + case on && endpoint != "" && last != "" && endpoint != last && !shared: + s.Events = append(s.Events, Event{Type: Roam, Person: dev.Person, Device: id, Detail: last + " → " + endpoint}) + s.Addresses = append(s.Addresses, endpoint) + } + if on != was || (endpoint != "" && endpoint != last && !shared) { + tell(dev.Person) + } + w.Online[id] = on + if endpoint != "" { + w.Endpoint[id] = endpoint + } + } + for id := range w.Online { + if m.Devices[id] == nil { + delete(w.Online, id) + delete(w.Endpoint, id) + delete(w.handshake, id) + delete(w.key, id) + } + } + return s +} + +// "203.0.113.7:41821", "[2001:db8::1]:41821". +var endpoint = regexp.MustCompile(`^\[?([^\]]+)\]?:[0-9]+$`) + +// EndpointIP is the address of an endpoint, without its port. +func EndpointIP(ep string) string { + if g := endpoint.FindStringSubmatch(ep); g != nil { + return g[1] + } + return ep +} diff --git a/backend/presence/presence_test.go b/backend/presence/presence_test.go new file mode 100644 index 0000000..1c7851c --- /dev/null +++ b/backend/presence/presence_test.go @@ -0,0 +1,164 @@ +package presence + +import ( + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +const ( + keyPhone = "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" + keyLaptop = "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=" + keyNew = "u4pL0000000000000000000000000000000000DyRrM=" +) + +func settings(t *testing.T, phoneKey string) *model.Model { + c, err := uci.Parse(` +config server 'home' + option ifname 'dawn0' + option subnet '10.77.0.0/24' + option private_key 'k' +config person 'anna' + option server 'home' +config device 'phone' + option person 'anna' + option kind 'phone' + option public_key '` + phoneKey + `' +config device 'laptop' + option person 'anna' + option kind 'computer' + option public_key '` + keyLaptop + `' +`) + if err != nil { + t.Fatal(err) + } + return model.Load(c, nil) +} + +// A look at the tunnel: its link's index, and the peers with their handshake and where they spoke from. +func look(index int, peers map[string]awg.Peer) awg.Dump { + d := awg.Dump{OK: true, Reads: map[string]string{"dawn0": awg.Read}, Ifaces: map[string]awg.Iface{"dawn0": {Ifindex: index}}, Peers: peers} + if index == 0 { + d.Reads["dawn0"] = awg.Down + d.Ifaces = map[string]awg.Iface{} + } + return d +} + +func TestConnectRoamDisconnect(t *testing.T) { + m := settings(t, keyPhone) + w := New(nil, nil) + at := func(now, handshake int64, from string) Seen { + return w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: handshake, Endpoint: from}, keyPhone: {}}), now, nil) + } + // never shook hands: nothing + if s := at(1000, 0, ""); len(s.Events) != 0 || len(s.People) != 0 { + t.Fatalf("idle: %+v", s) + } + s := at(1010, 1005, "203.0.113.7:41821") + if !reflect.DeepEqual(s.Events, []Event{{Type: Connect, Person: "anna", Device: "laptop", Detail: "203.0.113.7"}}) || + !reflect.DeepEqual(s.People, []string{"anna"}) || !reflect.DeepEqual(s.Addresses, []string{"203.0.113.7"}) { + t.Fatalf("connect: %+v", s) + } + // still there, nothing new + if s := at(1100, 1005, "203.0.113.7:41821"); len(s.Events) != 0 || len(s.People) != 0 { + t.Fatalf("steady: %+v", s) + } + s = at(1120, 1110, "[2001:db8::1]:500") + if len(s.Events) != 1 || s.Events[0].Type != Roam || s.Events[0].Detail != "203.0.113.7 → 2001:db8::1" || len(s.People) != 1 { + t.Fatalf("roam: %+v", s) + } + // a computer's window is 190 s from its handshake + if s := at(1110+189, 1110, "[2001:db8::1]:500"); len(s.Events) != 0 { + t.Fatalf("within its window: %+v", s) + } + s = at(1110+190, 1110, "[2001:db8::1]:500") + if !reflect.DeepEqual(s.Events, []Event{{Type: Disconnect, Person: "anna", Device: "laptop"}}) || w.Online["laptop"] { + t.Fatalf("disconnect: %+v", s) + } + if w.Endpoint["laptop"] != "2001:db8::1" { + t.Fatalf("the last address is kept: %v", w.Endpoint) + } +} + +// A phone sleeps through its keep-alives: ten minutes, not three. +func TestPhoneSleeps(t *testing.T) { + m := settings(t, keyPhone) + w := New(nil, nil) + at := func(now int64) Seen { + return w.Look(m, look(7, map[string]awg.Peer{keyPhone: {Handshake: 1000, Endpoint: "198.51.100.4:9"}}), now, nil) + } + at(1001) + if s := at(1000 + 599); len(s.Events) != 0 || !w.Online["phone"] { + t.Fatalf("asleep: %+v", s) + } + if s := at(1000 + 600); len(s.Events) != 1 || s.Events[0].Type != Disconnect { + t.Fatalf("gone: %+v", s) + } +} + +// One configuration on two devices: its address goes back and forth, which is no roaming. +func TestSharedConfigurationDoesNotRoam(t *testing.T) { + m := settings(t, keyPhone) + w := New(nil, nil) + w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: 1000, Endpoint: "203.0.113.7:1"}}), 1001, nil) + s := w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: 1010, Endpoint: "198.51.100.4:1"}}), 1011, func(string, *awg.Peer, bool, bool) bool { return true }) + if len(s.Events) != 0 || len(s.People) != 0 { + t.Fatalf("shared: %+v", s) + } +} + +// The tunnel set up again: its devices are missing for a while and come back without a handshake. +func TestTunnelSetUpAgain(t *testing.T) { + m := settings(t, keyPhone) + w := New(nil, nil) + w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: 1000, Endpoint: "203.0.113.7:1"}}), 1001, nil) + // a new link, no peers yet, then peers with no handshake: still online within the grace and its window + if s := w.Look(m, look(8, map[string]awg.Peer{}), 1010, nil); len(s.Events) != 0 || !w.Online["laptop"] { + t.Fatalf("set up again: %+v", s) + } + if s := w.Look(m, look(8, map[string]awg.Peer{keyLaptop: {}}), 1030, nil); len(s.Events) != 0 || !w.Online["laptop"] { + t.Fatalf("back without a handshake: %+v", s) + } + // past the grace, a device that is not in the tunnel is offline at once + if s := w.Look(m, look(8, map[string]awg.Peer{}), 1010+RestartGrace+1, nil); len(s.Events) != 1 || s.Events[0].Type != Disconnect { + t.Fatalf("removed: %+v", s) + } +} + +func TestUnreadTunnelSaysNothing(t *testing.T) { + m := settings(t, keyPhone) + w := New(nil, nil) + w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: 1000, Endpoint: "203.0.113.7:1"}}), 1001, nil) + failed := awg.Dump{Reads: map[string]string{"dawn0": awg.Failed}, Ifaces: map[string]awg.Iface{}, Peers: map[string]awg.Peer{}} + if s := w.Look(m, failed, 5000, nil); len(s.Events) != 0 || !w.Online["laptop"] { + t.Fatalf("an unread tunnel changed something: %+v", s) + } +} + +// New keys end the old session, whatever its handshake said; a removed device is forgotten. +func TestNewKeysAndRemoval(t *testing.T) { + w := New(nil, nil) + w.Look(settings(t, keyPhone), look(7, map[string]awg.Peer{keyPhone: {Handshake: 1000, Endpoint: "198.51.100.4:9"}}), 1001, nil) + s := w.Look(settings(t, keyNew), look(7, map[string]awg.Peer{keyNew: {}}), 1002, nil) + if !reflect.DeepEqual(s.Rekeyed, []string{"phone"}) || len(s.Events) != 1 || s.Events[0].Type != Disconnect { + t.Fatalf("new keys: %+v", s) + } + c, _ := uci.Parse("config server 'home'\n") + w.Look(model.Load(c, nil), look(7, nil), 1003, nil) + if len(w.Online) != 0 || len(w.Endpoint) != 0 { + t.Fatalf("removed devices are kept: %+v %+v", w.Online, w.Endpoint) + } +} + +// What was kept of the last run: a device online then is not a new connect now. +func TestRestartKeepsWhoWasOnline(t *testing.T) { + m := settings(t, keyPhone) + w := New(map[string]bool{"laptop": true}, map[string]string{"laptop": "203.0.113.7"}) + if s := w.Look(m, look(7, map[string]awg.Peer{keyLaptop: {Handshake: 1000, Endpoint: "203.0.113.7:1"}}), 1001, nil); len(s.Events) != 0 { + t.Fatalf("a restart logged a connect: %+v", s) + } +} diff --git a/backend/resolve/resolve.go b/backend/resolve/resolve.go new file mode 100644 index 0000000..5712557 --- /dev/null +++ b/backend/resolve/resolve.go @@ -0,0 +1,122 @@ +// Package resolve finds where a name points, as dawnline.lookup does: public resolvers first (local DNS +// often rewrites the router's own name to its LAN address), then the router's own; every server is asked at +// once for A and AAAA with a short timeout, and the first in that order that answers wins. Answers are kept +// five minutes, failures one. +package resolve + +import ( + "context" + "net" + "regexp" + "sync" + "time" +) + +// Servers are asked in this order of preference. +var Servers = []string{"1.1.1.1", "8.8.8.8", "127.0.0.1"} + +const ( + keep = 5 * time.Minute + keepFail = time.Minute + timeout = 2 * time.Second +) + +var name = regexp.MustCompile(`^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$`) + +type answer struct { + at time.Time + ips []string +} + +// A Resolver keeps what it found. Lookup is how one server is asked for one kind of address ("ip4", "ip6"); +// nil asks the real one. +type Resolver struct { + Lookup func(ctx context.Context, server, network, host string) []string + Now func() time.Time + + mu sync.Mutex + cache map[string]answer +} + +func ask(ctx context.Context, server, network, host string) []string { + r := &net.Resolver{PreferGo: true, Dial: func(ctx context.Context, n, _ string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, n, net.JoinHostPort(server, "53")) + }} + ips, _ := r.LookupIP(ctx, network, host) + out := make([]string, 0, len(ips)) + for _, ip := range ips { + out = append(out, ip.String()) + } + return out +} + +// Addresses is a name's addresses, IPv4 before IPv6; an address is itself; nothing for what does not resolve. +func (r *Resolver) Addresses(host string) []string { + if net.ParseIP(host) != nil { + return []string{host} + } + if len(host) > 253 || !name.MatchString(host) { + return nil + } + now := time.Now + if r.Now != nil { + now = r.Now + } + r.mu.Lock() + c, has := r.cache[host] + r.mu.Unlock() + if has && ((len(c.ips) > 0 && now().Sub(c.at) < keep) || (len(c.ips) == 0 && now().Sub(c.at) < keepFail)) { + return c.ips + } + lookup := r.Lookup + if lookup == nil { + lookup = ask + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + found := make([][2][]string, len(Servers)) + var wg sync.WaitGroup + for i, server := range Servers { + for j, network := range []string{"ip4", "ip6"} { + wg.Add(1) + go func() { + defer wg.Done() + found[i][j] = lookup(ctx, server, network, host) + }() + } + } + wg.Wait() + var ips []string + for _, f := range found { + if ips = append(append(ips, f[0]...), f[1]...); len(ips) > 0 { + break + } + } + r.mu.Lock() + if r.cache == nil { + r.cache = map[string]answer{} + } + for h, c := range r.cache { + if now().Sub(c.at) >= keep { + delete(r.cache, h) + } + } + r.cache[host] = answer{now(), ips} + r.mu.Unlock() + return ips +} + +// HostIP is the address to give an app that takes no name for the server: IPv4 first, as a phone on mobile +// data may have no IPv6. "" when the name does not resolve. +func (r *Resolver) HostIP(host string) string { + ips := r.Addresses(host) + for _, ip := range ips { + if net.ParseIP(ip).To4() != nil { + return ip + } + } + if len(ips) > 0 { + return ips[0] + } + return "" +} diff --git a/backend/resolve/resolve_test.go b/backend/resolve/resolve_test.go new file mode 100644 index 0000000..cdad287 --- /dev/null +++ b/backend/resolve/resolve_test.go @@ -0,0 +1,58 @@ +package resolve + +import ( + "context" + "reflect" + "sync/atomic" + "testing" + "time" +) + +func TestAddresses(t *testing.T) { + var asked atomic.Int32 + now := time.Unix(1_800_000_000, 0) + r := &Resolver{Now: func() time.Time { return now }, Lookup: func(_ context.Context, server, network, host string) []string { + asked.Add(1) + switch { + case host == "vpn.example.org" && server == "8.8.8.8" && network == "ip4": + return []string{"203.0.113.7"} + case host == "vpn.example.org" && server == "8.8.8.8" && network == "ip6": + return []string{"2001:db8::7"} + // the router's own resolver rewrites the name: it is believed only when the public ones say nothing + case host == "vpn.example.org" && server == "127.0.0.1" && network == "ip4": + return []string{"192.168.1.1"} + case host == "six.example.org" && server == "1.1.1.1" && network == "ip6": + return []string{"2001:db8::6"} + case host == "home.lan" && server == "127.0.0.1" && network == "ip4": + return []string{"192.168.1.20"} + } + return nil + }} + for host, want := range map[string][]string{ + "vpn.example.org": {"203.0.113.7", "2001:db8::7"}, "six.example.org": {"2001:db8::6"}, "home.lan": {"192.168.1.20"}, + "nowhere.example": nil, "198.51.100.4": {"198.51.100.4"}, "2001:db8::1": {"2001:db8::1"}, "not a name": nil, "": nil, + } { + if got := r.Addresses(host); !reflect.DeepEqual(got, want) { + t.Errorf("%q: %v", host, got) + } + } + if r.HostIP("vpn.example.org") != "203.0.113.7" || r.HostIP("six.example.org") != "2001:db8::6" || r.HostIP("nowhere.example") != "" { + t.Fatal("HostIP") + } + // kept: an answer five minutes, a failure one + n := asked.Load() + now = now.Add(4 * time.Minute) + r.Addresses("vpn.example.org") + if asked.Load() != n { + t.Fatal("asked again within five minutes") + } + r.Addresses("nowhere.example") + if asked.Load() == n { + t.Fatal("a failure was kept longer than a minute") + } + n = asked.Load() + now = now.Add(2 * time.Minute) + if r.Addresses("vpn.example.org"); asked.Load() == n { + t.Fatal("an answer was kept longer than five minutes") + } +} diff --git a/backend/roster/roster.go b/backend/roster/roster.go new file mode 100644 index 0000000..b11c4d5 --- /dev/null +++ b/backend/roster/roster.go @@ -0,0 +1,235 @@ +// Package roster makes the stream's topics from what the watcher knows (package view): the people and their +// devices, the servers, the router's own facts, the traffic, the places and the newest of the activity +// log. Publish puts them on the hub, whole; the hub tells the pages only what changed. +package roster + +import ( + "encoding/json" + "sort" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" +) + +// RecentKept is how many of the log's newest entries a status carries. +const RecentKept = 60 + +// Days is how long the router's daily series is. +const Days = 60 + +// Roster makes the topics. +type Roster struct { + // World is the watcher's (nil until it has looked); Home the home networks a person reaches. + World func() *view.World + Home func(srv *model.Server, p *model.Person) []string + // DataDir holds what was handed out and who was set up again (issued.json, reconnect.json). + DataDir string + Hub *hub.Hub + Log func(format string, args ...any) + + // RunDir holds the agent's last minutes of speed by person (rate_people.json), which a person's view carries. + RunDir string + // Own is the router's own addresses, which are no place people connect from. + Own func(m *model.Model) map[string]bool + // Iface is a netifd interface's state; Homes a server's home interfaces. + Iface func(ifname string) (bool, int64) + Homes func(srv *model.Server) []view.HomeNet + // Handler tells whether netifd lists the amneziawg protocol; WAN is the router's WAN address. + Handler func() bool + WAN func(m *model.Model) string + // Recent is the newest entries of the activity log as a page is shown them (the watcher's). + Recent func(n int) []map[string]any + // Keyed makes a list of the status into the stream's keyed form (bridge.Split's own, so both write one shape). + Keyed func(status map[string]any) map[string]any +} + +// Publish puts Go's own people on the stream now: called the moment the watcher saw something change, so a +// page is told at once and ucode is not asked for it. False: nothing was put, because the watcher has no +// world yet (it has not read the settings); whoever needs the topics asks again. +func (r *Roster) Publish() bool { + if r.Keyed == nil { + return false + } + w := r.world() + if w == nil { + return false + } + var rates map[string]any + files.ReadJSON(r.RunDir+"/rate_people.json", &rates) + people := make([]view.Person, 0, len(w.M.People)) + for _, p := range w.M.People { + people = append(people, w.PersonOf(p, true)) + } + // as the status sorts them: who is online first, then who was seen last, then by name + sort.SliceStable(people, func(i, j int) bool { + a, b := people[i], people[j] + if a.Online != b.Online { + return a.Online > b.Online + } + if a.LastSeen != b.LastSeen { + return a.LastSeen > b.LastSeen + } + return a.Name < b.Name + }) + raw, _ := json.Marshal(people) + var list []any + json.Unmarshal(raw, &list) + for _, p := range list { + m := p.(map[string]any) + m["rate"] = []any{} + if rate, ok := rates[m["id"].(string)].([]any); ok && len(rate) > 0 { + if _, isList := rate[0].([]any); isList { + m["rate"] = rate + } + } + } + // the router's sums, its days (as long as the bridge asks ucode for) and its last 24 hours + recs := make([]*usage.Record, 0, len(w.Usage.People)) + for _, rec := range w.Usage.People { + recs = append(recs, rec) + } + traffic := map[string]any{"totals": w.TotalsOf(people), "series": view.Series(recs, Days, w.Now), "hours": view.LastHours(w.Usage.Hours, w.Now)} + raw, _ = json.Marshal(traffic) + var plain map[string]any + json.Unmarshal(raw, &plain) + plain["people"] = list + // the services and the circles, in the order the settings list them + var services, circles []any + for _, id := range w.M.ServiceIDs() { + services = append(services, w.M.Services[id]) + } + for _, id := range w.M.CircleIDs() { + circles = append(circles, w.M.Circles[id]) + } + raw, _ = json.Marshal(map[string]any{"services": services, "circles": circles}) + var lists map[string]any + json.Unmarshal(raw, &lists) + for _, k := range []string{"services", "circles"} { + if lists[k] == nil { + lists[k] = []any{} + } + plain[k] = lists[k] + } + if r.Recent != nil { + raw, _ = json.Marshal(r.Recent(RecentKept)) + var events any + json.Unmarshal(raw, &events) + plain["events"] = events + } + if r.Own != nil { + raw, _ = json.Marshal(r.places(w)) + var geo any + json.Unmarshal(raw, &geo) + plain["geo"] = geo + } + owned := []string{"people", "traffic", "services", "circles", "recent", "places"} + if r.Iface != nil && r.Own != nil { + var rates map[string]any + files.ReadJSON(r.RunDir+"/rate.json", &rates) + router := r.router(w) + var servers []any + for _, id := range w.M.ServerIDs() { + raw, _ := json.Marshal(w.ServerOf(w.M.Servers[id], Days, router)) + var sv map[string]any + json.Unmarshal(raw, &sv) + // why it is kept down, if it is (Owns: a reason Go can word), and its last minutes of speed (the agent's file) + text, worded := blockedText(w.M.Servers[id]) + if !worded { + // a reason kept in a shape nobody here knows: still said, in the plainest words + text = w.M.Servers[id].Name + " is kept down." + } + sv["blocked"] = text + sv["rate"] = []any{} + if rate, ok := rates[id].([]any); ok { + sv["rate"] = rate + } + servers = append(servers, sv) + } + if servers == nil { + servers = []any{} + } + plain["servers"] = servers + owned = append(owned, "servers") + } + if r.Iface != nil && r.Own != nil { + // what could be told is told: a fact that could not be read is better missing than the whole router + if facts, _ := r.routerOf(w.M, w.Now); true { + raw, _ = json.Marshal(facts) + var m map[string]any + json.Unmarshal(raw, &m) + tz := m["tz"] + for k, v := range m { + plain[k] = v + } + plain["now"], plain["tz"] = w.Now, tz + owned = append(owned, "router", "clock") + } + } + docs := r.Keyed(plain) + for _, topic := range owned { + if doc, ok := docs[topic]; ok { + r.Hub.Put(topic, doc) + } + } + return true +} + +// router is what a server's view asks of the router, or nil when nobody answers for it. +func (r *Roster) router(w *view.World) *view.Router { + if r.Own == nil || r.Iface == nil { + return nil + } + return &view.Router{Own: r.Own(w.M), Iface: r.Iface, Homes: r.Homes} +} + +// places is the map's data as Go makes it. +func (r *Roster) places(w *view.World) view.Places { + var cache view.PlaceCache + if !files.ReadJSON(r.RunDir+"/geo.json", &cache) { + files.ReadJSON(r.DataDir+"/geo.json", &cache) + } + return w.PlacesOf(&cache, r.Own(w.M)) +} + +// world is the watcher's world with what the watcher does not hold. +func (r *Roster) world() *view.World { + return Complete(r.World(), r.Home, r.DataDir) +} + +// Complete gives the watcher's world what a view needs besides: the home networks a person reaches, what +// each device was last given and when each was set up again. nil stays nil. +func Complete(w *view.World, home func(srv *model.Server, p *model.Person) []string, dataDir string) *view.World { + if w == nil { + return nil + } + w.Home = home + w.Issued = issued(dataDir + "/issued.json") + files.ReadJSON(dataDir+"/reconnect.json", &w.Reconnect) + return w +} + +// issued reads issued.json as dawnline.awg issued() does: an entry is { fp, ts }, or from before +// timestamps were kept the fingerprint alone. +func issued(path string) map[string]view.Issued { + var raw map[string]json.RawMessage + files.ReadJSON(path, &raw) + out := map[string]view.Issued{} + for id, v := range raw { + var fp string + var e view.Issued + if json.Unmarshal(v, &fp) == nil { + if fp != "" { + out[id] = view.Issued{FP: fp} + } + } else if json.Unmarshal(v, &e) == nil && e.FP != "" { + if e.TS < 0 { + e.TS = 0 + } + out[id] = e + } + } + return out +} diff --git a/backend/roster/router.go b/backend/roster/router.go new file mode 100644 index 0000000..cda52ea --- /dev/null +++ b/backend/roster/router.go @@ -0,0 +1,167 @@ +package roster + +import ( + "fmt" + "os" + "path/filepath" + "strings" + "time" + + backend "github.com/tickcount/luci-app-dawnline/backend" + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/disguise" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// The links of the path that makes tunnel devices look like home devices (dawnline.loop). +const transit, inner = "dlx0", "dll0" + +func exists(path string) bool { + _, err := os.Stat(path) + return err == nil +} + +// LikeHome is the home-like path's last applied state, as dawnline.loop status() tells it. ok is false +// when it holds a reason only ucode can word yet (a refusal with its values). +func LikeHome(run string) (map[string]any, bool) { + var s struct { + Plan *struct { + Dev any `json:"dev"` + Address any `json:"address"` + DNS any `json:"dns"` + Gateway any `json:"gateway"` + TxNS any `json:"tx_ns"` + } `json:"plan"` + Off any `json:"off"` + Error any `json:"error"` + } + files.ReadJSON(run+"/loop.json", &s) + if s.Plan != nil { + master, _ := os.Readlink("/sys/class/net/" + inner + "/master") + dev, _ := s.Plan.Dev.(string) + return map[string]any{ + "active": exists("/sys/class/net/"+transit) && exists("/sys/class/net/"+inner), + "dev": s.Plan.Dev, "address": s.Plan.Address, "dns": s.Plan.DNS, "gateway": s.Plan.Gateway, "transit": s.Plan.TxNS, + "bridged": master != "" && filepath.Base(master) == dev, + }, true + } + if e, coded := s.Error.(map[string]any); coded { + s.Error = likeHomeError(e) + } + off := s.Off != nil && s.Off != false && s.Off != float64(0) && s.Off != "" + return map[string]any{"active": false, "off": off, "error": s.Error}, true +} + +// likeHomeError says why the home-like path could not be set up (dawnline.loop error_text), in English as +// the stream's reader is given it. +func likeHomeError(e map[string]any) string { + switch e["code"] { + case "no_lan": + return "No LAN detected." + case "not_bridge": + return fmt.Sprintf("%v is not a bridge, so Dawnline cannot join the LAN as a device.", e["dev"]) + case "no_ipv4": + return fmt.Sprintf("%v has no IPv4 address.", e["dev"]) + case "no_address": + return fmt.Sprintf("No free address on %v.", e["net"]) + case "no_transit": + return "No free link-local range for the internal link." + case "no_table": + return "No free routing table." + } + return fmt.Sprintf("Setup failed: %v", e["detail"]) +} + +// blockedText says why a server is kept down (dawnline.awg blocked_text), or nil when it is not. ok is false +// for a reason kept in a shape Go does not know. +func blockedText(srv *model.Server) (text any, ok bool) { + switch r := srv.Blocked.(type) { + case nil: + return nil, true + case string: + return srv.Name + " " + r + ".", true + case map[string]any: + switch r["code"] { + case "ifname": + return fmt.Sprintf("%s has an invalid interface name \"%v\".", srv.Name, r["ifname"]), true + case "taken": + return fmt.Sprintf("%s can't use the network interface %v: it exists and isn't Dawnline's.", srv.Name, r["ifname"]), true + case "disguise": + if in, _ := r["installed"].(string); in != "" { + return fmt.Sprintf("%s is kept down: its disguise needs AmneziaWG %v (installed: %s).", srv.Name, r["need"], in), true + } + return fmt.Sprintf("%s is kept down: its disguise needs AmneziaWG %v (installed: none).", srv.Name, r["need"]), true + case "disguise_invalid": + // which values, from the server's own + return strings.Trim(fmt.Sprintf("%s is kept down: its disguise has values AmneziaWG cannot take. %s", srv.Name, strings.Join(disguise.Unsafe(srv.Obf), " ")), " \t\r\n\v\f"), true + } + return srv.Name + " is kept down.", true + } + return nil, false +} + +// AwgState is what of AmneziaWG is on the router (dawnline.awg state()); handler: netifd lists its protocol. +func AwgState(handler func() bool) map[string]any { + tools := exists("/usr/bin/awg") && exists("/lib/netifd/proto/amneziawg.sh") + loaded := exists("/sys/module/amneziawg") + rel, _ := os.ReadFile("/proc/sys/kernel/osrelease") + r := strings.TrimSpace(string(rel)) + kmod := loaded || (r != "" && exists("/lib/modules/"+r+"/amneziawg.ko")) + has := tools && handler != nil && handler() + missing := []any{} + if !kmod { + missing = append(missing, "kmod-amneziawg") + } + if !tools { + missing = append(missing, "amneziawg-tools") + } + return map[string]any{"tools": tools, "kmod": kmod, "loaded": loaded, "handler": has, "missing": missing, "ok": len(missing) == 0 && loaded && has} +} + +// publicWAN is the router's public IPv4, or nil when it has none or a private one. +func publicWAN(wan string) any { + n, ok := ipnet.IP(wan) + if !ok { + return nil + } + for _, p := range []string{"100.64.0.0/10", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"} { + if r, _ := ipnet.Any(p); r.Holds(n) { + return nil + } + } + return wan +} + +// shown is what of the settings every page is shown. +func shown(set model.Settings) map[string]any { + return map[string]any{ + "portal_enabled": set.PortalEnabled, "portal_port": set.PortalPort, "portal_host": set.PortalHost, + "portal_public_port": set.PortalPort, "default_device_limit": set.DefaultDeviceLimit, "domain": set.Domain, + "hostnames": set.Hostnames, "geo_enabled": set.GeoEnabled, "home_dns_fallback": set.HomeDNSFallback, + } +} + +// routerOf is the `router` and `clock` parts of a status that Go can tell, and whether that is all of them: +// a part it cannot tell yet is left out. +func (r *Roster) routerOf(m *model.Model, now int64) (map[string]any, bool) { + host, _ := os.ReadFile("/proc/sys/kernel/hostname") + _, off := time.Unix(now, 0).In(zone.Local()).Zone() + out := map[string]any{ + "version": backend.Version, "hostname": strings.TrimSpace(string(host)), "tz": off / 60, + "awg_state": AwgState(r.Handler), "settings": shown(m.Settings), + } + all := r.Handler != nil && r.WAN != nil + if lh, ok := LikeHome(r.RunDir); ok { + out["like_home"] = lh + } else { + all = false + } + out["awg"] = awg.SystemCaps(r.DataDir) + if r.WAN != nil { + out["wan"] = publicWAN(r.WAN(m)) + } + return out, all +} diff --git a/backend/roster/router_test.go b/backend/roster/router_test.go new file mode 100644 index 0000000..36ac56f --- /dev/null +++ b/backend/roster/router_test.go @@ -0,0 +1,67 @@ +package roster + +import ( + "os" + "reflect" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" +) + +func TestBlockedText(t *testing.T) { + srv := func(why any) *model.Server { + return &model.Server{Name: "Home", Blocked: why, Obf: map[string]string{"jmin": "9", "jmax": "3"}} + } + for _, c := range []struct { + why any + text any + ok bool + }{ + {nil, nil, true}, + {"another tunnel has its name", "Home another tunnel has its name.", true}, + {map[string]any{"code": "ifname", "ifname": "bad name"}, `Home has an invalid interface name "bad name".`, true}, + {map[string]any{"code": "taken", "ifname": "wg0"}, "Home can't use the network interface wg0: it exists and isn't Dawnline's.", true}, + {map[string]any{"code": "disguise", "need": "3.1", "installed": "2.0"}, "Home is kept down: its disguise needs AmneziaWG 3.1 (installed: 2.0).", true}, + {map[string]any{"code": "disguise", "need": "2.0", "installed": nil}, "Home is kept down: its disguise needs AmneziaWG 2.0 (installed: none).", true}, + {map[string]any{"code": "later"}, "Home is kept down.", true}, + {map[string]any{"code": "disguise_invalid"}, "Home is kept down: its disguise has values AmneziaWG cannot take. Jmin must not be larger than Jmax.", true}, + {7.0, nil, false}, + } { + if text, ok := blockedText(srv(c.why)); text != c.text || ok != c.ok { + t.Errorf("%v: %v %v", c.why, text, ok) + } + } +} + +func TestLikeHome(t *testing.T) { + dir := t.TempDir() + for _, c := range []struct { + file string + want map[string]any + }{ + {``, map[string]any{"active": false, "off": false, "error": nil}}, + {`{"off":true}`, map[string]any{"active": false, "off": true, "error": nil}}, + {`{"error":"An older version's own words."}`, map[string]any{"active": false, "off": false, "error": "An older version's own words."}}, + {`{"error":{"code":"not_bridge","dev":"eth1"}}`, map[string]any{"active": false, "off": false, "error": "eth1 is not a bridge, so Dawnline cannot join the LAN as a device."}}, + {`{"error":{"code":"failed","detail":"ip: no such device"}}`, map[string]any{"active": false, "off": false, "error": "Setup failed: ip: no such device"}}, + // set up, but its links are not on this machine: not active, not in the bridge + {`{"plan":{"dev":"br-lan","address":"192.168.1.9","dns":"192.168.1.1","gateway":"192.168.1.1","tx_ns":"169.254.7.2"}}`, + map[string]any{"active": false, "dev": "br-lan", "address": "192.168.1.9", "dns": "192.168.1.1", "gateway": "192.168.1.1", "transit": "169.254.7.2", "bridged": false}}, + } { + os.Remove(dir + "/loop.json") + if c.file != "" { + os.WriteFile(dir+"/loop.json", []byte(c.file), 0o600) + } + if got, ok := LikeHome(dir); !ok || !reflect.DeepEqual(got, c.want) { + t.Errorf("%s: %v", c.file, got) + } + } +} + +func TestPublicWAN(t *testing.T) { + for wan, want := range map[string]any{"": nil, "192.168.1.2": nil, "100.72.0.9": nil, "10.0.0.1": nil, "172.20.1.1": nil, "203.0.113.7": "203.0.113.7"} { + if got := publicWAN(wan); got != want { + t.Errorf("%q: %v", wan, got) + } + } +} diff --git a/backend/servicelog/servicelog.go b/backend/servicelog/servicelog.go new file mode 100644 index 0000000..0055d43 --- /dev/null +++ b/backend/servicelog/servicelog.go @@ -0,0 +1,227 @@ +// Package servicelog writes the service log and syslog as dawnline.util slog() and syslog() do: an entry a +// line of JSON in run/service.log (what the admin's Service log shows), and the same in words in syslog as +// "dawnline: [info] [awg] Home started", at the matching priority, when the admin's level takes it. +package servicelog + +import ( + "encoding/json" + "os" + "os/exec" + "regexp" + "strings" + "time" +) + +var ( + rank = map[string]int{"error": 0, "warn": 1, "info": 2, "debug": 3} + prio = map[string]string{"error": "err", "warn": "warning", "info": "info", "debug": "debug"} + // a line break or a tab with the blanks around it: one space in a syslog line + lineBreak = regexp.MustCompile(`[ \t\r\n]*[\t\r\n][ \t\r\n]*`) + breaks = regexp.MustCompile(`[\r\n\t]+`) +) + +const space = " \t\r\n\v\f" + +// Extra is the admin's own fields of an entry: { By: "admin", Kind: "server", Note: "port 50115" } reads +// "You · "; SID is the server's id. +type Extra struct { + By, Kind, Note, SID string +} + +// Entry is one service log entry as slog() writes it: the subject first, the admin's own fields, the detail capped. +func Entry(src, level, msg, detail, who string, x Extra, ts int64) map[string]any { + e := map[string]any{"ts": ts, "src": src, "level": level, "msg": msg} + if who != "" { + e["who"] = who + } + for k, v := range map[string]string{"by": x.By, "kind": x.Kind, "note": x.Note, "sid": x.SID} { + if v != "" { + e[k] = v + } + } + if d := strings.Trim(detail, space); d != "" { + if len(d) > 2000 { + d = d[:2000] + } + e["detail"] = d + } + return e +} + +// Line is one syslog line's words: "[level] [src] line", on one line, at most 1000 characters. +func Line(level, src, line string) string { + if _, known := rank[level]; !known { + level = "info" + } + if src == "" { + src = "dawnline" + } + out := "[" + level + "] [" + src + "] " + lineBreak.ReplaceAllString(strings.Trim(line, space), " ") + if len(out) > 1000 { + out = out[:1000] + } + return out +} + +// Words is an entry as its syslog line tells it, and the level it goes out at. +func Words(src, level, msg, detail, who string, x Extra) (lvl, line string) { + line = msg + if x.By == "admin" { + parts := []string{"admin", msg} + for _, p := range []string{x.Kind, who} { + if p != "" { + parts = append(parts, p) + } + } + if x.Note != "" { + parts = append(parts, "· "+x.Note) + } + line = strings.Join(parts, " ") + } else if who != "" { + line = who + " " + msg + } + lvl = map[string]string{"error": "error", "repair": "warn", "down": "warn"}[level] + if lvl == "" { + lvl = "info" + } + // problems carry what went wrong + if d := strings.Trim(detail, space); d != "" && lvl != "info" { + if len(d) > 2000 { + d = d[:2000] + } + d = breaks.ReplaceAllString(d, " | ") + if len(d) > 400 { + d = d[:400] + } + line += " · " + d + } + return lvl, line +} + +// Log writes to a router's logs. Level is the admin's syslog level (error | warn | info | debug). +type Log struct { + RunDir string + Level func() string + // Syslog hands a line to syslog (nil: `logger`). + Syslog func(priority, line string) + Now func() time.Time +} + +// Write puts an entry in the service log and in syslog. +func (l Log) Write(src, level, msg, detail, who string, x Extra) { + now := time.Now + if l.Now != nil { + now = l.Now + } + raw, _ := json.Marshal(Entry(src, level, msg, detail, who, x, now().Unix())) + os.MkdirAll(l.RunDir, 0o755) + if f, err := os.OpenFile(l.RunDir+"/service.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o600); err == nil { + f.Write(append(raw, '\n')) + f.Close() + } + lvl, line := Words(src, level, msg, detail, who, x) + l.Say(lvl, src, line) +} + +// Say puts a line in syslog at a level, when the admin's level takes it. +func (l Log) Say(level, src, line string) { + at := "info" + if l.Level != nil { + at = l.Level() + } + r, known := rank[level] + if !known { + r = 2 + } + if r > rank[at] { + return + } + p := prio[level] + if p == "" { + p = "info" + } + if l.Syslog != nil { + l.Syslog("daemon."+p, Line(level, src, line)) + return + } + exec.Command("logger", "-t", "dawnline", "-p", "daemon."+p, Line(level, src, line)).Run() +} + +// Admin records a change the admin made in LuCI. +func (l Log) Admin(src, msg, kind, who, note string) { + l.Write(src, "info", msg, "", who, Extra{By: "admin", Kind: kind, Note: note}) +} + +// Clear removes entries from the service log, all of them or those older than `days` days, in the live +// copy and the one on flash (dataDir) when there is one; it returns how many went (dawnline.util slog_clear). +func (l Log) Clear(dataDir string, days int64) int { + now := time.Now + if l.Now != nil { + now = l.Now + } + raw, err := os.ReadFile(l.RunDir + "/service.log") + if err != nil { + raw, _ = os.ReadFile(dataDir + "/service.log") + } + var keep []string + removed := 0 + for _, line := range strings.Split(string(raw), "\n") { + if line == "" { + continue + } + var e struct { + TS *float64 `json:"ts"` + } + json.Unmarshal([]byte(line), &e) + if days > 0 && e.TS != nil && *e.TS >= float64(now().Unix()-days*86400) { + keep = append(keep, line) + } else { + removed++ + } + } + data := "" + if len(keep) > 0 { + data = strings.Join(keep, "\n") + "\n" + } + os.MkdirAll(l.RunDir, 0o755) + os.WriteFile(l.RunDir+"/service.log", []byte(data), 0o600) + if _, err := os.Stat(dataDir + "/service.log"); err == nil { + os.WriteFile(dataDir+"/service.log", []byte(data), 0o600) + } + return removed +} + +// keep is how many entries the service log holds. +const keep = 300 + +// Trim keeps the last entries only, and copies them to flash (dataDir) when asked and something was +// written since the last copy. +func (l Log) Trim(dataDir string, save bool) { + path := l.RunDir + "/service.log" + raw, err := os.ReadFile(path) + if err != nil { + return + } + var lines []string + for _, s := range strings.Split(string(raw), "\n") { + if s != "" { + lines = append(lines, s) + } + } + if len(lines) > keep+50 { + lines = lines[len(lines)-keep:] + os.WriteFile(path, []byte(strings.Join(lines, "\n")+"\n"), 0o600) + } + if !save || len(lines) == 0 { + return + } + live, err := os.Stat(path) + if err != nil { + return + } + if kept, err := os.Stat(dataDir + "/service.log"); err == nil && !live.ModTime().After(kept.ModTime()) { + return + } + os.MkdirAll(dataDir, 0o700) + os.WriteFile(dataDir+"/service.log", []byte(strings.Join(lines, "\n")+"\n"), 0o600) +} diff --git a/backend/servicelog/servicelog_test.go b/backend/servicelog/servicelog_test.go new file mode 100644 index 0000000..c752eb5 --- /dev/null +++ b/backend/servicelog/servicelog_test.go @@ -0,0 +1,40 @@ +package servicelog + +import ( + "os" + "strings" + "testing" + "time" +) + +func TestWrite(t *testing.T) { + dir := t.TempDir() + var said []string + level := "info" + l := Log{RunDir: dir, Level: func() string { return level }, Syslog: func(p, line string) { said = append(said, p+" "+line) }, + Now: func() time.Time { return time.Unix(1_800_000_000, 0) }} + l.Admin("dawnline", "exported", "", "all settings", "the file holds private keys") + l.Write("awg", "error", "did not start", " line one\n\tline two ", "Home", Extra{}) + l.Write("agent", "repair", "restarted", "why", "", Extra{}) + l.Say("debug", "apply", "a step") + level = "error" + l.Write("portal", "info", "started", "", "Personal portal", Extra{}) + raw, _ := os.ReadFile(dir + "/service.log") + want := `{"by":"admin","level":"info","msg":"exported","note":"the file holds private keys","src":"dawnline","ts":1800000000,"who":"all settings"} +{"detail":"line one\n\tline two","level":"error","msg":"did not start","src":"awg","ts":1800000000,"who":"Home"} +{"detail":"why","level":"repair","msg":"restarted","src":"agent","ts":1800000000} +{"level":"info","msg":"started","src":"portal","ts":1800000000,"who":"Personal portal"} +` + if string(raw) != want { + t.Fatalf("the service log:\n%s", raw) + } + // syslog: the admin's own words, a problem with what went wrong on one line; nothing below the admin's level + wantSaid := "daemon.info [info] [dawnline] admin exported all settings · the file holds private keys\n" + + "daemon.err [error] [awg] Home did not start · line one | line two\ndaemon.warning [warn] [agent] restarted · why" + if got := strings.Join(said, "\n"); got != wantSaid { + t.Fatalf("syslog:\n%s", got) + } + if Line("odd", "", " a\n b\tc ") != "[info] [dawnline] a b c" { + t.Fatal("a line's words") + } +} diff --git a/backend/state/state.go b/backend/state/state.go new file mode 100644 index 0000000..f51bd7a --- /dev/null +++ b/backend/state/state.go @@ -0,0 +1,110 @@ +// Package state is where a person stands: whether their access works now, and if not, why. As +// dawnline.core works it out (own_state, person_state, person_usage, person_quota): the same answer for the +// same settings, counters and moment, because the access rules, the admin and the person's own page must all +// say the same thing. +// +// Pure: the settings, the counters and a moment in, a word out. Days are the router's (package zone). +package state + +import ( + "regexp" + "strconv" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// The states. +const ( + Active = "active" + Paused = "paused" + Expired = "expired" + Quota = "quota" + NoServer = "no_server" + ServerOff = "server_off" +) + +var date = regexp.MustCompile(`^([0-9]{4})-([0-9]{2})-([0-9]{2})$`) + +// DateEnd is the last second of a day "YYYY-MM-DD" on the router's calendar; ok is false for anything else. +func DateEnd(s string) (int64, bool) { + m := date.FindStringSubmatch(s) + if m == nil { + return 0, false + } + y, _ := strconv.Atoi(m[1]) + mo, _ := strconv.Atoi(m[2]) + d, _ := strconv.Atoi(m[3]) + return time.Date(y, time.Month(mo), d, 23, 59, 59, 0, zone.Local()).Unix(), true +} + +// Usage is the bytes a person used in their limit's period at ts: their limit month, or all time. +func Usage(p *model.Person, u *usage.Usage, ts int64) float64 { + if u == nil { + return 0 + } + rec := u.People[p.ID] + if rec == nil { + return 0 + } + if p.QuotaPeriod == "total" { + if rec.Total == nil { + return 0 + } + return rec.Total[0] + rec.Total[1] + } + if lm := usage.LimitMonth(rec, ts); lm != nil { + return lm.Rx + lm.Tx + } + return 0 +} + +// QuotaBytes is a person's limit at ts: the base and the extra data while it lasts; 0 is no limit. +func QuotaBytes(p *model.Person, ts int64) float64 { + if !(p.QuotaGB > 0) { + return 0 + } + gb := p.QuotaGB + if p.BonusGB > 0 && ts < int64(p.BonusUntil) { + gb += p.BonusGB + } + return gb * 1073741824 +} + +// PersonExpired tells whether a person's end date has passed. +func PersonExpired(p *model.Person, ts int64) bool { + if p.Expires == "" { + return false + } + end, ok := DateEnd(p.Expires) + return ok && ts > end +} + +// Own is a person's state whatever their server is doing. +func Own(p *model.Person, u *usage.Usage, ts int64) string { + if p.Paused { + return Paused + } + // Past the end date access stops: the one thing an end date does. + if PersonExpired(p, ts) { + return Expired + } + if q := QuotaBytes(p, ts); q > 0 && Usage(p, u, ts) >= q { + return Quota + } + return Active +} + +// Of is a person's state: active, or why they are off (their own reason, or their server's). +func Of(m *model.Model, p *model.Person, u *usage.Usage, ts int64) string { + srv := m.Servers[p.Server] + if srv == nil { + return NoServer + } + if !srv.Enabled { + return ServerOff + } + return Own(p, u, ts) +} diff --git a/backend/state/state_test.go b/backend/state/state_test.go new file mode 100644 index 0000000..bf08938 --- /dev/null +++ b/backend/state/state_test.go @@ -0,0 +1,80 @@ +package state + +import ( + "encoding/json" + "os" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// Every person of testdata/state.uci, at every moment of the trace, stands where ucode says +// (scripts/ucode-golden.sh writes trace.json from dawnline.core). +func TestHeldToUcode(t *testing.T) { + zone.Set(time.UTC) + text, err := os.ReadFile("testdata/state.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Usage *usage.Usage `json:"usage"` + Moments []struct { + TS int64 `json:"ts"` + People map[string]struct { + State string `json:"state"` + Own string `json:"own"` + Used float64 `json:"used"` + Quota float64 `json:"quota"` + } `json:"people"` + } `json:"moments"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + seen := map[string]bool{} + for _, at := range golden.Moments { + if len(at.People) != len(m.People) { + t.Fatalf("ucode knows %d people, Go %d", len(at.People), len(m.People)) + } + for id, want := range at.People { + p := m.People[id] + got := [2]string{Of(m, p, golden.Usage, at.TS), Own(p, golden.Usage, at.TS)} + if got != [2]string{want.State, want.Own} { + t.Errorf("%s at %d: %v, ucode has %s / %s", id, at.TS, got, want.State, want.Own) + } + if u, q := Usage(p, golden.Usage, at.TS), QuotaBytes(p, at.TS); u != want.Used || q != want.Quota { + t.Errorf("%s at %d: used %v of %v, ucode has %v of %v", id, at.TS, u, q, want.Used, want.Quota) + } + seen[want.State] = true + } + } + for _, s := range []string{Active, Paused, Expired, Quota, NoServer, ServerOff} { + if !seen[s] { + t.Errorf("the trace never reaches %q", s) + } + } +} + +// An end date is the router's own day. +func TestTheRoutersDay(t *testing.T) { + msk, _ := zone.FromPOSIX("MSK-3") + zone.Set(msk) + defer zone.Set(time.UTC) + end, ok := DateEnd("2026-11-12") + if !ok || time.Unix(end, 0).UTC().Format("2006-01-02 15:04:05") != "2026-11-12 20:59:59" { + t.Fatalf("the end of the day: %v", time.Unix(end, 0).UTC()) + } +} diff --git a/backend/state/testdata/state.uci b/backend/state/testdata/state.uci new file mode 100644 index 0000000..7bc44e5 --- /dev/null +++ b/backend/state/testdata/state.uci @@ -0,0 +1,42 @@ +# People in every state, for testdata/trace.uc. +config settings 'settings' + +config server 'on' + option subnet '10.9.0.0/24' + +config server 'off' + option subnet '10.10.0.0/24' + option enabled '0' + +config person 'plain' + option server 'on' +config person 'paused' + option server 'on' + option paused '1' + option expires '2020-01-01' +config person 'ends' + option server 'on' + option expires '2027-01-15' +config person 'badend' + option server 'on' + option expires 'soon' +config person 'month' + option server 'on' + option quota_gb '1' +config person 'bonus' + option server 'on' + option quota_gb '1' + option bonus_gb '2' + option bonus_until '1800500000' +config person 'total' + option server 'on' + option quota_gb '0.5' + option quota_period 'total' +config person 'legacy' + option server 'on' + option quota_gb '1' +config person 'nowhere' + option server 'gone' +config person 'serveroff' + option server 'off' + option paused '1' diff --git a/backend/state/testdata/trace.json b/backend/state/testdata/trace.json new file mode 100644 index 0000000..b36261b --- /dev/null +++ b/backend/state/testdata/trace.json @@ -0,0 +1,704 @@ +{ + "usage": { + "devices": { + }, + "people": { + "month": { + "total": [ + 3221225472, + 3221225472 + ], + "period": { + "start": 1800000000, + "rx": 429496729.6, + "tx": 751619276.8 + } + }, + "bonus": { + "total": [ + 9663676416, + 0 + ], + "period": { + "start": 1800000000, + "rx": 1073741824, + "tx": 1610612736.0 + } + }, + "total": { + "total": [ + 214748364.8, + 332859965.44 + ] + }, + "legacy": { + "total": [ + 2147483648, + 0 + ], + "months": { + "2027-01": [ + 644245094.4, + 644245094.4 + ], + "2027-02": [ + 107374182.4, + 0 + ] + } + } + } + }, + "moments": [ + { + "ts": 1800000000, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800021600, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800055800, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800057600, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800080400, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800400000, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 2684354560.0, + "quota": 3221225472 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1800600000, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "quota", + "own": "quota", + "used": 2684354560.0, + "quota": 1073741824 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "quota", + "own": "quota", + "used": 1288490188.8, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1801728000, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "quota", + "own": "quota", + "used": 2684354560.0, + "quota": 1073741824 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "active", + "own": "active", + "used": 107374182.4, + "quota": 1073741824 + }, + "month": { + "state": "quota", + "own": "quota", + "used": 1181116006.4, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1802764800, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 0, + "quota": 1073741824 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "active", + "own": "active", + "used": 107374182.4, + "quota": 1073741824 + }, + "month": { + "state": "active", + "own": "active", + "used": 0, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + }, + { + "ts": 1804320000, + "people": { + "badend": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "bonus": { + "state": "active", + "own": "active", + "used": 0, + "quota": 1073741824 + }, + "ends": { + "state": "expired", + "own": "expired", + "used": 0, + "quota": 0 + }, + "legacy": { + "state": "active", + "own": "active", + "used": 0, + "quota": 1073741824 + }, + "month": { + "state": "active", + "own": "active", + "used": 0, + "quota": 1073741824 + }, + "nowhere": { + "state": "no_server", + "own": "active", + "used": 0, + "quota": 0 + }, + "paused": { + "state": "paused", + "own": "paused", + "used": 0, + "quota": 0 + }, + "plain": { + "state": "active", + "own": "active", + "used": 0, + "quota": 0 + }, + "serveroff": { + "state": "server_off", + "own": "paused", + "used": 0, + "quota": 0 + }, + "total": { + "state": "quota", + "own": "quota", + "used": 547608330.24, + "quota": 536870912.0 + } + } + } + ] +} diff --git a/backend/store/store.go b/backend/store/store.go new file mode 100644 index 0000000..cdc6261 --- /dev/null +++ b/backend/store/store.go @@ -0,0 +1,90 @@ +// Package store is changes to /etc/config/dawnline, the one way, as dawnline.store: under the config lock +// (the same lock file the ucode backend takes, so neither writes on the other's stale model), against the +// settings read inside that lock, written whole and kept readable by root only. A change that fails, or +// did not reach flash, never happened: nothing is written and the caller is told why. +package store + +import ( + "crypto/rand" + "encoding/hex" + "fmt" + "os" + "path/filepath" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// Store is where the settings are. +type Store struct { + // Config is the settings file; RunDir holds the lock and which servers are kept down. + Config, RunDir string +} + +// Unsaved is a change that could not be written: the flash is full or read-only. +type Unsaved struct{ Why error } + +func (u Unsaved) Error() string { + return fmt.Sprintf("Couldn't save /etc/config/dawnline: %s. Is the flash full?", u.Why) +} + +// Read is the settings as they stand now, parsed and as a model. +func (s Store) Read() (*uci.Config, *model.Model, error) { + text, err := os.ReadFile(s.Config) + if err != nil && !os.IsNotExist(err) { + return nil, nil, err + } + c, err := uci.Parse(string(text)) + if err != nil { + return nil, nil, err + } + var blocked map[string]any + files.ReadJSON(s.RunDir+"/netifd-blocked.json", &blocked) + return c, model.Load(c, blocked), nil +} + +// Transact runs fn on the settings with the config lock held and writes them when fn returns nil. Whatever +// fn returns as an error aborts: nothing is written, and the error is passed on. fn changes c; m is the +// model of the settings before the change. +func (s Store) Transact(fn func(c *uci.Config, m *model.Model) error) error { + defer files.Lock(s.RunDir, "config")() + c, m, err := s.Read() + if err != nil { + return err + } + if err := fn(c, m); err != nil { + return err + } + return s.write(c.Format()) +} + +// write puts the file in place whole: beside it under a hidden name (never a name `uci` would list as a +// configuration), on disk, then renamed over it. +func (s Store) write(text string) error { + var r [4]byte + rand.Read(r[:]) + tmp := filepath.Join(filepath.Dir(s.Config), "."+filepath.Base(s.Config)+".dl-"+hex.EncodeToString(r[:])) + f, err := os.OpenFile(tmp, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o600) + if err != nil { + return Unsaved{err} + } + _, err = f.WriteString(text) + if err == nil { + err = f.Sync() + } + if cerr := f.Close(); err == nil { + err = cerr + } + if err == nil { + err = os.Chmod(tmp, 0o600) + } + if err == nil { + err = os.Rename(tmp, s.Config) + } + if err != nil { + os.Remove(tmp) + return Unsaved{err} + } + return nil +} diff --git a/backend/store/store_test.go b/backend/store/store_test.go new file mode 100644 index 0000000..2f7bc51 --- /dev/null +++ b/backend/store/store_test.go @@ -0,0 +1,78 @@ +package store + +import ( + "errors" + "os" + "strings" + "sync" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +const file = "\nconfig settings 'settings'\n\toption portal_port '4500'\n\nconfig server 'home'\n\toption name 'Home'\n\n" + +func TestTransact(t *testing.T) { + dir := t.TempDir() + s := Store{Config: dir + "/dawnline", RunDir: dir + "/run"} + os.WriteFile(s.Config, []byte(file), 0o644) + // a change that fails leaves the file as it was + refused := errors.New("Unknown person.") + if err := s.Transact(func(c *uci.Config, m *model.Model) error { + c.Set("home", "name", "Changed") + return refused + }); err != refused { + t.Fatalf("the refusal: %v", err) + } + if raw, _ := os.ReadFile(s.Config); string(raw) != file { + t.Fatalf("a refused change was written:\n%s", raw) + } + // one that passes is written whole, against the model as it was, private to root + if err := s.Transact(func(c *uci.Config, m *model.Model) error { + if m.Servers["home"].Name != "Home" || m.Settings.PortalPort != 4500 { + t.Errorf("the model inside: %+v", m.Servers["home"]) + } + c.Set("home", "name", "Cabin") + c.Add("person", "anna") + c.Set("anna", "server", "home") + return nil + }); err != nil { + t.Fatal(err) + } + raw, _ := os.ReadFile(s.Config) + want := "\nconfig settings 'settings'\n\toption portal_port '4500'\n\nconfig server 'home'\n\toption name 'Cabin'\n\nconfig person 'anna'\n\toption server 'home'\n\n" + if st, _ := os.Stat(s.Config); string(raw) != want || st.Mode().Perm() != 0o600 { + t.Fatalf("written (%v):\n%s", st.Mode().Perm(), raw) + } + left, _ := os.ReadDir(dir) + for _, e := range left { + if strings.HasPrefix(e.Name(), ".") { + t.Fatalf("a temporary file stays: %s", e.Name()) + } + } + // writers wait for each other: none works on another's stale settings + var wg sync.WaitGroup + for i := 0; i < 20; i++ { + wg.Add(1) + go func() { + defer wg.Done() + s.Transact(func(c *uci.Config, m *model.Model) error { + n, _ := c.Section("settings").Get("count") + c.Set("settings", "count", n+"x") + return nil + }) + }() + } + wg.Wait() + c, _, _ := s.Read() + if n, _ := c.Section("settings").Get("count"); len(n) != 20 { + t.Fatalf("twenty writers left %q", n) + } + // a directory that cannot be written: told as ucode tells it, the file untouched + gone := Store{Config: dir + "/nowhere/dawnline", RunDir: dir + "/run"} + err := gone.Transact(func(*uci.Config, *model.Model) error { return nil }) + if _, unsaved := err.(Unsaved); !unsaved || !strings.HasPrefix(err.Error(), "Couldn't save /etc/config/dawnline: ") { + t.Fatalf("a write that fails: %v", err) + } +} diff --git a/backend/ubus/blob.go b/backend/ubus/blob.go new file mode 100644 index 0000000..1193f71 --- /dev/null +++ b/backend/ubus/blob.go @@ -0,0 +1,357 @@ +// Package ubus speaks the wire protocol of ubusd, OpenWrt's message bus, so the +// backend can publish an object of its own and notify its subscribers without +// libubus. LuCI reaches that object through uhttpd (/ubus: calls as JSON-RPC, +// notifications as an event stream), with rpcd's access lists in between. +// +// This file is the encoding: libubox's blob attributes, which carry the +// protocol's own fields, and blobmsg, the JSON-like values inside them. It +// owns no socket; conn.go does. +package ubus + +import ( + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "math" + "sort" +) + +// A blob attribute is a 4-byte big-endian word (flag, 7 bits of id, 24 bits of +// length counted from the word itself) and its payload, padded to 4 bytes. +const ( + attrHeader = 4 + attrExtended = 0x80000000 + attrIDMask = 0x7f000000 + attrIDShift = 24 + attrLenMask = 0x00ffffff +) + +// The types of a blobmsg value (the id of an extended attribute). +const ( + msgNull = 0 + msgArray = 1 + msgTable = 2 + msgString = 3 + msgInt64 = 4 + msgInt32 = 5 + msgInt16 = 6 + msgBool = 7 + msgDouble = 8 +) + +var errTruncated = errors.New("ubus: truncated attribute") + +func pad4(n int) int { return (n + 3) &^ 3 } + +// open starts an attribute and returns where its header is, for closeAttr. +func open(b []byte) ([]byte, int) { + at := len(b) + return append(b, 0, 0, 0, 0), at +} + +// closeAttr writes the header word of the attribute opened at `at` (`word` is +// its flag and id, the length is added here) and pads it. +func closeAttr(b []byte, at int, word uint32) []byte { + binary.BigEndian.PutUint32(b[at:], word|uint32(len(b)-at)) + for len(b)%4 != 0 { + b = append(b, 0) + } + return b +} + +func putBytes(b []byte, id uint32, p []byte) []byte { + b, at := open(b) + b = append(b, p...) + return closeAttr(b, at, id< len(b) { + return attr{}, nil, errTruncated + } + a := attr{id: (w & attrIDMask) >> attrIDShift, extended: w&attrExtended != 0, data: b[attrHeader:n]} + rest := pad4(n) + if rest > len(b) { + rest = len(b) + } + return a, b[rest:], nil +} + +// each calls fn for every attribute in b. +func each(b []byte, fn func(attr) error) error { + for len(b) > 0 { + a, rest, err := next(b) + if err != nil { + return err + } + if err := fn(a); err != nil { + return err + } + b = rest + } + return nil +} + +/* ---------- blobmsg: values ---------- */ + +// putValue appends one named blobmsg value. Values are what encoding/json +// makes of a document (nil, bool, float64, json.Number, string, []any, +// map[string]any) and Go's integers; anything else goes through encoding/json +// first, so a struct with json tags is sent the way it would be marshalled. +// Table keys are sorted: the same value always makes the same bytes. +func putValue(b []byte, name string, v any) ([]byte, error) { + switch x := v.(type) { + case nil: + b, at := putName(b, name) + return closeAttr(b, at, attrExtended|msgNull< math.MaxInt64 { + return putDouble(b, name, float64(x)), nil + } + return putInt(b, name, int64(x)), nil + case float64: + // A whole number is an integer on the bus, as it is in the JSON it came from. + if x == math.Trunc(x) && math.Abs(x) < 1<<53 { + return putInt(b, name, int64(x)), nil + } + return putDouble(b, name, x), nil + case json.Number: + if i, err := x.Int64(); err == nil { + return putInt(b, name, i), nil + } + f, err := x.Float64() + if err != nil { + return nil, fmt.Errorf("ubus: %q is not a number", string(x)) + } + return putDouble(b, name, f), nil + case []any: + b, at := putName(b, name) + var err error + for _, e := range x { + if b, err = putValue(b, "", e); err != nil { + return nil, err + } + } + return closeAttr(b, at, attrExtended|msgArray<= math.MinInt32 && v <= math.MaxInt32 { + b = binary.BigEndian.AppendUint32(b, uint32(int32(v))) + return closeAttr(b, at, attrExtended|msgInt32< math.MaxUint16 { + return nil, fmt.Errorf("ubus: field name of %d bytes", len(k)) + } + names = append(names, k) + } + sort.Strings(names) + var err error + for _, k := range names { + if b, err = putValue(b, k, m[k]); err != nil { + return nil, err + } + } + return b, nil +} + +// encodeTable is a table's fields as they sit inside a message's data attribute. +func encodeTable(m map[string]any) ([]byte, error) { + return putFields(make([]byte, 0, 256), m) +} + +// A value nested deeper than this is refused: the bus carries documents, and a +// peer that sends tables inside tables without end is not sending one. +const maxDepth = 32 + +// decodeTable reads the fields of a table. Integers come back as int64, +// whatever their width on the wire. +func decodeTable(b []byte, depth int) (map[string]any, error) { + out := map[string]any{} + err := each(b, func(a attr) error { + name, v, err := decodeValue(a, depth) + if err != nil { + return err + } + out[name] = v + return nil + }) + return out, err +} + +func decodeValue(a attr, depth int) (string, any, error) { + if !a.extended || len(a.data) < 2 { + return "", nil, errors.New("ubus: not a blobmsg value") + } + n := int(binary.BigEndian.Uint16(a.data)) + hdr := pad4(2 + n + 1) + if 2+n > len(a.data) { + return "", nil, errTruncated + } + name := string(a.data[2 : 2+n]) + var d []byte + if hdr <= len(a.data) { + d = a.data[hdr:] + } + switch a.id { + case msgNull: + return name, nil, nil + case msgBool: + if len(d) < 1 { + return "", nil, errTruncated + } + return name, d[0] != 0, nil + case msgInt16: + if len(d) < 2 { + return "", nil, errTruncated + } + return name, int64(int16(binary.BigEndian.Uint16(d))), nil + case msgInt32: + if len(d) < 4 { + return "", nil, errTruncated + } + return name, int64(int32(binary.BigEndian.Uint32(d))), nil + case msgInt64: + if len(d) < 8 { + return "", nil, errTruncated + } + return name, int64(binary.BigEndian.Uint64(d)), nil + case msgDouble: + if len(d) < 8 { + return "", nil, errTruncated + } + return name, math.Float64frombits(binary.BigEndian.Uint64(d)), nil + case msgString: + // The NUL that ends it is part of the length. + for i, c := range d { + if c == 0 { + d = d[:i] + break + } + } + return name, string(d), nil + case msgTable: + if depth >= maxDepth { + return "", nil, errors.New("ubus: value nested too deep") + } + t, err := decodeTable(d, depth+1) + return name, t, err + case msgArray: + if depth >= maxDepth { + return "", nil, errors.New("ubus: value nested too deep") + } + list := []any{} + err := each(d, func(e attr) error { + _, v, err := decodeValue(e, depth+1) + if err != nil { + return err + } + list = append(list, v) + return nil + }) + return name, list, err + } + return "", nil, fmt.Errorf("ubus: unknown blobmsg type %d", a.id) +} diff --git a/backend/ubus/blob_test.go b/backend/ubus/blob_test.go new file mode 100644 index 0000000..da568ec --- /dev/null +++ b/backend/ubus/blob_test.go @@ -0,0 +1,93 @@ +package ubus + +import ( + "encoding/hex" + "reflect" + "testing" +) + +// A table survives the wire: integers come back as int64, the rest as sent. +func TestTableRoundTrip(t *testing.T) { + in := map[string]any{ + "name": "Myata", + "on": true, + "off": false, + "none": nil, + "small": 42, + "neg": -7, + "big": int64(5_000_000_000), + "whole": float64(3), + "frac": 1.5, + "list": []any{"a", int64(2), map[string]any{"k": "v"}}, + "deep": map[string]any{"x": map[string]any{"y": []any{}}}, + "": "an empty name", + } + b, err := encodeTable(in) + if err != nil { + t.Fatal(err) + } + if len(b)%4 != 0 { + t.Fatalf("%d bytes: not padded to 4", len(b)) + } + got, err := decodeTable(b, 0) + if err != nil { + t.Fatal(err) + } + want := map[string]any{ + "name": "Myata", "on": true, "off": false, "none": nil, + "small": int64(42), "neg": int64(-7), "big": int64(5_000_000_000), "whole": int64(3), "frac": 1.5, + "list": []any{"a", int64(2), map[string]any{"k": "v"}}, + "deep": map[string]any{"x": map[string]any{"y": []any{}}}, + "": "an empty name", + } + if !reflect.DeepEqual(got, want) { + t.Fatalf("got %#v\nwant %#v", got, want) + } +} + +// The bytes libubox writes for { "a": 1, "s": "hi" } (blobmsg_add_u32, blobmsg_add_string). +func TestKnownBytes(t *testing.T) { + b, err := encodeTable(map[string]any{"a": 1, "s": "hi"}) + if err != nil { + t.Fatal(err) + } + want := "8500000c" + "00016100" + "00000001" + // int32 "a" = 1 + "8300000b" + "00017300" + "68690000" // string "s" = "hi\0", 11 bytes padded to 12 + if got := hex.EncodeToString(b); got != want { + t.Fatalf("got %s\nwant %s", got, want) + } +} + +// A struct goes the way encoding/json would write it. +func TestStructThroughJSON(t *testing.T) { + type dev struct { + ID string `json:"id"` + Online bool `json:"online"` + Rx uint64 `json:"rx"` + } + b, err := encodeTable(map[string]any{"d": dev{"d1", true, 1 << 40}}) + if err != nil { + t.Fatal(err) + } + got, err := decodeTable(b, 0) + if err != nil { + t.Fatal(err) + } + want := map[string]any{"d": map[string]any{"id": "d1", "online": true, "rx": int64(1 << 40)}} + if !reflect.DeepEqual(got, want) { + t.Fatalf("got %#v", got) + } +} + +// Lengths that point past the end are an error, never a panic. +func TestTruncated(t *testing.T) { + b, _ := encodeTable(map[string]any{"name": "Myata", "t": map[string]any{"k": []any{1, 2, 3}}}) + for n := 1; n < len(b); n++ { + decodeTable(b[:n], 0) + } + bad := append([]byte{}, b...) + bad[3] = 0xff + if _, err := decodeTable(bad, 0); err == nil { + t.Fatal("a length past the end was accepted") + } +} diff --git a/backend/ubus/bus.go b/backend/ubus/bus.go new file mode 100644 index 0000000..865c5ec --- /dev/null +++ b/backend/ubus/bus.go @@ -0,0 +1,116 @@ +// Bus keeps the backend's objects on ubus for as long as the backend runs. +// ubusd restarts (a package upgrade, a crash): the connection ends, and the +// objects are put back on the next one. Until then notifications are dropped +// and calls fail; nothing waits for the bus. +package ubus + +import ( + "context" + "sync" + "time" +) + +// Bus is the backend's place on ubus, reconnected when it is lost. +type Bus struct { + path string + objects []*Object + // Log is told why a connection was not made or ended, once per change. + Log func(format string, args ...any) + + mu sync.Mutex + conn *Conn +} + +// NewBus prepares a bus at path (Socket on a router) with these objects. +func NewBus(path string, objects ...*Object) *Bus { + return &Bus{path: path, objects: objects, Log: func(string, ...any) {}} +} + +// Run keeps the connection until ctx ends. Between tries it waits a little +// longer each time, up to 5 s: ubusd comes back within a second or two. +func (b *Bus) Run(ctx context.Context) { + wait := 200 * time.Millisecond + said := "" + for ctx.Err() == nil { + err := b.session(ctx) + if ctx.Err() != nil { + return + } + // The same reason is not repeated on every try. + if msg := err.Error(); msg != said { + b.Log("ubus: %s; trying again", msg) + said = msg + } + select { + case <-ctx.Done(): + return + case <-time.After(wait): + } + if wait < 5*time.Second { + wait *= 2 + } + } +} + +// session is one connection: dial, add the objects, stay until it ends. +func (b *Bus) session(ctx context.Context) error { + c, err := Dial(b.path) + if err != nil { + return err + } + defer c.Close() + for _, o := range b.objects { + actx, cancel := context.WithTimeout(ctx, 10*time.Second) + err := c.Add(actx, o) + cancel() + if err != nil { + return err + } + } + b.mu.Lock() + b.conn = c + b.mu.Unlock() + defer func() { + b.mu.Lock() + b.conn = nil + b.mu.Unlock() + // Whoever watched is gone with the connection. + for _, o := range b.objects { + if o.Watched != nil { + o.Watched(false) + } + } + }() + select { + case <-ctx.Done(): + return ctx.Err() + case <-c.Done(): + c.mu.Lock() + err := c.err + c.mu.Unlock() + return err + } +} + +// Notify sends a notification to the object's subscribers; without a +// connection it is dropped (a subscriber that comes back asks for what it missed). +func (b *Bus) Notify(o *Object, kind string, data map[string]any) error { + b.mu.Lock() + c := b.conn + b.mu.Unlock() + if c == nil { + return ErrClosed + } + return c.Notify(o, kind, data) +} + +// Call invokes a method of another object on the bus. +func (b *Bus) Call(ctx context.Context, object, method string, args map[string]any) (map[string]any, error) { + b.mu.Lock() + c := b.conn + b.mu.Unlock() + if c == nil { + return nil, ErrClosed + } + return c.Call(ctx, object, method, args) +} diff --git a/backend/ubus/conn.go b/backend/ubus/conn.go new file mode 100644 index 0000000..d53732e --- /dev/null +++ b/backend/ubus/conn.go @@ -0,0 +1,585 @@ +// One connection to ubusd: the hello, objects added with the signature of +// their methods, the answers to calls made on them, notifications to their +// subscribers, and calls this side makes on other objects. +// +// A Conn lives as long as its socket. ubusd going away (a restart) ends it; +// Bus (bus.go) dials again and puts the objects back. One goroutine reads; a +// call on an object runs in its own goroutine, so a slow answer holds up +// neither the reader nor the other callers. +package ubus + +import ( + "context" + "encoding/binary" + "errors" + "fmt" + "io" + "net" + "sync" +) + +// Socket is where ubusd listens on OpenWrt. +const Socket = "/var/run/ubus/ubus.sock" + +// The types of a message (ubusmsg.h). +const ( + typeHello = 0 + typeStatus = 1 + typeData = 2 + typeLookup = 4 + typeInvoke = 5 + typeAddObject = 6 + typeNotify = 10 +) + +// The fields of a message (ubusmsg.h). +const ( + fieldStatus = 1 + fieldObjPath = 2 + fieldObjID = 3 + fieldMethod = 4 + fieldSignature = 6 + fieldData = 7 + fieldActive = 9 + fieldNoReply = 10 + fieldMax = 14 +) + +// maxMessage is the largest message ubusd takes (UBUS_MAX_MSGLEN); a larger +// one makes it drop the client. +const maxMessage = 1 << 20 + +// Status is how a call ended, as ubus counts it. Zero is success. +type Status int + +// The statuses a handler may return (as an error) and a call may fail with. +const ( + StatusInvalidCommand Status = 1 + StatusInvalidArgument Status = 2 + StatusMethodNotFound Status = 3 + StatusNotFound Status = 4 + StatusNoData Status = 5 + StatusPermissionDenied Status = 6 + StatusTimeout Status = 7 + StatusNotSupported Status = 8 + StatusUnknownError Status = 9 + StatusConnectionFailed Status = 10 +) + +var statusText = map[Status]string{ + StatusInvalidCommand: "invalid command", StatusInvalidArgument: "invalid argument", + StatusMethodNotFound: "method not found", StatusNotFound: "not found", StatusNoData: "no data", + StatusPermissionDenied: "permission denied", StatusTimeout: "timeout", StatusNotSupported: "not supported", + StatusUnknownError: "unknown error", StatusConnectionFailed: "connection failed", +} + +func (s Status) Error() string { + if t, ok := statusText[s]; ok { + return "ubus: " + t + } + return fmt.Sprintf("ubus: status %d", int(s)) +} + +// ErrClosed is what calls return once the connection to ubusd has ended. +var ErrClosed = errors.New("ubus: connection closed") + +// Handler answers a call. The arguments are the caller's table (through +// uhttpd, with its session id in "ubus_rpc_session"). A nil table answers with +// nothing; an error that is a Status ends the call with it, any other with +// StatusUnknownError. +type Handler func(ctx context.Context, args map[string]any) (map[string]any, error) + +// Kind is the type of an argument in a method's signature (`ubus -v list`). +type Kind uint32 + +// The kinds of argument a signature names. +const ( + Array Kind = msgArray + Table Kind = msgTable + String Kind = msgString + Int Kind = msgInt32 + Bool Kind = msgBool +) + +// Method is one method of an object. +type Method struct { + Name string + Params map[string]Kind + Handle Handler + // Waits marks a method that holds its answer until it has something to say + // (a long poll). Such calls are counted apart from the quick ones, which + // they would otherwise keep out, and one too many is refused at once. + Waits bool +} + +// Object is what the backend publishes on the bus. +type Object struct { + Name string + Methods []Method + // Watched is called when the object's first subscriber comes and when its + // last one leaves, from the reader's goroutine: it must not block. + Watched func(active bool) +} + +type message struct { + kind uint8 + seq uint16 + peer uint32 + body []byte +} + +// fields is a message's attributes by id; nil where one is absent. +type fields [fieldMax + 1][]byte + +func (m *message) fields() (fields, error) { + var f fields + err := each(m.body, func(a attr) error { + if a.id <= fieldMax { + // An attribute that is there with no payload still counts as present. + if a.data == nil { + a.data = []byte{} + } + f[a.id] = a.data + } + return nil + }) + return f, err +} + +func (f *fields) uint32(id int) (uint32, bool) { + if len(f[id]) < 4 { + return 0, false + } + return binary.BigEndian.Uint32(f[id]), true +} + +func (f *fields) string(id int) string { + d := f[id] + for i, c := range d { + if c == 0 { + return string(d[:i]) + } + } + return string(d) +} + +// reply is what a request this side made has received so far. +type reply struct { + data [][]byte + status Status +} + +// Conn is a connection to ubusd. +type Conn struct { + c net.Conn + ctx context.Context + cancel context.CancelFunc + + wmu sync.Mutex // one message at a time on the socket + + mu sync.Mutex + seq uint16 + pending map[uint16]chan reply + partial map[uint16]*reply + objects map[uint32]*Object + ids map[*Object]uint32 + looked map[string]uint32 + err error + + // Calls on our objects that run now: at most this many, the rest wait in + // the reader, which is how a caller that floods the bus is slowed down. + slots chan struct{} + // Calls that wait (Method.Waits) and may each take most of a minute. + waits chan struct{} +} + +// Dial connects to ubusd at path and waits for its hello. +func Dial(path string) (*Conn, error) { + c, err := net.Dial("unix", path) + if err != nil { + return nil, err + } + conn := &Conn{ + c: c, + pending: map[uint16]chan reply{}, + partial: map[uint16]*reply{}, + objects: map[uint32]*Object{}, + ids: map[*Object]uint32{}, + looked: map[string]uint32{}, + slots: make(chan struct{}, 8), + waits: make(chan struct{}, 64), + } + conn.ctx, conn.cancel = context.WithCancel(context.Background()) + m, err := conn.read() + if err == nil && m.kind != typeHello { + err = fmt.Errorf("ubus: expected a hello, got message type %d", m.kind) + } + if err != nil { + c.Close() + return nil, err + } + go conn.loop() + return conn, nil +} + +// Close ends the connection; everything waiting on it returns ErrClosed. +func (c *Conn) Close() error { + c.fail(ErrClosed) + return nil +} + +// Done is closed when the connection has ended. +func (c *Conn) Done() <-chan struct{} { return c.ctx.Done() } + +func (c *Conn) fail(err error) { + c.mu.Lock() + if c.err == nil { + c.err = err + for seq, ch := range c.pending { + close(ch) + delete(c.pending, seq) + } + } + c.mu.Unlock() + c.cancel() + c.c.Close() +} + +func (c *Conn) read() (message, error) { + var h [12]byte + if _, err := io.ReadFull(c.c, h[:]); err != nil { + return message{}, err + } + if h[0] != 0 { + return message{}, fmt.Errorf("ubus: protocol version %d", h[0]) + } + n := int(binary.BigEndian.Uint32(h[8:]) & attrLenMask) + if n < attrHeader || n > maxMessage { + return message{}, fmt.Errorf("ubus: message of %d bytes", n) + } + m := message{kind: h[1], seq: binary.BigEndian.Uint16(h[2:]), peer: binary.BigEndian.Uint32(h[4:])} + m.body = make([]byte, n-attrHeader) + if _, err := io.ReadFull(c.c, m.body); err != nil { + return message{}, err + } + return m, nil +} + +func (c *Conn) write(kind uint8, seq uint16, peer uint32, body []byte) error { + n := attrHeader + len(body) + if n > maxMessage { + return fmt.Errorf("ubus: message of %d bytes is over the bus's limit", n) + } + b := make([]byte, 12, 12+len(body)) + b[1] = kind + binary.BigEndian.PutUint16(b[2:], seq) + binary.BigEndian.PutUint32(b[4:], peer) + binary.BigEndian.PutUint32(b[8:], uint32(n)) + b = append(b, body...) + c.wmu.Lock() + _, err := c.c.Write(b) + c.wmu.Unlock() + if err != nil { + c.fail(err) + } + return err +} + +// request sends a message and waits for the status that ends its answer. +func (c *Conn) request(ctx context.Context, kind uint8, peer uint32, body []byte) (reply, error) { + ch := make(chan reply, 1) + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return reply{}, ErrClosed + } + // A sequence number still waited for is not given out again. + for { + c.seq++ + if _, busy := c.pending[c.seq]; !busy { + break + } + } + seq := c.seq + c.pending[seq] = ch + c.mu.Unlock() + + if err := c.write(kind, seq, peer, body); err != nil { + c.forget(seq) + return reply{}, err + } + select { + case r, ok := <-ch: + if !ok { + return reply{}, ErrClosed + } + if r.status != 0 { + return r, r.status + } + return r, nil + case <-ctx.Done(): + c.forget(seq) + return reply{}, ctx.Err() + } +} + +func (c *Conn) forget(seq uint16) { + c.mu.Lock() + delete(c.pending, seq) + delete(c.partial, seq) + c.mu.Unlock() +} + +func (c *Conn) loop() { + for { + m, err := c.read() + if err != nil { + c.fail(err) + return + } + f, err := m.fields() + if err != nil { + c.fail(err) + return + } + switch m.kind { + case typeData, typeStatus: + c.answered(m, &f) + case typeInvoke: + c.invoked(m, &f) + case typeNotify: + // From ubusd: the object got its first subscriber or lost its last. + id, _ := f.uint32(fieldObjID) + c.mu.Lock() + o := c.objects[id] + c.mu.Unlock() + if o != nil && o.Watched != nil && f[fieldActive] != nil { + o.Watched(len(f[fieldActive]) > 0 && f[fieldActive][0] != 0) + } + } + } +} + +// answered takes a part of the answer to a request of ours: its data, or the +// status that ends it. +func (c *Conn) answered(m message, f *fields) { + c.mu.Lock() + defer c.mu.Unlock() + ch, ok := c.pending[m.seq] + if !ok { + return + } + r := c.partial[m.seq] + if r == nil { + r = &reply{} + c.partial[m.seq] = r + } + if m.kind == typeData { + // An answer to a lookup or to adding an object is the message itself; a + // method's answer sits in its data field. + r.data = append(r.data, m.body) + return + } + st, _ := f.uint32(fieldStatus) + r.status = Status(st) + delete(c.pending, m.seq) + delete(c.partial, m.seq) + ch <- *r +} + +// invoked runs a call on one of our objects and answers it. +func (c *Conn) invoked(m message, f *fields) { + id, _ := f.uint32(fieldObjID) + name := f.string(fieldMethod) + silent := len(f[fieldNoReply]) > 0 && f[fieldNoReply][0] != 0 + c.mu.Lock() + o := c.objects[id] + c.mu.Unlock() + end := func(st Status) { + if silent { + return + } + b := putUint32(nil, fieldStatus, uint32(st)) + b = putUint32(b, fieldObjID, id) + c.write(typeStatus, m.seq, m.peer, b) + } + var handle Handler + slots := c.slots + if o != nil { + for i := range o.Methods { + if o.Methods[i].Name == name { + handle = o.Methods[i].Handle + if o.Methods[i].Waits { + slots = c.waits + } + } + } + } + if handle == nil { + end(StatusMethodNotFound) + return + } + args, err := decodeTable(f[fieldData], 0) + if err != nil { + end(StatusInvalidArgument) + return + } + if slots == c.waits { + select { + case slots <- struct{}{}: + default: + // The caller asks again later, by its own clock. + end(StatusTimeout) + return + } + } else { + select { + case slots <- struct{}{}: + case <-c.ctx.Done(): + return + } + } + go func() { + defer func() { <-slots }() + out, err := handle(c.ctx, args) + var st Status + if err != nil && !errors.As(err, &st) { + st = StatusUnknownError + } + if err == nil && out != nil && !silent { + data, eerr := encodeTable(out) + if eerr != nil { + st = StatusUnknownError + } else { + b := putUint32(nil, fieldObjID, id) + b = putBytes(b, fieldData, data) + if c.write(typeData, m.seq, m.peer, b) != nil { + return + } + } + } + end(st) + }() +} + +// Add publishes an object. Its methods can be called as soon as this returns. +func (c *Conn) Add(ctx context.Context, o *Object) error { + b := putString(nil, fieldObjPath, o.Name) + b, at := open(b) + var err error + for _, m := range o.Methods { + sig := make(map[string]any, len(m.Params)) + for k, v := range m.Params { + sig[k] = int64(v) + } + if b, err = putValue(b, m.Name, sig); err != nil { + return err + } + } + b = closeAttr(b, at, fieldSignature<'\n\toption header_protection_key 'yvVKA41To0000000000000000000IUdcl4ZiyFE='\n\toption rekey_after_time '100-120'\n\toption random_trailers 'on'\n\nconfig server 'cabin'\n\toption port 'x'\n\toption dns '9.9.9.9, 149.112.112.112'\n\toption device_mesh '0'\n\toption enabled '0'\n\toption mesh 'everyone'\n\nconfig person 'anna'\n\toption server 'home'\n\toption name 'Anna'\n\toption access 'both'\n\toption device_limit '2'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption code_set '1790000000'\n\toption expires '2026-12-31'\n\toption quota_gb '1.5'\n\toption quota_period 'total'\n\toption dns_mode 'home'\n\toption bonus_gb '20'\n\toption bonus_until '1795000000'\n\tlist service 'nas'\n\tlist home_net 'br-lan'\n\toption circle 'family'\n\toption note 'A note, with a comma'\n\toption created '1780000000'\n\nconfig person 'boris'\n\toption server 'cabin'\n\toption access 'everything'\n\toption paused '1'\n\toption quota_gb 'lots'\n\toption bonus_month '2026-12'\n\toption service 'nas printer'\n\nconfig person 'nobody'\n\nconfig device 'd_1'\n\toption person 'anna'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.77.0.2'\n\toption public_key 'u4pL0000000000000000000000000000DyRrogDM='\n\toption preshared_key 'Yc0000000000000000000000000000bRABGUovbrNy4='\n\toption created '1780000100'\n\toption created_by 'portal'\n\toption mtu '1280'\n\toption keepalive '0'\n\toption lan_bypass '1'\n\nconfig device 'd_2'\n\toption person 'anna'\n\toption kind 'toaster'\n\toption disabled 'yes'\n\toption keepalive 'often'\n\nconfig device 'd_3'\n\toption person 'gone'\n\toption name 'Orphan'\n\toption kind 'router'\n\toption keepalive '60'\n\nconfig circle 'family'\n\toption server 'home'\n\toption name 'Family'\n\toption color '11'\n\nconfig service 'nas'\n\toption name 'NAS'\n\toption address '192.168.1.10'\n\tlist port '445'\n\tlist port '8080-8090'\n\nconfig service 'printer'\n\toption address '192.168.1.20'\n\n" + }, + "steps": [ + { + "op": [ + "set", + "settings", + "portal_port", + "9443" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "brand_new", + "it's a 'quoted' value" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'it'\\''s a '\\''quoted'\\'' value'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "a_list", + [ + "one", + "two words", + "" + ] + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'it'\\''s a '\\''quoted'\\'' value'\n\tlist a_list 'one'\n\tlist a_list 'two words'\n\tlist a_list ''\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "brand_new", + "changed in place" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'changed in place'\n\tlist a_list 'one'\n\tlist a_list 'two words'\n\tlist a_list ''\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "a_list", + [ + "only" + ] + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'changed in place'\n\tlist a_list 'only'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "a_list", + "now an option" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\toption portal_port '9443'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'changed in place'\n\toption a_list 'now an option'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "portal_port", + [ + "now", + "a list" + ] + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption brand_new 'changed in place'\n\toption a_list 'now an option'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "delete", + "settings", + "brand_new" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "set", + "settings", + "brand_new", + "back, at the end" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\n" + }, + { + "op": [ + "add", + "person", + "zed" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\n" + }, + { + "op": [ + "set", + "zed", + "name", + "Zed" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\toption name 'Zed'\n\n" + }, + { + "op": [ + "set", + "zed", + "multi", + "line one\nline two" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\n" + }, + { + "op": [ + "add", + "device", + "zphone" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\nconfig device 'zphone'\n\n" + }, + { + "op": [ + "set", + "zphone", + "person", + "zed" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\nconfig device 'zphone'\n\toption person 'zed'\n\n" + }, + { + "op": [ + "set", + "zed", + "server", + "home" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig person 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\nconfig device 'zphone'\n\toption person 'zed'\n\n" + }, + { + "op": [ + "add", + "circle", + "zed" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig circle 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\nconfig device 'zphone'\n\toption person 'zed'\n\n" + }, + { + "op": [ + "delete", + "zphone" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig circle 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\n" + }, + { + "op": [ + "delete", + "settings", + "no_such_option" + ], + "ok": false, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig circle 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\n" + }, + { + "op": [ + "set", + "settings", + "empty", + "" + ], + "ok": true, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig circle 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\n" + }, + { + "op": [ + "set", + "settings", + "empty_list", + [ + ] + ], + "ok": false, + "file": "\nconfig settings 'settings'\n\toption portal_enabled '1'\n\tlist portal_port 'now'\n\tlist portal_port 'a list'\n\toption portal_host 'vpn.example.com'\n\toption portal_title 'My VPN'\n\toption log_connections '0'\n\toption update_interval '7d'\n\tlist update_targets 'app'\n\toption a_list 'now an option'\n\toption brand_new 'back, at the end'\n\nconfig server 'main'\n\toption name 'Main'\n\toption ifname 'awgmain'\n\toption port '51820'\n\toption subnet '10.9.0.0/29'\n\toption private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='\n\toption public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='\n\toption mtu '1380'\n\toption jc '4'\n\toption jmin '64'\n\toption jmax '128'\n\toption s4 '12'\n\nconfig person 'alice'\n\toption server 'main'\n\toption name 'Alice'\n\toption code 'abcdef-ghijkl-mnopqr'\n\toption access 'both'\n\nconfig person 'bob'\n\toption server 'main'\n\toption name 'Bob'\n\toption code 'XyZ12345'\n\toption quota_gb '2'\n\nconfig device 'alice_phone'\n\toption person 'alice'\n\toption name 'Phone'\n\toption kind 'phone'\n\toption address '10.9.0.2'\n\toption public_key 'AuTb2wZ8C1032Ksn76nFgXzOJgT86OgEVbEE7ClpNy8='\n\nconfig circle 'zed'\n\toption name 'Zed'\n\toption multi 'line one\nline two'\n\toption server 'home'\n\n" + } + ] +} diff --git a/backend/uci/uci.go b/backend/uci/uci.go new file mode 100644 index 0000000..2cefbfd --- /dev/null +++ b/backend/uci/uci.go @@ -0,0 +1,242 @@ +// Package uci reads a configuration file of OpenWrt's UCI the way libuci does, without the uci program: +// the backend reads /etc/config/dawnline on every change, and a test reads fixtures on any system. +// +// Reading only. Whoever writes the file (the ucode backend's store, until the model's writer is ported) +// replaces it whole; this package never holds it open. +// +// The syntax, as libuci's parser takes it: one command a line (or several parted by `;`), `package`, +// `config []`, `option `, `list `; a word is bare, in single +// quotes (taken as written) or in double quotes (a backslash takes the next character), and pieces that +// touch are one word; `#` begins a comment where a word could begin. +package uci + +import ( + "fmt" + "strings" +) + +// Value is what an option holds: one string (`option`), or a list (`list`, one entry a line). +type Value struct { + Str string + List []string + IsList bool +} + +// Section is one `config` block. +type Section struct { + Type string + Name string + // Anonymous: the file gave it no name. libuci names such a section by its place and a hash of its + // content; here it gets its place only (Dawnline's own file names every section). + Anonymous bool + Values map[string]Value + // Order is the options' names in the order they stand in the file: what is written keeps it. + Order []string +} + +// Config is a parsed file: its sections in the order they stand. +type Config struct { + Sections []*Section +} + +// Get returns an option's string. A list has none (ok is false): its entries are List's. +func (s *Section) Get(name string) (string, bool) { + v, ok := s.Values[name] + if !ok || v.IsList { + return "", false + } + return v.Str, true +} + +// Section returns the section of that name, or nil. +func (c *Config) Section(name string) *Section { + for _, s := range c.Sections { + if s.Name == name { + return s + } + } + return nil +} + +// OfType returns the sections of a type, in the file's order. +func (c *Config) OfType(kind string) []*Section { + var out []*Section + for _, s := range c.Sections { + if s.Type == kind { + out = append(out, s) + } + } + return out +} + +// Parse reads a file's text. +func Parse(text string) (*Config, error) { + cmds, err := commands(text) + if err != nil { + return nil, err + } + c := &Config{} + var cur *Section + for _, cmd := range cmds { + w := cmd.words + switch w[0] { + case "package": + // one package a file; its name is the file's + case "config": + if len(w) < 2 { + return nil, fmt.Errorf("uci: line %d: config without a type", cmd.line) + } + name := "" + if len(w) > 2 { + name = w[2] + } + cur = c.open(w[1], name) + case "option", "list": + if cur == nil { + return nil, fmt.Errorf("uci: line %d: %s outside a section", cmd.line, w[0]) + } + if len(w) < 3 { + return nil, fmt.Errorf("uci: line %d: %s needs a name and a value", cmd.line, w[0]) + } + cur.set(w[1], w[2], w[0] == "list") + default: + return nil, fmt.Errorf("uci: line %d: unknown command %q", cmd.line, w[0]) + } + } + return c, nil +} + +// open starts a section. A name the file used before goes on with that section (its type becomes the new +// one), as libuci merges them. +func (c *Config) open(kind, name string) *Section { + if name != "" { + if s := c.Section(name); s != nil { + s.Type = kind + return s + } + } + s := &Section{Type: kind, Name: name, Values: map[string]Value{}} + if name == "" { + s.Anonymous = true + s.Name = fmt.Sprintf("cfg%02x", len(c.Sections)+1) + } + c.Sections = append(c.Sections, s) + return s +} + +// set stores a value: an option replaces what was there; a list entry is added to a list, and turns an +// option of that name into a list that begins with it. +func (s *Section) set(name, value string, list bool) { + if _, had := s.Values[name]; !had { + s.Order = append(s.Order, name) + } + if !list { + s.Values[name] = Value{Str: value} + return + } + old, had := s.Values[name] + switch { + case !had: + s.Values[name] = Value{IsList: true, List: []string{value}} + case old.IsList: + old.List = append(old.List, value) + s.Values[name] = old + default: + s.Values[name] = Value{IsList: true, List: []string{old.Str, value}} + } +} + +type command struct { + words []string + // line is where the command begins, for an error. + line int +} + +// commands cuts a file into commands: a line, or a part of one up to a `;`. A quoted word may run over +// several lines (a value with line breaks in it). +func commands(text string) ([]command, error) { + var out []command + var cur []string + line, began := 1, 1 + flush := func() { + if len(cur) > 0 { + out = append(out, command{words: cur, line: began}) + } + cur = nil + } + i := 0 + for i < len(text) { + switch c := text[i]; { + case c == '\n': + flush() + line++ + i++ + case c == ' ' || c == '\t' || c == '\r': + i++ + case c == ';': + flush() + i++ + case c == '#': + for i < len(text) && text[i] != '\n' { + i++ + } + default: + if len(cur) == 0 { + began = line + } + var b strings.Builder + piece: + for i < len(text) { + switch c := text[i]; c { + case ' ', '\t', '\r', '\n', ';': + break piece + case '\'': + end := strings.IndexByte(text[i+1:], '\'') + if end < 0 { + return nil, fmt.Errorf("uci: line %d: a single quote is not closed", line) + } + quoted := text[i+1 : i+1+end] + line += strings.Count(quoted, "\n") + b.WriteString(quoted) + i += end + 2 + case '"': + i++ + closed := false + for i < len(text) { + if text[i] == '\\' && i+1 < len(text) { + b.WriteByte(text[i+1]) + i += 2 + continue + } + if text[i] == '"' { + i++ + closed = true + break + } + if text[i] == '\n' { + line++ + } + b.WriteByte(text[i]) + i++ + } + if !closed { + return nil, fmt.Errorf("uci: line %d: a double quote is not closed", line) + } + case '\\': + if i+1 < len(text) { + b.WriteByte(text[i+1]) + i += 2 + } else { + i++ + } + default: + b.WriteByte(c) + i++ + } + } + cur = append(cur, b.String()) + } + } + flush() + return out, nil +} diff --git a/backend/uci/uci_test.go b/backend/uci/uci_test.go new file mode 100644 index 0000000..09f2aad --- /dev/null +++ b/backend/uci/uci_test.go @@ -0,0 +1,83 @@ +package uci + +import ( + "os" + "reflect" + "testing" +) + +func TestParse(t *testing.T) { + c, err := Parse(`# a comment +package dawnline + +config settings 'settings' + option portal_enabled '1' # after a value + option quoted "a \"b\" c" + option glued 'one'"two"three + option bare vpn.example.com + list update_targets 'app' + list update_targets 'packages' + option twice 'old' + option twice 'new' + option then_list 'first' + list then_list 'second' + option lines 'two +lines' + +config server main; option name Main +config device + option name 'no name of its own' +config settings 'settings' + option later 'merged' +`) + if err != nil { + t.Fatal(err) + } + s := c.Section("settings") + want := map[string]Value{ + "portal_enabled": {Str: "1"}, + "quoted": {Str: `a "b" c`}, + "glued": {Str: "onetwothree"}, + "bare": {Str: "vpn.example.com"}, + "update_targets": {IsList: true, List: []string{"app", "packages"}}, + "twice": {Str: "new"}, + "then_list": {IsList: true, List: []string{"first", "second"}}, + "lines": {Str: "two\nlines"}, + "later": {Str: "merged"}, + } + if !reflect.DeepEqual(s.Values, want) { + t.Fatalf("settings: %#v", s.Values) + } + if len(c.Sections) != 3 || c.Sections[1].Name != "main" || c.Sections[1].Values["name"].Str != "Main" { + t.Fatalf("sections: %+v", c.Sections) + } + if d := c.OfType("device"); len(d) != 1 || !d[0].Anonymous || d[0].Name == "" { + t.Fatalf("the anonymous section: %+v", d) + } + if _, ok := s.Get("update_targets"); ok { + t.Fatal("a list read as one string") + } +} + +func TestParseErrors(t *testing.T) { + for _, text := range []string{"option a b", "config", "config s 'x'\noption a", "config s x\noption a 'open", "frobnicate x"} { + if _, err := Parse(text); err == nil { + t.Errorf("%q was accepted", text) + } + } +} + +// The project's own fixture parses whole. +func TestFixture(t *testing.T) { + raw, err := os.ReadFile("testdata/household.uci") + if err != nil { + t.Skip(err) + } + c, err := Parse(string(raw)) + if err != nil { + t.Fatal(err) + } + if len(c.OfType("server")) != 1 || len(c.OfType("person")) != 2 || len(c.OfType("device")) != 1 { + t.Fatalf("sections: %d servers, %d people, %d devices", len(c.OfType("server")), len(c.OfType("person")), len(c.OfType("device"))) + } +} diff --git a/backend/uci/write.go b/backend/uci/write.go new file mode 100644 index 0000000..2cb136c --- /dev/null +++ b/backend/uci/write.go @@ -0,0 +1,118 @@ +package uci + +import "strings" + +// Writing a file as libuci commits it, and changing one as a cursor does, so that what the Go backend +// saves is byte for byte what the ucode backend would have (testdata/write.uc, scripts/ucode-golden.sh): +// +// config '' +// option '' +// list '' +// +// each section after an empty line, a single quote inside a value as '\''. + +func quote(s string) string { return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" } + +// Format is the file's text. +func (c *Config) Format() string { + var b strings.Builder + for _, s := range c.Sections { + b.WriteString("\nconfig " + s.Type) + if !s.Anonymous { + b.WriteString(" " + quote(s.Name)) + } + b.WriteString("\n") + for _, name := range s.Order { + v, ok := s.Values[name] + if !ok { + continue + } + if !v.IsList { + b.WriteString("\toption " + name + " " + quote(v.Str) + "\n") + continue + } + for _, e := range v.List { + b.WriteString("\tlist " + name + " " + quote(e) + "\n") + } + } + } + // the file ends with an empty line + if len(c.Sections) > 0 { + b.WriteString("\n") + } + return b.String() +} + +// Add makes a section, or gives the one of that name another type (its options stay). It returns the section. +func (c *Config) Add(kind, name string) *Section { + return c.open(kind, name) +} + +// Set gives an option a value; it keeps its place when it was there, else goes last. An empty value +// removes the option, as a cursor does. False when there is no such section. +func (c *Config) Set(section, option, value string) bool { + s := c.Section(section) + if s == nil { + return false + } + if value == "" { + s.remove(option) + return true + } + if _, had := s.Values[option]; !had { + s.Order = append(s.Order, option) + } + s.Values[option] = Value{Str: value} + return true +} + +// SetList gives an option a list of entries. An empty list changes nothing and is refused, as a cursor +// refuses it. +func (c *Config) SetList(section, option string, list []string) bool { + s := c.Section(section) + if s == nil || len(list) == 0 { + return false + } + // The cursor's own ways, as the goldens have them: a list of one entry is taken out and added anew, so + // it goes last whatever was there; a longer one is set in the place of what was there (its first entry + // set, the others added to it), and goes last only when nothing was. + if len(list) == 1 { + s.remove(option) + } + if _, had := s.Values[option]; !had { + s.Order = append(s.Order, option) + } + s.Values[option] = Value{IsList: true, List: append([]string{}, list...)} + return true +} + +func (s *Section) remove(option string) bool { + if _, had := s.Values[option]; !had { + return false + } + delete(s.Values, option) + for i, n := range s.Order { + if n == option { + s.Order = append(s.Order[:i], s.Order[i+1:]...) + break + } + } + return true +} + +// Delete removes an option; false when it was not there. +func (c *Config) Delete(section, option string) bool { + s := c.Section(section) + return s != nil && s.remove(option) +} + +// DeleteSection removes a section; false when it was not there. +func (c *Config) DeleteSection(name string) bool { + for i, s := range c.Sections { + if s.Name == name { + c.Sections = append(c.Sections[:i], c.Sections[i+1:]...) + return true + } + } + return false +} diff --git a/backend/uci/write_test.go b/backend/uci/write_test.go new file mode 100644 index 0000000..8a76d45 --- /dev/null +++ b/backend/uci/write_test.go @@ -0,0 +1,83 @@ +package uci + +import ( + "encoding/json" + "os" + "testing" +) + +// The model's fixtures as libuci commits them, and one of them through a row of changes, file for file +// (testdata/write.uc, scripts/ucode-golden.sh). +func TestWrittenAsLibuci(t *testing.T) { + raw, err := os.ReadFile("testdata/write.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + Canon map[string]string `json:"canon"` + Steps []struct { + Op []any `json:"op"` + OK bool `json:"ok"` + File string `json:"file"` + } `json:"steps"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + if len(golden.Canon) != 2 || len(golden.Steps) < 18 { + t.Fatal("the golden is too small") + } + for name, want := range golden.Canon { + text, err := os.ReadFile("../model/testdata/" + name + ".uci") + if err != nil { + t.Fatal(err) + } + c, err := Parse(string(text)) + if err != nil { + t.Fatal(err) + } + if got := c.Format(); got != want { + t.Errorf("%s is written otherwise:\n%s\n--- libuci:\n%s", name, got, want) + } + // what is written reads back as itself + again, err := Parse(c.Format()) + if err != nil || again.Format() != want { + t.Errorf("%s does not read back as written: %v", name, err) + } + } + text, _ := os.ReadFile("../model/testdata/small.uci") + file := string(text) + for i, step := range golden.Steps { + // as the golden: read anew, one change, written + c, err := Parse(file) + if err != nil { + t.Fatalf("step %d: %v", i, err) + } + str := func(n int) string { s, _ := step.Op[n].(string); return s } + var ok bool + switch str(0) { + case "add": + ok = c.Add(str(1), str(2)) != nil + case "delete": + if len(step.Op) > 2 { + ok = c.Delete(str(1), str(2)) + } else { + ok = c.DeleteSection(str(1)) + } + case "set": + if list, isList := step.Op[3].([]any); isList { + var entries []string + for _, e := range list { + entries = append(entries, e.(string)) + } + ok = c.SetList(str(1), str(2), entries) + } else { + ok = c.Set(str(1), str(2), str(3)) + } + } + file = c.Format() + if ok != step.OK || file != step.File { + t.Fatalf("step %d %v: ok %v (libuci %v)\n%s\n--- libuci:\n%s", i, step.Op, ok, step.OK, file, step.File) + } + } +} diff --git a/backend/updater/builds.go b/backend/updater/builds.go new file mode 100644 index 0000000..29bf5c5 --- /dev/null +++ b/backend/updater/builds.go @@ -0,0 +1,224 @@ +package updater + +import ( + "os" + "regexp" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" +) + +// Where AmneziaWG comes from (dawnline.awg_builds): the awg-openwrt projects publish builds per OpenWrt +// release and target (the kernel module must match the firmware), and the record of what was installed on +// which kernel and boot (an update whose module could not be swapped starts with the next boot). + +// Source is a project that publishes builds. +type Source struct{ Repo, Label string } + +var ( + Sources = map[string]Source{"slava": {"Slava-Shchipunov/awg-openwrt", "Slava-Shchipunov"}, "grey": {"2Grey/awg-openwrt", "2Grey"}} + // Order is the order they are tried in when no build is chosen. + Order = []string{"slava", "grey"} + // AwgPackages is a build's packages; AwgRU its Russian LuCI translation. + AwgPackages = []string{"kmod-amneziawg", "amneziawg-tools", "luci-proto-amneziawg"} +) + +const AwgRU = "luci-i18n-amneziawg-ru" + +// Firmware is this firmware as the builds name it: { Tag: "v24.10.6", Postfix: +// "_v24.10.6_aarch64_cortex-a53_mediatek_filogic", Ext }. +type Firmware struct { + Tag, Postfix, Ext string + Snapshot bool +} + +var distribArch = regexp.MustCompile(`DISTRIB_ARCH='([^']*)'`) + +// FirmwareOf makes it of what `ubus call system board` says of the release (version, target, arch; the +// arch from /etc/openwrt_release when the board does not say); ok is false when it cannot be told. +func FirmwareOf(version, target, arch, release, ext string) (Firmware, bool) { + parts := strings.Split(target, "/") + if arch == "" { + if m := distribArch.FindStringSubmatch(release); m != nil { + arch = m[1] + } + } + if version == "" || len(parts) != 2 || arch == "" { + return Firmware{}, false + } + return Firmware{Tag: "v" + version, Postfix: "_v" + version + "_" + arch + "_" + parts[0] + "_" + parts[1], Ext: ext, + Snapshot: strings.Contains(version, "SNAPSHOT")}, true +} + +// Asset is the file name of a package in a build. +func (fw Firmware) Asset(name string) string { return name + fw.Postfix + "." + fw.Ext } + +// ForTag is the same firmware, another release of its series (v24.10.6 → v24.10.8). +func (fw Firmware) ForTag(tag string) Firmware { + out := fw + out.Tag, out.Postfix = tag, strings.Replace(fw.Postfix, fw.Tag, tag, 1) + return out +} + +var awgPart = regexp.MustCompile(`([0-9]+\.[0-9]+\.[0-9]{8})(-r?[0-9]+)?$`) + +// Gen is the AmneziaWG generation of a package version ("" for none): 3.x packages carry 3.1; 1.0.x ones +// are 2.0 from July 2025 on, and the first generation before that. A kernel module's version carries the +// kernel release in front: the AmneziaWG part is at the end. +func Gen(version string) string { + if version == "" { + return "" + } + v := version + if m := awgPart.FindStringSubmatch(version); m != nil { + v = m[1] + } + switch { + case strings.HasPrefix(v, "3."): + return "3.1" + case strings.HasPrefix(v, "1.0.2024"): + return "1.0" + case len(v) >= 10 && strings.HasPrefix(v, "1.0.20250") && v[9] >= '1' && v[9] <= '6': + return "1.0" + } + return "2.0" +} + +// Record is awg.json: which build was installed on which kernel and boot. +type Record struct { + OSRelease string `json:"osrelease"` + Source any `json:"source"` + Tag any `json:"tag"` + Packages map[string]any `json:"packages"` + Installed int64 `json:"installed"` + Boot any `json:"boot"` + PrevGen any `json:"prev_gen"` + PrevCore any `json:"prev_core"` + Reloaded any `json:"reloaded"` +} + +func readTrim(path string) string { + raw, _ := os.ReadFile(path) + return strings.Trim(string(raw), " \t\r\n\v\f") +} + +// bootID is this boot ("" when the kernel does not say); moduleCore the size in memory of the loaded +// kernel module (0: none is loaded). sysfs has no version for it, but builds differ in size. +func bootID() string { return readTrim("/proc/sys/kernel/random/boot_id") } + +func moduleCore() int64 { + n, _ := strconv.ParseInt(readTrim("/sys/module/amneziawg/coresize"), 10, 64) + if n < 0 { + return 0 + } + return n +} + +// Pending tells an installed update that waits for a reboot: the install could not swap the kernel module +// (the old one stayed loaded), this is still the boot it ran in, and the module loaded is still the one +// from before it. Pure. +func Pending(rec *Record, boot string, core int64) bool { + if rec == nil || rec.Reloaded != false || boot == "" || rec.Boot != boot || core == 0 { + return false + } + prev, _ := rec.PrevCore.(float64) + return int64(prev) == core +} + +// Module is the kernel module loaded now, taken before an install changes packages. +type Module struct { + Core int64 + Gen string + Pending bool +} + +func record(data string) *Record { + var r Record + if !files.ReadJSON(data+"/awg.json", &r) { + return nil + } + return &r +} + +// moduleNow is what runs: the generation from before an install while it waits for a reboot, else the +// installed package's (version: the kmod-amneziawg package installed now). +func moduleNow(data, version string) Module { + rec, boot, core := record(data), bootID(), moduleCore() + m := Module{Core: core, Pending: Pending(rec, boot, core)} + switch { + case core == 0: + case m.Pending: + m.Gen, _ = rec.PrevGen.(string) + default: + m.Gen = Gen(version) + } + return m +} + +// writeRecord remembers which build was installed on which kernel. After a firmware upgrade the module is +// gone (it was built for that kernel): Health can then say so and offer the build for the new one. +func writeRecord(data string, source, tag any, packages map[string]any, was Module, reloaded bool) { + orNil := func(s string) any { + if s == "" { + return nil + } + return s + } + var core any + if was.Core != 0 { + core = was.Core + } + os.MkdirAll(data, 0o700) + files.WriteJSON(data+"/awg.json", map[string]any{"osrelease": readTrim("/proc/sys/kernel/osrelease"), "source": source, "tag": tag, "packages": packages, + "installed": time.Now().Unix(), "boot": orNil(bootID()), "prev_gen": orNil(was.Gen), "prev_core": core, "reloaded": reloaded}, 0o600) +} + +// GoArch is the name the backend's binary carries in a release (dawnlined--) for a +// router's architecture as OpenWrt names it (DISTRIB_ARCH: aarch64_cortex-a53, arm_cortex-a7_neon-vfpv4, +// mipsel_24kc, x86_64), or "" where none is built: such a router runs without the backend. ARM older than +// v7 has none (the binary is built for ARMv7's own instructions). +func GoArch(arch string) string { + cpu := strings.SplitN(arch, "_", 2) + sub := "" + if len(cpu) > 1 { + sub = cpu[1] + } + switch cpu[0] { + case "aarch64": + return "arm64" + case "x86": + if sub == "64" { + return "amd64" + } + case "mips": + return "mips" + case "mipsel": + return "mipsle" + case "arm": + // Cortex-A cores are ARMv7 or newer; arm926ej-s, arm1176jzf-s, xscale, fa526 and their like are not + if strings.HasPrefix(sub, "cortex-a") { + return "arm" + } + } + return "" +} + +// Adopt makes a record for a module Dawnline did not install (install.sh, by hand, or from before records +// were kept), so the next firmware upgrade is noticed: the kernel it is for, no source. Only when there is +// no record and the module is loaded or on disk for the running kernel. The backend calls it when it starts. +func Adopt(data string) { + rel := readTrim("/proc/sys/kernel/osrelease") + if _, err := os.Stat(data + "/awg.json"); err == nil { + return + } + _, loaded := os.Stat("/sys/module/amneziawg") + _, onDisk := os.Stat("/lib/modules/" + rel + "/amneziawg.ko") + if loaded != nil && (rel == "" || onDisk != nil) { + return + } + os.MkdirAll(data, 0o700) + files.WriteJSON(data+"/awg.json", map[string]any{"osrelease": rel, "source": nil, "tag": nil, "packages": nil, "installed": time.Now().Unix(), + "boot": bootID(), "prev_gen": nil, "prev_core": nil, "reloaded": nil}, 0o600) +} diff --git a/backend/updater/components.go b/backend/updater/components.go new file mode 100644 index 0000000..137ad6d --- /dev/null +++ b/backend/updater/components.go @@ -0,0 +1,721 @@ +package updater + +import ( + "fmt" + "os" + "regexp" + "sort" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +func (w *worker) must(ok bool, err error, format string, args ...any) { + if err != nil { + panic(err) + } + if !ok { + w.die(format, args...) + } +} + +func (w *worker) download(url, dest, want string) bool { + return github.Download(w.e.Fetch, url, dest, want, w.e.Policy.Mirrors, w.log, w.t) != "" +} + +/* ---------- Dawnline itself ---------- */ + +func (w *worker) checkApp() map[string]any { + v := w.e.Version + r := w.e.GH.Latest(Repo) + if r == nil { + return map[string]any{"installed": v, "latest": nil, "update": false, "repo": Repo, "status": "", "note": fmt.Sprintf(w.t("Cannot reach github.com/%s"), Repo)} + } + tag := str(r["tag"]) + latest := strings.TrimPrefix(tag, "v") + st := appStatus(v, latest) + switch st { + case "outdated": + w.logf("Dawnline update is available: %s → %s", v, latest) + case "dev": + w.logf("Installed Dawnline %s is newer than the release %s", v, latest) + default: + w.logf("Dawnline is up to date (%s)", v) + } + return map[string]any{"installed": v, "latest": latest, "tag": tag, "repo": Repo, "url": r["url"], "published": r["published"], "update": st == "outdated", "status": st} +} + +var ( + unsafeTag = regexp.MustCompile(`[^A-Za-z0-9.-]`) + sumLine = regexp.MustCompile(`^([0-9a-f]{64})[ \t]+\*?(\S+)$`) +) + +// wantSHA is the sha256 a release publishes for a file: GitHub's own (API), else the release's +// sha256sums.txt fetched straight from GitHub (never a mirror). +func (w *worker) wantSHA(tag, asset, dir string) string { + if want := w.e.GH.AssetSHA256(Repo, tag, asset); want != "" { + return want + } + sums := dir + "/sha256sums-" + unsafeTag.ReplaceAllString(tag, "_") + ".txt" + if github.Download(w.e.Fetch, "https://github.com/"+Repo+"/releases/download/"+tag+"/sha256sums.txt", sums, "", false, w.log, w.t) == "" { + return "" + } + raw, _ := os.ReadFile(sums) + for _, line := range strings.Split(string(raw), "\n") { + if m := sumLine.FindStringSubmatch(strings.Trim(line, " \t\r\n\v\f")); m != nil && m[2] == asset { + return m[1] + } + } + return "" +} + +// fetchFile downloads one file of a release, verified against its sha256. optional: a release without it +// (one from before the translations) gives "". +func (w *worker) fetchFile(tag, asset, dir string, optional bool) string { + w.phase("Downloading %s", asset) + want := w.wantSHA(tag, asset, dir) + if want == "" && optional { + w.logf("Release %s has no %s: it stays as it is", tag, asset) + return "" + } + if want == "" { + w.die("Release %s publishes no checksum for %s: not installing an unverified package", tag, asset) + } + f := dir + "/" + asset + if !w.download("https://github.com/"+Repo+"/releases/download/"+tag+"/"+asset, f, want) { + w.die("Download failed: %s", asset) + } + w.logf("sha256 matches the release (%s…)", want[:12]) + return f +} + +func (w *worker) langs() []string { + if w.e.Langs == nil { + return nil + } + return w.e.Langs() +} + +// fetchRelease is a release's package and the translations installed here, verified. +func (w *worker) fetchRelease(tag, dir string) []string { + ver := strings.TrimPrefix(tag, "v") + out := []string{w.fetchFile(tag, "luci-app-dawnline-"+ver+"."+w.e.Pkg.Ext(), dir, false)} + for _, l := range w.langs() { + if f := w.fetchFile(tag, "luci-i18n-dawnline-"+l+"-"+ver+"."+w.e.Pkg.Ext(), dir, true); f != "" { + out = append(out, f) + } + } + return out +} + +// tagOf is the release tag of a version: tags may or may not carry the v. +func (w *worker) tagOf(ver string) string { + for _, t := range []string{"v" + ver, ver} { + if r, _ := w.e.GH.Release(Repo, t); r != nil { + return t + } + } + return "v" + ver +} + +func (w *worker) backup() { + w.phase("Backing up configuration") + w.e.Run("/usr/bin/dawnline backup --reason pre-update >/dev/null 2>&1") +} + +// setLang adds the translation `lang` of the installed version from its release, or (lang "") removes the +// installed ones. LuCI reads its catalogs once per web server process: it restarts after the job. +func (w *worker) setLang(lang string) map[string]any { + v := w.e.Version + if lang == "" { + var have []string + for _, l := range w.langs() { + have = append(have, "luci-i18n-dawnline-"+l) + } + if len(have) > 0 { + w.phase("Removing the translation") + if !w.e.Pkg.Remove(have, w.log) { + w.die("The translation could not be removed") + } + } + } else { + tag := w.tagOf(v) + f := w.fetchFile(tag, "luci-i18n-dawnline-"+lang+"-"+v+"."+w.e.Pkg.Ext(), w.work, true) + if f == "" { + w.die("Release %s has no translation into %s: install a release that has one", tag, lang) + } + w.phase("Installing the translation") + ok, err := w.e.Pkg.InstallFiles([]string{f}, false, w.log) + w.must(ok, err, "Installation failed") + } + w.after["luci"] = true + return map[string]any{"from": v, "to": v, "lang": orNil(lang)} +} + +// installApp: arg "" (latest) | @ | reinstall | rollback | lang: | nolang +func (w *worker) installApp(arg string) map[string]any { + v := w.e.Version + if arg == "nolang" { + return w.setLang("") + } + if l, is := strings.CutPrefix(arg, "lang:"); is { + return w.setLang(l) + } + out := map[string]any{"from": v, "to": nil} + if arg == "rollback" { + k := kept(w.e.DataDir, "app") + if k == nil { + w.die("No previous Dawnline version is kept on the router") + } + out["to"] = k.Version + w.versions(v, k.Version) + w.backup() + w.phase("Rolling back to %s", k.Version) + ok, err := w.e.Pkg.InstallFiles(k.Files, true, w.log) + w.must(ok, err, "Installation failed") + forget(w.e.DataDir, "app") + w.after["app"] = true + return out + } + tag, force := "", false + switch { + case arg == "reinstall": + tag, force = w.tagOf(v), true + case strings.HasPrefix(arg, "@"): + tag = arg[1:] + force = VersionCmp(strings.TrimPrefix(tag, "v"), v) <= 0 + default: + c := w.checkApp() + if c["latest"] == nil { + panic(failure{str(c["note"])}) + } + if c["update"] != true { + out["to"] = v + return out + } + tag = str(c["tag"]) + } + to := strings.TrimPrefix(tag, "v") + out["to"] = to + w.versions(v, to) + paths := w.fetchRelease(tag, w.work) + // The version being replaced, for Roll back (downloaded again: the package manager keeps no package + // files). Always for an automatic run: nobody is there to recover a router whose new version does not + // come up (postupdate rolls back to it on its own). + if k := kept(w.e.DataDir, "app"); (w.e.Policy.Keep || w.job.Auto) && to != v && (k == nil || k.Version != v) { + w.phase("Keeping Dawnline %s for rollback", v) + func() { + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprint(r) + if f, is := r.(failure); is { + msg = f.msg + } + w.logf("Warning: could not keep %s: %s", v, msg) + } + }() + os.MkdirAll(w.work+"/keep", 0o700) + keep(w.e.DataDir, "app", v, w.fetchRelease(w.tagOf(v), w.work+"/keep"), nil, nil) + }() + } + w.backup() + w.phase("Installing package") + ok, err := w.e.Pkg.InstallFiles(paths, force, w.log) + w.must(ok, err, "Installation failed") + w.after["app"] = true + return out +} + +/* ---------- system packages ---------- */ + +// PkgNames is what Dawnline itself adds to OpenWrt (the rest of LuCI, rpcd and uhttpd is the stock system). +var PkgNames = []string{"ip-full", "kmod-veth", "libustream-openssl", "openssl-util", "acme", "acme-acmesh-dnsapi", "luci-app-acme"} + +// Packages released together with each of the above, updated as a set so OpenSSL never ends up half old +// and half new. +var families = [][2]*regexp.Regexp{ + {regexp.MustCompile(`^ip-full$`), regexp.MustCompile(`^ip-`)}, + {regexp.MustCompile(`^(libustream-openssl|openssl-util)$`), regexp.MustCompile(`^(libustream-openssl|libopenssl|openssl-util$)`)}, + {regexp.MustCompile(`^(acme|luci-app-acme$)`), regexp.MustCompile(`^acme`)}, +} + +// WithFamily is the packages to update for these names: each one plus its upgradable family. Pure. +func WithFamily(names []string, up map[string]string) []string { + set := map[string]bool{} + for _, n := range names { + if _, has := up[n]; has { + set[n] = true + } + for _, f := range families { + if f[0].MatchString(n) { + for u := range up { + if f[1].MatchString(u) { + set[u] = true + } + } + break + } + } + } + out := make([]string, 0, len(set)) + for k := range set { + out = append(out, k) + } + sort.Strings(out) + return out +} + +// checkPkgs; refresh: update the package lists first (a check by hand or on schedule). +func (w *worker) checkPkgs(refresh bool) map[string]any { + if refresh { + w.phase("Refreshing package lists") + w.e.Pkg.Refresh(nil) + } + up := w.e.Pkg.Upgradable() + res := map[string]any{} + all := map[string]bool{} + for _, p := range PkgNames { + v := w.e.Pkg.Version(p) + set := []string{} + if v != "" { + set = WithFamily([]string{p}, up) + } + with := []string{} + for _, x := range set { + all[x] = true + if x != p { + with = append(with, x) + } + } + var latest any + if l, has := up[p]; has && v != "" { + latest = l + } + res[p] = map[string]any{"installed": orNil(v), "latest": latest, "with": with} + } + names := make([]string, 0, len(all)) + for k := range all { + names = append(names, k) + } + sort.Strings(names) + n := len(names) + status := "latest" + if n > 0 { + status = "outdated" + w.log(fmt.Sprintf(w.e.T.N(int64(n), "%d package update in the feeds: %s", "%d package updates in the feeds: %s"), n, strings.Join(names, ", "))) + } else { + w.logf("System packages are up to date") + } + return map[string]any{"pkgs": res, "updates": n, "status": status} +} + +var ( + needsApply = regexp.MustCompile(`^(openssl-util|libustream|ip-full|kmod-veth)`) + needsUhttpd = regexp.MustCompile(`^(libustream|libopenssl)`) +) + +// installPkgs: arg name,name,… (only names Dawnline manages): missing ones are installed, present ones +// updated with their family. +func (w *worker) installPkgs(arg string) map[string]any { + var names []string + for _, n := range strings.Split(arg, ",") { + if n != "" { + names = append(names, n) + } + } + for _, n := range names { + if !has(PkgNames, n) { + w.die("%s is not a package Dawnline manages", n) + } + } + if len(names) == 0 { + w.die("Nothing to install") + } + w.phase("Refreshing package lists") + w.e.Pkg.Refresh(w.log) + var missing, present []string + for _, n := range names { + if w.e.Pkg.Version(n) == "" { + missing = append(missing, n) + } else { + present = append(present, n) + } + } + have := WithFamily(present, w.e.Pkg.Upgradable()) + if len(have) > 0 { + w.phase("Updating %s", strings.Join(have, ", ")) + ok, err := w.e.Pkg.Upgrade(have, w.log) + w.must(ok, err, "Update failed") + } + if len(missing) > 0 { + w.phase("Installing %s", strings.Join(missing, ", ")) + ok, err := w.e.Pkg.Add(missing, w.log) + w.must(ok, err, "Installation failed") + } + // the portal's HTTPS and the home-like link: a piece that just arrived lets them start + arrived, touched := false, false + for _, n := range missing { + arrived = arrived || needsApply.MatchString(n) + } + for _, n := range append(append([]string{}, missing...), have...) { + touched = touched || needsUhttpd.MatchString(n) + } + if arrived { + w.after["apply"], w.after["uhttpd"] = true, true + } else if touched { + w.after["uhttpd"] = true + } + if have == nil { + have = []string{} + } + if missing == nil { + missing = []string{} + } + return map[string]any{"updated": have, "installed": missing, "check": w.checkPkgs(false)} +} + +/* ---------- AmneziaWG ---------- */ + +func (w *worker) firmware() (Firmware, bool) { + version, target, arch := "", "", "" + if w.e.Board != nil { + version, target, arch = w.e.Board() + } + release, _ := os.ReadFile("/etc/openwrt_release") + return FirmwareOf(version, target, arch, string(release), w.e.Pkg.Ext()) +} + +func (w *worker) awgInstalled() map[string]any { + out := map[string]any{} + for _, p := range AwgPackages { + out[p] = orNil(w.e.Pkg.Version(p)) + } + return out +} + +// fetchBuild downloads one package of a build to dir, verified when GitHub publishes its sha256 (then +// mirrors may serve it); without a sha256 only github.com itself. The path, or "". +func (w *worker) fetchBuild(fw Firmware, name, src, dir string) string { + file := fw.Asset(name) + dest := dir + "/" + src + "_" + file + repo := Sources[src].Repo + if w.download("https://github.com/"+repo+"/releases/download/"+fw.Tag+"/"+file, dest, w.e.GH.AssetSHA256(repo, fw.Tag, file)) { + return dest + } + return "" +} + +var series = regexp.MustCompile(`^v([0-9]+\.[0-9]+)\.`) + +// newerSeriesTag is the newest tag of the same OpenWrt series (24.10.x) in a repository, if newer than ours. +func (w *worker) newerSeriesTag(repo, tag string) string { + m := series.FindStringSubmatch(tag) + if m == nil { + return "" + } + best := "" + list, _ := w.e.GH.Releases(repo, 1) + for _, x := range list { + r, _ := x.(map[string]any) + t := str(r["tag"]) + if !strings.HasPrefix(t, "v"+m[1]+".") { + continue + } + if c, ok := w.e.Pkg.Cmp(t[1:], tag[1:]); !ok || c <= 0 { + continue + } + if best != "" { + if c, ok := w.e.Pkg.Cmp(t[1:], best[1:]); !ok || c <= 0 { + continue + } + } + best = t + } + return best +} + +func (w *worker) checkAwg() map[string]any { + installed := w.awgInstalled() + ru := w.e.Pkg.Version(AwgRU) != "" + cur := str(installed["amneziawg-tools"]) + base := func(note string) map[string]any { + return map[string]any{"installed": orNil(cur), "gen": orNil(Gen(cur)), "packages": installed, "current": nil, "ru": ru, "sources": map[string]any{}, + "update": false, "status": "", "note": w.t(note)} + } + fw, ok := w.firmware() + if !ok { + return base("Cannot detect the firmware target") + } + if fw.Snapshot { + return base("This is a SNAPSHOT firmware: the AmneziaWG projects publish builds for releases only") + } + dir := w.work + "/check" + os.MkdirAll(dir, 0o700) + sources := map[string]any{} + versions := map[string]string{} + found := false + for _, id := range Order { + src := Sources[id] + w.logf("Looking for the %s build for OpenWrt %s", src.Label, fw.Tag[1:]) + v := "" + var date any + if f := w.fetchBuild(fw, "amneziawg-tools", id, dir); f != "" { + v = w.e.Pkg.FileVersion(f) + if r, _ := w.e.GH.Release(src.Repo, fw.Tag); r != nil { + date = r["published"] + } + } + s := map[string]any{"label": src.Label, "repo": src.Repo, "tag": fw.Tag, "version": orNil(v), "gen": orNil(Gen(v)), "date": date} + // a newer firmware may already get 3.1 from this source + if Gen(v) != "3.1" { + if nt := w.newerSeriesTag(src.Repo, fw.Tag); nt != "" { + if nf := w.fetchBuild(fw.ForTag(nt), "amneziawg-tools", id, dir); nf != "" && Gen(w.e.Pkg.FileVersion(nf)) == "3.1" { + s["newer"] = map[string]any{"tag": nt, "gen": "3.1"} + } + } + } + sources[id], versions[id] = s, v + found = found || v != "" + } + // The installed build: the source whose package matches. Unknown stays unknown (an automatic update + // never switches a build it could not identify). + current := "" + for _, id := range Order { + if current == "" && cur != "" && versions[id] == cur { + current = id + } + } + mine := versions[current] + st := "" + if cur != "" && mine != "" { + if c, known := w.e.Pkg.Cmp(cur, mine); known { + st = map[int]string{-1: "outdated", 0: "latest", 1: "dev"}[c] + } + } + // an update that waits for a reboot: Components says so after a check + pending := Pending(record(w.e.DataDir), bootID(), moduleCore()) + switch { + case cur == "": + w.logf("AmneziaWG is not installed") + case current == "": + w.logf("AmneziaWG %s: no source publishes this build for this firmware any more", cur) + case st == "outdated": + w.logf("AmneziaWG update is available: %s → %s", cur, mine) + default: + w.logf("AmneziaWG is up to date (%s)", cur) + } + var note any + switch { + case !found: + note = fmt.Sprintf(w.t("No AmneziaWG build for OpenWrt %s yet"), fw.Tag[1:]) + case pending: + note = w.t("The AmneziaWG update is installed and starts after a reboot.") + } + return map[string]any{"installed": orNil(cur), "gen": orNil(Gen(cur)), "packages": installed, "current": orNil(current), "ru": ru, "release": fw.Tag, + "sources": sources, "latest": orNil(mine), "status": st, "update": cur == "" || st == "outdated", + // an update that changes the generation (2.0 → 3.1) breaks older apps: never automatic + "gen_change": cur != "" && mine != "" && Gen(cur) != Gen(mine), "pending": pending, "note": note} +} + +func exists(path string) bool { _, err := os.Stat(path); return err == nil } + +// reloadModule: every AmneziaWG interface is brought down, the module swapped and the interfaces brought +// up again. False when the old module stays loaded: the tunnels come back on it and the installed one +// starts with the next boot. +func (w *worker) reloadModule() bool { + var ifaces []string + names := map[string]string{} + if raw, err := os.ReadFile("/etc/config/network"); err == nil { + if c, err := uci.Parse(string(raw)); err == nil { + for _, s := range c.OfType("interface") { + proto, _ := s.Get("proto") + if off, _ := s.Get("disabled"); proto == "amneziawg" && off != "1" && s.Name != "" { + ifaces = append(ifaces, s.Name) + names[s.Name], _ = s.Get("_dawnline_name") + } + } + } + } + n := len(ifaces) + w.job.Phase = fmt.Sprintf(w.e.T.N(int64(n), "Reloading the kernel module (%d tunnel restarts)", "Reloading the kernel module (%d tunnels restart)"), n) + w.log(w.job.Phase) + // why each goes down, so the log does not call it unexpected + path := w.e.RunDir + "/iface-intent.json" + all := map[string]map[string]any{} + files.ReadJSON(path, &all) + for _, i := range ifaces { + name := names[i] + if name == "" { + name = i + } + all[i] = map[string]any{"reason": "update", "name": name, "ts": w.now()} + } + files.WriteJSON(path, all, 0o600) + for _, i := range ifaces { + w.e.Run("ifdown '" + i + "' >/dev/null 2>&1") + } + if exists("/sys/module/amneziawg") { + w.run("rmmod amneziawg") + } + swapped := !exists("/sys/module/amneziawg") + if swapped { + w.run("modprobe amneziawg") + if !exists("/sys/module/amneziawg") { + w.die("The new AmneziaWG kernel module doesn't load on this firmware: the tunnels stay down until it does (see the log above)") + } + } + for _, i := range ifaces { + w.e.Run("ifup '" + i + "' >/dev/null 2>&1") + } + return swapped +} + +// settle, after packages changed: the module loaded, netifd knowing the protocol, Dawnline set up again. +// It returns whether the module that runs is the installed one. +func (w *worker) settle(before, after map[string]any, was Module) bool { + b, a := str(before["kmod-amneziawg"]), str(after["kmod-amneziawg"]) + fresh := true + switch { + // a new module package, one over a module loaded by hand, or an earlier update that still waits for a boot + case a != "" && (a != b || was.Pending) && (b != "" || was.Core != 0): + fresh = w.reloadModule() + case a != "" && b == "": + w.phase("Loading the kernel module") + if _, code := w.run("modprobe amneziawg"); code != 0 && !exists("/sys/module/amneziawg") { + w.die("AmneziaWG is installed, but its kernel module doesn't load on this firmware") + } + } + // netifd reads its protocol handlers when it starts + if out, _ := w.run("ubus call network get_proto_handlers"); !strings.Contains(out, `"amneziawg"`) { + w.phase("Restarting the network so it knows AmneziaWG (connections drop for a few seconds)") + w.run("/etc/init.d/network restart") + } + w.after["apply"] = true + return fresh +} + +func (w *worker) finishAwg(out map[string]any, source, tag any, was Module) map[string]any { + after := w.awgInstalled() + out["after"] = after + reloaded := w.settle(out["before"].(map[string]any), after, was) + out["reloaded"] = reloaded + writeRecord(w.e.DataDir, source, tag, after, was, reloaded) + if !reloaded { + w.logf("The old kernel module stays loaded (another AmneziaWG interface may use it): the AmneziaWG update is installed and starts after a reboot.") + } + return out +} + +// pick is the first source that publishes every package for this firmware. +func (w *worker) pick(fw Firmware) string { + for _, id := range Order { + assets := w.e.GH.Assets(Sources[id].Repo, fw.Tag) + all := assets != nil + for _, p := range AwgPackages { + all = all && has(assets, fw.Asset(p)) + } + if all { + return id + } + } + return "" +} + +// installAwg: arg [auto|slava|grey][:ru] | rollback +func (w *worker) installAwg(arg string) map[string]any { + before := w.awgInstalled() + was := moduleNow(w.e.DataDir, str(before["kmod-amneziawg"])) + from := str(before["amneziawg-tools"]) + out := map[string]any{"from": orNil(from), "to": nil, "before": before} + fw, ok := w.firmware() + if !ok { + w.die("Cannot detect the firmware target") + } + if arg == "rollback" { + k := kept(w.e.DataDir, "amneziawg") + if k == nil { + w.die("No previous AmneziaWG build is kept on the router") + } + if f := str(k.Firmware); f != "" && f != fw.Postfix { + w.die("The kept AmneziaWG build was made for another firmware: it would not load on this one") + } + out["to"], out["build"] = k.Version, k.Build + w.versions(from, k.Version) + w.phase("Rolling back to %s", k.Version) + ok, err := w.e.Pkg.InstallFiles(k.Files, true, w.log) + w.must(ok, err, "Package installation failed") + forget(w.e.DataDir, "amneziawg") + return w.finishAwg(out, k.Build, fw.Tag, was) + } + parts := strings.Split(arg, ":") + id := parts[0] + if id == "" { + id = "auto" + } + wantRU := len(parts) > 1 && parts[1] == "ru" + if id == "auto" { + if id = w.pick(fw); id == "" { + w.die("No AmneziaWG build for OpenWrt %s (%s) yet", fw.Tag[1:], fw.Postfix) + } + } + src, known := Sources[id] + if !known { + w.die("Unknown AmneziaWG build %s", id) + } + out["build"] = id + names := append([]string{}, AwgPackages...) + if wantRU { + names = append(names, AwgRU) + } + var paths []string + for _, p := range names { + w.phase("Downloading %s from %s", p, src.Repo) + f := w.fetchBuild(fw, p, id, w.work) + if f == "" { + w.die("No %s build for OpenWrt %s in %s, or it could not be verified", p, fw.Tag[1:], src.Repo) + } + paths = append(paths, f) + } + to := w.e.Pkg.FileVersion(paths[1]) + out["to"] = orNil(to) + w.versions(from, to) + // the build being replaced, for Roll back: from another source that still publishes it + if w.e.Policy.Keep && from != "" && to != from { + dir := w.work + "/keep" + os.MkdirAll(dir, 0o700) + other := "" + for _, sid := range Order { + if sid == id || other != "" { + continue + } + if f := w.fetchBuild(fw, "amneziawg-tools", sid, dir); f != "" && w.e.Pkg.FileVersion(f) == from { + other = sid + } + } + if other != "" { + w.phase("Keeping AmneziaWG %s for rollback", from) + var keepf []string + for _, p := range AwgPackages { + if f := w.fetchBuild(fw, p, other, dir); f != "" { + keepf = append(keepf, f) + } + } + if len(keepf) == len(AwgPackages) { + keep(w.e.DataDir, "amneziawg", from, keepf, other, fw.Postfix) + } + } else { + w.logf("Warning: the installed build is no longer published, nothing to keep for rollback") + } + } + w.phase("Refreshing package lists") + w.e.Pkg.Refresh(w.log) + w.phase("Installing the %s build", src.Label) + ok2, err := w.e.Pkg.InstallFiles(paths, true, w.log) + w.must(ok2, err, "Package installation failed") + if !wantRU && w.e.Pkg.Version(AwgRU) != "" { + w.e.Pkg.Remove([]string{AwgRU}, w.log) + } + return w.finishAwg(out, id, fw.Tag, was) +} diff --git a/backend/updater/shared.go b/backend/updater/shared.go new file mode 100644 index 0000000..1b19404 --- /dev/null +++ b/backend/updater/shared.go @@ -0,0 +1,171 @@ +// Package updater is Dawnline's background update worker (usr/libexec/dawnline/updater and the modules it +// ran: dawnline.updates, upd_app, upd_awg, upd_pkgs, awg_builds), started detached by the backend and by +// the minute's chores: +// +// updater check [app|amneziawg|packages] +// updater install app | app@ | app:reinstall | app:rollback +// updater install amneziawg[:auto|slava|grey[:ru]] | amneziawg:rollback +// updater install pkgs: +// updater auto (Settings → Updates: check, then install) +// +// One job at a time: the job holds the update lock until it exits. Progress: update-job.json; check +// results: update-check.json. The Components tab reads both. +package updater + +import ( + "os" + "regexp" + "strconv" + "strings" + "syscall" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" +) + +// Repo is where Dawnline's own releases are. +const Repo = "tickcount/luci-app-dawnline" + +// Targets is what a check looks at. +var Targets = []string{"app", "amneziawg", "packages"} + +// lock takes the update lock without waiting: the open file (kept for the whole job; the kernel releases +// it when the process ends), or nil when another job holds it. +func lock(run string) *os.File { + os.MkdirAll(run, 0o755) + f, err := os.OpenFile(run+"/update.lock", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o644) + if err != nil { + return nil + } + if syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB) != nil { + f.Close() + return nil + } + return f +} + +// historyAdd puts an entry at the head of the history (Components → Activity): newest first, the last 30 +// kept on flash. +func historyAdd(data string, now int64, e map[string]any) { + var h []map[string]any + files.ReadJSON(data+"/update-history.json", &h) + e["ts"] = now + h = append([]map[string]any{e}, h...) + if len(h) > 30 { + h = h[:30] + } + os.MkdirAll(data, 0o700) + files.WriteJSON(data+"/update-history.json", h, 0o600) +} + +var ( + versionShape = regexp.MustCompile(`^([0-9.]+)([-~]([0-9A-Za-z.]+))?`) + preShape = regexp.MustCompile(`^([^0-9]*)([0-9]*)`) +) + +// VersionCmp compares Dawnline release versions (0.3.2, v0.4.0-rc1): -1, 0 or 1. Numbers compare as +// numbers; a pre-release (-rc1, -beta) comes before its release. +func VersionCmp(a, b string) int { + type parsed struct { + nums []int + pre string + hasPre bool + } + parse := func(v string) parsed { + m := versionShape.FindStringSubmatch(strings.TrimPrefix(v, "v")) + if m == nil { + return parsed{[]int{0}, v, true} + } + var nums []int + for _, x := range strings.Split(m[1], ".") { + n, _ := strconv.Atoi(x) + nums = append(nums, n) + } + return parsed{nums, m[3], m[2] != ""} + } + x, y := parse(a), parse(b) + for i := 0; i < len(x.nums) || i < len(y.nums); i++ { + p, r := 0, 0 + if i < len(x.nums) { + p = x.nums[i] + } + if i < len(y.nums) { + r = y.nums[i] + } + if p != r { + if p < r { + return -1 + } + return 1 + } + } + switch { + case x.hasPre == y.hasPre && x.pre == y.pre: + return 0 + case !x.hasPre: + return 1 + case !y.hasPre: + return -1 + } + // rc1 < rc2 < rc10: the number runs compare as numbers + px, py := preShape.FindStringSubmatch(x.pre), preShape.FindStringSubmatch(y.pre) + if px[1] != py[1] { + if px[1] < py[1] { + return -1 + } + return 1 + } + nx, _ := strconv.Atoi(px[2]) + ny, _ := strconv.Atoi(py[2]) + switch { + case nx < ny: + return -1 + case nx > ny: + return 1 + } + return 0 +} + +// Kept is the version a component had before its last update (Keep the previous version). +type Kept struct { + Version string `json:"version"` + Build any `json:"build"` + Firmware any `json:"firmware"` + Files []string `json:"files"` + Saved int64 `json:"saved"` +} + +// kept is the kept version of a component, or nil (none, or its files are gone). +func kept(data, component string) *Kept { + var k Kept + if !files.ReadJSON(data+"/keep/"+component+"/meta.json", &k) || k.Version == "" || len(k.Files) == 0 { + return nil + } + for _, f := range k.Files { + if _, err := os.Stat(f); err != nil { + return nil + } + } + return &k +} + +// keep replaces the kept version of a component with these files (copied in); all of them, or nothing. +func keep(data, component, version string, paths []string, build, firmware any) { + dir := data + "/keep/" + component + os.RemoveAll(dir) + os.MkdirAll(dir, 0o700) + os.Chmod(data+"/keep", 0o700) + var saved []string + for _, f := range paths { + raw, err := os.ReadFile(f) + to := dir + "/" + f[strings.LastIndex(f, "/")+1:] + if err != nil || os.WriteFile(to, raw, 0o600) != nil { + os.RemoveAll(dir) + return + } + saved = append(saved, to) + } + files.WriteJSON(dir+"/meta.json", Kept{Version: version, Build: build, Firmware: firmware, Files: saved, Saved: time.Now().Unix()}, 0o600) +} + +func forget(data, component string) { os.RemoveAll(data + "/keep/" + component) } diff --git a/backend/updater/updater.go b/backend/updater/updater.go new file mode 100644 index 0000000..bc7d5ee --- /dev/null +++ b/backend/updater/updater.go @@ -0,0 +1,673 @@ +package updater + +import ( + "fmt" + "os" + "regexp" + "sort" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/i18n" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/pkgmgr" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +const usage = `Usage: + updater check [app|amneziawg|packages] + updater install app | app@ | app:reinstall | app:rollback + updater install amneziawg[:auto|slava|grey[:ru]] | amneziawg:rollback + updater install pkgs: + updater auto +` + +// Env is where a job works. +type Env struct { + RunDir, DataDir string + // Version is the installed Dawnline; Policy the settings' (Settings → Updates). + Version string + Policy model.Updates + Pkg *pkgmgr.Manager + GH *github.Client + Fetch github.Fetch + // T is the job's language (the phases and errors of a job the admin started; nil: English). + T *i18n.Catalog + // Run runs a shell command: what it said (both streams) and its exit code. + Run func(cmd string) (string, int) + // Board is the firmware as `ubus call system board` tells it (release version, target, arch). + Board func() (version, target, arch string) + // Langs is the languages of the translations installed here. + Langs func() []string + Log *servicelog.Log + Now func() time.Time + Pid int + // Sleep waits (a test does not). + Sleep func(time.Duration) +} + +type failure struct{ msg string } + +// Job is update-job.json. +type Job struct { + ID string `json:"id"` + Action string `json:"action"` + Component any `json:"component"` + State string `json:"state"` + Started int64 `json:"started"` + Finished any `json:"finished"` + Pid int `json:"pid"` + Auto bool `json:"auto"` + Phase string `json:"phase"` + From any `json:"from"` + To any `json:"to"` + Log []string `json:"log"` + Error any `json:"error"` + Result map[string]any `json:"result"` + Current string `json:"current,omitempty"` +} + +type worker struct { + e *Env + // quiet: an automatic run only shows up as a job once it installs something + quiet bool + job Job + // what to restart once the job is over (never in the middle of it) + after map[string]bool + work string +} + +func (w *worker) now() int64 { return w.e.Now().Unix() } + +func (w *worker) t(msg string) string { return w.e.T.T(msg) } + +func (w *worker) die(format string, args ...any) { + panic(failure{fmt.Sprintf(w.t(format), args...)}) +} + +func (w *worker) save() { + if !w.quiet { + files.WriteJSON(w.e.RunDir+"/update-job.json", w.job, 0o644) + } +} + +func (w *worker) log(msg string) { + t := w.e.Now().In(zone.Local()) + w.job.Log = append(w.job.Log, fmt.Sprintf("%02d:%02d:%02d %s", t.Hour(), t.Minute(), t.Second(), msg)) + if n := len(w.job.Log); n > 400 { + w.job.Log = w.job.Log[n-400:] + } + w.save() +} + +func (w *worker) logf(format string, args ...any) { w.log(fmt.Sprintf(w.t(format), args...)) } + +func (w *worker) phase(format string, args ...any) { + w.job.Phase = fmt.Sprintf(w.t(format), args...) + w.log(w.job.Phase) +} + +// run is a command with what it said in the log. +func (w *worker) run(cmd string) (string, int) { + out, code := w.e.Run(cmd) + for _, line := range strings.Split(strings.Trim(out, " \t\r\n\v\f"), "\n") { + if strings.Trim(line, " \t\r\n\v\f") != "" { + w.log(" " + line) + } + } + return out, code +} + +func (w *worker) versions(from, to string) { + w.job.From, w.job.To = orNil(from), orNil(to) + w.save() +} + +func orNil(s string) any { + if s == "" { + return nil + } + return s +} + +func (w *worker) slog(src, level, msg, detail, who string) { + if w.e.Log != nil { + w.e.Log.Write(src, level, msg, detail, who, servicelog.Extra{}) + } +} + +func (w *worker) history(e map[string]any) { historyAdd(w.e.DataDir, w.now(), e) } + +/* ---------- check results ---------- */ + +type checkFile struct { + Components map[string]map[string]any `json:"components"` + Time int64 `json:"time"` +} + +func (w *worker) checks() map[string]map[string]any { + var c checkFile + files.ReadJSON(w.e.RunDir+"/update-check.json", &c) + if c.Components == nil { + c.Components = map[string]map[string]any{} + } + return c.Components +} + +// saveCheck puts components' results into the check file (the others stay as they were). +func (w *worker) saveCheck(res map[string]map[string]any) { + c := checkFile{Components: w.checks()} + for k, v := range res { + v["time"] = w.now() + c.Components[k] = v + } + c.Time = w.now() + files.WriteJSON(w.e.RunDir+"/update-check.json", c, 0o644) +} + +func str(v any) string { s, _ := v.(string); return s } + +func num(v any) int { + switch x := v.(type) { + case int: + return x + case int64: + return int(x) + case float64: + return int(x) + } + return 0 +} + +// foundIn is what a check found, as short names ("Dawnline 0.3.3", "2 system packages"): kept in the +// history and shown later, so English whatever the job's language. +func foundIn(res map[string]map[string]any) []string { + var found []string + if a := res["app"]; a != nil && a["update"] == true { + found = append(found, "Dawnline "+str(a["latest"])) + } + if a := res["amneziawg"]; a != nil && a["update"] == true && a["installed"] != nil { + found = append(found, "AmneziaWG "+str(a["latest"])) + } + if p := res["packages"]; p != nil && num(p["updates"]) > 0 { + if n := num(p["updates"]); n == 1 { + found = append(found, "1 system package") + } else { + found = append(found, fmt.Sprintf("%d system packages", n)) + } + } + return found +} + +func (w *worker) checking(name string) string { + switch name { + case "app": + return "Checking Dawnline" + case "amneziawg": + return "Checking AmneziaWG" + } + return "Checking system packages" +} + +func (w *worker) updating(name string) string { + switch name { + case "app": + return "Updating Dawnline" + case "amneziawg": + return "Updating AmneziaWG" + } + return "Updating system packages" +} + +func (w *worker) check(name string) map[string]any { + switch name { + case "app": + return w.checkApp() + case "amneziawg": + return w.checkAwg() + } + return w.checkPkgs(true) +} + +func (w *worker) runChecks(which []string) map[string]map[string]any { + res := map[string]map[string]any{} + for _, name := range which { + w.phase(w.checking(name)) + func() { + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprint(r) + if f, is := r.(failure); is { + msg = f.msg + } + w.logf("Error: %s", msg) + res[name] = map[string]any{"error": msg, "status": ""} + } + }() + res[name] = w.check(name) + }() + } + w.saveCheck(res) + return res +} + +type autoState struct { + InstallDay string `json:"install_day,omitempty"` + Check int64 `json:"check,omitempty"` + Announced string `json:"announced"` +} + +func (w *worker) autoState() autoState { + var st autoState + files.ReadJSON(w.e.DataDir+"/update-auto.json", &st) + return st +} + +func (w *worker) autoSave(st autoState) { + os.MkdirAll(w.e.DataDir, 0o700) + files.WriteJSON(w.e.DataDir+"/update-auto.json", st, 0o600) +} + +// noteFound: one line in Activity a new finding (the same finding is not repeated). +func (w *worker) noteFound(res map[string]map[string]any, st *autoState, auto bool) { + found := foundIn(res) + sig := strings.Join(found, ", ") + if len(found) > 0 && sig != st.Announced { + if auto { + w.slog("dawnline", "info", "updates available · "+sig, "", "Components") + } + w.history(map[string]any{"kind": "found", "items": found, "auto": auto}) + } + st.Announced = sig +} + +/* ---------- installs ---------- */ + +// splitTarget: "app@v1" → app, "@v1"; "amneziawg:slava:ru" → amneziawg, "slava:ru"; "app" → app, "". +func splitTarget(s string) (name, arg string) { + i, at := strings.Index(s, ":"), strings.Index(s, "@") + cut := i + if i < 0 || (at >= 0 && at < i) { + cut = at + } + if cut < 0 { + return s, "" + } + if s[cut] == ':' { + return s[:cut], s[cut+1:] + } + return s[:cut], s[cut:] +} + +func appStatus(installed, latest string) string { + if latest == "" { + return "latest" + } + switch c := VersionCmp(installed, latest); { + case c < 0: + return "outdated" + case c > 0: + return "dev" + } + return "latest" +} + +// logUpdate is a line in the service log for each finished update (Dawnline's own is told when it starts again). +func (w *worker) logUpdate(name string, r map[string]any) { + switch name { + case "amneziawg": + before, _ := r["before"].(map[string]any) + after, _ := r["after"].(map[string]any) + b, a := str(before["kmod-amneziawg"]), str(after["kmod-amneziawg"]) + msg := fmt.Sprintf("installed the %s build", str(r["build"])) + switch { + case b != "" && a != "" && b != a && w.job.Auto: + msg = fmt.Sprintf("updated automatically · %s → %s", b, a) + case b != "" && a != "" && b != a: + msg = fmt.Sprintf("updated · %s → %s", b, a) + case a != "": + msg = fmt.Sprintf("installed the %s build · %s", str(r["build"]), a) + } + w.slog("awg", "up", msg, "", "AmneziaWG") + case "pkgs": + updated, _ := r["updated"].([]string) + installed, _ := r["installed"].([]string) + if all := append(append([]string{}, updated...), installed...); len(all) > 0 { + msg := "updated · " + if w.job.Auto { + msg = "updated automatically · " + } + w.slog("dawnline", "up", msg+strings.Join(all, ", "), "", "System packages") + } + } +} + +func (w *worker) install(what []string) { + if w.job.Result == nil { + w.job.Result = map[string]any{} + } + for _, target := range what { + name, arg := splitTarget(target) + var r map[string]any + w.job.Current = name + switch name { + case "app": + w.phase(w.updating(name)) + r = w.installApp(arg) + case "amneziawg": + w.phase(w.updating(name)) + r = w.installAwg(arg) + case "pkgs": + w.phase(w.updating(name)) + r = w.installPkgs(arg) + default: + w.die("Unknown component %s", name) + } + w.job.Result[name] = r + w.logUpdate(name, r) + // installed components are current now: no stale "Update available" + c := w.checks() + switch { + case name == "pkgs" && r["check"] != nil: + w.saveCheck(map[string]map[string]any{"packages": r["check"].(map[string]any)}) + case name == "app" && str(r["to"]) != "" && c["app"] != nil: + s := appStatus(str(r["to"]), str(c["app"]["latest"])) + a := c["app"] + a["installed"], a["update"], a["status"] = r["to"], s == "outdated", s + w.saveCheck(map[string]map[string]any{"app": a}) + case name == "amneziawg" && r["after"] != nil: + a := c["amneziawg"] + if a == nil { + a = map[string]any{} + } + after := r["after"].(map[string]any) + a["installed"], a["packages"], a["update"], a["status"] = after["amneziawg-tools"], after, false, "latest" + if r["build"] != nil { + a["current"] = r["build"] + } + w.saveCheck(map[string]map[string]any{"amneziawg": a}) + } + w.history(map[string]any{"kind": "install", "component": target, "from": r["from"], "to": r["to"], "state": "done", "auto": w.job.Auto, + "took": w.now() - w.job.Started}) + w.job.Current = "" + } +} + +var clock = regexp.MustCompile(`^([0-9]{1,2}):([0-9]{2})$`) + +var intervals = map[string]int64{"6h": 6 * 3600, "12h": 12 * 3600, "1d": 86400, "7d": 7 * 86400} + +// slot is the scheduled slot now is in (up to an hour after the set time, also across midnight). +func slot(pol model.Updates, now time.Time) (time.Time, bool) { + hm := clock.FindStringSubmatch(pol.Time) + if hm == nil { + return time.Time{}, false + } + var h, mi int + fmt.Sscan(hm[1], &h) + fmt.Sscan(hm[2], &mi) + for _, day := range []time.Time{now, now.Add(-24 * time.Hour)} { + d := day.In(zone.Local()) + at := time.Unix(day.Unix()-int64(d.Hour()*3600+d.Minute()*60+d.Second())+int64(h*3600+mi*60), 0) + if !now.Before(at) && now.Sub(at) < time.Hour { + return at, true + } + } + return time.Time{}, false +} + +func dayOf(t time.Time) string { return t.In(zone.Local()).Format("2006-01-02") } + +// due is what an automatic run should do now: "install" (the scheduled window, once a slot), "check" +// (the interval has passed), or "". +func due(pol model.Updates, st autoState, now time.Time) string { + if pol.Auto && pol.Mode == "scheduled" && len(pol.Targets) > 0 { + if at, in := slot(pol, now); in && st.InstallDay != dayOf(at) { + return "install" + } + } + every := intervals[pol.Interval] + if every == 0 { + every = 86400 + } + if pol.Check && now.Unix()-st.Check >= every { + return "check" + } + return "" +} + +func has(list []string, v string) bool { + for _, x := range list { + if x == v { + return true + } + } + return false +} + +// auto is Settings → Updates: check when due, install what is allowed (scheduled or right away). +func (w *worker) auto() { + pol := w.e.Policy + st := w.autoState() + what := due(pol, st, w.e.Now()) + if what == "" { + return + } + now := w.now() + var res map[string]map[string]any + if what == "check" || now-st.Check >= 3600 { + res = w.runChecks(Targets) + st.Check = now + w.noteFound(res, &st, true) + } else { + res = w.checks() + } + if what == "install" { + at, in := slot(pol, w.e.Now()) + if !in { + at = w.e.Now() + } + st.InstallDay = dayOf(at) + } + w.autoSave(st) + if !pol.Auto || (what != "install" && pol.Mode != "immediate") { + return + } + var todo []string + // packages first, Dawnline last: it restarts the service and itself + if p := res["packages"]; has(pol.Targets, "packages") && p != nil && num(p["updates"]) > 0 { + var names []string + pkgs, _ := p["pkgs"].(map[string]any) + for name, v := range pkgs { + one, _ := v.(map[string]any) + with, _ := one["with"].([]any) + withS, _ := one["with"].([]string) + if one["latest"] != nil || len(with) > 0 || len(withS) > 0 { + names = append(names, name) + } + } + sort.Strings(names) + if len(names) > 0 { + todo = append(todo, "pkgs:"+strings.Join(names, ",")) + } + } + if a := res["amneziawg"]; has(pol.Targets, "amneziawg") && a != nil && a["update"] == true && a["installed"] != nil { + // only the same build, same generation: anything else needs a person to decide + if cur := str(a["current"]); cur != "" && a["gen_change"] != true { + ru := "" + if a["ru"] == true { + ru = ":ru" + } + todo = append(todo, "amneziawg:"+cur+ru) + } else if latest := str(a["latest"]); latest != "" { + w.slog("awg", "info", latest+" needs a manual switch in Components", "", "AmneziaWG") + } else { + w.slog("awg", "info", "a new build needs a manual switch in Components", "", "AmneziaWG") + } + } + if a := res["app"]; has(pol.Targets, "app") && a != nil && a["update"] == true { + todo = append(todo, "app") + } + if len(todo) == 0 { + return + } + w.quiet = false + w.job.Action, w.job.Component, w.job.Auto, w.job.Log = "install", strings.Join(todo, " "), true, nil + w.logf("Automatic update: %s", strings.Join(todo, ", ")) + w.install(todo) +} + +var plainVersion = regexp.MustCompile(`[^A-Za-z0-9.-]`) + +// restarts is what the job asked for, in one go, after its final state is saved. Dawnline's own package is +// restarted by postupdate, a shell that also checks the new version and rolls back to the kept one when +// it does not come up. +func (w *worker) restarts() { + if w.after["app"] { + w.e.Run("/usr/libexec/dawnline/postupdate '" + plainVersion.ReplaceAllString(str(w.job.To), "") + "' /dev/null 2>&1 &") + return + } + var cmds []string + if w.after["apply"] { + cmds = append(cmds, "/usr/bin/dawnline apply") + } + // LuCI's own web server reads a language's catalogs once: a new translation needs a fresh one + if w.after["uhttpd"] || w.after["luci"] { + cmds = append(cmds, "/etc/init.d/uhttpd restart") + } + if w.after["apply"] || w.after["uhttpd"] { + cmds = append(cmds, "/etc/init.d/dawnline restart") + } + if len(cmds) > 0 { + w.e.Run("( sleep 2; " + strings.Join(cmds, "; ") + " ) /dev/null 2>&1 &") + } +} + +var who = map[string]string{"app": "Dawnline", "amneziawg": "AmneziaWG", "pkgs": "System packages", "packages": "System packages"} + +// main is the job the command line asks for, to its final state: done, or failed with the error in the +// log and the history. +func (w *worker) main() { + defer func() { + r := recover() + if r == nil { + return + } + msg := fmt.Sprint(r) + if f, is := r.(failure); is { + msg = f.msg + } else if f, is := r.(pkgmgr.Failure); is { + msg = f.Msg + } + w.quiet = false + w.job.State, w.job.Error = "failed", msg + w.logf("Error: %s", msg) + name := w.job.Current + if name == "" { + name, _ = splitTarget(strings.SplitN(str(w.job.Component), " ", 2)[0]) + } + if w.job.Action != "check" { + src, said, subject := "dawnline", "update failed", who[name] + if name == "amneziawg" { + src = "awg" + } + if w.job.Auto { + said = "automatic update failed" + } + if subject == "" { + subject = "Dawnline" + } + w.slog(src, "error", said, msg, subject) + w.history(map[string]any{"kind": "install", "component": name, "from": w.job.From, "to": w.job.To, "state": "failed", "auto": w.job.Auto, "error": msg, + "took": w.now() - w.job.Started}) + } else { + component := str(w.job.Component) + if component == "" { + component = "all" + } + w.history(map[string]any{"kind": "error", "component": component, "state": "failed", "error": msg}) + } + }() + switch w.job.Action { + case "check": + which := Targets + if c := str(w.job.Component); c != "" { + which = []string{c} + } + for _, x := range which { + if !has(Targets, x) { + w.die("Unknown component %s", x) + } + } + res := w.runChecks(which) + w.job.Result = map[string]any{} + for k, v := range res { + w.job.Result[k] = v + } + st := w.autoState() + w.noteFound(res, &st, false) + if len(which) == len(Targets) { + st.Check = w.now() + } + w.autoSave(st) + case "install": + w.install([]string{str(w.job.Component)}) + case "auto": + w.auto() + } + w.job.State = "done" + w.phase("Finished") +} + +// Main runs the updater's command line and returns its exit code. out and errs take the usage. +func Main(e *Env, args []string, out, errs interface{ Write([]byte) (int, error) }) int { + first := "" + if len(args) > 0 { + first = args[0] + } + // No command, one it does not know, or an install of nothing: the usage and out, before anything is + // read or written. Asked for help: the same, on the other stream. + if first == "-h" || first == "--help" || first == "help" { + out.Write([]byte(usage)) + return 0 + } + if (first != "check" && first != "install" && first != "auto") || (first == "install" && (len(args) < 2 || args[1] == "")) { + errs.Write([]byte(usage)) + return 2 + } + if e.Now == nil { + e.Now = time.Now + } + if e.Sleep == nil { + e.Sleep = time.Sleep + } + w := &worker{e: e, quiet: first == "auto", after: map[string]bool{}, work: fmt.Sprintf("/tmp/dawnline-update.%d", e.Pid)} + now := w.now() + w.job = Job{ID: fmt.Sprintf("%d-%d", now, e.Pid), Action: first, State: "running", Started: now, Pid: e.Pid, Log: []string{}} + if len(args) > 1 { + w.job.Component = args[1] + } + os.MkdirAll(e.RunDir, 0o755) + // one job at a time (the page refuses a second one; an automatic run just skips its turn) + var held *os.File + for i := 0; i < 10 && held == nil; i++ { + if held = lock(e.RunDir); held == nil { + e.Sleep(100 * time.Millisecond) + } + } + if held == nil { + return 0 + } + defer held.Close() + os.MkdirAll(w.work, 0o700) + w.save() + w.main() + os.RemoveAll(w.work) + w.job.Finished, w.job.Current = w.now(), "" + w.save() + w.restarts() + return 0 +} diff --git a/backend/updater/updater_test.go b/backend/updater/updater_test.go new file mode 100644 index 0000000..396a211 --- /dev/null +++ b/backend/updater/updater_test.go @@ -0,0 +1,370 @@ +package updater + +import ( + "bytes" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "os" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/github" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/pkgmgr" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" +) + +// The cases tests/ucode holds the ucode modules to (updates, awg_builds, pkg). +func TestPureParts(t *testing.T) { + for _, c := range []struct { + a, b string + want int + }{{"0.5.1", "0.5.1", 0}, {"v0.5.1", "0.5.1", 0}, {"0.5.1", "0.5.2", -1}, {"0.10.0", "0.9.9", 1}, {"0.6", "0.6.0", 0}, {"0.6.0-rc1", "0.6.0", -1}, + {"0.6.0-rc2", "0.6.0-rc10", -1}, {"0.6.0-beta", "0.6.0-rc1", -1}, {"garbage", "0.1", -1}} { + if got := VersionCmp(c.a, c.b); got != c.want { + t.Errorf("%s against %s: %d, not %d", c.a, c.b, got, c.want) + } + } + for v, want := range map[string]string{"": "", "3.1.20260812-r1": "3.1", "3.1.0-r1": "3.1", "1.0.20250722-r1": "2.0", "1.0.20250901": "2.0", "1.0.20250610-r1": "1.0", + "1.0.20241112-r2": "1.0", "6.12.94.3.1.20260906-r1": "3.1", "6.12.94.3.1.20260906": "3.1", "6.6.73.1.0.20250722-r1": "2.0", "6.6.73.1.0.20250612-r1": "1.0", + "5.15.150.1.0.20240711-r3": "1.0", "3.1.20260812": "3.1"} { + if got := Gen(v); got != want { + t.Errorf("the generation of %q: %q, not %q", v, got, want) + } + } + waiting := func() *Record { return &Record{Reloaded: false, Boot: "boot-1", PrevGen: "2.0", PrevCore: 98304.0} } + swapped, unknown, noBoot := waiting(), waiting(), waiting() + swapped.Reloaded, unknown.Reloaded, noBoot.Boot = true, nil, nil + for _, c := range []struct { + what string + rec *Record + boot string + core int64 + want bool + }{{"the old module still loaded, same boot", waiting(), "boot-1", 98304, true}, {"rebooted", waiting(), "boot-2", 98304, false}, + {"no module loaded", waiting(), "boot-1", 0, false}, {"another module loaded", waiting(), "boot-1", 110592, false}, + {"the install swapped it", swapped, "boot-1", 98304, false}, {"a module Dawnline did not install", unknown, "boot-1", 98304, false}, + {"a record from before boots were kept", &Record{OSRelease: "6.12.94", Source: "slava"}, "boot-1", 98304, false}, + {"the kernel gave no boot id", noBoot, "", 98304, false}, {"no record", nil, "boot-1", 98304, false}} { + if got := Pending(c.rec, c.boot, c.core); got != c.want { + t.Errorf("pending, %s: %v", c.what, got) + } + } + if n, v := pkgmgr.ControlInfo("Package: amneziawg-tools\nVersion: 1.0.20250722-r1\nDepends: libc\n", true); n != "amneziawg-tools" || v != "1.0.20250722-r1" { + t.Errorf("an ipk's control file: %q %q", n, v) + } + dump := "#%SCHEMA: 00504B47\ninfo:\n name: kmod-amneziawg\n version: 6.12.94.3.1.20260906-r1\n depends: # 2 items\n - kernel=6.12.94\npaths: # 2 items\n - name: lib/modules\n" + if n, v := pkgmgr.ControlInfo(dump, false); n != "kmod-amneziawg" || v != "6.12.94.3.1.20260906-r1" { + t.Errorf("an apk's dump: %q %q", n, v) + } + if n, v := pkgmgr.ControlInfo("", false); n != "" || v != "" { + t.Error("something read from nothing") + } + want := []pkgmgr.Wanted{{Name: "a", Version: "2"}, {Name: "b", Version: "1"}} + if len(pkgmgr.Mismatched(want, map[string]string{"a": "2", "b": "1"})) != 0 || len(pkgmgr.Mismatched(want, map[string]string{"a": "1", "b": "1"})) != 1 || + len(pkgmgr.Mismatched([]pkgmgr.Wanted{{File: "x.apk"}}, nil)) != 1 { + t.Error("which packages did not take") + } + up := pkgmgr.ParseUpgradable("libopenssl3-3.5.1-r1 < 3.5.2-r1\nip-full-6.11.0-r1 < 6.12.0-r1\nnoise\n", true) + if up["libopenssl3"] != "3.5.2-r1" || up["ip-full"] != "6.12.0-r1" || len(up) != 2 { + t.Errorf("apk's list: %v", up) + } + if up := pkgmgr.ParseUpgradable("acme - 4.0.0-r1 - 4.0.1-r1\n", false); up["acme"] != "4.0.1-r1" { + t.Errorf("opkg's list: %v", up) + } + fam := WithFamily([]string{"openssl-util", "ip-full", "kmod-veth"}, map[string]string{"libopenssl3": "1", "libustream-openssl20201210": "1", "ip-tiny": "1", "acme": "1"}) + if strings.Join(fam, " ") != "ip-tiny libopenssl3 libustream-openssl20201210" { + t.Errorf("the families: %v", fam) + } + for in, want := range map[string][2]string{"app": {"app", ""}, "app@v1.2": {"app", "@v1.2"}, "app:reinstall": {"app", "reinstall"}, "amneziawg:slava:ru": {"amneziawg", "slava:ru"}, + "pkgs:a,b": {"pkgs", "a,b"}, "app:lang:ru": {"app", "lang:ru"}} { + if n, a := splitTarget(in); n != want[0] || a != want[1] { + t.Errorf("the target %q: %q %q", in, n, a) + } + } + if fw, ok := FirmwareOf("24.10.6", "mediatek/filogic", "aarch64_cortex-a53", "", "ipk"); !ok || fw.Asset("kmod-amneziawg") != "kmod-amneziawg_v24.10.6_aarch64_cortex-a53_mediatek_filogic.ipk" || + fw.ForTag("v24.10.8").Postfix != "_v24.10.8_aarch64_cortex-a53_mediatek_filogic" { + t.Errorf("the firmware: %+v", fw) + } + if fw, ok := FirmwareOf("25.12.3", "x86/64", "", "DISTRIB_ARCH='x86_64'\n", "apk"); !ok || fw.Postfix != "_v25.12.3_x86_64_x86_64" { + t.Errorf("the arch from the release file: %+v", fw) + } + if fw, _ := FirmwareOf("SNAPSHOT", "x86/64", "x86_64", "", "apk"); !fw.Snapshot { + t.Error("a snapshot is not told") + } + for arch, want := range map[string]string{"aarch64_cortex-a53": "arm64", "aarch64_generic": "arm64", "x86_64": "amd64", "mips_24kc": "mips", "mipsel_24kc": "mipsle", + "mipsel_74kc": "mipsle", "arm_cortex-a7_neon-vfpv4": "arm", "arm_cortex-a9": "arm", "arm_arm926ej-s": "", "arm_xscale": "", "i386_pentium4": "", "riscv64_riscv64": "", "": ""} { + if got := GoArch(arch); got != want { + t.Errorf("the binary for %q: %q, not %q", arch, got, want) + } + } + if _, ok := FirmwareOf("", "x86/64", "x86_64", "", "apk"); ok { + t.Error("a firmware made of nothing") + } +} + +// router is a made-up router: a package manager that keeps versions, GitHub with one newer release. +type router struct { + t *testing.T + dir string + installed map[string]string + ran []string + sums map[string]string + releases map[string]map[string]string // tag -> asset -> body + env *Env + said []string +} + +func newRouter(t *testing.T) *router { + r := &router{t: t, dir: t.TempDir(), installed: map[string]string{"luci-app-dawnline": "0.18.0", "ip-full": "6.11.0-r1"}, releases: map[string]map[string]string{}} + r.release("v0.18.0", "0.18.0") + r.release("v0.19.0", "0.19.0") + clock := time.Unix(1_800_000_000, 0) + gh := &github.Client{RunDir: r.dir + "/run", Now: func() time.Time { return clock }, Get: func(url string) (int, []byte) { + rel := func(tag string) map[string]any { + var assets []any + for name, body := range r.releases[tag] { + sum := sha256.Sum256([]byte(body)) + a := map[string]any{"name": name, "id": 1.0} + if !strings.Contains(name, "nosum") { + a["digest"] = "sha256:" + hex.EncodeToString(sum[:]) + } + assets = append(assets, a) + } + return map[string]any{"tag_name": tag, "html_url": "https://github.com/" + Repo + "/releases/tag/" + tag, "published_at": "2026-11-01T00:00:00Z", "assets": assets} + } + var out any + switch { + case strings.HasSuffix(url, "/releases/latest"): + out = rel("v0.19.0") + case strings.Contains(url, "/releases/tags/"): + tag := url[strings.LastIndex(url, "/")+1:] + if r.releases[tag] == nil { + return 404, []byte(`{"message":"Not Found"}`) + } + out = rel(tag) + default: + return 404, []byte(`{"message":"Not Found"}`) + } + raw, _ := json.Marshal(out) + return 200, raw + }} + pkg := &pkgmgr.Manager{Apk: true, Run: func(cmd string) (string, int) { + switch { + case strings.HasPrefix(cmd, "apk list --installed "): + name := strings.Trim(strings.TrimPrefix(cmd, "apk list --installed "), "'") + if v := r.installed[name]; v != "" { + return name + "-" + v + " x86_64 {feed} [installed]\n", 0 + } + return "", 0 + case strings.HasPrefix(cmd, "apk adbdump "): + raw, _ := os.ReadFile(strings.Trim(strings.TrimPrefix(cmd, "apk adbdump "), "'")) + return string(raw), 0 + case strings.HasPrefix(cmd, "df "): + return "Filesystem 1024-blocks Used Available Capacity Mounted on\noverlay 100000 1000 99000 1% /overlay\n", 0 + case strings.HasPrefix(cmd, "apk add --allow-untrusted "): + r.ran = append(r.ran, "apk add files") + for _, f := range strings.Fields(strings.TrimPrefix(cmd, "apk add --allow-untrusted ")) { + raw, _ := os.ReadFile(strings.Trim(f, "'")) + if n, v := pkgmgr.ControlInfo(string(raw), false); n != "" { + r.installed[n] = v + } + } + return "OK: 10 MiB in 100 packages\n", 0 + case cmd == `apk version -l "<"`: + return "ip-full-6.11.0-r1 < 6.12.0-r1\nip-tiny-6.11.0-r1 < 6.12.0-r1\n", 0 + } + r.ran = append(r.ran, cmd) + return "", 0 + }} + r.env = &Env{RunDir: r.dir + "/run", DataDir: r.dir + "/data", Version: "0.18.0", Pkg: pkg, GH: gh, Pid: 4242, Now: func() time.Time { return clock }, Sleep: func(time.Duration) {}, + Policy: model.Updates{Check: true, Interval: "1d", Auto: true, Mode: "immediate", Time: "04:00", Targets: []string{"app", "packages"}, Mirrors: true}, + Fetch: func(url, dest string) bool { + parts := strings.Split(url, "/releases/download/") + if len(parts) != 2 || strings.HasPrefix(url, "https://gh") { + return false + } + ta := strings.SplitN(parts[1], "/", 2) + body, has := r.releases[ta[0]][ta[1]] + if !has { + return false + } + return os.WriteFile(dest, []byte(body), 0o600) == nil + }, + Run: func(cmd string) (string, int) { r.ran = append(r.ran, cmd); return "", 0 }, + Log: &servicelog.Log{RunDir: r.dir + "/run", Level: func() string { return "info" }, Syslog: func(_, line string) { r.said = append(r.said, line) }}} + return r +} + +func (r *router) release(tag, ver string) { + r.releases[tag] = map[string]string{"luci-app-dawnline-" + ver + ".apk": "info:\n name: luci-app-dawnline\n version: " + ver + "\n"} +} + +func (r *router) job() Job { + var j Job + raw, _ := os.ReadFile(r.dir + "/run/update-job.json") + json.Unmarshal(raw, &j) + return j +} + +func (r *router) run(args ...string) int { + var out, errs bytes.Buffer + return Main(r.env, args, &out, &errs) +} + +func TestUsage(t *testing.T) { + r := newRouter(t) + var out, errs bytes.Buffer + if Main(r.env, nil, &out, &errs) != 2 || Main(r.env, []string{"dance"}, &out, &errs) != 2 || Main(r.env, []string{"install"}, &out, &errs) != 2 || !strings.HasPrefix(errs.String(), "Usage:") { + t.Error("a command it does not know") + } + if Main(r.env, []string{"help"}, &out, &errs) != 0 || !strings.HasPrefix(out.String(), "Usage:") { + t.Error("asked for help") + } + if _, err := os.Stat(r.dir + "/run"); err == nil { + t.Error("something was written for no command") + } +} + +func TestCheckAndInstall(t *testing.T) { + r := newRouter(t) + r.run("check", "app") + var c struct { + Components map[string]map[string]any `json:"components"` + } + raw, _ := os.ReadFile(r.dir + "/run/update-check.json") + json.Unmarshal(raw, &c) + if a := c.Components["app"]; a["update"] != true || a["latest"] != "0.19.0" || a["status"] != "outdated" || a["installed"] != "0.18.0" { + t.Fatalf("the check: %s", raw) + } + if j := r.job(); j.State != "done" || j.Phase != "Finished" || j.Finished == nil { + t.Fatalf("the check's job: %+v", j) + } + r.run("check", "packages") + raw, _ = os.ReadFile(r.dir + "/run/update-check.json") + json.Unmarshal(raw, &c) + if p := c.Components["packages"]; p["updates"] != 2.0 || p["status"] != "outdated" || c.Components["app"]["latest"] != "0.19.0" { + t.Fatalf("the packages' check (the app's must stay): %s", raw) + } + // the install: verified, the old version kept, a backup first, the package in, postupdate last + r.env.Policy.Keep = true + r.ran = nil + r.run("install", "app") + j := r.job() + if j.State != "done" || j.From != "0.18.0" || j.To != "0.19.0" || r.installed["luci-app-dawnline"] != "0.19.0" { + t.Fatalf("the install: %+v\n%s", j, strings.Join(j.Log, "\n")) + } + did := strings.Join(r.ran, "; ") + if !strings.Contains(did, "dawnline backup --reason pre-update") || !strings.HasSuffix(did, "postupdate '0.19.0' /dev/null 2>&1 &") || + strings.Index(did, "backup") > strings.Index(did, "apk add files") { + t.Errorf("what ran: %s", did) + } + if k := kept(r.dir+"/data", "app"); k == nil || k.Version != "0.18.0" || len(k.Files) != 1 { + t.Errorf("the version kept for a rollback: %+v", k) + } + if !strings.Contains(strings.Join(j.Log, "\n"), "sha256 matches the release") { + t.Errorf("nothing says the file was verified:\n%s", strings.Join(j.Log, "\n")) + } + raw, _ = os.ReadFile(r.dir + "/data/update-history.json") + if !strings.Contains(string(raw), `"kind":"install"`) || !strings.Contains(string(raw), `"to":"0.19.0"`) { + t.Errorf("the history: %s", raw) + } + raw, _ = os.ReadFile(r.dir + "/run/update-check.json") + json.Unmarshal(raw, &c) + if a := c.Components["app"]; a["update"] != false || a["installed"] != "0.19.0" { + t.Errorf("the check after the install still offers it: %s", raw) + } + if _, err := os.Stat("/tmp/dawnline-update.4242"); err == nil { + t.Error("the work directory stays") + } + // and back + r.env.Version = "0.19.0" + r.ran = nil + r.run("install", "app:rollback") + if j := r.job(); j.State != "done" || r.installed["luci-app-dawnline"] != "0.18.0" || kept(r.dir+"/data", "app") != nil { + t.Errorf("the rollback: %+v", j) + } +} + +func TestInstallRefusals(t *testing.T) { + r := newRouter(t) + // a release that publishes no checksum is not installed + r.releases["v0.20.0"] = map[string]string{"luci-app-dawnline-0.20.0.apk.nosum": "x"} + r.releases["v0.20.0"]["luci-app-dawnline-0.20.0.apk"] = "info:\n name: luci-app-dawnline\n version: 0.20.0\n" + delete(r.releases["v0.20.0"], "luci-app-dawnline-0.20.0.apk.nosum") + r.run("install", "app@v9.9.9") + j := r.job() + if j.State != "failed" || !strings.Contains(j.Error.(string), "publishes no checksum") || r.installed["luci-app-dawnline"] != "0.18.0" { + t.Errorf("a release that is not there: %+v", j) + } + found := false + for _, l := range r.said { + found = found || strings.Contains(l, "Dawnline update failed") + } + raw, _ := os.ReadFile(r.dir + "/data/update-history.json") + if !found || !strings.Contains(string(raw), `"state":"failed"`) { + t.Errorf("a failed update is not told: %v / %s", r.said, raw) + } + r.run("install", "pkgs:busybox") + if j := r.job(); j.State != "failed" || j.Error != "busybox is not a package Dawnline manages" { + t.Errorf("a package that is not ours: %+v", j) + } + r.run("install", "nonsense") + if j := r.job(); j.State != "failed" || j.Error != "Unknown component nonsense" { + t.Errorf("a component there is none of: %+v", j) + } + // one job at a time: a second one leaves without a trace + held := lock(r.dir + "/run") + before, _ := os.ReadFile(r.dir + "/run/update-job.json") + if r.run("check", "app") != 0 { + t.Error("a busy updater is an error") + } + if after, _ := os.ReadFile(r.dir + "/run/update-job.json"); string(after) != string(before) { + t.Error("a second job wrote over the first") + } + held.Close() +} + +func TestAuto(t *testing.T) { + r := newRouter(t) + // nothing due: no check, no job + os.MkdirAll(r.dir+"/data", 0o700) + os.WriteFile(r.dir+"/data/update-auto.json", []byte(`{"check":1799999000}`), 0o600) + r.run("auto") + if _, err := os.Stat(r.dir + "/run/update-check.json"); err == nil { + t.Fatal("checked before its time") + } + // due, and updates right away: packages first, Dawnline last + os.WriteFile(r.dir+"/data/update-auto.json", []byte(`{"check":1799000000}`), 0o600) + r.ran = nil + r.run("auto") + j := r.job() + if j.State != "done" || !j.Auto || j.Component != "pkgs:ip-full app" || r.installed["luci-app-dawnline"] != "0.19.0" { + t.Fatalf("the automatic run: %+v\n%s", j, strings.Join(j.Log, "\n")) + } + did := strings.Join(r.ran, "; ") + if !strings.Contains(did, "apk upgrade 'ip-full' 'ip-tiny'") || strings.Index(did, "apk upgrade") > strings.Index(did, "apk add files") { + t.Errorf("the order: %s", did) + } + // an automatic run always keeps the version it replaces + if k := kept(r.dir+"/data", "app"); k == nil || k.Version != "0.18.0" { + t.Errorf("nothing kept by an automatic run: %+v", k) + } + said := strings.Join(r.said, "\n") + if !strings.Contains(said, "updates available · Dawnline 0.19.0, 2 system packages") || !strings.Contains(said, "updated automatically · ip-full, ip-tiny") { + t.Errorf("the service log: %s", said) + } + // checks only: found, told once, nothing installed + r2 := newRouter(t) + r2.env.Policy.Auto = false + r2.run("auto") + r2.run("auto") + if r2.installed["luci-app-dawnline"] != "0.18.0" || strings.Count(strings.Join(r2.said, "\n"), "updates available") != 1 { + t.Errorf("a check-only policy: %v", r2.said) + } + if _, err := os.Stat(r2.dir + "/run/update-job.json"); err == nil { + t.Error("an automatic check shows up as a job") + } +} diff --git a/backend/usage/testdata/trace.json b/backend/usage/testdata/trace.json new file mode 100644 index 0000000..47ab8ae --- /dev/null +++ b/backend/usage/testdata/trace.json @@ -0,0 +1,887 @@ +{ + "ts": 1794460039, + "steps": 400, + "seed": { + "devices": { + "d1": { + "raw": [ + 500, + 700 + ], + "total": [ + 9000, + 9000 + ], + "days": { + "2026-11-11": [ + 1, + 2 + ], + "2026-11-10": [ + 2, + 4 + ], + "2026-11-09": [ + 3, + 6 + ], + "2026-11-08": [ + 4, + 8 + ], + "2026-11-07": [ + 5, + 10 + ], + "2026-11-06": [ + 6, + 12 + ], + "2026-11-05": [ + 7, + 14 + ], + "2026-11-04": [ + 8, + 16 + ], + "2026-11-03": [ + 9, + 18 + ], + "2026-11-02": [ + 10, + 20 + ], + "2026-11-01": [ + 11, + 22 + ], + "2026-10-31": [ + 12, + 24 + ], + "2026-10-30": [ + 13, + 26 + ], + "2026-10-29": [ + 14, + 28 + ], + "2026-10-28": [ + 15, + 30 + ], + "2026-10-27": [ + 16, + 32 + ], + "2026-10-26": [ + 17, + 34 + ], + "2026-10-25": [ + 18, + 36 + ], + "2026-10-24": [ + 19, + 38 + ], + "2026-10-23": [ + 20, + 40 + ], + "2026-10-22": [ + 21, + 42 + ], + "2026-10-21": [ + 22, + 44 + ], + "2026-10-20": [ + 23, + 46 + ], + "2026-10-19": [ + 24, + 48 + ], + "2026-10-18": [ + 25, + 50 + ], + "2026-10-17": [ + 26, + 52 + ], + "2026-10-16": [ + 27, + 54 + ], + "2026-10-15": [ + 28, + 56 + ], + "2026-10-14": [ + 29, + 58 + ], + "2026-10-13": [ + 30, + 60 + ], + "2026-10-12": [ + 31, + 62 + ], + "2026-10-11": [ + 32, + 64 + ], + "2026-10-10": [ + 33, + 66 + ], + "2026-10-09": [ + 34, + 68 + ], + "2026-10-08": [ + 35, + 70 + ], + "2026-10-07": [ + 36, + 72 + ], + "2026-10-06": [ + 37, + 74 + ], + "2026-10-05": [ + 38, + 76 + ], + "2026-10-04": [ + 39, + 78 + ], + "2026-10-03": [ + 40, + 80 + ], + "2026-10-02": [ + 41, + 82 + ], + "2026-10-01": [ + 42, + 84 + ], + "2026-09-30": [ + 43, + 86 + ], + "2026-09-29": [ + 44, + 88 + ], + "2026-09-28": [ + 45, + 90 + ], + "2026-09-27": [ + 46, + 92 + ], + "2026-09-26": [ + 47, + 94 + ], + "2026-09-25": [ + 48, + 96 + ], + "2026-09-24": [ + 49, + 98 + ], + "2026-09-23": [ + 50, + 100 + ], + "2026-09-22": [ + 51, + 102 + ], + "2026-09-21": [ + 52, + 104 + ], + "2026-09-20": [ + 53, + 106 + ], + "2026-09-19": [ + 54, + 108 + ], + "2026-09-18": [ + 55, + 110 + ], + "2026-09-17": [ + 56, + 112 + ], + "2026-09-16": [ + 57, + 114 + ], + "2026-09-15": [ + 58, + 116 + ], + "2026-09-14": [ + 59, + 118 + ], + "2026-09-13": [ + 60, + 120 + ], + "2026-09-12": [ + 61, + 122 + ], + "2026-09-11": [ + 62, + 124 + ], + "2026-09-10": [ + 63, + 126 + ], + "2026-09-09": [ + 64, + 128 + ], + "2026-09-08": [ + 65, + 130 + ], + "2026-09-07": [ + 66, + 132 + ], + "2026-09-06": [ + 67, + 134 + ], + "2026-09-05": [ + 68, + 136 + ], + "2026-09-04": [ + 69, + 138 + ], + "2026-09-03": [ + 70, + 140 + ] + }, + "months": { + "2026-10": [ + 10, + 20 + ], + "2026-09": [ + 20, + 40 + ], + "2026-08": [ + 30, + 60 + ], + "2026-07": [ + 40, + 80 + ], + "2026-06": [ + 50, + 100 + ], + "2026-05": [ + 60, + 120 + ], + "2026-04": [ + 70, + 140 + ], + "2026-03": [ + 80, + 160 + ], + "2026-02": [ + 90, + 180 + ], + "2026-01": [ + 100, + 200 + ], + "2025-12": [ + 110, + 220 + ], + "2025-11": [ + 120, + 240 + ], + "2025-10": [ + 130, + 260 + ], + "2025-09": [ + 140, + 280 + ], + "2025-08": [ + 150, + 300 + ], + "2025-07": [ + 160, + 320 + ], + "2025-06": [ + 170, + 340 + ], + "2025-05": [ + 180, + 360 + ], + "2025-04": [ + 190, + 380 + ], + "2025-03": [ + 200, + 400 + ], + "2025-02": [ + 210, + 420 + ], + "2025-01": [ + 220, + 440 + ], + "2024-12": [ + 230, + 460 + ], + "2024-11": [ + 240, + 480 + ], + "2024-10": [ + 250, + 500 + ], + "2024-09": [ + 260, + 520 + ], + "2024-08": [ + 270, + 540 + ], + "2024-07": [ + 280, + 560 + ], + "2024-06": [ + 290, + 580 + ], + "2024-05": [ + 300, + 600 + ] + } + }, + "gone": { + "raw": [ + 1, + 1 + ], + "total": [ + 5, + 5 + ] + } + }, + "people": { + "anna": { + "total": [ + 5000, + 6000 + ], + "months": { + "2026-11": [ + 1000, + 2000 + ] + }, + "days": { + } + }, + "boris": { + "period": { + "start": 1791004039, + "rx": 11, + "tx": 22 + }, + "total": [ + 11, + 22 + ] + }, + "vera": { + "period": { + "start": 1794028039, + "rx": 100, + "tx": 200 + }, + "total": [ + 100, + 200 + ] + } + }, + "updated": 0, + "flushed": 0 + }, + "final": { + "devices": { + "d1": { + "raw": [ + 0, + 0 + ], + "total": [ + 1408856, + 22080989 + ], + "days": { + "2026-11-11": [ + 1, + 2 + ], + "2026-11-10": [ + 2, + 4 + ], + "2026-11-09": [ + 3, + 6 + ], + "2026-11-08": [ + 4, + 8 + ], + "2026-11-07": [ + 5, + 10 + ], + "2026-11-06": [ + 6, + 12 + ], + "2026-11-05": [ + 7, + 14 + ], + "2026-11-04": [ + 8, + 16 + ], + "2026-11-03": [ + 9, + 18 + ], + "2026-11-02": [ + 10, + 20 + ], + "2026-11-01": [ + 11, + 22 + ], + "2026-10-31": [ + 12, + 24 + ], + "2026-10-30": [ + 13, + 26 + ], + "2026-10-29": [ + 14, + 28 + ], + "2026-10-28": [ + 15, + 30 + ], + "2026-10-27": [ + 16, + 32 + ], + "2026-10-26": [ + 17, + 34 + ], + "2026-10-25": [ + 18, + 36 + ], + "2026-10-24": [ + 19, + 38 + ], + "2026-10-23": [ + 20, + 40 + ], + "2026-10-22": [ + 21, + 42 + ], + "2026-10-21": [ + 22, + 44 + ], + "2026-10-20": [ + 23, + 46 + ], + "2026-10-19": [ + 24, + 48 + ], + "2026-10-18": [ + 25, + 50 + ], + "2026-10-17": [ + 26, + 52 + ], + "2026-10-16": [ + 27, + 54 + ], + "2026-10-15": [ + 28, + 56 + ], + "2026-10-14": [ + 29, + 58 + ], + "2026-11-12": [ + 1399856, + 22071989 + ] + }, + "months": { + "2026-10": [ + 10, + 20 + ], + "2026-09": [ + 20, + 40 + ], + "2026-08": [ + 30, + 60 + ], + "2026-07": [ + 40, + 80 + ], + "2026-06": [ + 50, + 100 + ], + "2026-05": [ + 60, + 120 + ], + "2026-04": [ + 70, + 140 + ], + "2026-03": [ + 80, + 160 + ], + "2026-02": [ + 90, + 180 + ], + "2026-01": [ + 100, + 200 + ], + "2025-12": [ + 110, + 220 + ], + "2026-11": [ + 1399856, + 22071989 + ] + }, + "ifindex": 13, + "handshake": 1794457860, + "endpoint": "203.0.113.9", + "ips": { + "203.0.113.1": 1794457514, + "203.0.113.2": 1794457704, + "203.0.113.10": 1794457860, + "203.0.113.4": 1794457591, + "203.0.113.5": 1794457643, + "203.0.113.12": 1794457665, + "203.0.113.11": 1794457704, + "203.0.113.9": 1794457860 + } + }, + "d2": { + "raw": [ + 22072, + 342972 + ], + "ifindex": 17, + "total": [ + 702411, + 12930847 + ], + "months": { + "2026-11": [ + 702411, + 12930847 + ] + }, + "days": { + "2026-11-12": [ + 702411, + 12930847 + ] + }, + "handshake": 1794457781, + "endpoint": "203.0.113.10", + "ips": { + "203.0.113.12": 1794457744, + "203.0.113.11": 1794457118, + "203.0.113.6": 1794457166, + "203.0.113.4": 1794457702, + "203.0.113.9": 1794457336, + "203.0.113.8": 1794457660, + "203.0.113.1": 1794457375, + "203.0.113.10": 1794457781 + } + }, + "d3": { + "raw": [ + 7040, + 168363 + ], + "ifindex": 17, + "total": [ + 247234, + 4021581 + ], + "months": { + "2026-11": [ + 247234, + 4021581 + ] + }, + "days": { + "2026-11-12": [ + 247234, + 4021581 + ] + }, + "handshake": 1794457562, + "endpoint": "203.0.113.1", + "ips": { + "203.0.113.10": 1794457265, + "203.0.113.8": 1794457303, + "203.0.113.6": 1794457462, + "203.0.113.1": 1794457562 + } + }, + "d4": { + "raw": [ + 0, + 0 + ], + "ifindex": 18, + "total": [ + 305250, + 6415449 + ], + "months": { + "2026-11": [ + 305250, + 6415449 + ] + }, + "days": { + "2026-11-12": [ + 305250, + 6415449 + ] + }, + "handshake": 1794458057, + "endpoint": "203.0.113.11", + "ips": { + "203.0.113.2": 1794457539, + "203.0.113.3": 1794457992, + "203.0.113.11": 1794458057, + "203.0.113.6": 1794457370, + "203.0.113.1": 1794457822, + "203.0.113.12": 1794457458, + "203.0.113.9": 1794457923, + "203.0.113.5": 1794457993 + } + }, + "d5": { + "raw": [ + 0, + 0 + ], + "ifindex": 17, + "total": [ + 766080, + 13086788 + ], + "months": { + "2026-11": [ + 766080, + 13086788 + ] + }, + "days": { + "2026-11-12": [ + 766080, + 13086788 + ] + }, + "handshake": 1794458348, + "endpoint": "203.0.113.8", + "ips": { + "203.0.113.8": 1794458348, + "203.0.113.6": 1794458060, + "203.0.113.9": 1794458179, + "203.0.113.3": 1794457958, + "203.0.113.1": 1794458039, + "203.0.113.12": 1794458094, + "203.0.113.2": 1794458127, + "203.0.113.10": 1794458264 + } + } + }, + "people": { + "anna": { + "total": [ + 2107267, + 35008836 + ], + "months": { + "2026-11": [ + 2103267, + 35004836 + ] + }, + "days": { + "2026-11-12": [ + 2102267, + 35002836 + ] + }, + "period": { + "start": 1793491200, + "rx": 2103267, + "tx": 35004836 + } + }, + "boris": { + "period": { + "start": 1794460039, + "rx": 247234, + "tx": 4021581 + }, + "total": [ + 247245, + 4021603 + ], + "months": { + "2026-11": [ + 247234, + 4021581 + ] + }, + "days": { + "2026-11-12": [ + 247234, + 4021581 + ] + } + }, + "vera": { + "period": { + "start": 1794028039, + "rx": 1071430, + "tx": 19502437 + }, + "total": [ + 1071430, + 19502437 + ], + "months": { + "2026-11": [ + 1071330, + 19502237 + ] + }, + "days": { + "2026-11-12": [ + 1071330, + 19502237 + ] + } + } + }, + "updated": 1794460039, + "flushed": 0, + "hours": { + "2026-11-12 05": [ + 3420831, + 58526654 + ] + } + }, + "hash": 174869661 +} diff --git a/backend/usage/testdata/usage.uci b/backend/usage/testdata/usage.uci new file mode 100644 index 0000000..d446dd5 --- /dev/null +++ b/backend/usage/testdata/usage.uci @@ -0,0 +1,51 @@ +# The settings the usage trace runs on (testdata/trace.uc): two servers, three people, five devices, a +# short history kept so the trace's old days and months are pruned. + +config settings 'settings' + option usage_keep_days '30' + option usage_keep_months '12' + +config server 'home' + option ifname 'dawn0' + option subnet '10.77.0.0/24' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + +config server 'cabin' + option ifname 'dawn1' + option subnet '10.78.0.0/24' + option private_key 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' + option keepalive '300' + +config person 'anna' + option server 'home' + +config person 'boris' + option server 'home' + +config person 'vera' + option server 'cabin' + +config device 'd1' + option person 'anna' + option kind 'phone' + option public_key 'HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=' + +config device 'd2' + option person 'anna' + option kind 'computer' + option public_key 'TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=' + +config device 'd3' + option person 'boris' + option kind 'computer' + option public_key 'u4pL0000000000000000000000000000000000DyRrM=' + +config device 'd4' + option person 'vera' + option kind 'router' + option public_key 'Yc0000000000000000000000000000000000ovbrNy4=' + +config device 'd5' + option person 'vera' + option kind 'tablet' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' diff --git a/backend/usage/usage.go b/backend/usage/usage.go new file mode 100644 index 0000000..e666455 --- /dev/null +++ b/backend/usage/usage.go @@ -0,0 +1,410 @@ +// Package usage is the traffic accounting: the tunnels' counters folded into what each device and person +// used, by the day, the month and the person's limit month, and the router's traffic by the hour. It is +// dawnline.live's collect() and its helpers in Go, rule for rule, on the same file: usage.json is read and +// written by both backends while both exist, so its shape here is the file's. +// +// Pure but for Load and Save: the settings, a look at the tunnels and the clock go in, the counters change. +// The clock is the router's local one (days and months are the router's calendar). +package usage + +import ( + "os" + "regexp" + "sort" + "strconv" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/presence" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// hoursKept is how many hours of router-wide traffic are kept (today and yesterday): Overview's bars. +const hoursKept = 48 + +// addressesKept is how many recent client addresses a device keeps (for the map). +const addressesKept = 8 + +// Pair is bytes received from a device and sent to it. Numbers are float64 as the file's are read: whole +// to 2^53, far more than a router moves. +type Pair [2]float64 + +// Period is a person's limit month: when it began and what it counted. +type Period struct { + Start float64 `json:"start"` + Rx float64 `json:"rx"` + Tx float64 `json:"tx"` +} + +// Record is what is kept of a device or a person. A device has Raw (its peer's counters at the last +// read), Ifindex (the link they were read on), its last handshake, address and recent addresses; a person +// has Period. Both have the totals and the history. +type Record struct { + Raw *Pair `json:"raw,omitempty"` + Ifindex *int `json:"ifindex,omitempty"` + Total *Pair `json:"total,omitempty"` + Months map[string]Pair `json:"months,omitempty"` + Days map[string]Pair `json:"days,omitempty"` + Period *Period `json:"period,omitempty"` + Handshake float64 `json:"handshake,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + IPs map[string]float64 `json:"ips,omitempty"` +} + +// Usage is the whole file. +type Usage struct { + Devices map[string]*Record `json:"devices"` + People map[string]*Record `json:"people"` + Hours map[string]Pair `json:"hours,omitempty"` + Updated float64 `json:"updated"` + Flushed float64 `json:"flushed"` +} + +// Empty is a file with nothing counted yet. +func Empty() *Usage { + return &Usage{Devices: map[string]*Record{}, People: map[string]*Record{}} +} + +// Load reads the counters: the live copy in the run directory, else what flash holds. With fromFlash only +// flash counts (a restore put new counters there, and the live ones are the old). +func Load(run, data string, fromFlash bool) *Usage { + u := Empty() + if !fromFlash && files.ReadJSON(run+"/usage.json", u) { + return fill(u) + } + u = Empty() + files.ReadJSON(data+"/usage.json", u) + return fill(u) +} + +func fill(u *Usage) *Usage { + if u.Devices == nil { + u.Devices = map[string]*Record{} + } + if u.People == nil { + u.People = map[string]*Record{} + } + return u +} + +// Save writes the counters to the run directory (tmpfs), and to flash too when persist is set: flash is +// not worn by a write a minute. +func Save(u *Usage, run, data string, persist bool, now int64) error { + os.MkdirAll(run, 0o755) + if err := files.WriteJSON(run+"/usage.json", u, 0o600); err != nil { + return err + } + if !persist { + return nil + } + u.Flushed = float64(now) + os.MkdirAll(data, 0o700) + return files.WriteJSON(data+"/usage.json", u, 0o600) +} + +// Policy is how much history is kept. +type Policy struct { + Days, Months int +} + +var whole = regexp.MustCompile(`^-?[0-9]{1,9}$`) + +// PolicyOf reads the retention settings as dawnline.live policy() does: a whole number within its range, +// or the default. +func PolicyOf(r model.Retention) Policy { + get := func(v any, dflt, lo, hi int) int { + s, _ := v.(string) + s = strings.TrimSpace(s) + if !whole.MatchString(s) { + return dflt + } + n, _ := strconv.Atoi(s) + if n < lo || n > hi { + return dflt + } + return n + } + return Policy{Days: get(r.UsageKeepDays, 62, 7, 1830), Months: get(r.UsageKeepMonths, 24, 1, 120)} +} + +// Live is a device as the last look found it. +type Live struct { + Online bool `json:"online"` + Handshake float64 `json:"handshake"` + Endpoint string `json:"endpoint"` + Present bool `json:"present"` +} + +func monthKey(t time.Time) string { return t.Format("2006-01") } +func dayKey(t time.Time) string { return t.Format("2006-01-02") } +func hourKey(t time.Time) string { return t.Format("2006-01-02 15") } + +// monthAfter is the same moment a month later on the router's calendar (a day the next month does not +// have is its last one: 31 Jan → 28 or 29 Feb): when a limit month that began at ts ends. +func MonthAfter(ts int64) int64 { return monthAfter(ts) } + +func monthAfter(ts int64) int64 { + t := time.Unix(ts, 0).In(zone.Local()) + y, mo := t.Year(), t.Month()+1 + if mo > 12 { + y, mo = y+1, 1 + } + // the last day of that month: the day before the 1st of the one after it + last := time.Date(y, mo+1, 1, 12, 0, 0, 0, zone.Local()).AddDate(0, 0, -1).Day() + return time.Date(y, mo, min(t.Day(), last), t.Hour(), t.Minute(), t.Second(), 0, zone.Local()).Unix() +} + +// LimitMonth is the limit month of a person's record that runs at ts, or nil when none does. A limit month +// is not the calendar's: it begins with the person's first traffic and ends a month later; the next one +// begins only with their next traffic, so time they are away uses up none of it. A record from before +// limit months has none: the calendar month that ran then is its first one, with what it had counted, and +// it ends on the 1st as it would have. +func LimitMonth(u *Record, ts int64) *Period { + if u == nil { + return nil + } + p := u.Period + if p == nil { + t := time.Unix(ts, 0).In(zone.Local()) + mm, counted := u.Months[monthKey(t)] + if !counted { + return nil + } + first := time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, zone.Local()).Unix() + p = &Period{Start: float64(first), Rx: mm[0], Tx: mm[1]} + } + if ts < monthAfter(int64(p.Start)) { + return p + } + return nil +} + +func add(bucket map[string]Pair, key string, rx, tx float64) { + v := bucket[key] + bucket[key] = Pair{v[0] + rx, v[1] + tx} +} + +// prune keeps the newest `keep` keys of a history (they sort by date). +func prune(bucket map[string]Pair, keep int) { + if len(bucket) <= keep { + return + } + keys := make([]string, 0, len(bucket)) + for k := range bucket { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys[:len(keys)-keep] { + delete(bucket, k) + } +} + +// account adds traffic to a record's total and its day and month. +func account(rec *Record, rx, tx float64, t time.Time) { + total := Pair{} + if rec.Total != nil { + total = *rec.Total + } + rec.Total = &Pair{total[0] + rx, total[1] + tx} + if rec.Months == nil { + rec.Months = map[string]Pair{} + } + if rec.Days == nil { + rec.Days = map[string]Pair{} + } + add(rec.Months, monthKey(t), rx, tx) + add(rec.Days, dayKey(t), rx, tx) +} + +// accountMonth adds a person's traffic to their limit month: the one that runs, or a new one that begins +// with this traffic. Called before account, which a record from before limit months is read by. +func accountMonth(rec *Record, rx, tx float64, ts int64) { + p := LimitMonth(rec, ts) + if p == nil { + p = &Period{Start: float64(ts)} + } + rec.Period = &Period{Start: p.Start, Rx: p.Rx + rx, Tx: p.Tx + tx} +} + +// Collect folds a look at the tunnels into the counters and returns each device as that look found it. +// Counters restart from zero when a peer is added again or its tunnel is set up again: a drop is taken as +// a reset, and so is a new link (each record keeps the index of the link its counters were read on: new +// counters that already passed the old ones would be counted short). +// +// A device missing from the look had its counters reset only when its tunnel was read or is down: one the +// tool could not read says nothing, and forgetting the last counters there would count them again on the +// next good read. +func Collect(m *model.Model, u *Usage, d awg.Dump, ts int64) map[string]Live { + now := time.Unix(ts, 0).In(zone.Local()) + live := map[string]Live{} + var all Pair + for _, id := range m.DeviceIDs() { + dev := m.Devices[id] + rec := u.Devices[id] + if rec == nil { + rec = &Record{Raw: &Pair{}} + u.Devices[id] = rec + } + var srv *model.Server + if p := m.People[dev.Person]; p != nil { + srv = m.Servers[p.Server] + } + peer, there := d.Peers[dev.PublicKey] + if !there { + ifname := "" + if srv != nil { + ifname = srv.Ifname + } + if d.Reads[ifname] != awg.Failed { + rec.Raw = &Pair{} + } + endpoint := "" + if rec.Endpoint != nil { + endpoint = *rec.Endpoint + } + live[id] = Live{Handshake: rec.Handshake, Endpoint: endpoint} + continue + } + raw := Pair{} + if rec.Raw != nil { + raw = *rec.Raw + } + if ifc, read := d.Ifaces[peer.Ifname]; read { + if rec.Ifindex != nil && *rec.Ifindex != ifc.Ifindex { + raw = Pair{} + } + index := ifc.Ifindex + rec.Ifindex = &index + } + rx, tx := float64(peer.Rx), float64(peer.Tx) + drx, dtx := rx, tx + if rx >= raw[0] { + drx = rx - raw[0] + } + if tx >= raw[1] { + dtx = tx - raw[1] + } + rec.Raw = &Pair{rx, tx} + if drx > 0 || dtx > 0 { + account(rec, drx, dtx, now) + all[0] += drx + all[1] += dtx + p := u.People[dev.Person] + if p == nil { + p = &Record{} + u.People[dev.Person] = p + } + accountMonth(p, drx, dtx, ts) + account(p, drx, dtx, now) + } + ip := presence.EndpointIP(peer.Endpoint) + if peer.Handshake > 0 { + rec.Handshake = float64(peer.Handshake) + rec.Endpoint = &ip + if rec.IPs == nil { + rec.IPs = map[string]float64{} + } + if ip != "" { + rec.IPs[ip] = float64(peer.Handshake) + } + keepNewest(rec.IPs, addressesKept) + } + l := Live{Present: true, Handshake: rec.Handshake, Endpoint: ip, + Online: peer.Handshake > 0 && ts-peer.Handshake < int64(model.OnlineWindowOf(srv, dev))} + if peer.Handshake > 0 { + l.Handshake = float64(peer.Handshake) + } + if l.Endpoint == "" && rec.Endpoint != nil { + l.Endpoint = *rec.Endpoint + } + live[id] = l + } + // Counters of devices that no longer exist are forgotten (their bytes stay in the person's totals). + for id := range u.Devices { + if m.Devices[id] == nil { + delete(u.Devices, id) + } + } + if all[0] > 0 || all[1] > 0 { + if u.Hours == nil { + u.Hours = map[string]Pair{} + } + add(u.Hours, hourKey(now), all[0], all[1]) + } + if u.Hours != nil { + prune(u.Hours, hoursKept) + } + Prune(u, PolicyOf(m.Settings.Retention)) + u.Updated = float64(ts) + return live +} + +// keepNewest keeps the n addresses seen last. +func keepNewest(ips map[string]float64, n int) { + if len(ips) <= n { + return + } + keys := make([]string, 0, len(ips)) + for k := range ips { + keys = append(keys, k) + } + sort.SliceStable(keys, func(i, j int) bool { return ips[keys[i]] > ips[keys[j]] }) + for _, k := range keys[n:] { + delete(ips, k) + } +} + +// Prune applies the history's retention to every record. +func Prune(u *Usage, pol Policy) { + for _, group := range []map[string]*Record{u.Devices, u.People} { + for _, rec := range group { + if rec.Months != nil { + prune(rec.Months, pol.Months) + } + if rec.Days != nil { + prune(rec.Days, pol.Days) + } + } + } +} + +// wipe forgets a record's traffic history; the kernel's counters and the last handshake stay. +func wipe(rec *Record) { + if rec == nil { + return + } + rec.Total, rec.Months, rec.Days, rec.Period = nil, nil, nil, nil +} + +// Reset forgets traffic history. scope: all | person | device | limit. A person's reset also clears their +// devices and restarts their data limit; a device's leaves the person's totals (and so their limit) alone; +// `limit` restarts a person's limit month and touches nothing else (an ended month is left in its place, +// not none: a record from before limit months would be read by its calendar month again). +func Reset(u *Usage, m *model.Model, scope, id string) { + switch scope { + case "all": + u.Hours = nil + for _, rec := range u.Devices { + wipe(rec) + } + for _, rec := range u.People { + wipe(rec) + } + case "person": + wipe(u.People[id]) + if p := m.People[id]; p != nil { + for _, did := range p.Devices { + wipe(u.Devices[did]) + } + } + case "device": + wipe(u.Devices[id]) + case "limit": + if rec := u.People[id]; rec != nil { + rec.Period = &Period{} + } + } +} diff --git a/backend/usage/usage_test.go b/backend/usage/usage_test.go new file mode 100644 index 0000000..644a11f --- /dev/null +++ b/backend/usage/usage_test.go @@ -0,0 +1,282 @@ +package usage + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "strings" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// The generator of testdata/trace.uc, number for number. +type gen struct{ x int64 } + +func (g *gen) rnd(n int64) int64 { + g.x = (g.x*1103515245 + 12345) % 2147483648 + return (g.x >> 8) % n +} + +// plain is a document as JSON reads it, without what is empty: an empty history is the same as none. +func plain(v any) any { + raw, _ := json.Marshal(v) + var out any + json.Unmarshal(raw, &out) + return tidy(out) +} + +func tidy(v any) any { + if m, ok := v.(map[string]any); ok { + for k, e := range m { + e = tidy(e) + if sub, isMap := e.(map[string]any); isMap && len(sub) == 0 { + delete(m, k) + continue + } + m[k] = e + } + } + return v +} + +func differ(path string, got, want any) []string { + g, gok := got.(map[string]any) + w, wok := want.(map[string]any) + if gok && wok { + var out []string + for k := range w { + if _, has := g[k]; !has { + out = append(out, fmt.Sprintf("%s.%s: missing, ucode has %v", path, k, w[k])) + } + } + for k, v := range g { + if _, has := w[k]; !has { + out = append(out, fmt.Sprintf("%s.%s: %v, ucode has none", path, k, v)) + continue + } + out = append(out, differ(path+"."+k, v, w[k])...) + } + return out + } + if reflect.DeepEqual(got, want) { + return nil + } + return []string{fmt.Sprintf("%s: %v, ucode has %v", path, got, want)} +} + +// The same made-up looks through Collect as trace.uc put through dawnline.live collect(), from the same +// usage file, at the same moment: the same counters at the end, and the same view of every device at +// every look. +func TestHeldToUcode(t *testing.T) { + zone.Set(time.UTC) + text, err := os.ReadFile("testdata/usage.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + TS int64 `json:"ts"` + Steps int `json:"steps"` + Seed json.RawMessage `json:"seed"` + Final any `json:"final"` + Hash int64 `json:"hash"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + u := Empty() + if err := json.Unmarshal(golden.Seed, u); err != nil { + t.Fatalf("the seeded usage does not read: %v", err) + } + ts0 := golden.TS + + g := &gen{x: 4711} + ifindex := []int{5, 9} + type peer struct { + present bool + rx, tx, hs int64 + ep string + } + st := map[string]*peer{} + for _, id := range m.DeviceIDs() { + st[id] = &peer{present: true, hs: ts0 - 3000} + } + hash := int64(7) + for i := 0; i < golden.Steps; i++ { + d := awg.Dump{OK: true, Reads: map[string]string{}, Ifaces: map[string]awg.Iface{}, Peers: map[string]awg.Peer{}} + state := map[string]string{} + for n, sid := range m.ServerIDs() { + srv := m.Servers[sid] + switch r := g.rnd(100); { + case r < 4: + state[sid] = awg.Failed + case r < 7: + state[sid] = awg.Down + default: + state[sid] = awg.Read + } + if g.rnd(100) < 2 { + ifindex[n]++ + } + d.Reads[srv.Ifname] = state[sid] + if state[sid] == awg.Read { + d.Ifaces[srv.Ifname] = awg.Iface{Ifindex: ifindex[n]} + } + } + for _, id := range m.DeviceIDs() { + dev, s := m.Devices[id], st[id] + sid := m.People[dev.Person].Server + if g.rnd(100) < 3 { + s.present = !s.present + if s.present { + s.rx, s.tx = 0, 0 + } + } + if !s.present { + continue + } + if g.rnd(100) < 60 { + s.rx += g.rnd(5000) + } + if g.rnd(100) < 60 { + s.tx += g.rnd(90000) + } + if g.rnd(100) < 3 { + s.rx = g.rnd(100) + s.tx = g.rnd(100) + } + if g.rnd(100) < 20 { + s.hs += 1 + g.rnd(50) + } + if g.rnd(100) < 10 { + s.ep = fmt.Sprintf("203.0.113.%d:4000", 1+g.rnd(12)) + } + if state[sid] == awg.Read { + d.Peers[dev.PublicKey] = awg.Peer{Ifname: m.Servers[sid].Ifname, Endpoint: s.ep, Handshake: s.hs, Rx: s.rx, Tx: s.tx} + } + } + seen := Collect(m, u, d, ts0) + for _, id := range m.DeviceIDs() { + v := seen[id] + on, present := 0, 0 + if v.Online { + on = 1 + } + if v.Present { + present = 1 + } + for _, ch := range []byte(fmt.Sprintf("%s:%d:%d:%s:%d;", id, on, int64(v.Handshake), v.Endpoint, present)) { + hash = (hash*131 + int64(ch)) % 1000000007 + } + } + } + if d := differ("", plain(u), tidy(golden.Final)); len(d) > 0 { + t.Errorf("the counters ended differently than ucode's:\n%s", strings.Join(d[:min(len(d), 25)], "\n")) + } + if hash != golden.Hash { + t.Errorf("what the looks showed of the devices differs somewhere: hash %d, ucode has %d", hash, golden.Hash) + } +} + +func TestLimitMonth(t *testing.T) { + zone.Set(time.UTC) + at := func(s string) int64 { + v, err := time.Parse("2006-01-02 15:04:05", s) + if err != nil { + t.Fatal(err) + } + return v.Unix() + } + // a month later on the calendar; a day the next month lacks is its last one + for from, to := range map[string]string{ + "2026-01-31 10:00:00": "2026-02-28 10:00:00", + "2028-01-31 10:00:00": "2028-02-29 10:00:00", + "2026-12-15 23:59:59": "2027-01-15 23:59:59", + "2026-03-31 00:00:00": "2026-04-30 00:00:00", + } { + if got := monthAfter(at(from)); got != at(to) { + t.Errorf("a month after %s: %s, want %s", from, time.Unix(got, 0).UTC().Format("2006-01-02 15:04:05"), to) + } + } + running := &Record{Period: &Period{Start: float64(at("2026-11-01 00:00:00")), Rx: 5}} + if p := LimitMonth(running, at("2026-11-30 23:59:59")); p == nil || p.Rx != 5 { + t.Error("a running limit month is not found") + } + if LimitMonth(running, at("2026-12-01 00:00:00")) != nil { + t.Error("an ended limit month still runs") + } + old := &Record{Months: map[string]Pair{"2026-11": {7, 9}}} + if p := LimitMonth(old, at("2026-11-11 12:00:00")); p == nil || p.Start != float64(at("2026-11-01 00:00:00")) || p.Tx != 9 { + t.Errorf("a record from before limit months: %+v", p) + } + if LimitMonth(&Record{}, at("2026-11-11 12:00:00")) != nil || LimitMonth(nil, 0) != nil { + t.Error("a limit month out of nothing") + } +} + +func TestReset(t *testing.T) { + c, _ := uci.Parse("config person 'anna'\nconfig device 'd1'\n\toption person 'anna'\nconfig device 'd2'\n\toption person 'x'\n") + m := model.Load(c, nil) + fresh := func() *Usage { + return &Usage{ + Devices: map[string]*Record{"d1": {Raw: &Pair{1, 1}, Total: &Pair{5, 5}, Handshake: 9}, "d2": {Total: &Pair{7, 7}}}, + People: map[string]*Record{"anna": {Total: &Pair{5, 5}, Period: &Period{Start: 3, Rx: 5}}}, + Hours: map[string]Pair{"2026-11-11 10": {1, 1}}, + } + } + u := fresh() + Reset(u, m, "person", "anna") + if u.People["anna"].Total != nil || u.Devices["d1"].Total != nil || u.Devices["d1"].Raw == nil || u.Devices["d1"].Handshake != 9 || u.Devices["d2"].Total == nil { + t.Errorf("person: %+v %+v", u.People["anna"], u.Devices["d1"]) + } + u = fresh() + Reset(u, m, "device", "d1") + if u.Devices["d1"].Total != nil || u.People["anna"].Total == nil { + t.Error("device") + } + u = fresh() + Reset(u, m, "limit", "anna") + if p := u.People["anna"].Period; p == nil || p.Start != 0 || p.Rx != 0 || u.People["anna"].Total == nil { + t.Errorf("limit: %+v", u.People["anna"]) + } + u = fresh() + Reset(u, m, "all", "") + if u.Hours != nil || u.Devices["d2"].Total != nil || u.People["anna"].Period != nil { + t.Error("all") + } +} + +// Days, hours and months are the router's own, not UTC's: a Go program on OpenWrt knows no zone unless it +// is told (package zone). The night this was found: 00:06 in Moscow, 21:06 the day before in UTC. +func TestDaysAreTheRoutersOwn(t *testing.T) { + msk, err := zone.FromPOSIX("MSK-3") + if err != nil { + t.Fatal(err) + } + zone.Set(msk) + defer zone.Set(time.UTC) + ts := time.Date(2026, 11, 11, 21, 6, 32, 0, time.UTC).Unix() + now := time.Unix(ts, 0).In(zone.Local()) + if dayKey(now) != "2026-11-12" || hourKey(now) != "2026-11-12 00" || monthKey(now) != "2026-11" { + t.Fatalf("the day %s, the hour %s, the month %s", dayKey(now), hourKey(now), monthKey(now)) + } + // a limit month that began on the 31st at 23:30 Moscow time ends on the last of the next month there + began := time.Date(2026, 1, 31, 20, 30, 0, 0, time.UTC).Unix() + if got := time.Unix(monthAfter(began), 0).In(msk).Format("2006-01-02 15:04"); got != "2026-02-28 23:30" { + t.Fatalf("a month after: %s", got) + } +} diff --git a/backend/version.go b/backend/version.go new file mode 100644 index 0000000..a458af3 --- /dev/null +++ b/backend/version.go @@ -0,0 +1,34 @@ +// Package backend is Dawnline's backend in Go. Its packages: +// +// ubus the wire protocol of ubusd: our object, calls, notifications +// hub the live state: topics, their changes as numbered events +// api the admin's door: the object `dawnline` over the hub +// bridge the topics told again when they may have moved without an event, and their shape on the stream +// uci /etc/config files read as libuci reads them +// model the settings as the backend works with them, read by the rules the settings' file has always had +// awg the one door to AmneziaWG: what the tunnels say of their peers +// presence who is online: connects, leaves and moves from one look at the tunnels to the next +// link how a device's link behaves: knocking, shared, dropped, unstable; the set-up sheet's state +// meter the live meter: a point a second from two looks at the tunnels +// usage the traffic accounting: by the day, the month, the person's limit month, the hour +// journal the activity log's writer, on its file and under its lock +// files locks and whole-file writes +// ipnet IPv4 networks as the settings write them, with the settings' own rules +// state where a person stands: active, or why not (paused, past the end date, over the limit) +// view a person and their devices as the pages show them: the settings joined with the tunnels, the counters and what was handed out +// netview the router's own networks: its interfaces, the WAN, the LAN, what a server's and a person's home reaches +// handout what a device is given: its configuration and the fingerprint that says whether it must import again +// zone the router's time zone, read where OpenWrt keeps it: what a day and an hour are +// watch the watcher: every second, presence, link, meter, counters and the log, on disk and on the stream +// portal the personal portal's web server: the door, the answers behind it, a stream a page +// roster the stream's topics, made from what the watcher knows +// daemon the parts joined and kept running +// cmd/dawnlined the program +// +// Layers point one way: ubus, hub and uci know nothing of each other or of +// Dawnline; model reads uci, awg reads the tunnels; api and bridge join them, daemon runs them; only cmd knows the router's paths. +package backend + +// Version is the backend's, the package's: the build sets it +// (-ldflags "-X …/backend.Version=0.18.0"). +var Version = "dev" diff --git a/backend/view/testdata/trace.json b/backend/view/testdata/trace.json new file mode 100644 index 0000000..b075977 --- /dev/null +++ b/backend/view/testdata/trace.json @@ -0,0 +1,2855 @@ +{ + "ts": 1794460039, + "usage": { + "devices": { + "a1": { + "total": [ + 5000000000.0, + 6000000000.0 + ], + "days": { + "2026-11-12": [ + 1000000.0, + 6000000.0 + ], + "2026-11-10": [ + 2000000.0, + 9000000.0 + ], + "2026-11-08": [ + 3000000.0, + 12000000.0 + ], + "2026-11-06": [ + 4000000.0, + 15000000.0 + ], + "2026-11-04": [ + 5000000.0, + 18000000.0 + ], + "2026-11-02": [ + 6000000.0, + 21000000.0 + ], + "2026-10-31": [ + 7000000.0, + 24000000.0 + ], + "2026-10-29": [ + 8000000.0, + 27000000.0 + ], + "2026-10-27": [ + 9000000.0, + 30000000.0 + ], + "2026-10-25": [ + 10000000.0, + 33000000.0 + ], + "2026-10-23": [ + 11000000.0, + 36000000.0 + ], + "2026-10-21": [ + 12000000.0, + 39000000.0 + ], + "2026-10-19": [ + 13000000.0, + 42000000.0 + ], + "2026-10-17": [ + 14000000.0, + 45000000.0 + ], + "2026-10-15": [ + 15000000.0, + 48000000.0 + ], + "2026-10-13": [ + 16000000.0, + 51000000.0 + ], + "2026-10-11": [ + 17000000.0, + 54000000.0 + ], + "2026-10-09": [ + 18000000.0, + 57000000.0 + ], + "2026-10-07": [ + 19000000.0, + 60000000.0 + ], + "2026-10-05": [ + 20000000.0, + 63000000.0 + ] + }, + "handshake": 1794456039, + "endpoint": "198.51.100.7" + }, + "a2": { + "total": [ + 1, + 2 + ], + "days": { + "2026-11-12": [ + 10, + 40 + ], + "2026-11-10": [ + 20, + 60 + ], + "2026-11-08": [ + 30, + 80 + ] + }, + "handshake": 1794459989 + }, + "a4": { + "days": { + } + }, + "b1": { + "total": [ + 7, + 8 + ], + "days": { + "2026-11-12": [ + 5, + 12 + ], + "2026-11-10": [ + 10, + 18 + ], + "2026-11-08": [ + 15, + 24 + ], + "2026-11-06": [ + 20, + 30 + ], + "2026-11-04": [ + 25, + 36 + ], + "2026-11-02": [ + 30, + 42 + ], + "2026-10-31": [ + 35, + 48 + ], + "2026-10-29": [ + 40, + 54 + ], + "2026-10-27": [ + 45, + 60 + ], + "2026-10-25": [ + 50, + 66 + ], + "2026-10-23": [ + 55, + 72 + ], + "2026-10-21": [ + 60, + 78 + ], + "2026-10-19": [ + 65, + 84 + ], + "2026-10-17": [ + 70, + 90 + ], + "2026-10-15": [ + 75, + 96 + ], + "2026-10-13": [ + 80, + 102 + ], + "2026-10-11": [ + 85, + 108 + ], + "2026-10-09": [ + 90, + 114 + ], + "2026-10-07": [ + 95, + 120 + ], + "2026-10-05": [ + 100, + 126 + ], + "2026-10-03": [ + 105, + 132 + ], + "2026-10-01": [ + 110, + 138 + ], + "2026-09-29": [ + 115, + 144 + ], + "2026-09-27": [ + 120, + 150 + ], + "2026-09-25": [ + 125, + 156 + ], + "2026-09-23": [ + 130, + 162 + ], + "2026-09-21": [ + 135, + 168 + ], + "2026-09-19": [ + 140, + 174 + ], + "2026-09-17": [ + 145, + 180 + ], + "2026-09-15": [ + 150, + 186 + ], + "2026-09-13": [ + 155, + 192 + ], + "2026-09-11": [ + 160, + 198 + ], + "2026-09-09": [ + 165, + 204 + ], + "2026-09-07": [ + 170, + 210 + ], + "2026-09-05": [ + 175, + 216 + ], + "2026-09-03": [ + 180, + 222 + ], + "2026-09-01": [ + 185, + 228 + ], + "2026-08-30": [ + 190, + 234 + ], + "2026-08-28": [ + 195, + 240 + ], + "2026-08-26": [ + 200, + 246 + ] + }, + "handshake": 1794360039, + "endpoint": "192.168.1.9" + } + }, + "people": { + "anna": { + "total": [ + 9000000000.0, + 9000000000.0 + ], + "days": { + "2026-11-12": [ + 2000000.0, + 8000000.0 + ], + "2026-11-10": [ + 4000000.0, + 12000000.0 + ], + "2026-11-08": [ + 6000000.0, + 16000000.0 + ], + "2026-11-06": [ + 8000000.0, + 20000000.0 + ], + "2026-11-04": [ + 10000000.0, + 24000000.0 + ], + "2026-11-02": [ + 12000000.0, + 28000000.0 + ], + "2026-10-31": [ + 14000000.0, + 32000000.0 + ], + "2026-10-29": [ + 16000000.0, + 36000000.0 + ], + "2026-10-27": [ + 18000000.0, + 40000000.0 + ], + "2026-10-25": [ + 20000000.0, + 44000000.0 + ], + "2026-10-23": [ + 22000000.0, + 48000000.0 + ], + "2026-10-21": [ + 24000000.0, + 52000000.0 + ], + "2026-10-19": [ + 26000000.0, + 56000000.0 + ], + "2026-10-17": [ + 28000000.0, + 60000000.0 + ], + "2026-10-15": [ + 30000000.0, + 64000000.0 + ], + "2026-10-13": [ + 32000000.0, + 68000000.0 + ], + "2026-10-11": [ + 34000000.0, + 72000000.0 + ], + "2026-10-09": [ + 36000000.0, + 76000000.0 + ], + "2026-10-07": [ + 38000000.0, + 80000000.0 + ], + "2026-10-05": [ + 40000000.0, + 84000000.0 + ], + "2026-10-03": [ + 42000000.0, + 88000000.0 + ], + "2026-10-01": [ + 44000000.0, + 92000000.0 + ], + "2026-09-29": [ + 46000000.0, + 96000000.0 + ], + "2026-09-27": [ + 48000000.0, + 100000000.0 + ], + "2026-09-25": [ + 50000000.0, + 104000000.0 + ] + }, + "period": { + "start": 1794373639, + "rx": 1000000000.0, + "tx": 2000000000.0 + } + }, + "boris": { + "total": [ + 7, + 8 + ], + "days": { + "2026-11-12": [ + 1, + 2 + ], + "2026-11-10": [ + 2, + 3 + ] + } + } + } + }, + "peers": { + "KEYA1": { + "handshake": 1794460009, + "endpoint": "203.0.113.7:41821", + "rx": 1, + "tx": 2 + }, + "KEYA2": { + "handshake": 1794459639, + "endpoint": "[2001:db8::1]:500", + "rx": 1, + "tx": 2 + }, + "KEYA4": { + "handshake": 0, + "endpoint": "", + "rx": 0, + "tx": 0 + }, + "KEYB1": { + "handshake": 1794460019, + "endpoint": "192.168.1.9:7", + "rx": 3, + "tx": 4 + } + }, + "issued": { + "a1": { + "fp": "933a64b9", + "ts": 1794459539 + }, + "a2": { + "fp": "deadbeef", + "ts": 1794459139 + }, + "a3": { + "fp": "a38bbaca", + "ts": 0 + } + }, + "reconnect": { + "b1": 1794460029, + "a1": 1794459039 + }, + "watched": { + "admin": { + "anna": { + "id": "anna", + "name": "Anna", + "server": "main", + "access": "both", + "device_limit": 5, + "expires": "", + "quota_gb": 10, + "quota_period": "month", + "quota_used": 3000000000.0, + "quota_limit": 16106127360, + "quota_month": [ + 1000000000.0, + 2000000000.0 + ], + "quota_resets": 1796965639, + "quota_reset_day": "2026-12-11", + "bonus_gb": 5, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 240000000.0, + 540000000.0 + ], + "total": [ + 9000000000.0, + 9000000000.0 + ], + "online": 1, + "last_seen": 1794460009, + "devices": [ + { + "id": "a2", + "name": "iPhone!", + "kind": "phone", + "address": "10.9.0.3", + "disabled": false, + "created": 1700000200, + "created_by": "portal", + "online": false, + "handshake": 1794459639, + "endpoint": "2001:db8::1", + "active": true, + "month": [ + 60, + 180 + ], + "total": [ + 1, + 2 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 30, + 80 + ], + [ + 0, + 0 + ], + [ + 20, + 60 + ], + [ + 0, + 0 + ], + [ + 10, + 40 + ] + ], + "hostname": "iphone.anna.home.arpa", + "browser_key": true, + "config_stale": true, + "config_issued": 1794459139, + "lan_bypass": true, + "mtu": 1300, + "keepalive": 0, + "mtu_used": 1300, + "keepalive_used": 0, + "link": { + "state": "knocking", + "since": 1794459979 + }, + "setup": null + }, + { + "id": "a1", + "name": "iPhone", + "kind": "phone", + "address": "10.9.0.2", + "disabled": false, + "created": 1700000300, + "created_by": "admin", + "online": true, + "handshake": 1794460009, + "endpoint": "203.0.113.7", + "active": true, + "month": [ + 120000000.0, + 405000000.0 + ], + "total": [ + 5000000000.0, + 6000000000.0 + ], + "spark": [ + [ + 4000000.0, + 15000000.0 + ], + [ + 0, + 0 + ], + [ + 3000000.0, + 12000000.0 + ], + [ + 0, + 0 + ], + [ + 2000000.0, + 9000000.0 + ], + [ + 0, + 0 + ], + [ + 1000000.0, + 6000000.0 + ] + ], + "hostname": "iphone-2.anna.home.arpa", + "browser_key": false, + "config_stale": false, + "config_issued": 1794459539, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": { + "state": "flowing", + "since": 1794460009 + } + }, + { + "id": "a3", + "name": "Ноутбук", + "kind": "computer", + "address": "10.9.0.4", + "disabled": true, + "created": 1700000400, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "noutbuk.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + }, + { + "id": "a4", + "name": "!!!", + "kind": "router", + "address": "10.9.0.5", + "disabled": false, + "created": 1700000500, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": true, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "device.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": true, + "note": "A note", + "services": [ + ], + "home_nets": [ + ], + "circle": "family", + "created": 1700000000, + "code_set": 1700000100 + }, + "boris": { + "id": "boris", + "name": "Борис", + "server": "main", + "access": "lan", + "device_limit": 3, + "expires": "2099-01-01", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 3, + 5 + ], + "total": [ + 7, + 8 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "b1", + "name": "Телефон", + "kind": "tablet", + "address": "10.9.0.6", + "disabled": false, + "created": 1700000600, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "192.168.1.9", + "active": true, + "month": [ + 600, + 810 + ], + "total": [ + 7, + 8 + ], + "spark": [ + [ + 20, + 30 + ], + [ + 0, + 0 + ], + [ + 15, + 24 + ], + [ + 0, + 0 + ], + [ + 10, + 18 + ], + [ + 0, + 0 + ], + [ + 5, + 12 + ] + ], + "hostname": "telefon.boris.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": false, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + }, + "nobody": { + "id": "nobody", + "name": "Nobody", + "server": "gone", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "no_server", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "n1", + "name": "Lost", + "kind": "other", + "address": "10.99.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "lost.nobody.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": null, + "keepalive_used": null, + "link": null, + "setup": null + } + ], + "has_link": false, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + }, + "vera": { + "id": "vera", + "name": "Vera", + "server": "off", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": true, + "state": "server_off", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "v1", + "name": "Laptop", + "kind": "computer", + "address": "10.10.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "laptop.vera.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": true, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + } + }, + "own": { + "anna": { + "id": "anna", + "name": "Anna", + "server": "main", + "access": "both", + "device_limit": 5, + "expires": "", + "quota_gb": 10, + "quota_period": "month", + "quota_used": 3000000000.0, + "quota_limit": 16106127360, + "quota_month": [ + 1000000000.0, + 2000000000.0 + ], + "quota_resets": 1796965639, + "quota_reset_day": "2026-12-11", + "bonus_gb": 5, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 240000000.0, + 540000000.0 + ], + "total": [ + 9000000000.0, + 9000000000.0 + ], + "online": 1, + "last_seen": 1794460009, + "devices": [ + { + "id": "a2", + "name": "iPhone!", + "kind": "phone", + "address": "10.9.0.3", + "disabled": false, + "created": 1700000200, + "created_by": "portal", + "online": false, + "handshake": 1794459639, + "endpoint": "2001:db8::1", + "active": true, + "month": [ + 60, + 180 + ], + "total": [ + 1, + 2 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 30, + 80 + ], + [ + 0, + 0 + ], + [ + 20, + 60 + ], + [ + 0, + 0 + ], + [ + 10, + 40 + ] + ], + "hostname": "iphone.anna.home.arpa", + "browser_key": true, + "config_stale": true, + "config_issued": 1794459139, + "lan_bypass": true, + "mtu": 1300, + "keepalive": 0, + "mtu_used": 1300, + "keepalive_used": 0, + "link": { + "state": "knocking", + "since": 1794459979 + }, + "setup": null + }, + { + "id": "a1", + "name": "iPhone", + "kind": "phone", + "address": "10.9.0.2", + "disabled": false, + "created": 1700000300, + "created_by": "admin", + "online": true, + "handshake": 1794460009, + "endpoint": "203.0.113.7", + "active": true, + "month": [ + 120000000.0, + 405000000.0 + ], + "total": [ + 5000000000.0, + 6000000000.0 + ], + "spark": [ + [ + 4000000.0, + 15000000.0 + ], + [ + 0, + 0 + ], + [ + 3000000.0, + 12000000.0 + ], + [ + 0, + 0 + ], + [ + 2000000.0, + 9000000.0 + ], + [ + 0, + 0 + ], + [ + 1000000.0, + 6000000.0 + ] + ], + "hostname": "iphone-2.anna.home.arpa", + "browser_key": false, + "config_stale": false, + "config_issued": 1794459539, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": { + "state": "flowing", + "since": 1794460009 + } + }, + { + "id": "a3", + "name": "Ноутбук", + "kind": "computer", + "address": "10.9.0.4", + "disabled": true, + "created": 1700000400, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "noutbuk.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + }, + { + "id": "a4", + "name": "!!!", + "kind": "router", + "address": "10.9.0.5", + "disabled": false, + "created": 1700000500, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": true, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "device.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + }, + "boris": { + "id": "boris", + "name": "Борис", + "server": "main", + "access": "lan", + "device_limit": 3, + "expires": "2099-01-01", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 3, + 5 + ], + "total": [ + 7, + 8 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "b1", + "name": "Телефон", + "kind": "tablet", + "address": "10.9.0.6", + "disabled": false, + "created": 1700000600, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "192.168.1.9", + "active": true, + "month": [ + 600, + 810 + ], + "total": [ + 7, + 8 + ], + "spark": [ + [ + 20, + 30 + ], + [ + 0, + 0 + ], + [ + 15, + 24 + ], + [ + 0, + 0 + ], + [ + 10, + 18 + ], + [ + 0, + 0 + ], + [ + 5, + 12 + ] + ], + "hostname": "telefon.boris.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + }, + "nobody": { + "id": "nobody", + "name": "Nobody", + "server": "gone", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "no_server", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "n1", + "name": "Lost", + "kind": "other", + "address": "10.99.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "lost.nobody.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": null, + "keepalive_used": null, + "link": null, + "setup": null + } + ] + }, + "vera": { + "id": "vera", + "name": "Vera", + "server": "off", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": true, + "state": "server_off", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "v1", + "name": "Laptop", + "kind": "computer", + "address": "10.10.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "laptop.vera.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + } + } + }, + "alone": { + "admin": { + "anna": { + "id": "anna", + "name": "Anna", + "server": "main", + "access": "both", + "device_limit": 5, + "expires": "", + "quota_gb": 10, + "quota_period": "month", + "quota_used": 3000000000.0, + "quota_limit": 16106127360, + "quota_month": [ + 1000000000.0, + 2000000000.0 + ], + "quota_resets": 1796965639, + "quota_reset_day": "2026-12-11", + "bonus_gb": 5, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 240000000.0, + 540000000.0 + ], + "total": [ + 9000000000.0, + 9000000000.0 + ], + "online": 2, + "last_seen": 1794460009, + "devices": [ + { + "id": "a2", + "name": "iPhone!", + "kind": "phone", + "address": "10.9.0.3", + "disabled": false, + "created": 1700000200, + "created_by": "portal", + "online": true, + "handshake": 1794459639, + "endpoint": "2001:db8::1", + "active": true, + "month": [ + 60, + 180 + ], + "total": [ + 1, + 2 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 30, + 80 + ], + [ + 0, + 0 + ], + [ + 20, + 60 + ], + [ + 0, + 0 + ], + [ + 10, + 40 + ] + ], + "hostname": "iphone.anna.home.arpa", + "browser_key": true, + "config_stale": true, + "config_issued": 1794459139, + "lan_bypass": true, + "mtu": 1300, + "keepalive": 0, + "mtu_used": 1300, + "keepalive_used": 0, + "link": null, + "setup": { + "state": "flowing", + "since": 1794459639 + } + }, + { + "id": "a1", + "name": "iPhone", + "kind": "phone", + "address": "10.9.0.2", + "disabled": false, + "created": 1700000300, + "created_by": "admin", + "online": true, + "handshake": 1794460009, + "endpoint": "203.0.113.7", + "active": true, + "month": [ + 120000000.0, + 405000000.0 + ], + "total": [ + 5000000000.0, + 6000000000.0 + ], + "spark": [ + [ + 4000000.0, + 15000000.0 + ], + [ + 0, + 0 + ], + [ + 3000000.0, + 12000000.0 + ], + [ + 0, + 0 + ], + [ + 2000000.0, + 9000000.0 + ], + [ + 0, + 0 + ], + [ + 1000000.0, + 6000000.0 + ] + ], + "hostname": "iphone-2.anna.home.arpa", + "browser_key": false, + "config_stale": false, + "config_issued": 1794459539, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": { + "state": "flowing", + "since": 1794460009 + } + }, + { + "id": "a3", + "name": "Ноутбук", + "kind": "computer", + "address": "10.9.0.4", + "disabled": true, + "created": 1700000400, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "noutbuk.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + }, + { + "id": "a4", + "name": "!!!", + "kind": "router", + "address": "10.9.0.5", + "disabled": false, + "created": 1700000500, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": true, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "device.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": true, + "note": "A note", + "services": [ + ], + "home_nets": [ + ], + "circle": "family", + "created": 1700000000, + "code_set": 1700000100 + }, + "boris": { + "id": "boris", + "name": "Борис", + "server": "main", + "access": "lan", + "device_limit": 3, + "expires": "2099-01-01", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 3, + 5 + ], + "total": [ + 7, + 8 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "b1", + "name": "Телефон", + "kind": "tablet", + "address": "10.9.0.6", + "disabled": false, + "created": 1700000600, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "192.168.1.9", + "active": true, + "month": [ + 600, + 810 + ], + "total": [ + 7, + 8 + ], + "spark": [ + [ + 20, + 30 + ], + [ + 0, + 0 + ], + [ + 15, + 24 + ], + [ + 0, + 0 + ], + [ + 10, + 18 + ], + [ + 0, + 0 + ], + [ + 5, + 12 + ] + ], + "hostname": "telefon.boris.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": false, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + }, + "nobody": { + "id": "nobody", + "name": "Nobody", + "server": "gone", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "no_server", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "n1", + "name": "Lost", + "kind": "other", + "address": "10.99.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "lost.nobody.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": null, + "keepalive_used": null, + "link": null, + "setup": null + } + ], + "has_link": false, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + }, + "vera": { + "id": "vera", + "name": "Vera", + "server": "off", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": true, + "state": "server_off", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "v1", + "name": "Laptop", + "kind": "computer", + "address": "10.10.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "laptop.vera.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ], + "has_link": true, + "note": "", + "services": [ + ], + "home_nets": [ + ], + "circle": "", + "created": 0, + "code_set": 0 + } + }, + "own": { + "anna": { + "id": "anna", + "name": "Anna", + "server": "main", + "access": "both", + "device_limit": 5, + "expires": "", + "quota_gb": 10, + "quota_period": "month", + "quota_used": 3000000000.0, + "quota_limit": 16106127360, + "quota_month": [ + 1000000000.0, + 2000000000.0 + ], + "quota_resets": 1796965639, + "quota_reset_day": "2026-12-11", + "bonus_gb": 5, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 240000000.0, + 540000000.0 + ], + "total": [ + 9000000000.0, + 9000000000.0 + ], + "online": 2, + "last_seen": 1794460009, + "devices": [ + { + "id": "a2", + "name": "iPhone!", + "kind": "phone", + "address": "10.9.0.3", + "disabled": false, + "created": 1700000200, + "created_by": "portal", + "online": true, + "handshake": 1794459639, + "endpoint": "2001:db8::1", + "active": true, + "month": [ + 60, + 180 + ], + "total": [ + 1, + 2 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 30, + 80 + ], + [ + 0, + 0 + ], + [ + 20, + 60 + ], + [ + 0, + 0 + ], + [ + 10, + 40 + ] + ], + "hostname": "iphone.anna.home.arpa", + "browser_key": true, + "config_stale": true, + "config_issued": 1794459139, + "lan_bypass": true, + "mtu": 1300, + "keepalive": 0, + "mtu_used": 1300, + "keepalive_used": 0, + "link": null, + "setup": { + "state": "flowing", + "since": 1794459639 + } + }, + { + "id": "a1", + "name": "iPhone", + "kind": "phone", + "address": "10.9.0.2", + "disabled": false, + "created": 1700000300, + "created_by": "admin", + "online": true, + "handshake": 1794460009, + "endpoint": "203.0.113.7", + "active": true, + "month": [ + 120000000.0, + 405000000.0 + ], + "total": [ + 5000000000.0, + 6000000000.0 + ], + "spark": [ + [ + 4000000.0, + 15000000.0 + ], + [ + 0, + 0 + ], + [ + 3000000.0, + 12000000.0 + ], + [ + 0, + 0 + ], + [ + 2000000.0, + 9000000.0 + ], + [ + 0, + 0 + ], + [ + 1000000.0, + 6000000.0 + ] + ], + "hostname": "iphone-2.anna.home.arpa", + "browser_key": false, + "config_stale": false, + "config_issued": 1794459539, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": { + "state": "flowing", + "since": 1794460009 + } + }, + { + "id": "a3", + "name": "Ноутбук", + "kind": "computer", + "address": "10.9.0.4", + "disabled": true, + "created": 1700000400, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "noutbuk.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + }, + { + "id": "a4", + "name": "!!!", + "kind": "router", + "address": "10.9.0.5", + "disabled": false, + "created": 1700000500, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": true, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "device.anna.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + }, + "boris": { + "id": "boris", + "name": "Борис", + "server": "main", + "access": "lan", + "device_limit": 3, + "expires": "2099-01-01", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "active", + "month": [ + 3, + 5 + ], + "total": [ + 7, + 8 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "b1", + "name": "Телефон", + "kind": "tablet", + "address": "10.9.0.6", + "disabled": false, + "created": 1700000600, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "192.168.1.9", + "active": true, + "month": [ + 600, + 810 + ], + "total": [ + 7, + 8 + ], + "spark": [ + [ + 20, + 30 + ], + [ + 0, + 0 + ], + [ + 15, + 24 + ], + [ + 0, + 0 + ], + [ + 10, + 18 + ], + [ + 0, + 0 + ], + [ + 5, + 12 + ] + ], + "hostname": "telefon.boris.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1280, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + }, + "nobody": { + "id": "nobody", + "name": "Nobody", + "server": "gone", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": false, + "state": "no_server", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "n1", + "name": "Lost", + "kind": "other", + "address": "10.99.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "lost.nobody.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": null, + "keepalive_used": null, + "link": null, + "setup": null + } + ] + }, + "vera": { + "id": "vera", + "name": "Vera", + "server": "off", + "access": "internet", + "device_limit": 3, + "expires": "", + "quota_gb": 0, + "quota_period": "month", + "quota_used": 0, + "quota_limit": 0, + "quota_month": [ + 0, + 0 + ], + "quota_resets": 0, + "quota_reset_day": "", + "bonus_gb": 0, + "dns_mode": "device", + "paused": true, + "state": "server_off", + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "online": 0, + "last_seen": 0, + "devices": [ + { + "id": "v1", + "name": "Laptop", + "kind": "computer", + "address": "10.10.0.2", + "disabled": false, + "created": 0, + "created_by": "admin", + "online": false, + "handshake": 0, + "endpoint": "", + "active": false, + "month": [ + 0, + 0 + ], + "total": [ + 0, + 0 + ], + "spark": [ + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ], + [ + 0, + 0 + ] + ], + "hostname": "laptop.vera.home.arpa", + "browser_key": true, + "config_stale": false, + "config_issued": 0, + "lan_bypass": false, + "mtu": 0, + "keepalive": null, + "mtu_used": 1380, + "keepalive_used": 25, + "link": null, + "setup": null + } + ] + } + } + } +} diff --git a/backend/view/testdata/view.uci b/backend/view/testdata/view.uci new file mode 100644 index 0000000..0117742 --- /dev/null +++ b/backend/view/testdata/view.uci @@ -0,0 +1,105 @@ +# People and devices for testdata/trace.uc: names that give one label, a device set up again, one never +# handed out, one whose configuration changed since, a person with a limit month and extra data. +config settings 'settings' + option portal_enabled '1' + option portal_port '8443' + option portal_host 'vpn.example.com' + list portal_alt '203.0.113.9' + option hostnames '1' + option domain 'home.arpa' + +config server 'main' + option name 'Main' + option subnet '10.9.0.0/24' + option public_key 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' + option keepalive '25' + +config server 'off' + option subnet '10.10.0.0/24' + option enabled '0' + +config person 'anna' + option server 'main' + option name 'Anna' + option code 'kamiro-telosu-bavine' + option access 'both' + option device_limit '5' + option quota_gb '10' + option bonus_gb '5' + option bonus_until '4000000000' + option note 'A note' + option circle 'family' + option created '1700000000' + option code_set '1700000100' + list services 'nas' + list home_nets 'br-lan' + +config person 'boris' + option server 'main' + option name 'Борис' + option code 'short' + option access 'lan' + option expires '2099-01-01' + +config person 'vera' + option server 'off' + option name 'Vera' + option code 'telosu-kamiro-bavine' + option paused '1' + +config person 'nobody' + option server 'gone' + option name 'Nobody' + +config device 'a1' + option person 'anna' + option name 'iPhone' + option kind 'phone' + option address '10.9.0.2' + option public_key 'KEYA1' + option private_key 'priv' + option created '1700000300' +config device 'a2' + option person 'anna' + option name 'iPhone!' + option kind 'phone' + option address '10.9.0.3' + option public_key 'KEYA2' + option created '1700000200' + option created_by 'portal' + option mtu '1300' + option keepalive '0' + option lan_bypass '1' +config device 'a3' + option person 'anna' + option name 'Ноутбук' + option kind 'computer' + option address '10.9.0.4' + option public_key 'KEYA3' + option created '1700000400' + option disabled '1' +config device 'a4' + option person 'anna' + option name '!!!' + option kind 'router' + option address '10.9.0.5' + option public_key 'KEYA4' + option created '1700000500' +config device 'b1' + option person 'boris' + option name 'Телефон' + option kind 'tablet' + option address '10.9.0.6' + option public_key 'KEYB1' + option created '1700000600' +config device 'v1' + option person 'vera' + option name 'Laptop' + option kind 'computer' + option address '10.10.0.2' + option public_key 'KEYV1' +config device 'n1' + option person 'nobody' + option name 'Lost' + option address '10.99.0.2' + option public_key 'KEYN1' diff --git a/backend/view/view.go b/backend/view/view.go new file mode 100644 index 0000000..01614f5 --- /dev/null +++ b/backend/view/view.go @@ -0,0 +1,741 @@ +// Package view is a person and their devices as the pages show them: the settings joined with what the +// tunnels say now, the counters and what was handed out. As dawnline.view makes them (device_view, +// person_view), field for field: the admin's status and the person's own page are both made of these. +// +// Pure: everything it reads comes in the World; the moment is the World's too. +package view + +import ( + "regexp" + "sort" + "strings" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/handout" + "github.com/tickcount/luci-app-dawnline/backend/ipnet" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/state" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +// Issued is what a device was last given: its configuration's fingerprint, and when. +type Issued struct { + FP string `json:"fp"` + TS float64 `json:"ts"` +} + +// World is everything a view is made from. +type World struct { + M *model.Model + Usage *usage.Usage + // Peers is what the tunnels say, by public key; Reads how each tunnel's read went (awg.Read, awg.Failed). + Peers map[string]awg.Peer + Reads map[string]string + // Online is the watcher's word on who is online; nil without a watcher (a recent handshake decides then, + // within Windows[id] seconds, 190 by default). + Online map[string]bool + Windows map[string]int64 + // Link is each device's link trouble; Setup what its link does right now (nil: no watcher tells). + Link map[string]any + Setup map[string]any + // Issued is what each device was last given; Reconnect when each was set up again. + Issued map[string]Issued + Reconnect map[string]float64 + // Home is the home networks a person reaches on their server (the router's own; nil: none). + Home func(srv *model.Server, p *model.Person) []string + // Now is the moment (unix seconds). + Now int64 +} + +// Device is a device as the pages show it. +type Device struct { + ID string `json:"id"` + Name string `json:"name"` + Kind string `json:"kind"` + Address string `json:"address"` + Disabled bool `json:"disabled"` + Created int `json:"created"` + CreatedBy string `json:"created_by"` + Online bool `json:"online"` + Handshake int64 `json:"handshake"` + Endpoint string `json:"endpoint"` + Active bool `json:"active"` + Month usage.Pair `json:"month"` + Total usage.Pair `json:"total"` + Spark []usage.Pair `json:"spark"` + Hostname string `json:"hostname"` + BrowserKey bool `json:"browser_key"` + ConfigStale bool `json:"config_stale"` + ConfigIssued float64 `json:"config_issued"` + LanBypass bool `json:"lan_bypass"` + MTU int `json:"mtu"` + Keepalive *int `json:"keepalive"` + MTUUsed *int `json:"mtu_used"` + KeepaliveUsed *int `json:"keepalive_used"` + Link any `json:"link"` + Setup any `json:"setup"` + // Behind is the networks behind a router, as the settings have them; then what its owner asked for on + // their own page and how it stands (model.Device has each). + Behind []string `json:"behind,omitempty"` + Waiting bool `json:"waiting,omitempty"` + Ask []string `json:"ask,omitempty"` + Asked int `json:"asked,omitempty"` + Declined string `json:"declined,omitempty"` + DeclinedNets []string `json:"declined_nets,omitempty"` +} + +// Person is a person as the pages show them. The fields from HasLink on are the admin's only. +type Person struct { + ID string `json:"id"` + Name string `json:"name"` + Server string `json:"server"` + Access string `json:"access"` + DeviceLimit int `json:"device_limit"` + Expires string `json:"expires"` + QuotaGB float64 `json:"quota_gb"` + QuotaPeriod string `json:"quota_period"` + QuotaUsed float64 `json:"quota_used"` + QuotaLimit float64 `json:"quota_limit"` + QuotaMonth usage.Pair `json:"quota_month"` + QuotaResets int64 `json:"quota_resets"` + QuotaResetDay string `json:"quota_reset_day"` + BonusGB float64 `json:"bonus_gb"` + DNSMode string `json:"dns_mode"` + Paused bool `json:"paused"` + State string `json:"state"` + Month usage.Pair `json:"month"` + Total usage.Pair `json:"total"` + Online int `json:"online"` + LastSeen int64 `json:"last_seen"` + Devices []Device `json:"devices"` + + HasLink *bool `json:"has_link,omitempty"` + Note *string `json:"note,omitempty"` + Services *[]string `json:"services,omitempty"` + HomeNets *[]string `json:"home_nets,omitempty"` + Circle *string `json:"circle,omitempty"` + Created *int `json:"created,omitempty"` + CodeSet *int `json:"code_set,omitempty"` +} + +func dayKey(ts int64) string { return time.Unix(ts, 0).In(zone.Local()).Format("2006-01-02") } + +// dayAgo is the day `days` before ts, counted from local noon, so a 23- or 25-hour day around a change of +// the clocks neither skips nor repeats a day. +func dayAgo(days int, ts int64) string { + t := time.Unix(ts, 0).In(zone.Local()) + noon := time.Date(t.Year(), t.Month(), t.Day(), 12, 0, 0, 0, zone.Local()).Unix() + return dayKey(noon - int64(days)*86400) +} + +// recent is [rx, tx] of the last `days` days, today included. +func recent(rec *usage.Record, days int, ts int64) usage.Pair { + var out usage.Pair + if rec == nil { + return out + } + for i := 0; i < days; i++ { + if v, ok := rec.Days[dayAgo(i, ts)]; ok { + out[0] += v[0] + out[1] += v[1] + } + } + return out +} + +// Spark is each day's [rx, tx] for the last n days, oldest first. +func Spark(rec *usage.Record, n int, ts int64) []usage.Pair { + out := make([]usage.Pair, 0, n) + for i := n - 1; i >= 0; i-- { + var v usage.Pair + if rec != nil { + v = rec.Days[dayAgo(i, ts)] + } + out = append(out, v) + } + return out +} + +var notLabel = regexp.MustCompile(`[^a-z0-9]+`) + +// HostLabel is a device's name as a DNS label ("Galaxy S24" → "galaxy-s24"): at most 40 characters, +// "device" when nothing is left. +func HostLabel(name string) string { + l := notLabel.ReplaceAllString(strings.ToLower(handout.Translit(name)), "-") + l = strings.Trim(l, "-") + if len(l) > 40 { + l = l[:40] + } + l = strings.TrimRight(l, "-") + if l == "" { + return "device" + } + return l +} + +// Labels is the DNS labels of a person's devices, unique within the person: two devices whose names give +// one label get -2, -3 by age. +func Labels(m *model.Model, p *model.Person) map[string]string { + devs := make([]*model.Device, 0, len(p.Devices)) + for _, id := range p.Devices { + if d := m.Devices[id]; d != nil { + devs = append(devs, d) + } + } + sort.SliceStable(devs, func(i, j int) bool { + if devs[i].Created != devs[j].Created { + return devs[i].Created < devs[j].Created + } + return devs[i].ID < devs[j].ID + }) + out, used := map[string]string{}, map[string]bool{} + for _, d := range devs { + base := HostLabel(d.Name) + l := base + for n := 2; used[l]; n++ { + b := base + if len(b) > 37 { + b = b[:37] + } + l = b + "-" + itoa(n) + } + used[l] = true + out[d.ID] = l + } + return out +} + +func itoa(n int) string { + if n < 10 { + return string(rune('0' + n)) + } + return itoa(n/10) + string(rune('0'+n%10)) +} + +var code = regexp.MustCompile(`^[a-z]{6}-[a-z]{6}-[a-z]{6}$`) + +// PortalHosts is every address of the portal, the main one first. +func PortalHosts(m *model.Model) []string { + var out []string + for _, h := range append([]string{m.Settings.PortalHost}, m.Settings.PortalAlt...) { + dup := false + for _, o := range out { + dup = dup || o == h + } + if h != "" && !dup { + out = append(out, h) + } + } + return out +} + +// PortalLink is a person's link on one address: https for names, plain http for IP addresses; "" when the +// page would not answer (no portal, no server, no code). +func PortalLink(m *model.Model, p *model.Person, host string) string { + if !m.Settings.PortalEnabled || host == "" || m.Servers[p.Server] == nil || !code.MatchString(p.Code) { + return "" + } + port := func(n, std int) string { + if n == std { + return "" + } + return ":" + itoa(n) + } + if _, ip := ipnet.IP(host); ip { + return "http://" + host + port(m.Settings.PortalPort+1, 80) + "/" + p.Code + } + h := host + if strings.Contains(h, ":") && !strings.HasPrefix(h, "[") { + h = "[" + h + "]" + } + return "https://" + h + port(m.Settings.PortalPort, 443) + "/" + p.Code +} + +var endpoint = regexp.MustCompile(`^\[?([^\]]+)\]?:[0-9]+$`) + +func endpointIP(ep string) string { + if m := endpoint.FindStringSubmatch(ep); m != nil { + return m[1] + } + return ep +} + +// DeviceOf is one device's view. labels is its person's (Labels), worked out once for all their devices. +func (w *World) DeviceOf(d *model.Device, labels map[string]string) Device { + m := w.M + var u *usage.Record + if w.Usage != nil { + u = w.Usage.Devices[d.ID] + } + peer, has := w.Peers[d.PublicKey] + p := m.People[d.Person] + var srv *model.Server + if p != nil { + srv = m.Servers[p.Server] + } + // Set up again (Reconnect): a handshake from before it does not count. + hs := peer.Handshake + if hs == 0 && u != nil { + hs = int64(u.Handshake) + } + if since := w.Reconnect[d.ID]; since != 0 && float64(hs) <= since { + hs = 0 + } + online := false + if hs > 0 && has { + if w.Online != nil { + online = w.Online[d.ID] + } else { + window := int64(model.OnlineWindow) + if v, ok := w.Windows[d.ID]; ok { + window = v + } + online = peer.Handshake > 0 && w.Now-peer.Handshake < window + } + } + v := Device{ + ID: d.ID, Name: d.Name, Kind: d.Kind, Address: d.Address, Disabled: d.Disabled, Created: d.Created, CreatedBy: d.CreatedBy, + Online: online, Handshake: hs, Active: has, + Month: recent(u, 30, w.Now), Spark: Spark(u, 7, w.Now), + BrowserKey: d.PrivateKey == "", LanBypass: d.LanBypass, MTU: d.MTU, Keepalive: d.Keepalive, Behind: d.Behind, + Waiting: d.Waiting, Ask: d.Ask, Asked: d.Asked, Declined: d.Declined, DeclinedNets: d.DeclinedNets, + } + if ep := endpointIP(peer.Endpoint); ep != "" { + v.Endpoint = ep + } else if u != nil && u.Endpoint != nil { + v.Endpoint = *u.Endpoint + } + if u != nil && u.Total != nil { + v.Total = *u.Total + } + // The same label /tmp/hosts carries, so what is shown resolves. + if m.Settings.Hostnames && p != nil { + l := labels[d.ID] + if l == "" { + l = "device" + } + v.Hostname = l + "." + p.ID + "." + m.Settings.Domain + } + if was, ok := w.Issued[d.ID]; ok { + var home []string + if w.Home != nil && srv != nil { + home = w.Home(srv, p) + } + // Its configuration changed since it was last shown or downloaded. + v.ConfigStale = was.FP != handout.Fingerprint(m, d, home) + v.ConfigIssued = was.TS + } + if srv != nil { + mtu, ka := model.DeviceMTU(srv, d), model.DeviceKeepalive(srv, d) + v.MTUUsed, v.KeepaliveUsed = &mtu, &ka + } + if l, ok := w.Link[d.ID]; ok { + v.Link = l + } + // Without a watcher nobody tells data from a bare handshake: a session that lives counts as flowing. + if w.Setup != nil { + if s, ok := w.Setup[d.ID]; ok { + v.Setup = s + } + } else if online { + v.Setup = map[string]any{"state": "flowing", "since": hs} + } + return v +} + +// PersonOf is one person's view with their devices, oldest first. admin adds what only the admin sees. +func (w *World) PersonOf(p *model.Person, admin bool) Person { + m := w.M + var u *usage.Record + if w.Usage != nil { + u = w.Usage.People[p.ID] + } + labels := Labels(m, p) + devs := make([]Device, 0, len(p.Devices)) + for _, id := range p.Devices { + if d := m.Devices[id]; d != nil { + devs = append(devs, w.DeviceOf(d, labels)) + } + } + sort.SliceStable(devs, func(i, j int) bool { return devs[i].Created < devs[j].Created }) + v := Person{ + ID: p.ID, Name: p.Name, Server: p.Server, Access: p.Access, DeviceLimit: p.DeviceLimit, Expires: p.Expires, + QuotaGB: p.QuotaGB, QuotaPeriod: p.QuotaPeriod, + QuotaUsed: state.Usage(p, w.Usage, w.Now), QuotaLimit: state.QuotaBytes(p, w.Now), + DNSMode: p.DNSMode, Paused: p.Paused, State: state.Of(m, p, w.Usage, w.Now), + Month: recent(u, 30, w.Now), Devices: devs, + } + // Their limit month: what it has counted, and when it ends (0: none runs). + if lm := usage.LimitMonth(u, w.Now); lm != nil { + end := usage.MonthAfter(int64(lm.Start)) + v.QuotaMonth, v.QuotaResets, v.QuotaResetDay = usage.Pair{lm.Rx, lm.Tx}, end, dayKey(end) + } + if p.BonusGB > 0 && w.Now < int64(p.BonusUntil) { + v.BonusGB = p.BonusGB + } + if u != nil && u.Total != nil { + v.Total = *u.Total + } + for _, d := range devs { + if d.Online { + v.Online++ + } + if d.Handshake > v.LastSeen { + v.LastSeen = d.Handshake + } + } + if admin { + // The code and the links themselves are another call's (admins only). + hosts := PortalHosts(m) + link := len(hosts) > 0 && PortalLink(m, p, hosts[0]) != "" + services, nets := p.Services, p.HomeNets + v.HasLink, v.Note, v.Services, v.HomeNets, v.Circle, v.Created, v.CodeSet = &link, &p.Note, &services, &nets, &p.Circle, &p.Created, &p.CodeSet + } + return v +} + +// Day is one day of traffic. +type Day struct { + Day string `json:"day"` + Rx float64 `json:"rx"` + Tx float64 `json:"tx"` +} + +// Series is the daily traffic of these records for the last `days` days, oldest first. +func Series(recs []*usage.Record, days int, ts int64) []Day { + out := make([]Day, 0, days) + for i := days - 1; i >= 0; i-- { + d := Day{Day: dayAgo(i, ts)} + for _, r := range recs { + if r == nil { + continue + } + if v, ok := r.Days[d.Day]; ok { + d.Rx += v[0] + d.Tx += v[1] + } + } + out = append(out, d) + } + return out +} + +// LastHours is the last 24 hours of router-wide traffic by the hour, oldest first, the hour of ts last. +func LastHours(hours map[string]usage.Pair, ts int64) []usage.Pair { + out := make([]usage.Pair, 0, 24) + for i := 23; i >= 0; i-- { + out = append(out, hours[time.Unix(ts-int64(i)*3600, 0).In(zone.Local()).Format("2006-01-02 15")]) + } + return out +} + +// Totals is the router's sums: its people and devices, who is online, today's and the month's traffic. +type Totals struct { + People int `json:"people"` + Devices int `json:"devices"` + Online int `json:"online"` + Active int `json:"active"` + Today usage.Pair `json:"today"` + Month usage.Pair `json:"month"` +} + +// TotalsOf sums up the people's views and the people's counters. +func (w *World) TotalsOf(people []Person) Totals { + t := Totals{People: len(people)} + for _, p := range people { + t.Devices += len(p.Devices) + t.Online += p.Online + if p.State == state.Active { + t.Active++ + } + } + if w.Usage != nil { + today := dayAgo(0, w.Now) + for _, r := range w.Usage.People { + if r == nil { + continue + } + if v, ok := r.Days[today]; ok { + t.Today[0] += v[0] + t.Today[1] += v[1] + } + m := recent(r, 30, w.Now) + t.Month[0] += m[0] + t.Month[1] += m[1] + } + } + return t +} + +// Server is what of a server's view follows from the settings, the tunnels and the counters alone. What +// the router itself must be asked (whether its interface is up, why it is kept down) is not here yet. +type Server struct { + ID string `json:"id"` + Name string `json:"name"` + Ifname string `json:"ifname"` + Port int `json:"port"` + Subnet string `json:"subnet"` + Endpoint string `json:"endpoint"` + PublicKey string `json:"public_key"` + Enabled bool `json:"enabled"` + LanLike bool `json:"lan_like"` + DeviceMesh bool `json:"device_mesh"` + Mesh string `json:"mesh"` + // PortalRouters and PortalNets are what people may do about routers on their own pages. + PortalRouters string `json:"portal_routers"` + PortalNets string `json:"portal_nets"` + Preset string `json:"preset"` + MTU int `json:"mtu"` + Keepalive int `json:"keepalive"` + DNS []string `json:"dns"` + MTUs map[string]int `json:"mtus"` + Address *string `json:"address"` + Peers int `json:"peers"` + Online int `json:"online"` + HPK bool `json:"hpk"` + Series []Day `json:"series"` + // Reached is the newest handshake from a public address that is not the router's own: proof that the + // port is reachable from the internet. Up and Uptime are its interface's, as netifd says. + Reached float64 `json:"reached"` + Up bool `json:"up"` + Uptime int64 `json:"uptime"` + Home []HomeNet `json:"home"` + Obf map[string]string `json:"obf"` +} + +// HomeNet is one interface of a server's home network, for the per-person picker. +type HomeNet struct { + Dev string `json:"dev"` + Nets []string `json:"nets"` +} + +// Router is what a server's view asks of the router itself. +type Router struct { + // Own is the router's own addresses; Iface a netifd interface's state; Homes a server's home interfaces. + Own map[string]bool + Iface func(ifname string) (up bool, uptime int64) + Homes func(srv *model.Server) []HomeNet +} + +// ServerOf is a server's view, all but why it is kept down (a sentence in the reader's language) and its +// last minutes of speed (the agent's file); `days` is how long its chart is. Without a Router, what the +// router must be asked is left empty. +func (w *World) ServerOf(srv *model.Server, days int, r *Router) Server { + m := w.M + ids := map[string]string{} + for id, d := range m.Devices { + ids[d.PublicKey] = id + } + v := Server{ + ID: srv.ID, Name: srv.Name, Ifname: srv.Ifname, Port: srv.Port, Subnet: srv.Subnet, Endpoint: m.EndpointHost(srv), + PublicKey: srv.PublicKey, Enabled: srv.Enabled, LanLike: srv.LanLike, DeviceMesh: srv.DeviceMesh, Mesh: srv.Mesh, + PortalRouters: srv.PortalRouters, PortalNets: srv.PortalNets, + Preset: srv.Preset, MTU: srv.MTU, Keepalive: srv.Keepalive, DNS: srv.DNS, + MTUs: map[string]int{ + "computer": model.DeviceMTU(srv, &model.Device{Kind: "computer"}), + "phone": model.DeviceMTU(srv, &model.Device{Kind: "phone"}), + }, + HPK: srv.Obf["header_protection_key"] != "", + } + if a := model.ServerAddress(srv); a != "" { + v.Address = &a + } + if t, ok := model.TunnelOf(srv); ok { + for key, p := range w.Peers { + if p.Ifname != t.Ifname { + continue + } + v.Peers++ + id := ids[key] + if w.Online != nil { + if w.Online[id] { + v.Online++ + } + } else if p.Handshake > 0 { + window := int64(model.OnlineWindow) + if x, ok := w.Windows[id]; ok { + window = x + } + if w.Now-p.Handshake < window { + v.Online++ + } + } + } + } + var recs []*usage.Record + if w.Usage != nil { + for id, p := range m.People { + if p.Server == srv.ID { + recs = append(recs, w.Usage.People[id]) + } + } + } + v.Series = Series(recs, days, w.Now) + v.Obf = map[string]string{} + for k, x := range srv.Obf { + // the header protection key is a secret every device shares: only whether there is one is told + if k != "header_protection_key" { + v.Obf[k] = x + } + } + v.Home = []HomeNet{} + if r == nil { + return v + } + if srv.PrivateKey != "" && r.Iface != nil { + v.Up, v.Uptime = r.Iface(srv.Ifname) + } + if r.Homes != nil { + if h := r.Homes(srv); h != nil { + v.Home = h + } + } + if w.Usage != nil { + for id, d := range m.Devices { + if p := m.People[d.Person]; p == nil || p.Server != srv.ID || w.Usage.Devices[id] == nil { + continue + } + for ip, ts := range w.Usage.Devices[id].IPs { + if IsPublic(ip) && !r.Own[ip] && ts > v.Reached { + v.Reached = ts + } + } + } + } + return v +} + +// Place is where an address is, as the places' cache holds it. +type Place struct { + Lat *float64 `json:"lat"` + Lon *float64 `json:"lon"` + City string `json:"city"` + Country string `json:"country"` + CC string `json:"cc"` + ASN float64 `json:"asn"` + Org string `json:"org"` + Fail any `json:"fail,omitempty"` +} + +// PlaceCache is the places' cache (geo.json). +type PlaceCache struct { + IPs map[string]*Place `json:"ips"` + Home *Place `json:"home"` +} + +// Point is one address a device was seen from, on the map. +type Point struct { + Person string `json:"person"` + Device string `json:"device"` + IP string `json:"ip"` + TS float64 `json:"ts"` + Online bool `json:"online"` + Lat *float64 `json:"lat"` + Lon *float64 `json:"lon"` + City string `json:"city"` + Country string `json:"country"` + CC string `json:"cc"` + ASN float64 `json:"asn"` + Org string `json:"org"` +} + +// Places is the map's data: the router's own place and a point for each address a device was seen from. +type Places struct { + Enabled bool `json:"enabled"` + Provider *string `json:"provider,omitempty"` + Cached *int `json:"cached,omitempty"` + Home *HomePlace `json:"home"` + Points []Point `json:"points"` +} + +// HomePlace is where the router itself is. +type HomePlace struct { + Lat *float64 `json:"lat"` + Lon *float64 `json:"lon"` + City string `json:"city"` + Country string `json:"country"` + CC string `json:"cc"` + ASN float64 `json:"asn"` + Org string `json:"org"` +} + +var private4 = []string{"0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.168.0.0/16", "198.18.0.0/15", "224.0.0.0/3"} +var ( + hex6 = regexp.MustCompile(`^[0-9a-f:]+$`) + private6 = regexp.MustCompile(`^(fe[89ab]|f[cd]|::1$|::$)`) +) + +// IsPublic tells whether a geolocation service can say something about an address. +func IsPublic(ip string) bool { + if ip == "" { + return false + } + if n, ok := ipnet.IP(ip); ok { + for _, r := range private4 { + if net, _ := ipnet.Any(r); net.Holds(n) { + return false + } + } + return true + } + l := strings.ToLower(ip) + return hex6.MatchString(l) && !private6.MatchString(l) +} + +// PlacesOf is the map's data. own is the router's own public addresses: a device at home that reaches the +// server through one (NAT loopback) shows up from there, and home is not a place people connect from. +// The points stand in the devices' order, a device's newest address first. +func (w *World) PlacesOf(cache *PlaceCache, own map[string]bool) Places { + m := w.M + if !m.Settings.GeoEnabled { + return Places{Points: []Point{}} + } + if cache == nil { + cache = &PlaceCache{} + } + points := []Point{} + for _, id := range m.DeviceIDs() { + d := m.Devices[id] + if w.Usage == nil || w.Usage.Devices[id] == nil { + continue + } + peer, has := w.Peers[d.PublicKey] + cur := endpointIP(peer.Endpoint) + online := false + if has { + if w.Online != nil { + online = w.Online[id] + } else { + window := int64(model.OnlineWindow) + if x, ok := w.Windows[id]; ok { + window = x + } + online = peer.Handshake > 0 && w.Now-peer.Handshake < window + } + } + var mine []Point + for ip, ts := range w.Usage.Devices[id].IPs { + pl := cache.IPs[ip] + if !IsPublic(ip) || own[ip] || pl == nil || (pl.Fail != nil && pl.Fail != false && pl.Fail != float64(0)) { + continue + } + mine = append(mine, Point{Person: d.Person, Device: id, IP: ip, TS: ts, Online: online && ip == cur, + Lat: pl.Lat, Lon: pl.Lon, City: pl.City, Country: pl.Country, CC: pl.CC, ASN: pl.ASN, Org: pl.Org}) + } + sort.Slice(mine, func(i, j int) bool { + if mine[i].TS != mine[j].TS { + return mine[i].TS > mine[j].TS + } + return mine[i].IP < mine[j].IP + }) + points = append(points, mine...) + } + provider, cached := m.Settings.GeoProvider, len(cache.IPs) + v := Places{Enabled: true, Provider: &provider, Cached: &cached, Points: points} + if h := cache.Home; h != nil && h.Lat != nil { + v.Home = &HomePlace{Lat: h.Lat, Lon: h.Lon, City: h.City, Country: h.Country, CC: h.CC, ASN: h.ASN, Org: h.Org} + } + return v +} diff --git a/backend/view/view_test.go b/backend/view/view_test.go new file mode 100644 index 0000000..51d5733 --- /dev/null +++ b/backend/view/view_test.go @@ -0,0 +1,117 @@ +package view + +import ( + "encoding/json" + "os" + "reflect" + "sort" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +func plain(v any) any { + raw, _ := json.Marshal(v) + var out any + json.Unmarshal(raw, &out) + return out +} + +// where the two differ, by path +func differ(path string, got, want any, out *[]string) { + g, gok := got.(map[string]any) + w, wok := want.(map[string]any) + if gok && wok { + keys := map[string]bool{} + for k := range g { + keys[k] = true + } + for k := range w { + keys[k] = true + } + names := make([]string, 0, len(keys)) + for k := range keys { + names = append(names, k) + } + sort.Strings(names) + for _, k := range names { + differ(path+"."+k, g[k], w[k], out) + } + return + } + ga, gok := got.([]any) + wa, wok := want.([]any) + if gok && wok && len(ga) == len(wa) { + for i := range ga { + differ(path+"["+string(rune('0'+i%10))+"]", ga[i], wa[i], out) + } + return + } + if !reflect.DeepEqual(got, want) { + g, _ := json.Marshal(got) + w, _ := json.Marshal(want) + *out = append(*out, path+": "+string(g)+", ucode has "+string(w)) + } +} + +// Every person of testdata/view.uci is shown as ucode shows them, to the admin and to themselves, with a +// watcher's word on who is online and without one (scripts/ucode-golden.sh writes trace.json from dawnline.view). +func TestHeldToUcode(t *testing.T) { + zone.Set(time.UTC) + text, err := os.ReadFile("testdata/view.uci") + if err != nil { + t.Fatal(err) + } + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + raw, err := os.ReadFile("testdata/trace.json") + if err != nil { + t.Fatal(err) + } + var golden struct { + TS int64 `json:"ts"` + Usage *usage.Usage `json:"usage"` + Peers map[string]awg.Peer `json:"peers"` + Issued map[string]Issued `json:"issued"` + Reconnect map[string]float64 `json:"reconnect"` + Watched map[string]map[string]any `json:"watched"` + Alone map[string]map[string]any `json:"alone"` + } + if err := json.Unmarshal(raw, &golden); err != nil { + t.Fatal(err) + } + base := World{M: m, Usage: golden.Usage, Peers: golden.Peers, Issued: golden.Issued, Reconnect: golden.Reconnect, Now: golden.TS} + watched := base + watched.Online = map[string]bool{"a1": true, "a2": false, "b1": true} + watched.Link = map[string]any{"a2": map[string]any{"state": "knocking", "since": float64(golden.TS - 60)}} + watched.Setup = map[string]any{"a1": map[string]any{"state": "flowing", "since": float64(golden.TS - 30)}} + alone := base + alone.Windows = map[string]int64{"a2": 600} + var diffs []string + for name, run := range map[string]struct { + w World + want map[string]map[string]any + }{"watched": {watched, golden.Watched}, "alone": {alone, golden.Alone}} { + if len(run.want["admin"]) != len(m.People) { + t.Fatalf("%s: ucode shows %d people, the model has %d", name, len(run.want["admin"]), len(m.People)) + } + for id, p := range m.People { + differ(name+".admin."+id, plain(run.w.PersonOf(p, true)), run.want["admin"][id], &diffs) + differ(name+".own."+id, plain(run.w.PersonOf(p, false)), run.want["own"][id], &diffs) + } + } + sort.Strings(diffs) + for i, d := range diffs { + if i < 40 { + t.Error(d) + } + } +} diff --git a/backend/watch/watch.go b/backend/watch/watch.go new file mode 100644 index 0000000..ca5eac5 --- /dev/null +++ b/backend/watch/watch.go @@ -0,0 +1,664 @@ +// Package watch is the watcher: every second it looks at the tunnels and, the moment a device connects, +// leaves, moves or its link fails in a named way, logs it, folds the counters and tells the pages. It is +// the agent's watcher (libexec/agent watch() and what its tick did for the counters) in Go, with the same +// outcome on disk, because the ucode that still runs reads it there: +// +// presence.json who is online, each device's last address, and the revisions pages and the portal follow +// link.json a device's link trouble once it held; setup.json what its link does right now +// usage.json the counters (tmpfs; flash hourly and on a stop) +// meter.json the live meter's points, while someone asked for them (meter.want) +// events.json the activity log, under the `events` lock +// backend.beat this watcher runs: the agent's own watcher stands by while it is fresh +// +// and as topics of the stream: `presence`, `link`, `meter`. +// +// What the agent keeps: its minute tick (access rules, the home path, the watchdog, backups, updates) and +// the places' lookups. It asks for a revision's move by writing presence.poke (the people it concerns), +// and is asked to locate the addresses that just connected by geo.poke. +// +// One goroutine does everything, one look after another. +package watch + +import ( + "context" + "encoding/json" + "fmt" + "os" + "regexp" + "strings" + "sync" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/hub" + "github.com/tickcount/luci-app-dawnline/backend/journal" + "github.com/tickcount/luci-app-dawnline/backend/link" + "github.com/tickcount/luci-app-dawnline/backend/meter" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/presence" + "github.com/tickcount/luci-app-dawnline/backend/uci" + "github.com/tickcount/luci-app-dawnline/backend/usage" + "github.com/tickcount/luci-app-dawnline/backend/view" + "github.com/tickcount/luci-app-dawnline/backend/zone" +) + +const ( + // The counters are folded this often when nothing happens, and put on flash this often (seconds). + collectEvery = 60 + flushEvery = 3600 + // The meter is written for this long after it was last asked for (dawnline.meter WANT_FOR). + meterWantFor = 10 + // A link that keeps failing and coming back is one line of the log within this long. + failingWindow = 3600 +) + +// Wants tells whether a page shows a topic now (api.Audience). +type Wants interface { + Wants(topic string) bool +} + +// Watcher is the router's watcher. +type Watcher struct { + // Config is the settings file; RunDir and DataDir the state directories (tmpfs and flash); DHCP the router's + // DHCP settings and Leases its leases, for the names of addresses at home. + Config, RunDir, DataDir string + DHCP, Leases string + // Zone is the file that holds the router's time zone (package zone); empty: the zone is left as it is. + Zone string + Tunnels awg.Reader + Hub *hub.Hub + Audience Wants + Log func(format string, args ...any) + // Changed is called when a look found something to tell (someone came, left or moved, a link's state). + Changed func() + // Now and Mono are the clocks (a test's own): the router's time, and seconds that only go forward. + Now func() time.Time + Mono func() float64 + + mu sync.Mutex + peers map[string]awg.Peer + reads map[string]string + m *model.Model + sig string + zone string + ka map[string]int64 + pres *presence.Watcher + // The revision pages follow, and each person's. + rev int64 + personRev map[string]int64 + links map[string]*link.History + // Whether what link.json and setup.json show changed since they were written. + linkDirty, setupDirty bool + touched map[string]bool + failing []journal.Event + + usage *usage.Usage + lastCollect int64 + lastFlush int64 + + prev *meter.Sample + ring []meter.Point + meterOut bool + // meterTold: the stream has the points kept so far. + meterTold bool +} + +// World is what a view of people and devices is made from, as the watcher knows it at this moment +// (package view): the settings, the counters, the tunnels' last word, who is online and how their links do. +// What the watcher does not hold (what was handed out, the home networks) is the caller's to add. nil +// before the first look. +func (w *Watcher) World() *view.World { + w.mu.Lock() + defer w.mu.Unlock() + if w.m == nil { + return nil + } + online := map[string]bool{} + for id, on := range w.pres.Online { + online[id] = on + } + shown, setup := map[string]any{}, map[string]any{} + for id, s := range link.ShownOf(w.links) { + shown[id] = map[string]any{"state": s.State, "since": s.Since} + } + for id, s := range link.SetupsOf(w.links) { + setup[id] = map[string]any{"state": s.State, "since": s.Since} + } + raw, _ := json.Marshal(w.usage) + u := usage.Empty() + json.Unmarshal(raw, u) + return &view.World{M: w.m, Usage: u, Peers: w.peers, Reads: w.reads, Online: online, Link: shown, Setup: setup, Now: w.Now().Unix()} +} + +// Run watches until ctx ends, then saves what it holds. +func (w *Watcher) Run(ctx context.Context) { + w.Start() + tick := time.NewTicker(time.Second) + defer tick.Stop() + for { + select { + case <-ctx.Done(): + w.Stop() + return + case <-tick.C: + w.Look() + } + } +} + +// Start takes up where the last watcher (this one's earlier run, or the agent's) left: who was online, the +// revisions, the counters. What a link showed comes from the watcher's memory, which starts empty: a state +// shows again once it held, a set-up state with the next read that tells it. +func (w *Watcher) Start() { + w.mu.Lock() + defer w.mu.Unlock() + if w.Now == nil { + w.Now = time.Now + } + if w.Mono == nil { + began := time.Now() + w.Mono = func() float64 { return time.Since(began).Seconds() } + } + if w.Log == nil { + w.Log = func(string, ...any) {} + } + os.MkdirAll(w.RunDir, 0o755) + var kept struct { + Online map[string]bool `json:"online"` + Endpoint map[string]string `json:"endpoint"` + Rev int64 `json:"rev"` + People map[string]int64 `json:"people"` + } + files.ReadJSON(w.RunDir+"/presence.json", &kept) + w.pres = presence.New(kept.Online, kept.Endpoint) + w.rev, w.personRev = kept.Rev, kept.People + if w.personRev == nil { + w.personRev = map[string]int64{} + } + w.links = map[string]*link.History{} + files.WriteJSON(w.RunDir+"/link.json", map[string]any{}, 0o600) + files.WriteJSON(w.RunDir+"/setup.json", map[string]any{}, 0o600) + os.Remove(w.RunDir + "/meter.json") + w.usage = usage.Load(w.RunDir, w.DataDir, false) + now := w.Now().Unix() + w.lastCollect, w.lastFlush = now, now +} + +// Stop saves the counters to flash and takes the meter's file and the beat away: a stopped watcher's +// points are no speed now, and the agent's watcher takes over at once. +func (w *Watcher) Stop() { + now := w.Now().Unix() + if w.m != nil { + usage.Collect(w.m, w.usage, w.Tunnels.Dump(w.m.TunnelIfnames()), now) + } + if err := usage.Save(w.usage, w.RunDir, w.DataDir, true, now); err != nil { + w.Log("watch: the counters were not saved: %v", err) + } + os.Remove(w.RunDir + "/meter.json") + os.Remove(w.RunDir + "/backend.beat") +} + +// timeZone takes the router's zone again when its file changed (the admin set another): the days and +// hours counted from then on are that zone's. +func (w *Watcher) timeZone() { + if w.Zone == "" { + return + } + sig := "-" + if st, err := os.Stat(w.Zone); err == nil { + sig = fmt.Sprintf("%d/%d", st.ModTime().UnixNano(), st.Size()) + } + if sig == w.zone { + return + } + w.zone = sig + if zone.Load(w.Zone) { + w.Log("watch: the router's time zone is %s", zone.Local()) + } +} + +// load reads the settings again when their file, or which servers are kept down, changed. +func (w *Watcher) load() bool { + sig := "" + for _, p := range []string{w.Config, w.RunDir + "/netifd-blocked.json"} { + if st, err := os.Stat(p); err == nil { + sig += fmt.Sprintf("%d/%d;", st.ModTime().UnixNano(), st.Size()) + } else { + sig += "-;" + } + } + if w.m != nil && sig == w.sig { + return true + } + text, err := os.ReadFile(w.Config) + if err != nil { + return w.m != nil + } + c, err := uci.Parse(string(text)) + if err != nil { + w.Log("watch: the settings do not parse, the last ones stay: %v", err) + return w.m != nil + } + var blocked map[string]any + files.ReadJSON(w.RunDir+"/netifd-blocked.json", &blocked) + w.m, w.sig = model.Load(c, blocked), sig + // the largest keepalive each device's server makes (its disguise): what a bare packet may weigh + w.ka = map[string]int64{} + for _, id := range w.m.DeviceIDs() { + var srv *model.Server + if p := w.m.People[w.m.Devices[id].Person]; p != nil { + srv = w.m.Servers[p.Server] + } + w.ka[id] = link.KeepaliveMax(srv) + } + return true +} + +// Look is one look at the tunnels. Besides the watcher's own second, whoever tells the topics asks for one +// first; before Start there is nothing to look with, and it does nothing. +func (w *Watcher) Look() { + w.mu.Lock() + defer w.mu.Unlock() + if w.pres == nil { + return + } + now := w.Now().Unix() + files.Write(w.RunDir+"/backend.beat", []byte(fmt.Sprint(now)), 0o644) + w.timeZone() + if !w.load() { + return + } + m := w.m + d := w.Tunnels.Dump(m.TunnelIfnames()) + w.peers, w.reads = d.Peers, d.Reads + w.touched = map[string]bool{} + w.failing = nil + seen := w.pres.Look(m, d, now, func(id string, peer *awg.Peer, on, rekeyed bool) bool { + return w.link(id, peer, now, on, rekeyed) + }) + for id, h := range w.links { + if m.Devices[id] == nil { + w.linkDirty = w.linkDirty || h.State != "" + w.setupDirty = w.setupDirty || h.Setup != nil + delete(w.links, id) + } + } + if w.linkDirty { + files.WriteJSON(w.RunDir+"/link.json", link.ShownOf(w.links), 0o600) + } + // The portal's set-up sheet asks for it: no revision moves with it. + if w.setupDirty { + files.WriteJSON(w.RunDir+"/setup.json", link.SetupsOf(w.links), 0o600) + } + if w.linkDirty || w.setupDirty { + w.Hub.Put("link", map[string]any{"shown": link.ShownOf(w.links), "setup": link.SetupsOf(w.links)}) + w.linkDirty, w.setupDirty = false, false + } + pol := journal.PolicyOf(m.Settings.Retention) + log := journal.Log{Run: w.RunDir, Data: w.DataDir} + for _, e := range w.failing { + log.AddMerged(e, failingWindow, pol, journal.NamesOf(m), now) + } + w.meter(d, now) + w.minute(d, now) + + people := seen.People + for _, p := range w.poked() { + w.touched[p] = true + } + for p := range w.touched { + known := false + for _, q := range people { + known = known || q == p + } + if !known { + people = append(people, p) + } + } + if len(people) == 0 { + return + } + w.save(people) + if len(seen.Events) == 0 { + return + } + usage.Collect(m, w.usage, d, now) + usage.Save(w.usage, w.RunDir, w.DataDir, false, now) + w.lastCollect = now + names := w.homeNames() + events := make([]journal.Event, 0, len(seen.Events)) + for _, e := range seen.Events { + ev := journal.Event{"type": e.Type, "person": e.Person, "device": e.Device} + if e.Detail != "" { + ev["detail"] = e.Detail + } + // The event carries the place when the cache already knows it; a new address is located by the + // agent within the minute, and its place goes onto this event then. + if e.Type == presence.Connect { + if where := w.place(e.Detail); where != "" { + ev["where"] = where + } + } + // Connections from home: the DHCP name of the address, as it is now. + if e.Type != presence.Disconnect { + if hosts := hostsIn(e.Detail, names); hosts != nil { + ev["hosts"] = hosts + } + } + events = append(events, ev) + } + if err := log.Add(events, pol, journal.NamesOf(m), now); err != nil { + w.Log("watch: the activity log was not written: %v", err) + } + w.save(people) + if m.Settings.GeoEnabled && len(seen.Addresses) > 0 { + w.locate(seen.Addresses) + } +} + +// locate asks the agent to find the places of these addresses now (it keeps the lookups: they wait on the +// network in a child of its own). What an earlier look asked for and the agent has not taken yet is kept. +func (w *Watcher) locate(ips []string) { + path := w.RunDir + "/geo.poke" + var waiting []string + files.ReadJSON(path, &waiting) + for _, ip := range ips { + known := false + for _, q := range waiting { + known = known || q == ip + } + if !known { + waiting = append(waiting, ip) + } + } + files.WriteJSON(path, waiting, 0o600) +} + +// link keeps a device's link history through a look and tells whether its configuration is shared. +func (w *Watcher) link(id string, peer *awg.Peer, now int64, on, rekeyed bool) bool { + dev := w.m.Devices[id] + h := w.links[id] + // New keys: a new link history. The old one's set-up session and its answers would otherwise be + // taken for the new configuration's. + if rekeyed && h != nil { + if h.State != "" { + w.linkDirty = true + w.touched[dev.Person] = true + } + w.setupDirty = w.setupDirty || h.Setup != nil + h = nil + } + if h == nil { + h = link.Fresh(now) + w.links[id] = h + } + var read *link.Read + if peer != nil { + read = &link.Read{Endpoint: peer.Endpoint, Handshake: peer.Handshake, Rx: peer.Rx, Tx: peer.Tx} + } + ka := w.ka[id] + if ka == 0 { + ka = link.Keepalive + } + change, setupChanged := h.Step(read, now, on, ka) + w.setupDirty = w.setupDirty || setupChanged + // What is shown changed: the person's pages read it again, also when it cleared without an event + // (the device stopped trying, or was paused). + if change != nil { + w.linkDirty = true + w.touched[dev.Person] = true + if kind, detail := link.Event(change, on); kind != "" { + w.failing = append(w.failing, journal.Event{"type": kind, "person": dev.Person, "device": id, "detail": detail}) + } + } + return h.Raw == link.Shared || h.State == link.Shared +} + +// save moves the revisions (all, and these people's) and writes who is online. +func (w *Watcher) save(people []string) { + w.rev++ + for _, p := range people { + w.personRev[p] = w.rev + } + err := files.WriteJSON(w.RunDir+"/presence.json", map[string]any{ + "online": w.pres.Online, "endpoint": w.pres.Endpoint, "rev": w.rev, "people": w.personRev, + }, 0o600) + if err != nil { + w.Log("watch: presence was not written: %v", err) + } + w.Hub.Put("presence", map[string]any{"online": w.pres.Online, "endpoint": w.pres.Endpoint}) + if w.Changed != nil { + w.Changed() + } +} + +// poked reads and takes away the agent's word that something changed for these people (a state that moved +// on its own, a place that was found): their revisions move with this look. +func (w *Watcher) poked() []string { + path := w.RunDir + "/presence.poke" + var people []string + if !files.ReadJSON(path, &people) { + return nil + } + os.Remove(path) + return people +} + +// meter makes a point of this look and keeps it. The stream has the two minutes always, each new point as it +// is made: a page that starts looking has them in the answer that starts its look, so its line is drawn with +// the rest of the page and not a second later (the owner, 2026-11-12: the charts «появляются в разное время»). +// Only those who asked for the topic are told. The file (meter.json, for the page that asks the old way) is +// written while someone looks: all the points the first second of a look, then with each new one; once nobody +// does, it goes. +func (w *Watcher) meter(d awg.Dump, now int64) { + s := meter.Take(w.m, d, w.Mono(), now) + var p *meter.Point + cut := false + if w.prev != nil { + if point, ok := meter.Between(*w.prev, s); ok { + p = &point + w.ring, cut = meter.Keep(w.ring, point) + } + } + w.prev = &s + points := w.ring + if points == nil { + points = []meter.Point{} + } + if w.meterTold && p != nil && !cut { + w.Hub.Append("meter", meter.Points, *p) + } else if p != nil || !w.meterTold { + w.Hub.Put("meter", points) + } + w.meterTold = true + wanted := w.Audience != nil && w.Audience.Wants("meter") + if st, err := os.Stat(w.RunDir + "/meter.want"); err == nil { + age := now - st.ModTime().Unix() + wanted = wanted || (age < meterWantFor && -age < meterWantFor) + } + if !wanted { + if w.meterOut { + os.Remove(w.RunDir + "/meter.json") + } + w.meterOut = false + return + } + if p == nil && w.meterOut { + return + } + ts := int64(0) + if n := len(w.ring); n > 0 { + ts = w.ring[n-1].TS + } + files.WriteJSON(w.RunDir+"/meter.json", map[string]any{"ts": ts, "points": points}, 0o644) + w.meterOut = true +} + +// minute does what is due once a minute: a reset or a restore of the counters someone asked for, the +// counters folded and saved (to flash hourly, and at once after a reset). +func (w *Watcher) minute(d awg.Dump, now int64) { + if now-w.lastCollect < collectEvery { + return + } + w.lastCollect = now + // A restore or an import put other counters on flash (dawnline.backup leaves a marker): start over + // from them, whatever was written since. + if _, err := os.Stat(w.RunDir + "/usage.reload"); err == nil { + os.Remove(w.RunDir + "/usage.reload") + w.usage = usage.Load(w.RunDir, w.DataDir, true) + } + reset := w.resets() + usage.Collect(w.m, w.usage, d, now) + persist := reset || now-w.lastFlush >= flushEvery + if err := usage.Save(w.usage, w.RunDir, w.DataDir, persist, now); err != nil { + w.Log("watch: the counters were not saved: %v", err) + } + if persist { + w.lastFlush = now + } +} + +// ResetUsage forgets traffic history now (usage.Reset's scopes) and puts the counters on flash at once: the +// admin asked for it, and the pages show it without waiting for the minute. False before the first look. +func (w *Watcher) ResetUsage(scope, id string) bool { + w.mu.Lock() + if w.m == nil || w.usage == nil { + w.mu.Unlock() + return false + } + usage.Reset(w.usage, w.m, scope, id) + now := w.Now().Unix() + if err := usage.Save(w.usage, w.RunDir, w.DataDir, true, now); err != nil { + w.Log("watch: the counters were not saved: %v", err) + } + w.lastFlush = now + w.mu.Unlock() + if w.Changed != nil { + w.Changed() + } + return true +} + +// resets applies the traffic history resets asked for from the admin (usage.reset: one, or a list). +func (w *Watcher) resets() bool { + path := w.RunDir + "/usage.reset" + raw, err := os.ReadFile(path) + if err != nil { + return false + } + os.Remove(path) + type request struct { + Scope string `json:"scope"` + ID string `json:"id"` + } + var list []request + if json.Unmarshal(raw, &list) != nil { + var one request + if json.Unmarshal(raw, &one) != nil { + return false + } + list = []request{one} + } + for _, r := range list { + usage.Reset(w.usage, w.m, r.Scope, r.ID) + } + return true +} + +// place is "City · ISP" for an address the places' cache knows, else "". +func (w *Watcher) place(ip string) string { + var cache struct { + IPs map[string]struct { + City string `json:"city"` + Org string `json:"org"` + Fail any `json:"fail"` + } `json:"ips"` + } + if !files.ReadJSON(w.RunDir+"/geo.json", &cache) && !files.ReadJSON(w.DataDir+"/geo.json", &cache) { + return "" + } + c, ok := cache.IPs[ip] + if !ok || (c.Fail != nil && c.Fail != false && c.Fail != float64(0)) { + return "" + } + var parts []string + for _, x := range []string{c.City, c.Org} { + if x != "" { + parts = append(parts, x) + } + } + return strings.Join(parts, " · ") +} + +// homeNames is the names of addresses at home: the DHCP leases, then the hosts the admin named. +// Recent is the newest `n` entries of the activity log as a page is shown them: an older connection from +// home gets the DHCP name its address has now (rpc/status.uc with_hosts). +func (w *Watcher) Recent(n int) []map[string]any { + var events []map[string]any + if !files.ReadJSON(w.RunDir+"/events.json", &events) { + files.ReadJSON(w.DataDir+"/events.json", &events) + } + if n > 0 && len(events) > n { + events = events[len(events)-n:] + } + var names map[string]string + for _, e := range events { + t, _ := e["type"].(string) + if _, has := e["hosts"]; has || (t != "connect" && t != "roam") { + continue + } + if names == nil { + names = w.homeNames() + } + detail, _ := e["detail"].(string) + if h := hostsIn(detail, names); h != nil { + e["hosts"] = h + } + } + if events == nil { + events = []map[string]any{} + } + return events +} + +func (w *Watcher) homeNames() map[string]string { + out := map[string]string{} + if raw, err := os.ReadFile(w.Leases); err == nil { + for _, line := range strings.Split(string(raw), "\n") { + if f := strings.Split(line, " "); len(f) >= 4 && f[3] != "*" { + out[f[2]] = f[3] + } + } + } + if raw, err := os.ReadFile(w.DHCP); err == nil { + if c, err := uci.Parse(string(raw)); err == nil { + for _, h := range c.OfType("host") { + ip, _ := h.Get("ip") + name, _ := h.Get("name") + if ip != "" && name != "" { + if _, leased := out[ip]; !leased { + out[ip] = name + } + } + } + } + } + return out +} + +var ipv4 = regexp.MustCompile(`[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+`) + +// hostsIn is the addresses in an event's detail that belong to devices at home, with their names. +func hostsIn(detail string, names map[string]string) map[string]string { + var out map[string]string + for _, ip := range ipv4.FindAllString(detail, -1) { + if name := names[ip]; name != "" { + if out == nil { + out = map[string]string{} + } + out[ip] = name + } + } + return out +} diff --git a/backend/watch/watch_test.go b/backend/watch/watch_test.go new file mode 100644 index 0000000..7d5d089 --- /dev/null +++ b/backend/watch/watch_test.go @@ -0,0 +1,305 @@ +package watch + +import ( + "encoding/json" + "os" + "path/filepath" + "reflect" + "testing" + "time" + + "github.com/tickcount/luci-app-dawnline/backend/awg" + "github.com/tickcount/luci-app-dawnline/backend/hub" +) + +const ( + keyPhone = "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" + keyLaptop = "TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=" +) + +const settings = ` +config settings 'settings' + option geo_enabled '1' +config server 'home' + option ifname 'dawn0' + option subnet '10.77.0.0/24' + option private_key 'k' +config person 'anna' + option server 'home' + option name 'Anna' +config device 'phone' + option person 'anna' + option name 'Phone' + option kind 'phone' + option public_key '` + keyPhone + `' +config device 'laptop' + option person 'anna' + option name 'Laptop' + option kind 'computer' + option public_key '` + keyLaptop + `' +` + +// A router to watch: its state directories in a temporary one, its tunnel and its clocks in the test's hands. +type stand struct { + t *testing.T + dir string + w *Watcher + now int64 + peers map[string]awg.Peer + wants bool +} + +func (s *stand) Wants(string) bool { return s.wants } + +func newStand(t *testing.T) *stand { + dir := t.TempDir() + s := &stand{t: t, dir: dir, now: 1_800_000_000, peers: map[string]awg.Peer{}} + for _, d := range []string{"run", "data"} { + os.MkdirAll(filepath.Join(dir, d), 0o755) + } + os.WriteFile(dir+"/config", []byte(settings), 0o600) + s.w = &Watcher{ + Config: dir + "/config", RunDir: dir + "/run", DataDir: dir + "/data", DHCP: dir + "/dhcp", Leases: dir + "/leases", + Hub: hub.New(), Audience: s, + Now: func() time.Time { return time.Unix(s.now, 0) }, + Mono: func() float64 { return float64(s.now) }, + } + return s +} + +// look moves the clock a second on and takes a look at the tunnel as it is set. +func (s *stand) look() { + s.now++ + peers := map[string]awg.Peer{} + for k, p := range s.peers { + peers[k] = p + } + s.w.Tunnels = dumpOf(awg.Dump{OK: true, Reads: map[string]string{"dawn0": awg.Read}, Ifaces: map[string]awg.Iface{"dawn0": {Ifindex: 7}}, Peers: peers}) + s.w.Look() +} + +// dumpOf is a reader that gives this look whatever it is asked for. +func dumpOf(d awg.Dump) awg.Reader { + lines := "" + // one interface line, then a peer a line, as `awg show dump` prints them + lines += "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\txTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\t4500\toff\n" + for key, p := range d.Peers { + ep := p.Endpoint + if ep == "" { + ep = "(none)" + } + lines += key + "\t(none)\t" + ep + "\t10.77.0.2/32\t" + itoa(p.Handshake) + "\t" + itoa(p.Rx) + "\t" + itoa(p.Tx) + "\toff\n" + } + return awg.Reader{ + Show: func(string) (string, bool) { return lines, true }, + Index: func(string) (int, bool) { return 7, true }, + } +} + +func itoa(n int64) string { + b, _ := json.Marshal(n) + return string(b) +} + +func (s *stand) read(name string, v any) bool { + raw, err := os.ReadFile(s.dir + "/" + name) + if err != nil { + return false + } + if err := json.Unmarshal(raw, v); err != nil { + s.t.Fatalf("%s is not JSON: %v", name, err) + } + return true +} + +func TestConnectWritesWhatTheAgentWrote(t *testing.T) { + s := newStand(t) + // what the last watcher left, the places' cache and the leases + os.WriteFile(s.dir+"/run/presence.json", []byte(`{"online":{"phone":false},"endpoint":{},"rev":40,"people":{"anna":12}}`), 0o600) + os.WriteFile(s.dir+"/run/geo.json", []byte(`{"ips":{"203.0.113.7":{"city":"Krasnodar","org":"Rostelecom"},"198.51.100.4":{"fail":1}}}`), 0o600) + os.WriteFile(s.dir+"/leases", []byte("1800000000 aa:bb:cc:dd:ee:ff 192.168.1.50 laptop-lan *\n"), 0o644) + s.w.Start() + s.look() + var pres struct { + Online map[string]bool + Endpoint map[string]string + Rev int64 + People map[string]int64 + } + // nobody came: nothing is written anew, the revision stands + s.read("run/presence.json", &pres) + if pres.Rev != 40 { + t.Fatalf("the revision moved with nothing to tell: %d", pres.Rev) + } + if _, err := os.Stat(s.dir + "/run/backend.beat"); err != nil { + t.Fatal("no beat: the agent's watcher would not stand by") + } + + s.peers[keyLaptop] = awg.Peer{Handshake: s.now, Endpoint: "203.0.113.7:41821", Rx: 1000, Tx: 5000} + s.look() + s.read("run/presence.json", &pres) + // as the agent: the revision moves when presence is saved, and again once the log has the event + if !pres.Online["laptop"] || pres.Online["phone"] || pres.Endpoint["laptop"] != "203.0.113.7" || pres.Rev != 42 || pres.People["anna"] != 42 { + t.Fatalf("presence: %+v", pres) + } + var events []map[string]any + s.read("run/events.json", &events) + want := []map[string]any{{ + "ts": float64(s.now), "type": "connect", "person": "anna", "device": "laptop", "detail": "203.0.113.7", + "where": "Krasnodar · Rostelecom", "pname": "Anna", "dname": "Laptop", "dkind": "computer", + }} + if !reflect.DeepEqual(events, want) { + t.Fatalf("the log: %v", events) + } + var u struct { + Devices map[string]struct{ Total [2]float64 } + People map[string]struct{ Total [2]float64 } + } + s.read("run/usage.json", &u) + if u.Devices["laptop"].Total != [2]float64{1000, 5000} || u.People["anna"].Total != [2]float64{1000, 5000} { + t.Fatalf("the counters: %+v", u) + } + // the agent is asked for the place of an address that connected (the lookups stay with it) + var asked []string + if s.read("run/geo.poke", &asked); !reflect.DeepEqual(asked, []string{"203.0.113.7"}) { + t.Fatalf("the addresses to locate: %v", asked) + } + // the stream has it too + snap := s.w.Hub.Sync("", 0, nil) + if on := snap.Docs["presence"].(map[string]any)["online"].(map[string]any); on["laptop"] != true { + t.Fatalf("the presence topic: %v", snap.Docs["presence"]) + } + + // from an address at home: the lease's name goes with the event; a place that failed is no place + s.peers[keyPhone] = awg.Peer{Handshake: s.now, Endpoint: "192.168.1.50:5000"} + s.look() + s.read("run/events.json", &events) + last := events[len(events)-1] + if last["device"] != "phone" || !reflect.DeepEqual(last["hosts"], map[string]any{"192.168.1.50": "laptop-lan"}) || last["where"] != nil { + t.Fatalf("a connect from home: %v", last) + } +} + +func TestMeterOnlyWhileAsked(t *testing.T) { + s := newStand(t) + s.w.Start() + s.peers[keyLaptop] = awg.Peer{Handshake: s.now, Endpoint: "203.0.113.7:1", Rx: 0, Tx: 0} + for i := 0; i < 3; i++ { + s.peers[keyLaptop] = awg.Peer{Handshake: s.peers[keyLaptop].Handshake, Endpoint: "203.0.113.7:1", Rx: int64(i) * 1000, Tx: int64(i) * 4000} + s.look() + } + if _, err := os.Stat(s.dir + "/run/meter.json"); err == nil { + t.Fatal("the meter is written with nobody looking") + } + // the stream has the points all the same: a page that starts looking draws its line at once + if list, _ := s.w.Hub.Sync("", 0, nil).Docs["meter"].([]any); len(list) != 2 { + t.Fatalf("the meter topic with nobody looking: %v", list) + } + s.wants = true + s.peers[keyLaptop] = awg.Peer{Handshake: s.peers[keyLaptop].Handshake, Endpoint: "203.0.113.7:1", Rx: 3000, Tx: 12000} + s.look() + var m struct { + TS int64 + Points []struct { + TS int64 + Servers map[string][2]int64 + Dev map[string][2]int64 + } + } + if !s.read("run/meter.json", &m) || m.TS != s.now || len(m.Points) != 3 { + t.Fatalf("the meter: %+v", m) + } + // the points kept while nobody looked are there at once + if p := m.Points[2]; p.Servers["home"] != [2]int64{1000, 4000} || p.Dev["laptop"] != [2]int64{1000, 4000} { + t.Fatalf("the newest point: %+v", p) + } + if list, _ := s.w.Hub.Sync("", 0, nil).Docs["meter"].([]any); len(list) != 3 { + t.Fatalf("the meter topic: %v", list) + } + s.wants = false + s.look() + if _, err := os.Stat(s.dir + "/run/meter.json"); err == nil { + t.Fatal("the meter's file stays though nobody looks") + } + // asked for through the old door: the file whose age says so + os.WriteFile(s.dir+"/run/meter.want", nil, 0o644) + os.Chtimes(s.dir+"/run/meter.want", time.Unix(s.now, 0), time.Unix(s.now, 0)) + s.look() + if _, err := os.Stat(s.dir + "/run/meter.json"); err != nil { + t.Fatal("the meter is not written for the page that asks the old way") + } +} + +func TestPokeResetAndStop(t *testing.T) { + s := newStand(t) + os.WriteFile(s.dir+"/run/usage.json", []byte(`{"devices":{},"people":{"anna":{"total":[5,5],"days":{"2026-01-01":[5,5]}}},"updated":0,"flushed":0}`), 0o600) + s.w.Start() + s.look() + // the agent's word that something changed for a person: their revision moves + os.WriteFile(s.dir+"/run/presence.poke", []byte(`["anna"]`), 0o600) + s.look() + var pres struct { + Rev int64 + People map[string]int64 + } + s.read("run/presence.json", &pres) + if pres.Rev != 1 || pres.People["anna"] != 1 { + t.Fatalf("after a poke: %+v", pres) + } + if _, err := os.Stat(s.dir + "/run/presence.poke"); err == nil { + t.Fatal("the poke was not taken away") + } + // a reset asked for from the admin is applied within the minute, and put on flash at once + os.WriteFile(s.dir+"/run/usage.reset", []byte(`{"scope":"person","id":"anna"}`), 0o600) + s.now += 60 + s.look() + var u struct { + People map[string]map[string]any + Flushed float64 + } + if !s.read("data/usage.json", &u) || u.People["anna"]["total"] != nil || u.Flushed != float64(s.now) { + t.Fatalf("after a reset: %+v", u) + } + s.w.Stop() + if _, err := os.Stat(s.dir + "/run/backend.beat"); err == nil { + t.Fatal("the beat stays after a stop: the agent's watcher would not take over") + } +} + +func TestResetUsageNow(t *testing.T) { + s := newStand(t) + if s.w.ResetUsage("all", "") { + t.Fatal("reset before the first look") + } + os.WriteFile(s.dir+"/run/usage.json", []byte(`{"devices":{"laptop":{"total":[7,7],"days":{"2026-01-01":[7,7]}}},"people":{"anna":{"total":[9,9],"days":{"2026-01-01":[9,9]}}},"updated":0,"flushed":0}`), 0o600) + s.w.Start() + s.look() + told := 0 + s.w.Changed = func() { told++ } + if !s.w.ResetUsage("device", "laptop") { + t.Fatal("not reset") + } + var u struct { + Devices map[string]map[string]any + People map[string]map[string]any + Flushed float64 + } + // on flash at once, the person's own totals untouched, and the pages told + if !s.read("data/usage.json", &u) || u.Devices["laptop"]["total"] != nil || u.People["anna"]["total"] == nil || u.Flushed != float64(s.now) || told != 1 { + t.Fatalf("after a device's reset: %+v, told %d", u, told) + } +} + +// A look asked for before the watcher started (whoever tells the topics may ask at any moment) does nothing. +func TestLookBeforeStart(t *testing.T) { + s := newStand(t) + s.w.Look() + if s.w.World() != nil { + t.Fatal("a world before the watcher started") + } + s.w.Start() + s.look() + if s.w.World() == nil { + t.Fatal("no world after the first look") + } +} diff --git a/backend/watchdog/watchdog.go b/backend/watchdog/watchdog.go new file mode 100644 index 0000000..b148a0f --- /dev/null +++ b/backend/watchdog/watchdog.go @@ -0,0 +1,362 @@ +// Package watchdog checks, once a minute, what keeps people connected and repairs what it can, waiting +// longer after each repair that did not help (dawnline.watchdog). What it finds goes to the service log +// (English, as logged); its state to watchdog.json for the Health page. +package watchdog + +import ( + "fmt" + "os" + "strings" + + "github.com/tickcount/luci-app-dawnline/backend/files" + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" +) + +// wait is the seconds before the next repair, by the number of repairs so far. +var wait = []int64{0, 120, 600, 1800, 3600} + +// settled is the good minutes in a row before a repaired target's count of repairs is forgotten: one good +// minute between two failures is still flapping. +const settled = 10 + +// Repair is how a target is put right: what is said of it ("restarting it"), how many times at most +// (0: no limit), and the doing (n: which try this is). +type Repair struct { + What string + Max int + Run func(n int) +} + +// Probe is one thing looked at. ID is the Health check's id; Name the chip (stored in English); Who the +// log's subject. The log reads " - ". +type Probe struct { + ID, Src, Name, Who string + OK bool + Problem, Back string + Detail func() string + Repair *Repair +} + +// Target is what is kept of a target between passes. +type Target struct { + Bad int `json:"bad"` + Tries int `json:"tries"` + Next int64 `json:"next"` + Name string `json:"name"` + OK bool `json:"ok"` + Reported bool `json:"reported"` + Stuck bool `json:"stuck"` + Good int `json:"good"` + Last int64 `json:"last,omitempty"` +} + +// Fixed is a repair that was made. +type Fixed struct { + TS int64 `json:"ts"` + ID string `json:"id"` + Name string `json:"name"` +} + +// State is watchdog.json. +type State struct { + Last int64 `json:"last"` + Targets map[string]*Target `json:"targets"` + Repairs []Fixed `json:"repairs"` +} + +// Pass is one pass over the probes. With fix off it only reports. busy: an update is replacing packages +// or restarting tunnels; what looks broken meanwhile is being worked on, and repairs would only get in +// its way. +func Pass(path string, probes []Probe, fix, busy bool, now int64, log *servicelog.Log) { + say := func(src, level, msg string, detail func() string, who string) { + if log == nil { + return + } + d := "" + if detail != nil { + d = detail() + } + log.Write(src, level, msg, d, who, servicelog.Extra{}) + } + var st State + files.ReadJSON(path, &st) + if st.Targets == nil { + st.Targets = map[string]*Target{} + } + repairs := []Fixed{} + for _, r := range st.Repairs { + if now-r.TS < 86400 { + repairs = append(repairs, r) + } + } + seen := map[string]bool{} + for _, p := range probes { + seen[p.ID] = true + x := st.Targets[p.ID] + if x == nil { + x = &Target{} + st.Targets[p.ID] = x + } + x.Name, x.OK = p.Name, p.OK + if p.OK { + if x.Reported { + msg := p.Back + switch { + case x.Stuck: + msg = p.Back + " · restored" + case x.Tries > 1: + msg = fmt.Sprintf("%s (after %d repairs)", p.Back, x.Tries) + case x.Tries == 1: + msg = fmt.Sprintf("%s (after %d repair)", p.Back, x.Tries) + } + say(p.Src, "up", msg, nil, p.Who) + } + x.Bad, x.Next, x.Reported, x.Stuck = 0, 0, false, false + // The repairs so far are forgotten only once it has stayed up a while. + if x.Good++; x.Good >= settled { + x.Tries, x.Good = 0, 0 + } + continue + } + x.Good = 0 + // one bad minute can be a restart in progress + if x.Bad++; x.Bad < 2 { + continue + } + if busy { + continue + } + max := 0 + if p.Repair != nil { + max = p.Repair.Max + } + if max > 0 && x.Tries >= max && !x.Reported { + say(p.Src, "error", fmt.Sprintf("%s - not repaired again (%d repairs didn't help)", p.Problem, max), p.Detail, p.Who) + x.Reported = true + continue + } + if !fix || p.Repair == nil || (max > 0 && x.Tries >= max) { + if !x.Reported { + say(p.Src, "error", p.Problem, p.Detail, p.Who) + } + x.Reported = true + continue + } + // Three repairs did not help: said once, and from then on it keeps trying quietly until it works + // again (that is logged). + if x.Tries >= 3 && !x.Stuck && now-x.Last >= 50 { + x.Stuck = true + say(p.Src, "error", fmt.Sprintf("%s - %d repairs didn't help", p.Problem, x.Tries), p.Detail, p.Who) + } + if now < x.Next { + continue + } + x.Tries++ + x.Last = now + w := x.Tries + if w > len(wait)-1 { + w = len(wait) - 1 + } + x.Next = now + wait[w] + x.Reported = true + if !x.Stuck { + say(p.Src, "repair", p.Problem+" - "+p.Repair.What, p.Detail, p.Who) + } + func() { + defer func() { + if e := recover(); e != nil && !x.Stuck { + say(p.Src, "error", fmt.Sprintf("couldn't be repaired: %v", e), nil, p.Who) + } + }() + p.Repair.Run(x.Tries) + }() + if !x.Stuck { + repairs = append(repairs, Fixed{TS: now, ID: p.ID, Name: p.Name}) + } + } + for id := range st.Targets { + if !seen[id] { + delete(st.Targets, id) + } + } + st.Last, st.Repairs = now, repairs + if i := strings.LastIndex(path, "/"); i > 0 { + os.MkdirAll(path[:i], 0o755) + } + files.WriteJSON(path, st, 0o644) +} + +// Iface is netifd's word on an interface. +type Iface struct { + Exists, Up bool +} + +// Facts is what the probes are made from: the router as it is now, and what repairs it. +type Facts struct { + // AmneziaWG: its tool and protocol script, its module (installed, loaded), netifd's handler for it, + // the packages that are missing. + Tools, Kmod, Loaded, Handler bool + Missing []string + // Owner is whose an interface of the network configuration is: has false when there is none, id "" + // when it is not Dawnline's. + Owner func(ifname string) (id string, has bool) + Iface func(ifname string) Iface + // IfaceErrors is why a tunnel is down, from netifd and the last related syslog lines. + IfaceErrors func(ifname string) string + UDPListening func(port int) bool + // Drift is what of each running server's interface differs from what Dawnline writes, by option name. + Drift map[string][]string + // NftPresent: the access table is loaded. Firewall: "" fine, "off", "changed" or "not loaded". + NftPresent bool + Firewall string + // The portal: whether it can run at all here (HTTPS is there, nobody else holds its port), and listens. + PortalCan, PortalListening bool + // The Home-only resolver: its configuration is there, and it runs. + ResolverConf, ResolverRunning bool + // Said is the last lines of syslog about something ("uhttpd", "rpcd"), for a problem's detail. + Said func(what string) string + // Reapply is the full apply; Run a command; StartServices starts the service's missing instances. + Reapply func() + Run func(name string, args ...string) + StartServices func() + // BlockedNote and BlockedFix word why a server is kept down. + BlockedNote, BlockedFix func(why map[string]any) string +} + +// Probes is what to look at for these settings on this router. +func Probes(m *model.Model, f Facts) []Probe { + var out []Probe + var on []*model.Server + keyed := false + for _, id := range m.ServerIDs() { + srv := m.Servers[id] + keyed = keyed || srv.PrivateKey != "" + if srv.Enabled && srv.PrivateKey != "" { + on = append(on, srv) + } + } + // The tunnels check themselves: AmneziaWG first (without it no tunnel can run), then each server's interface. + awgOK := false + tunnels := func() { + if len(on) == 0 { + return + } + base := Probe{ID: "awg", Src: "awg", Name: "AmneziaWG", Who: "AmneziaWG", Back: "is ready again"} + if !f.Tools || !f.Kmod { + p := base + p.Problem = "isn't installed: no tunnel can run - install it in Dawnline → Components" + if f.Tools { + p.Problem = "kernel module isn't installed: no tunnel can run - install it in Dawnline → Components" + } + p.Detail = func() string { return "Missing: " + strings.Join(f.Missing, ", ") + "." } + out = append(out, p) + return + } + p := base + p.OK = f.Loaded && f.Handler + awgOK = p.OK + if !f.Loaded { + p.Problem = "kernel module isn't loaded" + p.Detail = func() string { return f.Said("modprobe") } + p.Repair = &Repair{What: "loading it", Run: func(int) { f.Run("modprobe", "amneziawg") }} + } else { + p.Problem = "isn't known to the network service - restart the network or reboot" + p.Detail = func() string { + return "netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed." + } + } + out = append(out, p) + // without the protocol handler ifup cannot work: the tunnels are not probed (or restarted) one by one + if f.Loaded && !f.Handler { + return + } + for _, srv := range on { + srv := srv + t := Probe{ID: "up_" + srv.ID, Src: "awg", Name: srv.Name + " · AmneziaWG", Who: srv.Name} + // A tunnel Dawnline may not set up is reported, never restarted: an interface of the same name + // that isn't Dawnline's may be your LAN. + why, _ := srv.Blocked.(map[string]any) + if why == nil { + if !model.ValidIfname(srv.Ifname) { + why = map[string]any{"code": "ifname", "ifname": srv.Ifname} + } else if owner, has := f.Owner(srv.Ifname); has && owner != srv.ID { + why = map[string]any{"code": "taken", "ifname": srv.Ifname} + } + } + if why != nil { + t.Problem, t.Back = f.BlockedNote(why), "AmneziaWG is running again" + t.Detail = func() string { return f.BlockedFix(why) } + out = append(out, t) + continue + } + s := f.Iface(srv.Ifname) + t.OK = s.Up && f.UDPListening(srv.Port) + switch { + case !s.Exists: + t.Problem = "AmneziaWG is missing from the router" + case !s.Up: + t.Problem = "AmneziaWG isn't running" + default: + t.Problem = fmt.Sprintf("AmneziaWG isn't accepting connections on port %d", srv.Port) + } + t.Back = fmt.Sprintf("AmneziaWG is running again · accepting connections on port %d", srv.Port) + t.Detail = func() string { return f.IfaceErrors(srv.Ifname) } + if s.Exists { + t.Repair = &Repair{What: "restarting it", Run: func(int) { f.Run("ifup", srv.Ifname) }} + } else { + t.Repair = &Repair{What: "setting it up again", Run: func(int) { f.Reapply() }} + } + out = append(out, t) + } + } + tunnels() + // A tunnel's interface edited outside Dawnline keeps that until the next apply: set up again with + // Dawnline's settings. Only while AmneziaWG itself works (its target comes first, and is fixed first). + if awgOK { + for _, id := range m.ServerIDs() { + diff, has := f.Drift[id] + if !has { + continue + } + srv := m.Servers[id] + out = append(out, Probe{ID: "cfg_" + id, Src: "awg", Name: srv.Name + " · interface settings", Who: srv.Name, OK: len(diff) == 0, + Problem: fmt.Sprintf("interface %s was changed outside Dawnline", srv.Ifname), + Back: fmt.Sprintf("interface %s has Dawnline's settings again", srv.Ifname), + // option names only: their values hold the server's private key + Detail: func() string { return "Changed: " + strings.Join(diff, ", ") + "." }, + Repair: &Repair{What: "setting it up again", Run: func(int) { f.Reapply() }}}) + } + } + if len(m.Servers) > 0 { + out = append(out, Probe{ID: "nft", Src: "dawnline", Name: "Access rules", Who: "Access rules", OK: f.NftPresent, + Problem: "are missing", Back: "are loaded again", Repair: &Repair{What: "loading them again", Run: func(int) { f.Reapply() }}}) + } + if keyed { + p := Probe{ID: "fw", Src: "dawnline", Name: "Firewall", Who: "Firewall", OK: f.Firewall == "", Back: "rules for Dawnline are in place again"} + switch f.Firewall { + case "off": + // fw4 stopped on purpose is the admin's call: report it, do not start it + p.Problem = "isn't running on this router (fw4): tunnels and the portal are closed" + case "changed": + p.Problem = "rules for Dawnline were changed or removed" + default: + p.Problem = "rules for Dawnline aren't loaded" + } + if f.Firewall != "off" { + p.Repair = &Repair{What: "restoring them", Run: func(int) { f.Reapply(); f.Run("fw4", "-q", "reload") }} + } + out = append(out, p) + } + if s := m.Settings; s.PortalEnabled && f.PortalCan { + out = append(out, Probe{ID: "portal", Src: "portal", Name: "Portal", Who: "Personal portal", OK: f.PortalListening, + Problem: fmt.Sprintf("isn't answering on port %d", s.PortalPort), Back: "answers again", + Detail: func() string { return f.Said("portal") }, Repair: &Repair{What: "restarting it", Run: func(int) { f.StartServices() }}}) + } + // only while a server is on: with all of them off the resolver idles on loopback + if f.ResolverConf && len(on) > 0 { + out = append(out, Probe{ID: "resolver", Src: "dawnline", Name: "Resolver", Who: "DNS for Home-only devices", OK: f.ResolverRunning, + Problem: "isn't running", Back: "runs again", Repair: &Repair{What: "restarting it", Run: func(int) { f.StartServices() }}}) + } + return out +} diff --git a/backend/watchdog/watchdog_test.go b/backend/watchdog/watchdog_test.go new file mode 100644 index 0000000..a40354c --- /dev/null +++ b/backend/watchdog/watchdog_test.go @@ -0,0 +1,197 @@ +package watchdog + +import ( + "encoding/json" + "os" + "strings" + "testing" + + "github.com/tickcount/luci-app-dawnline/backend/model" + "github.com/tickcount/luci-app-dawnline/backend/servicelog" + "github.com/tickcount/luci-app-dawnline/backend/uci" +) + +// A target through its life: one bad minute is nothing, the second is repaired, each repair that did not +// help waits longer, three are said once, and coming back is told with how many it took. +func TestPass(t *testing.T) { + dir := t.TempDir() + path := dir + "/run/watchdog.json" + var said []string + log := &servicelog.Log{RunDir: dir + "/run", Level: func() string { return "info" }, Syslog: func(_, line string) { said = append(said, line) }} + ok, runs := false, 0 + probe := func() []Probe { + return []Probe{{ID: "nft", Src: "dawnline", Name: "Access rules", Who: "Access rules", OK: ok, Problem: "are missing", Back: "are loaded again", + Detail: func() string { return "what nft said" }, Repair: &Repair{What: "loading them again", Run: func(n int) { runs++ }}}} + } + state := func() State { + var st State + raw, _ := os.ReadFile(path) + json.Unmarshal(raw, &st) + return st + } + told := func(part string) int { + n := 0 + for _, l := range said { + if strings.Contains(l, part) { + n++ + } + } + return n + } + now := int64(1_800_000_000) + Pass(path, probe(), true, false, now, log) + if runs != 0 || len(said) != 0 || state().Targets["nft"].Bad != 1 { + t.Fatalf("one bad minute: %d repairs, %v", runs, said) + } + // busy with an update: nothing is repaired, however long it is bad + Pass(path, probe(), true, true, now+60, log) + if runs != 0 { + t.Fatal("repaired during an update") + } + Pass(path, probe(), true, false, now+120, log) + if runs != 1 || told("Access rules are missing - loading them again") != 1 { + t.Fatalf("the second bad minute: %d repairs, %v", runs, said) + } + // the next repair waits two minutes, the one after ten + Pass(path, probe(), true, false, now+180, log) + if runs != 1 { + t.Fatal("repaired again before its wait") + } + Pass(path, probe(), true, false, now+240, log) + Pass(path, probe(), true, false, now+300, log) + Pass(path, probe(), true, false, now+840, log) + if runs != 3 { + t.Fatalf("%d repairs after fourteen minutes", runs) + } + // three did not help: said once, then quiet tries + Pass(path, probe(), true, false, now+2700, log) + Pass(path, probe(), true, false, now+6400, log) + if told("3 repairs didn't help") != 1 || runs != 5 || told("loading them again") != 3 { + t.Fatalf("after three: %d repairs, %v", runs, said) + } + if st := state(); len(st.Repairs) != 3 || !st.Targets["nft"].Stuck { + t.Fatalf("the state: %+v", st) + } + ok = true + Pass(path, probe(), true, false, now+6460, log) + if told("Access rules are loaded again · restored") != 1 { + t.Fatalf("coming back is not told: %v", said) + } + // it flaps: the count of repairs stays until ten good minutes in a row + if state().Targets["nft"].Tries != 5 { + t.Fatal("the repairs are forgotten at once") + } + for i := int64(1); i <= 9; i++ { + Pass(path, probe(), true, false, now+6460+60*i, log) + } + if state().Targets["nft"].Tries != 0 { + t.Fatal("the repairs are never forgotten") + } + // repairs off: reported once, nothing done; a target no longer looked at is dropped + ok, said = false, nil + Pass(path, probe(), false, false, now+90000, log) + Pass(path, probe(), false, false, now+90060, log) + Pass(path, probe(), false, false, now+90120, log) + if runs != 5 || told("Access rules are missing") != 1 || len(state().Repairs) != 0 { + t.Fatalf("with repairs off: %d repairs, %v, %+v", runs, said, state().Repairs) + } + Pass(path, nil, true, false, now+90180, log) + if len(state().Targets) != 0 { + t.Fatal("a target nobody looks at stays") + } + // a repair with a limit stops there (as ucode's: the repair itself was the last word on it) + n := 0 + limited := []Probe{{ID: "x", Src: "dawnline", Name: "X", Who: "X", Problem: "is down", Back: "is up", Repair: &Repair{What: "kicking it", Max: 1, Run: func(int) { n++; panic("it bit back") }}}} + said = nil + for i := int64(0); i < 5; i++ { + Pass(path, limited, true, false, now+100000+4000*i, log) + } + if n != 1 || told("is down - kicking it") != 1 || told("couldn't be repaired: it bit back") != 1 { + t.Fatalf("a limited repair ran %d times: %v", n, said) + } +} + +// The probes for access's household on a router where all is well, and what each fault turns up. +func TestProbes(t *testing.T) { + text, _ := os.ReadFile("../access/testdata/access.uci") + c, err := uci.Parse(string(text)) + if err != nil { + t.Fatal(err) + } + m := model.Load(c, nil) + var ran []string + good := func() Facts { + return Facts{Tools: true, Kmod: true, Loaded: true, Handler: true, NftPresent: true, PortalCan: true, PortalListening: true, ResolverConf: true, ResolverRunning: true, + Owner: func(ifn string) (string, bool) { + for id, s := range m.Servers { + if s.Ifname == ifn { + return id, true + } + } + return "", false + }, + Iface: func(string) Iface { return Iface{Exists: true, Up: true} }, IfaceErrors: func(string) string { return "" }, UDPListening: func(int) bool { return true }, + Drift: map[string][]string{"home": {}, "cabin": {}, "open": {}}, Said: func(string) string { return "" }, + Reapply: func() { ran = append(ran, "apply") }, Run: func(name string, args ...string) { ran = append(ran, name+" "+strings.Join(args, " ")) }, + StartServices: func() { ran = append(ran, "start") }, BlockedNote: func(map[string]any) string { return "is kept down" }, BlockedFix: func(map[string]any) string { return "fix" }} + } + by := func(f Facts) map[string]Probe { + out := map[string]Probe{} + for _, p := range Probes(m, f) { + out[p.ID] = p + } + return out + } + all := by(good()) + for _, id := range []string{"awg", "up_home", "up_cabin", "up_open", "cfg_home", "cfg_cabin", "cfg_open", "nft", "fw", "portal", "resolver"} { + if p, has := all[id]; !has || !p.OK { + t.Errorf("%s: there %v, fine %v", id, has, p.OK) + } + } + if len(all) != 11 { + t.Errorf("%d probes", len(all)) + } + f := good() + f.Kmod = false + f.Missing = []string{"kmod-amneziawg"} + if p := by(f); p["awg"].OK || p["awg"].Repair != nil || p["awg"].Detail() != "Missing: kmod-amneziawg." || len(p) != 5 { + t.Errorf("without the module: %+v, %d probes", p["awg"], len(p)) + } + f = good() + f.Loaded = false + p := by(f) + p["awg"].Repair.Run(1) + if p["awg"].Problem != "kernel module isn't loaded" || ran[len(ran)-1] != "modprobe amneziawg" || p["up_home"].ID == "" { + t.Errorf("a module not loaded: %+v, %v", p["awg"], ran) + } + f = good() + f.Handler = false + if p := by(f); p["awg"].Repair != nil || p["up_home"].ID != "" || p["cfg_home"].ID != "" { + t.Errorf("without netifd's handler the tunnels are still probed: %v", p) + } + f = good() + f.Iface = func(ifn string) Iface { return Iface{Exists: ifn != "dawn1", Up: ifn == "dawn2"} } + f.Owner = func(ifn string) (string, bool) { return "", ifn == "dawn2" } + f.Drift = map[string][]string{"home": {"listen_port", "mtu"}} + f.Firewall = "off" + p = by(f) + p["up_home"].Repair.Run(1) + p["up_cabin"].Repair.Run(1) + p["cfg_home"].Repair.Run(1) + if p["up_home"].Problem != "AmneziaWG isn't running" || p["up_cabin"].Problem != "AmneziaWG is missing from the router" || + p["up_open"].Problem != "is kept down" || p["up_open"].Repair != nil || strings.Join(ran[len(ran)-3:], "; ") != "ifup dawn0; apply; apply" { + t.Errorf("the tunnels' faults: %q %q %q, %v", p["up_home"].Problem, p["up_cabin"].Problem, p["up_open"].Problem, ran) + } + if p["cfg_home"].OK || p["cfg_home"].Detail() != "Changed: listen_port, mtu." || p["cfg_cabin"].ID != "" { + t.Errorf("an interface changed by hand: %+v", p["cfg_home"]) + } + if p["fw"].OK || p["fw"].Repair != nil { + t.Errorf("fw4 stopped on purpose is repaired: %+v", p["fw"]) + } + f = good() + f.Firewall = "changed" + by(f)["fw"].Repair.Run(1) + if strings.Join(ran[len(ran)-2:], "; ") != "apply; fw4 -q reload" { + t.Errorf("the firewall's repair: %v", ran) + } +} diff --git a/backend/zone/zone.go b/backend/zone/zone.go new file mode 100644 index 0000000..a11ea63 --- /dev/null +++ b/backend/zone/zone.go @@ -0,0 +1,85 @@ +// Package zone is the router's time zone: what "today", an hour of the day and the first of a month mean +// when the traffic is counted. +// +// Go finds the local zone in the TZ variable or in /etc/localtime. OpenWrt has neither for a service: its +// zone is one line in /etc/TZ, a POSIX TZ string ("MSK-3", "CET-1CEST,M3.5.0,M10.5.0/3"), which its C +// library reads there. Left alone, a Go program on the router counts its days in UTC. So the zone is read +// from that line here, and everything that asks for local time asks Local(). +// +// The string is handed to Go's own reader of such rules: a zone file (TZif, RFC 8536) with no transitions +// and the string as its footer, which is where a zone file says how time goes on after its last +// transition. +package zone + +import ( + "os" + "strings" + "sync/atomic" + "time" +) + +// File is where OpenWrt keeps the zone. +const File = "/etc/TZ" + +var ( + local atomic.Pointer[time.Location] + read atomic.Pointer[string] +) + +// Local is the router's zone: the one last set or loaded, else Go's own idea of it. +func Local() *time.Location { + if l := local.Load(); l != nil { + return l + } + return time.Local +} + +// Set makes loc the router's zone (a test's own, too). +func Set(loc *time.Location) { local.Store(loc) } + +// Load reads the zone from path when its line changed since the last Load, and tells whether it did. A +// file that is not there or does not parse leaves the zone as it was. +func Load(path string) bool { + raw, err := os.ReadFile(path) + if err != nil { + return false + } + tz := strings.TrimSpace(string(raw)) + if was := read.Load(); tz == "" || (was != nil && *was == tz) { + return false + } + loc, err := FromPOSIX(tz) + if err != nil { + return false + } + read.Store(&tz) + local.Store(loc) + return true +} + +// FromPOSIX is the zone a POSIX TZ string describes, daylight saving rules included. +func FromPOSIX(tz string) (*time.Location, error) { + // One block: no transitions, one local time type (UTC, never used: the footer rules from the start), + // its abbreviation. + block := func() []byte { + b := []byte("TZif2") + b = append(b, make([]byte, 15)...) + // isutcnt, isstdcnt, leapcnt, timecnt, typecnt, charcnt + for _, n := range []byte{0, 0, 0, 0, 1, 4} { + b = append(b, 0, 0, 0, n) + } + // utoff (4), isdst (1), abbreviation's index (1); then "UTC\0" + b = append(b, 0, 0, 0, 0, 0, 0) + return append(b, 'U', 'T', 'C', 0) + } + // The 32-bit block, then the 64-bit one (the same, with no transition times to differ in), then the footer. + data := append(block(), block()...) + data = append(data, '\n') + data = append(data, tz...) + data = append(data, '\n') + loc, err := time.LoadLocationFromTZData(tz, data) + if err != nil { + return nil, err + } + return loc, nil +} diff --git a/backend/zone/zone_test.go b/backend/zone/zone_test.go new file mode 100644 index 0000000..b61cef6 --- /dev/null +++ b/backend/zone/zone_test.go @@ -0,0 +1,62 @@ +package zone + +import ( + "os" + "testing" + "time" +) + +func TestFromPOSIX(t *testing.T) { + at := func(tz, utc string) string { + loc, err := FromPOSIX(tz) + if err != nil { + t.Fatalf("%s: %v", tz, err) + } + u, _ := time.Parse("2006-01-02 15:04", utc) + return u.In(loc).Format("2006-01-02 15:04 MST") + } + for _, c := range []struct{ tz, utc, want string }{ + // the development router's night: a new day there, the old one in UTC + {"MSK-3", "2026-11-11 21:06", "2026-11-12 00:06 MSK"}, + // daylight saving by rule: the last Sunday of March to the last one of October + {"CET-1CEST,M3.5.0,M10.5.0/3", "2026-01-15 12:00", "2026-01-15 13:00 CET"}, + {"CET-1CEST,M3.5.0,M10.5.0/3", "2026-07-15 12:00", "2026-07-15 14:00 CEST"}, + {"CET-1CEST,M3.5.0,M10.5.0/3", "2026-03-29 00:59", "2026-03-29 01:59 CET"}, + {"CET-1CEST,M3.5.0,M10.5.0/3", "2026-03-29 01:00", "2026-03-29 03:00 CEST"}, + // west of Greenwich, half hours, names in brackets (as OpenWrt writes zones that have no letters) + {"EST5EDT,M3.2.0,M11.1.0", "2026-12-01 03:00", "2026-11-30 22:00 EST"}, + {"<+0330>-3:30", "2026-06-01 00:00", "2026-06-01 03:30 +0330"}, + {"UTC0", "2026-06-01 00:00", "2026-06-01 00:00 UTC"}, + } { + if got := at(c.tz, c.utc); got != c.want { + t.Errorf("%s at %s: %s, want %s", c.tz, c.utc, got, c.want) + } + } + if _, err := FromPOSIX("no zone at all"); err == nil { + // Go takes a name it cannot read for UTC under that name or refuses it: either is no zone to count days in + t.Log("a line that is no zone was taken") + } +} + +func TestLoadFollowsTheFile(t *testing.T) { + defer local.Store(nil) + defer read.Store(nil) + path := t.TempDir() + "/TZ" + if Load(path) { + t.Fatal("a zone from no file") + } + os.WriteFile(path, []byte("MSK-3\n"), 0o644) + if !Load(path) || Load(path) { + t.Fatal("the zone is loaded once per line") + } + if _, off := time.Unix(0, 0).In(Local()).Zone(); off != 3*3600 { + t.Fatalf("offset %d", off) + } + os.WriteFile(path, []byte("CET-1CEST,M3.5.0,M10.5.0/3\n"), 0o644) + if !Load(path) { + t.Fatal("a changed line is not taken") + } + if _, off := time.Date(2026, 7, 1, 0, 0, 0, 0, time.UTC).In(Local()).Zone(); off != 2*3600 { + t.Fatalf("offset %d", off) + } +} diff --git a/docs/backend.md b/docs/backend.md new file mode 100644 index 0000000..6882303 --- /dev/null +++ b/docs/backend.md @@ -0,0 +1,229 @@ +# The Go backend and the live stream + +Where Dawnline's backend is going, what is built, and the order of the rest. Read with `rules/backend-go.md` (how the Go code is written) and `rules/frontend.md` › Live data. + +## Why + +Three things are wrong with the ucode backend, and they have one cause: nothing in it stays running with the state in memory. + +- **Every page asks for everything.** The admin fetches `status` (the whole model: every server, person, device, counter and the last 60 events) every 30 s and on each move of a revision it polls every 2 s. The answer is one document, so a page cannot know what changed in it and rebuilds what it shows. One open tab costs a `rev` call every 2 s for nothing. +- **The portal pays 140 ms of CPU per request before any work** (a CGI process compiles the module graph), so it does not follow anything: it loads once and polls only while a set-up sheet is open. +- **State is passed between processes as files** (`presence.json`, `meter.want`, `usage.reset`, …), each with its own lock, format and staleness rule. + +The target is what podkop-exp did to podkop's shell backend, for the same reasons: **one long-running Go program** that holds the state, with packages that each have one job, and the pages following it over **a stream of changes** instead of asking again. + +## Target + +``` + ┌──────────────────────────── dawnlined (Go, procd) ────────────────────────────┐ + LuCI admin ── uhttpd /ubus ── rpcd ACL ── ubus ──┤ api ──┐ │ + (shared/live) calls + event stream │ ├── hub ◄── producers: watch, usage, log, │ + portal ───────── HTTPS (own listener) ───────────┤ portal┘ ▲ people, servers, health, … │ + (shared/live) calls + event stream │ │ │ + dawnline CLI ──── unix socket ───────────────────┤ ctl └── model ◄── uci (/etc/config/dawnline) + │ apply ──► awg, nft, netifd, fw │ + └──────────────────────────────────────────────────┘ +``` + +- **`hub`** holds the live state as named documents (*topics*) and publishes each change as a numbered event. It knows no transport and owns no data. +- **Producers** own the data: one goroutine each, or one supervisor loop for everything that changes the router (one writer per resource, as today, without lock files). +- **`api`** (admin, over ubus) and **`portal`** (people, over its own HTTPS listener) are doors onto the hub plus the commands. The admin stays a LuCI page: its login, sessions and access lists are rpcd's. +- The settings stay `/etc/config/dawnline` in today's format. Nothing a user has changes with the backend's language. + +## The stream + +The same protocol over both doors; `web/src/shared/live` is its client. + +**Topics.** A topic is a JSON document: `people`, `servers`, `traffic`, `meter`, … A list of things that have an id is published as a *keyed list*, `{ "order": [ids], "items": { id: {…} } }`, so one entry changing does not resend the list. A daily series is keyed by its `day` the same way: on a real router the arrays of days were most of what a minute's refresh resent. + +**Events.** Every change of every topic is one event, numbered from 1 in the order it happened: `{ seq, topic, op, data }`. + +| `op` | `data` | | +|---|---|---| +| `put` | the document | first time, or it is not an object | +| `patch` | a JSON Merge Patch (RFC 7396) | only the fields that changed; `null` removes one. Documents hold no `null` | +| `append` | `{ items, keep }` | new entries of a list (a log, the meter's points); the list holds its newest `keep` | +| `drop` | — | the topic is gone | + +A producer puts a whole document as often as it likes; the hub works out the patch and publishes nothing when nothing changed. Producers never write patches by hand. + +**Following.** A page takes a snapshot once (`sync` with no position → `{ epoch, seq, docs }`), then applies events in order. The next event is always `seq + 1`. Anything else (a number skipped, another `epoch`: the backend restarted) means *ask where we are*: `sync { epoch, seq }` answers with the events missed (the last 512 are kept) or a new snapshot. A page is therefore never wrong for longer than it takes to notice, and never needs "refresh everything" logic of its own. + +**Two transports, same events, same numbers:** + +- **Event stream** (SSE): `GET /ubus/subscribe/dawnline` with the session as a Bearer token. uhttpd turns the object's ubus notifications (`event`, and `ping` every 15 s of silence, carrying the current `seq`) into `text/event-stream`. Used where uhttpd can hold one. +- **Held call** (long poll): `wait { epoch, seq, timeout }` answers when there is an event. Works through any web server LuCI runs on. + +`hello` says which to use. **uhttpd before 2026-08-03 leaks every subscription's connection** (fixed upstream in `3c48b9e`; the 24.10.6 and 25.12.3 images ship a uhttpd from before it, 25.12.5 one from after) and stops serving once `max_connections` of them are open, so the stream is used only where the installed uhttpd has the fix; a page also gives a stream up for the held call after it fails twice. Today the choice is `dawnlined -stream sse|poll` and defaults to `poll`; stage 2 has the init script set it from the installed uhttpd's version. Not WebSocket: uhttpd has none, and nothing here is said from the page to the router that a plain call does not say better. + +**Only while someone looks.** Each question renews a 30 s lease on the topics it names; subscribers count too. Producers that cost something (the 1-second meter) run only for topics under a lease (`watch { topics }`, renewed by the page every 10 s). No page open: nothing is read for the pages at all. **The meter is the exception since 2026-11-12:** its points cost nothing more to make (the watcher looks at the tunnels every second whoever is there), so the `meter` topic is kept current always and a page has the last two minutes in the answer that starts its look; only the old `meter.json` file is still written under a lease. + +**Commands** (creating a device, changing a setting) are calls that answer with their result and the `seq` their change is visible at. The page does not refetch after a command: the change arrives on the stream like anyone else's. + +### On the page + +- `signal.ts`: signals (`signal`, `computed`, `effect`, `batch`). A text node, an attribute or a list reads the signals it shows inside an effect; only that effect runs when one moves. +- `store.ts`: the topics' documents. `store.at('people', 'items', id, 'online')` is a signal for that one place. Patches are applied with structural sharing, so a part that did not change is the same object and its readers are not told. +- `follow.ts`: the rules above over a `Transport`; pauses while the page is hidden, catches up when it is shown. + +This is what replaces "fetch `status`, rebuild the box": a person's card binds its name, its state and each device's `online` to their places, and a device connecting changes one dot. + +### Loading: pending, ready, stale + +Every topic has a state the page can read (`store.state(topic)`), and that is the whole model for what a page shows before and without data: + +| state | means | the page shows | +|---|---|---| +| `pending` | nothing came yet | the page waits under its section row, then comes in whole; not "empty" and not a spinner over the whole page | +| `ready` | the router's document, followed live | the data | +| `stale` | the last document seen, and the stream is down | the data, marked as old; **never** hidden behind a wait the page does not need | + +With it the admin's `load()` no longer waits for `status` under LuCI's spinner: the section row stands at once and the page comes in when its answer has come, its blocks rising as the portal's do (`DESIGN.md` › Motion › 16, `rules/frontend.md`). The admin had skeletons (skullet) for a day, 2026-11-12; the owner had them taken out the same day in favour of that entrance. A backend that was just started used to tell its first topics only with the bridge's next Refresh (measured after a deploy, 2026-11-12: every question answered by 2.6 s, the stream's first events at 22 s); that is fixed in the bridge (*Told as the router is at that moment*, below: about 1 s now). The page keeps its own guard all the same: while it waits for its first status it asks for the snapshot itself every 700 ms (`state/stream.ts streamStatus`: `refresh` + `sync`) and takes whichever comes first. The portal's first paint can go further: the backend can put the person's state into the HTML it serves, so there is nothing to wait for (stage 3). + +## Stages + +Each stage ships and runs on the router; the ucode it replaces is deleted in the same stage. + +| | Stage | State | +|---|---|---| +| 1 | **The stream.** `dawnlined` with `ubus`, `hub`, `api`; topics filled by `bridge`, which asks the ucode backend (`luci.dawnline status`, `meter`) once for all pages, only on a change, and republishes the answer cut into topics. Client: `shared/live`. | **Done.** | +| 2 | **The admin on the stream.** | **Half done:** the backend runs on the router as the service's `backend` instance (deploy builds it for the router's processor); `api.status` and `api.meter` are answered from the stream and `state/live.ts` follows it instead of polling `rev` (`state/stream.ts`, `transport.ts`, `join.ts`), with the old asking kept for a router without the backend. **Left:** pages bind to the store directly instead of reading a whole `Status` (then `join.ts`, the pollers and the fallback go); the other answers pages still ask for (`health`, `service_log`, `events`, `settings_get`, `updates_status`) become topics; the release packages carry the backend for every architecture. | +| 3 | **The portal in the backend.** `dawnlined` serves the portal itself (HTTPS with Go's TLS, the assets, the API, the person's stream): no CGI, no second uhttpd, no `openssl`/libustream dependency for it. | **Serving on the development router, behind a marker** (`/etc/dawnline/backend-portal`; the init script then starts no portal uhttpd and hands the port, the certificate and the process count to `dawnlined`). `backend/portal`: the door (what is no personal link gets the bare 404 or the redirect from this process, nothing is started for a scanner), the ucode portal behind it as CGI exactly as uhttpd ran it (a few at a time), the certificate read again when its file changes (a renewal restarts nothing), and **the page's stream** `GET //api/live`: the page's state whole (`put`), then a merge patch of what changed (`patch`), `gone` when the link stops working. The state is the ucode portal's own `/api/state` for that visitor, asked again only when the person's revision, the settings, a set-up or (once a minute) the counters moved. The page follows it when its shell says a stream waits (`data-live`, `web/src/portal/live.ts`); before, it asked once and never again. Held by a test against the real ucode portal in both OpenWrt rootfs images (`scripts/backend-container.sh`). The binary grew from 4.1 to 7.3 MB with `net/http` and TLS. **Left:** the API itself in Go (stage 5: then no CGI), the portal's loading states, making it the default. | +| 4 | **The watcher.** `awg` (the tunnels' peers), presence, link trouble, the meter, usage and the activity log move from the agent into producers; their files in `/var/run/dawnline` and the bridge's `status` call go. | **In charge on the development router, behind a marker:** `backend/watch` runs `awg`, `presence`, `link`, `meter`, `usage` and `journal` every second and writes what the ucode that remains reads; the agent's watcher stands by while `backend.beat` is fresh and takes everything back within a second of it going stale (`/etc/dawnline/backend-watch` turns it on; `backend-shadow` instead only compares). Each part is held to ucode's own output (`scripts/ucode-golden.sh`: the model on two fixtures, the link step for step over 36 000 made-up reads, the counters after 400 made-up looks). **Left:** make it the default once it has run for days on real traffic; then `status` is put together from the topics instead of asked from ucode, and the files go with the ucode that reads them (stage 5). | +| 5 | **The model and apply.** `uci` and `model` (read and the one writer), then `apply` (awg, nft, netifd, firewall, the netns path) under one supervisor loop; the RPC methods move from `luci.dawnline` to `dawnline` as their part lands. The ucode agent, rpcd plugin and CLI are deleted. | **Begun:** `backend/uci` reads the file as libuci does; `backend/model` reads it exactly as `dawnline.core load()` does, held to ucode's own output on two fixtures (`scripts/ucode-golden.sh`), and works out a server's address, MTU and DNS as `dawnline.core` does (`derived.go`); `backend/ipnet` reads and collapses networks as `dawnline.util` and `dawnline.net` do; `backend/handout` makes a device's configuration and its fingerprint, character for character what `dawnline.awg client_config` and `config_fingerprint` make for 24 devices across plain WireGuard, the junk-only disguise and the 3.1 one, every kind of access, a device with its own network kept outside, and home networks from two interfaces made up in the golden's container. `backend/state` says where a person stands (paused, past the end date, over the limit, no server, server off) and what they used of what limit, as `dawnline.core person_state` does for 10 people at 10 moments. `backend/netview` finds the router's interfaces, its WAN and LAN and each person's home networks as `dawnline.net` and `core.person_home` do, from what a router made up in the golden's container said (a bridge with ports, a guest interface, a VPN client, a placeholder). With the watcher on, `backend/roster` makes the people of every `status` ucode answers from these and compares the two field by field (topic `roster`, and the log where they differ for three looks): on the development router, 2026-11-12, three people and six devices, no difference; the same for the router's sums, its 60 days and its last 24 hours, and what of a server's view follows from the settings, the tunnels and the counters (its peers and who of them is online, its MTUs, address, DNS, its people's days). While they agree, **the stream's `people` topic is Go's own**: put the moment the watcher sees someone come, leave or move (no call to ucode stands between the event and the page), and again with each status for the counters; the bridge leaves that topic alone (`bridge.Own`), and takes it back the moment a difference holds for three looks. The same now holds for `traffic`, `services`, `circles` and `recent` (the log's newest sixty, with home names): Go's own, on the same terms. So are the `places` (a point for each address a device was seen from, the router's own addresses left out: 35 points on the development router, the same as ucode's). And the `servers`, whole (their interface's state from netifd, their home interfaces, their disguise as shown, the proof that the port is reached from outside), while none of them is kept down: why one is, is a sentence in the reader's language that only ucode writes yet, and with one kept down the topic is ucode's again. And **what changes only those no longer asks ucode anything** (`bridge.Quiet`): someone coming or going, the counters, a line of the log. And the `router` and `clock` topics (the version, the hostname, the offset from UTC, the settings as shown, the home-like path's state from `loop.json`, what of AmneziaWG is installed and loaded, what it can do as ucode last worked it out in `awg-caps.json`, the public address): on the development router the topic Go put was byte for byte the one ucode's status gave. **With every topic Go's own, ucode's `status` is no longer asked for the pages at all**: Go tells its topics again every 30 s while someone looks (`bridge.Tell`: the counters, the uptimes and the clock move with no event), and ucode is asked only when the settings or the configurations handed out change and every 10 minutes (`bridge.Audit`), to be compared with (on the development router: not once in 70 s with a page open, where it was every 30 s). Why a server is kept down and why the home-like path was refused are worded by Go too, as ucode words them for a reader with no language (`roster/router.go`), the disguise values AmneziaWG cannot take named one by one: `backend/disguise` is `obf_unsafe`, sentence for sentence on 32 made-up sets of values. What AmneziaWG can do is worked out by Go itself (`backend/awg/caps.go`: the protocol script, the tool, the module's package version, an update that waits for a reboot; `gen`, `pending` and `running_gen` held to ucode on 14 versions and 144 runs), the same on the development router as ucode's. **Nothing of `status` is ucode's alone any more.** It is still asked on a change of the settings and every 10 minutes, only to be compared with. **Left:** the comparison and the bridge go once the roster has run for days; then the RPC methods, the writer and apply. **The methods move one by one** (`backend/methods`): the Go object answers a question with the arguments and the answer `luci.dawnline` has for it, a failure as `{ error }` in the page's language; `hello` names the questions it answers (`methods`), and the admin's one `call()` then asks them of `dawnline` instead (`web/src/admin/api.ts`), so a router without the Go watcher keeps asking ucode. The access list names each (read: `events`, `person_usage`; admins only: `person_links`). First three, 2026-11-12: `events`, `person_usage`, `person_links`; on the development router 17 questions asked of both backends (filters, limits, every person, an unknown one in Russian) got the same answers. The language is Go's own reading of LuCI's catalogs (`backend/i18n`: the lookup and the plural rules as `luci.core` answers from two catalogs made for the test). Then `device_config` (admins only; the server's IP for the apps that take no name comes from `backend/resolve`: the public resolvers before the router's own, A and AAAA at once, answers kept five minutes), `service_log` (the watchdog's targets in the file's order, their names in the page's language) and `backup_list`: ten more questions, every device's configuration among them, the same from both. Then `settings_get` (the settings as written and as they take effect, the packages a feature misses, the portal's certificate and when it ends as `openssl` writes it, the TCP ports taken and by whom from `netstat` and the firewall's forwards, what the log and the history hold) and `backup_read` (admins only): six questions, the same from both, 14 taken ports and the ACME certificate among them. Known difference: a port forward with neither a name nor a section name is called by its place, not by libuci's made-up name. Then `server_ports` (the UDP ports a server cannot take: the other servers, the router's own tunnels, what `/proc/net/udp` has bound and whose it is, forwards; the networks a tunnel network must not overlap): 15 UDP ports, 14 TCP ports and 3 networks, the same from both. Then `interfaces`: `backend/netview` now makes the whole of `dawnline.net`'s snapshot (each interface's category, whether it is up, its bridge and a bridge's ports, its addresses, its firewall zone by device or by network, every zone's name) and what a server uses of it (`ServerNet`: its WAN, its home interfaces with their zones, a saved one that is gone), the same as ucode on the golden's router with two more zones made up for it, and on the development router's ten interfaces through netifd. Then `updates_status` (the firmware, the last check and job as the updater left them, a job whose worker no longer holds the update lock read as failed, the policy, what is kept for a rollback and still on disk, the translations installed, the history's newest twelve, the AmneziaWG tunnels): the same from both. Then `setup_defaults` (what a new server starts from: a free id, interface name, port and network, the address to reach the router by and where it came from, the zones, the portal's port): the same from both but for the port and the network, which each backend draws at random once the usual ones are taken. Then the three that ask GitHub, `updates_releases`, `updates_notes` and `updates_changes` (`backend/github`: the API over Go's own HTTPS, answers kept ten minutes in the files the ucode backend keeps its own in, so the two share GitHub's hourly allowance; a rate limit and an API error told as ucode tells them): eight questions, each backend fetching for itself, the same answers. The binary is 8.2 MB with it. Then `endpoint_probe`: `backend/endpoint` is `dawnline.health`'s facts about a public address and their words (a name that does not resolve, Cloudflare, CGNAT, a private WAN, a name that points elsewhere, AAAA records that are not the router's, an IPv6-only name), fact for fact and sentence for sentence on 26 made-up reads; on the development router twelve questions got the same verdicts, with one known difference: a name with several addresses lists them in the order Go's resolver sorts them, not the DNS answer's, and a name behind a load balancer may answer each backend with another address. **Health** (`backend/health`: every check a pure function of what is read on the router, so each way a check fails is made up in a test, 41 of them; `methods/health.go` reads the router). Its three harder inputs are held to ucode on a settings file broken on purpose (`testdata/broken.uci`): what is wrong with people and devices (`ModelErrors`, 16 sentences), who is loaded into each tunnel (`TunnelDevices`) and how a tunnel stands against that (`PeerDiff`); the proxies' diverts and the reply table (`ProxyDiverts`, `ReplyScript`) are tested in Go only. On the development router all of ucode's 18 checks come out the same from Go, in the same order, in English and in Russian, with the watchdog's state and the log beside them; all of them pass there, so no failing sentence has been held to ucode's on a real router. `portal_info` with it (the addresses the portal could use, best first, and Health's checks of the portal): the same from both. Then `home_hosts` (leases, static hosts and what umdns hears, inside a server's home networks; a device's services in the order of their type and name, where ucode has umdns's own order) and `export` (admins only), the same from both on the development router (seven hosts, eleven sections; umdns does not run there). `export` is the first method of Go's that writes the service log: `backend/servicelog` is `dawnline.util`'s `slog` and `syslog` (an entry a line of JSON in `service.log`, the same in words in syslog at the admin's level), and its line in syslog was ucode's, letter for letter. Then `access_check` (`backend/access`: the walk through the same rules the access table and a device's configuration apply, each step a sentence), held to ucode on a household made up for it (`testdata/access.uci`: three servers with circles, every device reaching each other, and none; twelve people with every kind of access, a paused one, home services, home networks of their own; fourteen devices) on the golden's router: 580 connections, step for step and sentence for sentence. On the development router 256 connections between its six devices, the router, home and the internet, in English and in Russian: the same from both. **Every question is Go's now: twenty-one methods.** `luci.dawnline` is asked only to change something. **The first methods that change something** are those that touch neither the settings nor the tunnels: `logs_clear` and `service_log_clear` (admins only). What they leave on disk is held to ucode file for file (`journal/testdata/clear.uc`: eleven filters over a live log and an older copy on flash, seven cuts of the service log), under the same lock the watcher writes the log under, and what went is written in the service log as ucode writes it. They are never run against a real router's data to compare: there only their refusals were asked of both (an unknown person, an unknown category, a bad age), the same. That golden holds the container's clock, so it changes with every run and CI does not diff it. Then `usage_clear` (the watcher forgets in its own counters at once and puts them on flash, `Watcher.ResetUsage`, where ucode left a request for the agent's next minute and edited the live file meanwhile), `geo_clear` and `backup_delete`: tested in Go, and on the development router only their refusals were asked of both, the same. **The writer's ground is laid, and nothing uses it yet.** `backend/uci` writes the settings file byte for byte as libuci commits it (`Format`: the model's two fixtures as a commit leaves them) and changes it as a cursor does (`Set`, `SetList`, `Delete`, `Add`, `DeleteSection`: twenty changes in a row, the file after each the same as libuci's, an option that changes kind keeping its place, an empty value removing it); options keep the order they stand in (`Section.Order`). `backend/store` is `dawnline.store`'s transaction: under the same `config.lock` the ucode backend takes, against the settings read inside the lock, written whole under a hidden name beside the file and renamed over it, mode 0600; a change that is refused or does not reach flash writes nothing. **The first methods that change the settings are Go's**: `service_set` and `service_delete` (`methods/write.go`), on `store.Transact` with the checks `dawnline.rpc.home` makes. Putting a change into effect is still ucode's: Go asks it for its runtime sync over ubus (`luci.dawnline sync`, a method added for this and gone with the port of apply) and passes on its warning; then the watcher reads the settings anew and the topics are put again, so a page sees its change at once (`Deps.Told`). Held to ucode on access's household (`methods/testdata/write.uc`): sixteen changes and refusals in a row, the settings file after each byte for byte the one the ucode method leaves, each refusal in its words. On the development router a service nobody has was added, changed and removed through Go: the stream had it and lost it at once, and the settings file ended byte for byte what it was, mode 0600, no temporary file left. Then `circle_set` and `circle_delete` the same way (twelve more steps of the golden: a new circle with members of whom one is on another server and one unknown, a colour out of range either way, a name another circle of the server has in other letters, removal with its members let go; an id made at random is taken from the golden's file for the comparison). On the router a circle nobody is in was added, changed and removed: in the stream and out of it at once, the file as it was, three lines in the service log (added, changed, removed) as ucode writes them. Then `person_pause`, the first that writes the activity log: its event goes in with the names it carries and, being about the system, into syslog too (`journal.Level`, `journal.Line`: `dawnline.live` `event_level` and `event_line`). Five more steps of the golden, a pause of someone already paused among them, which writes nothing and refuses nothing. On the router only its refusal was asked: nobody real was paused. (The watcher's own events are all about connections, which stay out of syslog in ucode too; a limit reached or a pause that ends is still the ucode agent's to log.) Then `person_delete` (five more steps: someone with one device, with three, someone already gone, a device's id, a server's): on the router only its refusal was asked. Then `person_update` and `people_update` (`methods/person.go`: `dawnline.core`'s `update_person`, field by field in its order, and `bulk_changes`): 68 more steps of the golden, 106 in all. They hold what no reading of the code would have: a number is read as ucode's unary plus reads it (`' 7 '`, `'3.9'` cut to 3, `'1e1'`, `'0x10'`), a small one is written as C's `%g` writes it (`1e-05`), a day that does not exist is no end date, a move to another server gives every device the first free address there and drops the circle and the home networks, and **a list that replaces a list goes to the section's end** while an option that becomes a list keeps its place (the cursor's own ways; `uci.SetList` follows them now). Extra data (`bonus_gb`) above zero writes a moment that depends on the clock, so the golden has only its refusals and its clearing. On the router a note was put on a person and taken off again through Go: written, the person answered the same as ucode's for the same call (the methods' world is now the completed one, `roster.Complete`, with what each device was last given), six refusals the same, the settings file byte for byte what it was. Then `person_create` and `person_regen` (nineteen more steps, 125 in all): an id from the name (`slugify` over `handout.Translit`, `_2`, `_3` for a name taken, `user` for a name of no letters), a personal code of three words of three syllables, the moment; a new link with the devices the old one handed out taken away when asked, and no sync when none is. The code and the moment are ucode's dice and clock, so the test hands Go the ones the golden's file has. All people's methods are Go's with them. On the router a person with no device was added, given a new link and removed: in the stream and out of it at once, the settings file byte for byte what it was; three lines stay in the activity log. Then `device_update` and `device_delete` (`methods/device.go`, twenty-five more steps, 150 in all): a name by `valid_device_name`'s rule (letters of any language, no symbols, twenty characters), a name another device of the person has, off and on, an MTU and a keep-alive of its own and the server's again, LAN Bypass; a change of the link values alone writes and asks for no sync, as in ucode. On the router only their refusals were asked, the same: a real device renamed or given other link values would show as changed to its owner. Then `device_create` and `device_rotate` (thirteen more steps, 163 in all; the golden's container has no AmneziaWG, so there the settings they leave are `dawnline.core`'s `create_device`, `set_device_kind`, `set_device_link` and `rotate_device` called with keys made up for it). The keys are made in Go, with no tool: a Curve25519 private key clamped as `awg genkey` clamps it, its public key, 32 random bytes to share (`crypto/ecdh`). The configuration given out is marked in `issued.json` and a device set up again in `reconnect.json`, under ucode's locks. All devices' methods are Go's with them. On the router a device was added to a person made for it, given new keys and removed with them: the public key was the one `awg pubkey` makes of the private key both times, the sync loaded it into the tunnel and took the old one out, the configuration came back, the marks were written, and the settings file ended byte for byte what it was. Then `settings_update` (`methods/save.go`: `dawnline.schema`'s `validate` for every kind of setting, and `check_portal`; 57 more steps, 220 in all): each kind at its edges, a value back to its default, the list of log categories that stands for the older switch, the portal's port against the router's own ports, the next port for plain HTTP links, a port another program holds or a forward sends on. Two things differ from ucode by design: the settings of one call are taken in the schema's order, not the caller's (the bus hands them over as a map), and a change that restarts the portal runs the service's reload a second after the answer is out, since that reload may restart this very process. The golden corrected the list rule once more: **a list of one entry goes to the section's end whatever was there, a longer one keeps the place of what was there** (`uci.SetList`). On the router a setting was changed and put back through Go: saved, told in syslog as ucode tells it (`admin changed settings · log_keep_days: default → 41`), answered as `settings_get`, six refusals the same as ucode's, the settings file byte for byte what it was. A change that restarts the portal was not tried there. Then `server_update` (`methods/server.go`, 33 more steps, 253 in all): a name, a public address, a port against what holds UDP ports, on and off, who reaches whom, MTU and keep-alive, DNS servers of either family, and a new tunnel network that must be private and free, with every device given an address in it, lowest first. It ends in ucode's full apply (`luci.dawnline apply` over ubus, a minute at most), whose answer is passed on. That apply notes a migration in the settings the first time it runs, which the test puts where apply puts it. **On the router only refusals with an id that does not exist are asked of a server's methods.** On 2026-11-12 a probe meant to be refused (`subnet: 192.168.1.0/24` on the real server) was accepted, since that network is free there: the tunnel network changed and every device was renumbered, until the settings were put back from the pre-deploy backup 80 minutes later. A value-dependent refusal is held in the golden's container, never on a real server. Then `server_interfaces` and `server_delete` (fifteen more steps, 268 in all, on the golden's router: a bridge's port refused for the bridge, an interface in no firewall zone refused as WAN, the WAN refused as a home network, a saved name that is gone kept, the zones kept in step), and `backup_create` (`methods/backup.go`: a tar.gz written in Go with the paths ucode's restore unpacks, whole or not at all, the oldest of each kind beyond its number removed; `server_delete` makes one first). On the router a backup made by Go was read by `tar`, held the settings as they are, was listed by ucode as the newest, and was removed again; the servers' methods were asked only with an id that does not exist. Then `server_obfuscation`: `backend/disguise` makes a method's values as `awg.obf_preset` does (`Preset`: none, AmneziaWG 2.0's with DNS-shaped signature packets of the server's own, 3.1's with a header protection key) and checks them as `obf_errors` does (`Errors`, on 39 made-up sets the same sentences as ucode). What the dice decide cannot be compared value for value: a Go preset has the names, the order and the shapes of forty presets ucode drew, passes its own check, and ucode's pass it too (`testdata/presets.uc`, which CI does not diff; nor the methods' golden, whose ids, codes and moments are ucode's dice and clock). The golden's container has no AmneziaWG, so there only no disguise can be set and the others are refused in ucode's words (six more steps, 274 in all); with an AmneziaWG that runs them the method is tested in Go. Then `server_create` (eighteen more steps, 292 in all), the wizard's last step: an id, an interface name and a port that are free, a private tunnel network that overlaps none, every fault of the definition told at once, the keys made in Go, the disguise of its method, the portal as asked and checked as it will be; then ucode's full apply, and the service turned on and restarted in the background (`Deps.Restart`: this very process restarts with it). For the golden ucode's own method runs on a copy of ucode with the one check taken out that needs AmneziaWG's module loaded, and a stand-in `awg` gives two made-up keys. On the router it was asked only with an id no server can have. **All servers' methods are Go's.** Then `health_fix` (a fix by its name: apply and sync are passed to ucode, a restart of the service or the network runs in the background after the answer, `ifup` only for one of Dawnline's own tunnels), `updates_run` (the target checked as ucode checks it, the ucode updater started with the admin's language, the new job answered once the updater wrote it) and `apply`: tested in Go; on the router four refusals the same as ucode's, and a check for updates started through Go ran and ended. **Fifty methods are Go's.** Then `backup_restore`, `backup_upload` and `import` (`methods/backup.go`): an archive read in Go and held to `check_archive`'s rules (only Dawnline's three files, regular files only, the settings among them, sixteen megabytes at most), the settings in it checked as `dawnline.backup config_errors` checks them (`health.ConfigErrors`: on settings whose servers are wrong in every way, the same thirteen sentences as ucode) before anything is touched, a backup of what is there made first, the settings written first under the config lock, the counters and the log handed back to flash for the watcher to load anew, then ucode's full apply. A backup ucode made with its own tar is read file for file (`testdata/backup.uc`). An import writes a section's options in the order of their names, where ucode keeps the export's order (the bus hands them over as a map). On the router only what cannot be a backup or an export was sent: six refusals the same as ucode's, nothing touched, no backup made. **The apply has begun, with what decides who reaches what.** `backend/nft` makes the table `inet dawnline` as `dawnline.nft` does: who is in which set by each person's state (`AccessSets`), the table's text (`Render`), the script that replaces every set's members at once (`Update`) and the one that replaces the table (`Rebuild`). Held to ucode byte for byte on nineteen tables: access's household under four rows of states and four of what is read from the router (the netns's DNS, the resolver in the netns or on the router, the LAN's DNS, each also as something that is no address), and a second household for what the first has none of (services with ports, one of them no number and one on IPv6, home names, two devices with one address, a server that sends the internet through the LAN, one without keys, one whose interface name will not do, a portal on a port people never reach through the tunnel); a test fails if a set is filled by no case. Nothing loads it yet: the table on a router is still ucode's. **The runtime sync is Go's** (`backend/apply/sync.go`, `dawnline.apply` `sync`): the sets' members replaced at once, the whole table rebuilt when that fails, a failure told once in the service log and kept in `nft.err`; fail closed (with no table at all nobody is loaded into a tunnel); each tunnel given its devices by `awg syncconf`, the file with its key removed again; the hostnames for dnsmasq; people's states in `states.json`; the warning for the admin. Under the same `apply.lock` and with the same remembered files (`nft-sets.json`, `peers-seen.json`) as ucode, so either may run. Held to ucode on the golden's router with stand-ins for `nft` and `awg` that keep what they are given: nine syncs in a row (no table yet, the sets alone, someone paused, a table that will not load while the old one stays, one that will not load when there is none, the same failure again, a tunnel that refuses its devices, a tunnel that is down, all well), and for each the scripts loaded, every tunnel's peers, the hostnames and who may read them, the states and what is answered: the same. On the development router Go's plan of a sync (`sync_plan`, which loads nothing) was the table ucode renders line for line, the same script for the sets, the hostnames dnsmasq reads and the six devices the tunnel holds. It is **turned on there by `/etc/dawnline/backend-sync`** (2026-11-12): what the Go methods change is put into effect by Go's sync, with no call to ucode; a service added and removed left the table, the tunnel and the hostnames as they were. Without the marker the sync is ucode's. **Left of apply:** the full apply (netifd, firewall, the home-like path, the resolver, the reply table), which the servers' methods, a restore and an import still ask of ucode; the agent's own sync every minute is ucode's too. **Left of `dawnline.rpc.*`:** `uninstall`; the apply (`apply.sync`, `apply.apply`); the backups that write settings (`backup_create`, `backup_restore`, `backup_upload`, `import`); `health_fix`; the agent's remaining duties, the CLI. `backend/view` already makes a person and their devices as `dawnline.view person_view` does, field for field for four people and seven devices, the admin's view and the person's own, with a watcher's word on presence and without one (labels that collide, a device set up again, one whose configuration changed since it was handed out, a limit month with extra data). | +| 6 | **Site-to-site** ("Networks behind this device", issue #4), built on stage 5's model and apply. | After the migration, by the owner's decision. | +| 7 | **Updater and health**, last: they change least and are used least. | | + +### The full apply (stage 5) + +The full apply is Go's own: `backend/apply` holds each part, and every part is held to the ucode module it replaces by a golden taken in the OpenWrt container (`scripts/ucode-golden.sh`, the files after each of a row of changes compared byte for byte, the commands in their order). + +| Part | Go | Golden | +|---|---|---| +| Tunnel interfaces in `/etc/config/network` (`dawnline.netifd`) | `netifd.go` · `Router.Netifd` | `testdata/netifd.uc`, 9 steps | +| fw4 zones, forwardings, WAN rules (`dawnline.fw` sync) | `fw.go` · `Router.Fw`, `FirewallDiffers` | `testdata/fw.uc`, 11 steps | +| The table that keeps our answers out of proxies (`sync_reply_routes`) | `reply.go` · `Router.ReplyRoutes`, `ReplyOK` | a test of its own; the script itself is `health`'s golden | +| The Home-only resolver's configuration (`dawnline.resolver`) | `resolver.go` · `Router.Resolver`, `SyncResolver` | `testdata/resolver.uc`, 6 steps | +| "Like a home device": netns, links, policy rules (`dawnline.loop`) | `loop.go` · `Router.LoopEnsure`, `LoopRemove`, `LoopPlanFor` | `testdata/loop.uc`, 15 steps with a stand-in `ip`, and the pure parts | +| The network signature (`net_signature`) | `apply.go` · `Router.NetSignature`, `NetChanged` | `testdata/sig.uc`: the same text, the ucode agent compares it | +| One-time steps for older set-ups (`dawnline.migrate`) | `backend/migrate` | a test of its own | +| All of it under the apply lock (`dawnline.apply` apply) | `apply.go` · `Router.Apply` | the parts' goldens; on the router by `apply_plan` | + +**On the router** it runs behind a marker, `/etc/dawnline/backend-apply`: with it, the `apply` method and every method that ends in a full apply run Go's; without it they ask the ucode backend as before. Remove the file to go back. + +**`ubus call dawnline apply_plan`** is the full apply with nothing applied: each part runs on copies of the files it would write, commands that only ask the router something are run, the ones that would change it are noted. It answers which lines of `network` and `firewall` would change (keys never shown), which commands would run, and whether the network signature holds. Right after a ucode apply it must find nothing to do; that is how the Go apply was held to the development router before the marker was set (2026-11-12: nothing to change, then a Go apply left `network`, `firewall`, the settings and the access table byte for byte as they were, all six devices in the tunnel). + +**`auto-merge` is gone from the access table's interval sets** (`home_`, `tun_nets`), in Go and in ucode: nft 1.1.6 takes about 0.9 s to load a set that has it on an MT7981, and the networks in those sets are collapsed before they are written (`Collapse`: none covers another, so none overlap). A full apply on the development router went from about 1050 ms to about 300 ms. + +**The keeper** (`backend/apply/keep.go`, `Keeper.Tick` once a minute from `dawnlined`, with the same marker) is what holds the router to the settings between the admin's changes, the ucode agent's steps "Access rules", "Internet like a home device" and "Router": a runtime sync when people's states changed, the settings' file was written by anyone, the access table is gone, a running tunnel holds other devices than it should, or ten minutes passed; the home-like path, the resolver and the reply table kept in step; everything applied again when the router's networks stay changed for two ticks. The agent leaves those three steps alone while the marker is there and the backend's beat is fresh (`backend_keeping()`), and takes them back within a tick when it is not. Checked on the development router: the access table deleted by hand was back on the keeper's next tick, every device still in the tunnel. + +**`uninstall` is Go's** (`backend/methods/uninstall.go`, `Router.Teardown`): no admin method is left to the ucode backend. The order differs from ucode's on purpose: the settings are emptied first (whatever applies in between then works from nothing and puts nothing back), then the router is cleaned from the settings as they were, and the service is stopped last, once the answer is out, since `dawnlined` is part of it. Held by tests (`TestUninstall`, `TestTeardown`: `network` and `firewall` end as they were before Dawnline, an interface of someone else's under a tunnel's name untouched); never run on the development router. + +**The minute's other work is Go's too**, with the same marker and the same stand-by of the agent: + +- `backend/chores` (`Chores.Tick`): people's states that change on their own (end date, data limit) and an end date's last days go to the activity log, and those people's pages are told (`presence.poke`); a renewed certificate is told and taken, one that runs out within a week is told once; a changed public address is told, with the servers that still hand out the old one; the settings are backed up in the night's third hour when they changed; an automatic update check or install is started when one is due (`Due`). What was told is kept in `notes.json`, the file the agent kept, so neither repeats the other. +- `backend/watchdog` (`Probes`, `Pass`): the same targets, waits and words as `dawnline.watchdog`, the same `watchdog.json` (the Health page reads it either way). One target is gone on purpose: `rpc` (is `luci.dawnline` in rpcd) guarded the plugin that is being retired, and its repair restarted rpcd. A target reads from facts gathered once a pass (`methods.WatchdogFacts`); `Router.NetifdDrift` and `Router.FirewallDrift` are the two that compare a configuration with what an apply would write. + +Checked on the development router: the first pass of Go's watchdog found all seven targets well, the chores' first minute told nothing that was not new and started no update. + +**And the rest of the agent's minute**, with the same marker: + +- the speed record (`chores/rate.go`): `rate.json` and `rate_people.json`, a point a minute from the counters' totals, the same shape the pages read; +- the logs on flash (`Chores.keepLogs`): the service log trimmed and copied (`servicelog.Log.Trim`), the activity log copied as often as Settings says (`journal.Log.Persist`), the places' cache hourly; +- the places for the map (`backend/geo`): the cache, what is stale, the two services, the merge that never pushes out an address still shown (the cases of `tests/ucode/geo.test.uc`), and `Locator`, which runs lookups by itself, three addresses a run, so nothing waits on the network. `dawnlined` takes the watcher's `geo.poke` itself and asks over Go's own HTTP client (no `uclient-fetch`); a place found goes onto the connections logged before it was known (`journal.Log.SetPlaces`). + +With the marker set the agent's tick does nothing but stand by: every step is the backend's. It stays as the fallback for a backend that is not alive (its beat), and it still saves on a clean stop. + +**The Go side is the default** (2026-11-12). No marker is read any more: where `dawnlined` runs on the router, the init script starts it with its watcher and the portal, and its apply, sync, keeper, chores and watchdog are in charge. One file gives all of it back to the ucode backend for as long as that one is shipped: `/etc/dawnline/backend-off` (then `/etc/init.d/dawnline restart`). The older markers (`backend-watch`, `backend-portal`, `backend-sync`, `backend-apply`) mean nothing now; where this document names one above, read "by default". Checked on the development router with every marker removed and the service restarted as a fresh install starts it. + +**The command line is Go's** (`backend/cli`, run as `dawnlined cli …`): `/usr/bin/dawnline` is now a few lines of shell that hand their words to the backend's binary where it runs, and to the ucode command (moved to `/usr/libexec/dawnline/cli`) where it does not or is switched off. What the service itself needs works with no backend running: `apply` (what the init script runs when the service starts, and the updater after an update), `sync` and `iface-event` (the hotplug script, a tunnel coming up or going down), `portal-cert`, `portal-http-port`, `teardown`, `log`, `version`. What an admin types about people and devices (`status`, `health`, `person …`, `device …`, `backup`) goes through the running backend, the same methods and the same topic the pages use, so there is one place a person or a device is made. Checked on the development router against the ucode command: the same certificate, the same people, devices and addresses. + +**A sync replaces the table whole** (in Go and in ucode, `rebuild(m, sets, members)`), never a set in place. To add an element to a set that exists, nft first reads the router's whole ruleset, every other program's sets with it: 0.9 s on the development router, whose ruleset is 0.8 MB beside a proxy's lists. Replacing our own table reads nothing: 0.06 s. Nothing reads the table's counters, and the replace is one transaction. `dawnline sync` went from 2.1 s to 0.12 s there, and every change an admin makes ends in one. + +**The portal's API is Go's** (`backend/methods/portal.go`, `Portal`, behind `portal.Server.Native`): the door, the count of wrong codes, the shell, the assets, the state, a configuration and every change a person makes through their link are answered by `dawnlined` itself; no ucode process is started for the portal any more, and a page's stream reads its state without one. The device changes are the admin methods' own code with an `Actor` (`DeviceCreateAs`, `DeviceUpdateAs`, `DeviceRotateAs`, `DeviceDeleteAs`): the portal is held to the person's own devices and their limit, cannot touch a device the admin turned off, may bring the browser's public key, and has the new keys of the device a page came through loaded a moment after the answer. Held to the ucode portal three ways: `TestNativeAsUcode` asks both the same 26 things in both OpenWrt rootfs images (`scripts/backend-container.sh`: the page byte for byte, the state and a configuration field for field, every refusal with its status and words, in English and Russian); `TestPortalChanges` and `TestPortalLimits` cover what changes and what is counted; and on the development router the state of each person was the same in every field as the ucode portal's for the same request. The ucode portal answers only where the backend runs without its watcher (`backend-off`). + +**The updater is Go's** (`backend/updater`, run as `dawnlined updater …`; `/usr/libexec/dawnline/updater` hands its words over, the ucode one is `updater.uc` beside it): the job with its lock, log and phases in the admin's language, the three checks, the installs of Dawnline (latest, a tag, the same again, the kept version, a translation), of an AmneziaWG build (with the kernel module swapped or left for the next boot, and the record of it) and of the system packages with their families, the automatic run, and the restarts after a job. Under it `backend/pkgmgr` (opkg and apk behind one interface) and verified downloads in `backend/github` (`Download`: GitHub first, a mirror only with a sha256 from the API; Go's own HTTP client, so neither curl nor uclient-fetch and its 4 KB header limit). Held by tests on the cases `tests/ucode` holds the ucode modules to (versions, generations, a pending reboot, package files, what apk left alone) and by whole jobs on a made-up router (`TestCheckAndInstall`, `TestInstallRefusals`, `TestAuto`). On the development router a Go `check` gave the same `update-check.json` as the ucode one in every field, with the same lines in the job's log, in 5 s against 9. **An install was never run on the router by the Go updater**: that part rests on the tests until a release is cut. + +**Left in ucode:** the agent as the fallback (a backend that is not alive, or switched off) and the rpcd plugin itself with the temporary `sync` method; the ucode command line, apply, portal and updater stay beside them as that fallback's. `postupdate` (a shell on purpose) still judges a new version by `luci.dawnline` and the agent: it changes with them. + +**The backend asks nothing of ucode while it keeps the router** (2026-11-12). The stream's topics are Go's own without being held against a ucode `status` first (`roster.Roster.Sole`, `bridge.Bridge.Sole`: the bridge only has them told again when the settings change, when somebody starts to look, and with the minute; `TestSoleNeverAsks`). Before the switch the two had agreed on the development router with no difference ever logged. The methods' calls to `luci.dawnline apply` and `sync` are gone, and with them the temporary `sync` method of the rpcd plugin. What is left of ucode on a router with the backend is a fallback nothing calls: the agent standing by, the rpcd plugin, and the ucode command line, apply, portal and updater behind `backend-off`. + +**Told as the router is at that moment** (2026-11-12). When the bridge has the topics told, the watcher looks first (`daemon`: `tell`), and topics that could not be made stay due: the bridge asks again with its next second and does not put `backend` until they are there (`bridge.Bridge.Tell` answers whether it told). Before, the bridge told from what the watcher knew at its last second, and took for told whatever came of it. Its second comes just before the watcher's, so a page that was open while the backend restarted asked in the first second, was told nothing (the watcher had not looked yet: no world), and got its first documents with the next `Refresh`, half a minute later, unless someone came or went meanwhile; and settings changed on disk were told as they were before, `refresh` included. Measured on the stand (`TestThroughUhttpd`, a restarted backend whose watcher starts 0.3 s late, as on flash): the first documents 32 s after the page asked before, 1 s after. That test now runs the backend's own watcher and topics over a stand's settings and tunnel (`daemon.Options.Tunnels`); it used to wait for the answer of a ucode stand-in nobody asks any more, and failed. + +**The ucode backend is removed** (2026-11-12, on the owner's word). Gone from the package: every module under `usr/share/ucode/dawnline`, the rpcd plugin `luci.dawnline`, the agent and its heartbeat check, the ucode command line, updater and portal (with the portal's own uhttpd). Gone from the repository with them: `tests/ucode`, the ucode lint, compile and container scripts, and the script that made the goldens. What stays of that backend is its answers: the goldens in `backend/*/testdata`, fixed, which the Go tests still compare with. What it left to do was taken over first: the service-log line that says why the backend started (a crash, a restart, a boot, an update, a rollback), the beat the Health page reads, the logs and places put on flash on a clean stop (`backend/daemon/life.go`), the version in a file of its own (`usr/share/dawnline/version`), the translations' source (`backend/i18n/messages.js`), and the pages' one call that still went to the rpcd plugin directly (`person_update`). `/etc/dawnline/backend-off` means nothing any more; a router without the binary runs nothing, says so in the log, and fetches it at its next start. Checked on the development router: the service is the backend and the resolver, no ucode file or process is left, `luci.dawnline` is off the bus, Health reads 18 of 18, the settings, `network` and `firewall` are byte for byte as before. + +Who this leaves out, knowingly: a router whose architecture has no binary (ARM older than v7, 32-bit x86, RISC-V) and a router installed with no network until its first start with one. + +**Before any of the ucode can be deleted, a release has to put `dawnlined` on the router.** The package is `all`-architecture and the binary was built by `scripts/deploy.sh` for the development router alone: a router that installs a release gets no backend, and runs entirely on the ucode fallback. + +What is in place for it, whichever way the binary is delivered: the release workflow builds it for five architectures (`backend` job in `.github/workflows/build.yml`: arm64, arm for ARMv7, mips, mipsle, amd64; static, 9 to 11 MB each: more than some routers have free, which the install has to check) and publishes each as `dawnlined--` with its sha256 in `sha256sums.txt`; `updater.GoArch` names the one for a router by its `DISTRIB_ARCH` (none for ARM older than v7, x86 32-bit and RISC-V: those stay on the fallback). + +How it gets from the release onto the router: **fetched beside the package** (`/usr/libexec/dawnline/fetch-backend`, a plain shell like `postupdate`, since it runs when no backend does). It asks GitHub's API for the release of the installed version, takes the file for this router's architecture through the API (the same way round uclient-fetch's header limit as the updater's), keeps it only when it matches the sha256 the API gives and runs here as that version, and renames it into place. A binary of another version is always removed, fetched or not: two versions never run side by side, and the service then runs on the ucode backend. It is called by `install.sh` after the package is in, by `postupdate` before a new version starts (and again after a rollback), and by the init script in the background, once a boot, when there is no binary. The package's `prerm` removes the file: the package manager does not own it. Tried against a made-up GitHub in both OpenWrt rootfs images: a fresh router, again, over another version, a file that does not match its sha256, a version with no release, an architecture with none. + +This was built without the owner's answer to "per-architecture packages or a fetch beside the package", on the recommendation given; it adds a script and three calls and changes no package. Should the answer be per-architecture packages, `fetch-backend` and its calls go, and the release's binaries become those packages' payload. + +What it does not give: an install with no network leaves a router without the backend until its next start with one; ARM older than v7, 32-bit x86 and RISC-V have no binary at all. So the ucode fallback cannot be deleted outright yet: it can go once the owner accepts that those routers are no longer served, or the backend is built for them. + +### The watcher's takeover (stage 4) + +The agent's 1-second watcher and its counters are the Go backend's while its watcher runs; the agent keeps its minute tick. Who owns what: + +| | Go backend (`backend/watch`) | ucode agent (until stage 5) | +|---|---|---| +| Every second | the tunnels' dump; presence, link, meter; a connect, a leave, a move, a link's trouble into the activity log; `backend.beat` | looks at the beat's age, and at `geo.poke` | +| Counters | `usage`: folded on every event and every minute, written to tmpfs, to flash hourly and on stop; `usage.reset` and `usage.reload` honoured | reads `usage.json` at each tick, never writes it | +| Files the ucode that remains still reads | `presence.json` (with its revisions), `link.json`, `setup.json`, `usage.json`, `meter.json` while asked, `events.json` under the `events` lock | `rate.json`, `rate_people.json`, the rest of the tick's | +| Revisions | moves them with each event, and for the people named in `presence.poke` | writes `presence.poke` where it used to save presence (a state that moved on its own, a place that was found) | +| Places | a connect's place from the cache when it is known; the addresses that connected or moved into `geo.poke` | the lookups: at once for `geo.poke`, each minute for what is shown (`geo.json`; the bridge watches it and `events.json`) | + +Handing over, both ways, is by the beat alone: + +- **The backend starts**: it reads `presence.json` (who was online, the revisions) and `usage.json` as the agent left them, so nobody connects or leaves "again" and no counter is lost. What a link showed starts empty: a state shows again once it held. +- **The backend stops** (or a package without it is installed): it folds the counters once more, writes them to flash and removes the beat; the agent's watcher reads the files back within a second and goes on. If it is killed, the beat goes stale in five seconds and the same happens, with at most a minute of traffic counted from the tunnel's own counters at the next look. + +Measured on the development router (MT7981, 2026-11-11): the takeover and the take-back moved no revision and logged no event; the counters file after the first Go write had the same devices, people and fields, with only that minute's traffic added; `dawnlined` with the watcher holds about 6 MB. + +### What stage 1 is + +``` +backend/ + ubus/ the wire protocol of ubusd: our object, calls, notifications, reconnect (own implementation) + hub/ topics, merge-patch diff, the numbered journal, wait and follow + api/ the object `dawnline`: hello, sync, wait, watch; the broadcast; who looks + bridge/ `status` cut into topics; asks luci.dawnline only while a page looks + daemon/ the parts joined + cmd/dawnlined/ +web/src/shared/live/ signal.ts, patch.ts, store.ts, follow.ts +scripts/backend-container.sh +``` + +Verified by `scripts/backend-container.sh` on the OpenWrt 24.10 and 25.12 rootfs images, against their real `ubusd`, `rpcd` and `uhttpd`: + +- the object, its signature, calls, statuses and notifications, with OpenWrt's own `ubus` tool on the other side; +- a page's whole path: an rpcd session, the package's ACL file, `sync`, a held `wait`, the event stream, the meter under a lease, arguments refused at the door; +- one device coming online reaches the page as a 67-byte patch about 0.6 s after the agent's file moved (the bridge looks once a second; a native producer in stage 4 publishes at once). + +Run on the reference router (2026-11-11, OpenWrt 25.12.5, uhttpd 2026.08.24, from `/tmp` beside the real agent, three people and one server): + +- the event stream through that uhttpd holds for 50 s with a ping every 15 s of silence, and its connection is gone when the client leaves (the leak of older builds is not there); +- the snapshot is 40 KB in ten topics, where one `status` answer is 48 KB and takes 0.39 s in rpcd; +- a page that follows receives about 240 bytes per 30 s while nothing happens, and about 13.5 KB when the agent's minute tick moves the counters: `places` 8.7 KB (its points are a list without ids, resent whole) and `people` 2.9 KB are what is left to cut, by the producers of stage 4 rather than in the bridge; +- the daemon holds 9.2 MB of memory and used 0.23 s of CPU in 154 s of being followed. + +As a service on that router (the same day, deployed with `scripts/deploy.sh`), with Overview open in a browser: the page asks no `rev` and no `status` at all; the bridge asks the ucode backend for one `status` per 30 s for every open tab together (and at once on a change), and for the meter once a second only while a speed is on screen. The backend holds 4 MB of memory there. + +A session opened before the backend's object was in the access list does not have it until its next login (rpcd grants a session its access when it logs in): such a page falls back to asking the router, as on a router without the backend. + +## Decisions + +- **As little ucode as can be** (the owner, 2026-11-12: «Нужно будет максимально уйти от ucode»). The bridge is scaffolding, not a design: a part is ported, held to ucode on fixtures, compared with it on the real router (`roster`), then published by Go, and its ucode call goes. Nothing stays on the bridge once it is ported. + +- **Go, not Rust.** Cross-compiles to every OpenWrt architecture with no SDK, the reference (podkop-exp) proves the approach on the same routers, and nothing here needs what Rust would buy. The cost is the binary: stage 1 is 3.4 MB for aarch64 (3.9 MB mipsle; 1.4 MB gzipped) and 9 MB of memory on the router, and both grow with what is ported. +- **No dependencies so far.** ubus, the hub and the API are the standard library only. A dependency is added when it replaces real work (nftables and netlink in stage 5), not for convenience. +- **podkop-exp is studied, not copied.** Its backend is GPL-2.0-or-later and Dawnline is MIT: its patterns are reused (one door per external system, a single loop for router changes, fakes behind interfaces, golden files from the old backend), its code is not. `backend/ubus` is written from ubus's own protocol (`ubusmsg.h`) and, unlike podkop-exp's, also notifies, calls and reconnects. +- **The package stops being `all`.** A Go binary is per architecture. Until stage 2 ships, the binary is built and deployed for the development router only; the release build then follows podkop-exp's matrix (one SDK image per package architecture) and `install.sh` picks the asset by `DISTRIB_ARCH`. +- **The router's time zone is read from `/etc/TZ`** (`backend/zone`). Go looks for the zone in `TZ` or `/etc/localtime`; an OpenWrt service has neither, so a Go program there counts its days in UTC. Found the first night the watcher ran (2026-11-12, MSK): after local midnight the traffic went on into yesterday's UTC day and «Today» read 0 B. Everything that needs local time asks `zone.Local()`; the watcher takes the file again when it changes. A golden made with `TZ=UTC` cannot see this: `usage` and `zone` have their own tests in a zone east of Greenwich. +- **A router stands for the networks behind it** (site to site, issue 4; 2026-11-12). A device of kind `router` may have networks of its own behind it (`list behind_net`), which the tunnel then carries both ways. `model/behind.go` is the one place that says what may be one (a private network from /16 to /30, eight a router) and which are in effect (`BehindOf`: none that shares addresses with a tunnel's subnet, with a network the router has itself, or with one an earlier device has), so a bad line in the file never takes a route away from the router or from another site. Everything else is made from that answer: the peer's `AllowedIPs` (`apply.PeersConf`); the router's routes (`apply/routes.go`: reconciled, every route of ours marked with routing protocol 205, and only into a tunnel that took its devices); the home-like path (the networks keep their direct route, and the netns answers them through the tunnel); the access sets, where a network stands wherever its router's address does, so a host there has exactly its owner's access and is reached by exactly those who reach the router (every run-time set takes intervals for it: the set declarations in the goldens of `nft` and `apply` were edited by hand, the rest of each table is still ucode's byte for byte); and the configurations of the devices that reach it (`model.BehindReach`), whose fingerprint then tells them to import again. `device_networks` sets a router's networks and ends in the full apply, since the home-like path's rules move. None of this is held to ucode: there never was a ucode version. Checked on real `nft` (1.1.1 and 1.1.6, the table loaded and its sets replaced) and `ip` of OpenWrt 24.10. **On the development router** (2026-11-12, OpenWrt 25.12.5, `nft` 1.1.6, iproute2 6.18, one server with six real devices; a person with the internet alone made for it and removed after, so no real device's configuration was touched): the table with its interval sets loaded on the router's own kernel, `fib` rules and all, with the same members as before; a router added with two networks got them in its peer's AllowedIPs, a route each (`ip route get` answers the tunnel), and its place in `inet_ok` and in no home set; changing the list moved the routes and the same list applied nothing; the refusals named the real tunnel's network and the router's own LAN; a router asked for through the person's link waited outside the tunnel with no configuration (409), was turned down, put back and taken, a network asked for later was taken on its own and another taken away by its owner at once; Health said how many networks the tunnel carries and Check access walked a host behind the router. With the person removed the routes, the peers and the sets were as before and the settings file byte for byte what it was. **Not checked there:** packets through a real far router (no second site to test with), and the home-access case, where other people's devices are given the networks. +- **A router and its networks may be asked of the admin** (2026-11-12). On their own page a person adds a router and names the networks behind it; what then happens is the server's rule (`portal_routers`: off, ask, free; `portal_nets`: ask, free; a server starts with ask for both, and the page is told the rule and is not offered a router where it is off). Asked, neither takes effect: the router waits (`waiting`: no device of the tunnel, in no access set, no configuration, no new keys; `health.TunnelDevices`, `nft.AccessSets`, `model.BehindOf` and the methods that hand a configuration out each leave it out) and the networks are only asked for (`ask_net`, `asked`). `device_answer` is the admin's answer: accept (checked now against everything the networks must not share addresses with, refused in a sentence that names whose they are), decline with a reason the person reads (`declined`: one of four words the pages put in their reader's language; `declined_net` for networks; a router turned down stays, waiting, for its owner to read why and remove), or reopen, the undo of either. Taking a network away is the person's own to do, at once (`DeviceWishAs`, the portal's `networks` action). A person is never told whose a network is unless it is their own: while something is only asked, other people's networks are not held against it at all, and the admin's answer is where the clash is said. What moved decides how it is put into effect: the routes (the full apply), who is in a tunnel (the sync), or nothing on the router. The model's goldens gained the two rules on every server by hand. +- **Check access and Health know the networks behind routers** (2026-11-12). An address typed into «Check access» that stands in such a network is a host behind its router: the walk says so first («192.168.2.10 is behind Boris · Dacha») and then goes on as it does for the router itself, since the access table sees the two alike; the router and what is behind it, or two hosts behind one router, need no tunnel between them, and that is the answer. A router that waits for the admin stands for nothing. Health has one more check a server (`sites_`, on the page's Home stage), only where a router has a network written: every network in effect, or which is not and what it shares addresses with (a tunnel, the router's own network, another router's), or the route the last sync could not set (`routes.err`), with the sync as its fix. The household's 580 connections held to ucode come out as before. +- **ucode output is the oracle.** When a part is ported, its Go version is held to the ucode one's answers on the same input (fixtures from `tests/ucode`), as podkop-exp holds its planner to the shell backend's configurations. diff --git a/docs/screenshots/core-ru.png b/docs/screenshots/core-ru.png new file mode 100644 index 0000000..6b8c764 Binary files /dev/null and b/docs/screenshots/core-ru.png differ diff --git a/docs/screenshots/core.png b/docs/screenshots/core.png new file mode 100644 index 0000000..b198615 Binary files /dev/null and b/docs/screenshots/core.png differ diff --git a/docs/screenshots/device-ru.png b/docs/screenshots/device-ru.png new file mode 100644 index 0000000..6a83c81 Binary files /dev/null and b/docs/screenshots/device-ru.png differ diff --git a/docs/screenshots/device.png b/docs/screenshots/device.png new file mode 100644 index 0000000..50e5dfb Binary files /dev/null and b/docs/screenshots/device.png differ diff --git a/docs/screenshots/overview-ru.png b/docs/screenshots/overview-ru.png deleted file mode 100644 index 8c9313c..0000000 Binary files a/docs/screenshots/overview-ru.png and /dev/null differ diff --git a/docs/screenshots/overview.png b/docs/screenshots/overview.png deleted file mode 100644 index e48cacd..0000000 Binary files a/docs/screenshots/overview.png and /dev/null differ diff --git a/docs/screenshots/people-ru.png b/docs/screenshots/people-ru.png index d353563..a772a76 100644 Binary files a/docs/screenshots/people-ru.png and b/docs/screenshots/people-ru.png differ diff --git a/docs/screenshots/people.png b/docs/screenshots/people.png index abe2ba6..dabff7d 100644 Binary files a/docs/screenshots/people.png and b/docs/screenshots/people.png differ diff --git a/docs/screenshots/person-ru.png b/docs/screenshots/person-ru.png index fb7f6ce..c8c2124 100644 Binary files a/docs/screenshots/person-ru.png and b/docs/screenshots/person-ru.png differ diff --git a/docs/screenshots/person.png b/docs/screenshots/person.png index c08e7ac..8f34d77 100644 Binary files a/docs/screenshots/person.png and b/docs/screenshots/person.png differ diff --git a/docs/screenshots/places-ru.png b/docs/screenshots/places-ru.png new file mode 100644 index 0000000..7e3a58c Binary files /dev/null and b/docs/screenshots/places-ru.png differ diff --git a/docs/screenshots/places.png b/docs/screenshots/places.png new file mode 100644 index 0000000..e894a82 Binary files /dev/null and b/docs/screenshots/places.png differ diff --git a/docs/screenshots/raw/core-ru.png b/docs/screenshots/raw/core-ru.png new file mode 100644 index 0000000..72b31ec Binary files /dev/null and b/docs/screenshots/raw/core-ru.png differ diff --git a/docs/screenshots/raw/core.png b/docs/screenshots/raw/core.png new file mode 100644 index 0000000..ff3efdc Binary files /dev/null and b/docs/screenshots/raw/core.png differ diff --git a/docs/screenshots/raw/device-ru.png b/docs/screenshots/raw/device-ru.png new file mode 100644 index 0000000..7d70ae5 Binary files /dev/null and b/docs/screenshots/raw/device-ru.png differ diff --git a/docs/screenshots/raw/device.png b/docs/screenshots/raw/device.png new file mode 100644 index 0000000..448757f Binary files /dev/null and b/docs/screenshots/raw/device.png differ diff --git a/docs/screenshots/raw/overview-ru.png b/docs/screenshots/raw/overview-ru.png deleted file mode 100644 index 68c824d..0000000 Binary files a/docs/screenshots/raw/overview-ru.png and /dev/null differ diff --git a/docs/screenshots/raw/overview.png b/docs/screenshots/raw/overview.png deleted file mode 100644 index 9ca7646..0000000 Binary files a/docs/screenshots/raw/overview.png and /dev/null differ diff --git a/docs/screenshots/raw/people-ru.png b/docs/screenshots/raw/people-ru.png index 1ceda5a..dd1cf27 100644 Binary files a/docs/screenshots/raw/people-ru.png and b/docs/screenshots/raw/people-ru.png differ diff --git a/docs/screenshots/raw/people.png b/docs/screenshots/raw/people.png index ff13c11..342222f 100644 Binary files a/docs/screenshots/raw/people.png and b/docs/screenshots/raw/people.png differ diff --git a/docs/screenshots/raw/person-ru.png b/docs/screenshots/raw/person-ru.png index d120127..ca9fe58 100644 Binary files a/docs/screenshots/raw/person-ru.png and b/docs/screenshots/raw/person-ru.png differ diff --git a/docs/screenshots/raw/person.png b/docs/screenshots/raw/person.png index b7fdbeb..7c1aa76 100644 Binary files a/docs/screenshots/raw/person.png and b/docs/screenshots/raw/person.png differ diff --git a/docs/screenshots/raw/places-ru.png b/docs/screenshots/raw/places-ru.png new file mode 100644 index 0000000..ad99438 Binary files /dev/null and b/docs/screenshots/raw/places-ru.png differ diff --git a/docs/screenshots/raw/places.png b/docs/screenshots/raw/places.png new file mode 100644 index 0000000..c183f82 Binary files /dev/null and b/docs/screenshots/raw/places.png differ diff --git a/install.sh b/install.sh index 0bae4d2..4ab2e12 100755 --- a/install.sh +++ b/install.sh @@ -805,7 +805,7 @@ record_state() { [ "$WAS_INSTALLED" -eq 1 ] || return 0 WAS_VERSION="$(pkg_version "$PKG_NAME")" ls /etc/rc.d/S*dawnline >/dev/null 2>&1 && WAS_ENABLED=1 - _r="$(ubus call service list '{"name":"dawnline"}' 2>/dev/null | jsonfilter -q -e '@.dawnline.instances.agent.running' 2>/dev/null)" + _r="$(ubus call service list '{"name":"dawnline"}' 2>/dev/null | jsonfilter -q -e '@.dawnline.instances.backend.running' -e '@.dawnline.instances.agent.running' 2>/dev/null | head -n 1)" [ "$_r" = true ] && WAS_RUNNING=1 debug "Installed: $WAS_VERSION, enabled=$WAS_ENABLED, running=$WAS_RUNNING" } @@ -1292,10 +1292,23 @@ install_dawnline() { msg "Installing Dawnline $VERSION" # The translation in the same transaction: it depends on this very version. if [ -n "$I18N_FILE" ]; then - pkg_install_files dawnline "$_force" "$ASSET_FILE" "$I18N_FILE" + pkg_install_files dawnline "$_force" "$ASSET_FILE" "$I18N_FILE" || return 1 else - pkg_install_files dawnline "$_force" "$ASSET_FILE" + pkg_install_files dawnline "$_force" "$ASSET_FILE" || return 1 fi + # The Go backend's binary for this router's architecture, from the same release, kept only when it + # matches the release's sha256 (the package is the same for every architecture). Without it Dawnline + # still works, on its older backend: the service asks for it again when it starts. + if [ -x /usr/libexec/dawnline/fetch-backend ]; then + msg "Fetching the backend for this router" + if /usr/libexec/dawnline/fetch-backend "$VERSION"; then + [ -x /usr/libexec/dawnline/dawnlined ] && ok "Backend $VERSION is in place" || + warn "No backend is built for this router's architecture: Dawnline runs without it" + else + warn "The backend could not be fetched: Dawnline runs without it and tries again at its next start (logread -e dawnline says why)" + fi + fi + return 0 } healthcheck() { @@ -1320,26 +1333,27 @@ healthcheck() { return 1 } _w=0 - until ubus list luci.dawnline >/dev/null 2>&1; do + # its backend's object on the bus (a version from before the backend did the work: the rpcd plugin's) + until ubus list dawnline >/dev/null 2>&1 || ubus list luci.dawnline >/dev/null 2>&1; do _w=$((_w + 1)) if [ "$_w" -eq "$UBUS_WAIT" ]; then warn "rpcd has not loaded the Dawnline backend yet; restarting rpcd" /etc/init.d/rpcd restart >/dev/null 2>&1 fi [ "$_w" -ge $((UBUS_WAIT + 10)) ] && { - err "The LuCI backend does not answer (ubus list luci.dawnline)" + err "Dawnline's backend does not answer (ubus list dawnline; logread -e dawnline says why)" return 1 } sleep 1 done - _r="$(ubus call service list '{"name":"dawnline"}' 2>/dev/null | jsonfilter -q -e '@.dawnline.instances.agent.running' 2>/dev/null)" + _r="$(ubus call service list '{"name":"dawnline"}' 2>/dev/null | jsonfilter -q -e '@.dawnline.instances.backend.running' -e '@.dawnline.instances.agent.running' 2>/dev/null | head -n 1)" if [ "$_r" != true ]; then - warn "The Dawnline agent is not running yet (see Dawnline → Diagnostics)" + warn "Dawnline's backend is not running yet (see Dawnline → Diagnostics)" fi if [ -n "$I18N_PKG" ] && [ "$(pkg_version "$I18N_PKG")" != "$VERSION" ]; then warn "$I18N_PKG $VERSION is not installed: Dawnline shows in English" fi - ok "Healthcheck passed: $PKG_NAME $VERSION, LuCI backend answers" + ok "Healthcheck passed: $PKG_NAME $VERSION, its backend answers" } # An upgrade keeps a service the user had disabled disabled (the package's diff --git a/package/luci-app-dawnline/Makefile b/package/luci-app-dawnline/Makefile index bfcc232..731eb24 100644 --- a/package/luci-app-dawnline/Makefile +++ b/package/luci-app-dawnline/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-dawnline -PKG_VERSION:=0.18.0 +PKG_VERSION:=0.20.0 PKG_RELEASE:=1 PKG_LICENSE:=MIT # po//dawnline.po becomes luci-i18n-dawnline- (luci.mk), released @@ -19,11 +19,10 @@ LUCI_TITLE:=Dawnline - AmneziaWG access server # the router's firmware. The portal's HTTPS needs any libustream TLS module and # openssl-util; Settings offers to install them when the portal is turned on. # Runtime dependencies only (control file Depends): the package ships scripts -# and web files, so the SDK has nothing to build for them, and as build +# and web files (its backend, dawnlined, is a static binary fetched beside it: fetch-backend), so the SDK has nothing to build for them, and as build # dependencies ip-full (iproute2) and kmod-veth would pull in the whole kernel. # OpenWrt 25.12's luci.mk wants a version on each; (>=0) means any. -LUCI_EXTRA_DEPENDS:=luci-base (>=0), rpcd-mod-ucode (>=0), ucode (>=0), ucode-mod-fs (>=0), ucode-mod-uci (>=0), \ - ucode-mod-ubus (>=0), ucode-mod-uloop (>=0), ip-full (>=0), kmod-veth (>=0), uhttpd (>=0) +LUCI_EXTRA_DEPENDS:=luci-base (>=0), ip-full (>=0), kmod-veth (>=0), uhttpd (>=0), uhttpd-mod-ubus (>=0) LUCI_PKGARCH:=all # The web bundles are already minified by esbuild (LuCI's jsmin cannot parse modern JS). LUCI_MINIFY_JS:=0 @@ -48,6 +47,8 @@ define Package/luci-app-dawnline/prerm [ "$$1" = "upgrade" ] && exit 0 /etc/init.d/dawnline stop 2>/dev/null /usr/bin/dawnline teardown 2>/dev/null +# The backend's binary is fetched beside the package (fetch-backend), so the package manager does not own it. +rm -f /usr/libexec/dawnline/dawnlined /usr/libexec/dawnline/dawnlined.new # The heartbeat check would point at a removed file. grep -qs /usr/libexec/dawnline/ /etc/crontabs/root && { sed -i '\#/usr/libexec/dawnline/#d' /etc/crontabs/root diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/activity.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/activity.js index 8692329..d88be6e 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/activity.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/activity.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.activity()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/device.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/device.js new file mode 100644 index 0000000..4f58f72 --- /dev/null +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/device.js @@ -0,0 +1,6 @@ +'use strict'; +'require view'; +'require dawnline.app as app'; +'require dawnline.style'; + +return view.extend(app.device()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/diagnostics.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/diagnostics.js index d6e2d85..71676dd 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/diagnostics.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/diagnostics.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.diagnostics()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/health.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/health.js index 584a1f3..33fabb1 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/health.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/health.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.health()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/log.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/log.js new file mode 100644 index 0000000..a93b565 --- /dev/null +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/log.js @@ -0,0 +1,6 @@ +'use strict'; +'require view'; +'require dawnline.app as app'; +'require dawnline.style'; + +return view.extend(app.log()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/overview.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/overview.js index e12aa87..dbcb745 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/overview.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/overview.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.overview()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/people.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/people.js index daf02ed..d5815b7 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/people.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/people.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.people()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/person.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/person.js index e6a723f..f880445 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/person.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/person.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.person()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/places.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/places.js new file mode 100644 index 0000000..3005a48 --- /dev/null +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/places.js @@ -0,0 +1,6 @@ +'use strict'; +'require view'; +'require dawnline.app as app'; +'require dawnline.style'; + +return view.extend(app.places()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/server.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/server.js index cb67351..573112a 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/server.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/server.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.server()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/settings.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/settings.js index e80a1f0..b32c516 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/settings.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/settings.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.settings()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/system.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/system.js new file mode 100644 index 0000000..b804a31 --- /dev/null +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/system.js @@ -0,0 +1,6 @@ +'use strict'; +'require view'; +'require dawnline.app as app'; +'require dawnline.style'; + +return view.extend(app.system()); diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/updates.js b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/updates.js index 1362d03..2a8020c 100644 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/updates.js +++ b/package/luci-app-dawnline/htdocs/luci-static/resources/view/dawnline/updates.js @@ -1,5 +1,6 @@ 'use strict'; 'require view'; 'require dawnline.app as app'; +'require dawnline.style'; return view.extend(app.updates()); diff --git a/package/luci-app-dawnline/po/ru/dawnline.po b/package/luci-app-dawnline/po/ru/dawnline.po index ee1167f..e772bd8 100644 --- a/package/luci-app-dawnline/po/ru/dawnline.po +++ b/package/luci-app-dawnline/po/ru/dawnline.po @@ -8,121 +8,126 @@ msgstr "" "Language-Team: Russian\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "\"%s\" already exists." msgstr "Устройство «%s» уже есть." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "\"%s\" is already taken." msgstr "Идентификатор «%s» уже занят." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "\"%s\" is not a device or an IPv4 address." msgstr "«%s» не является ни устройством, ни IPv4-адресом." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "\"Devices reach each other\" is off on %s" msgstr "«Связь между устройствами» выключена на сервере %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "%d MB free on the overlay" msgstr "Свободно в разделе overlay: %d МБ" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d MB free on the overlay." msgstr "Свободно в разделе overlay: %d МБ." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d device is loaded in the tunnel." msgid_plural "%d devices are loaded in the tunnel." msgstr[0] "В туннель загружено %d устройство." msgstr[1] "В туннель загружено %d устройства." msgstr[2] "В туннель загружено %d устройств." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "%d network behind routers is carried by the tunnel." +msgid_plural "%d networks behind routers are carried by the tunnel." +msgstr[0] "Туннель несёт %d сеть за роутерами." +msgstr[1] "Туннель несёт %d сети за роутерами." +msgstr[2] "Туннель несёт %d сетей за роутерами." + +#: backend/i18n/messages.js msgid "%d of %d device missing, %d loaded that should not be." msgid_plural "%d of %d devices missing, %d loaded that should not be." msgstr[0] "Не загружено %d из %d устройства, лишних загружено: %d." msgstr[1] "Не загружено %d из %d устройств, лишних загружено: %d." msgstr[2] "Не загружено %d из %d устройств, лишних загружено: %d." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d of %d device missing." msgid_plural "%d of %d devices missing." msgstr[0] "Не загружено %d из %d устройства." msgstr[1] "Не загружено %d из %d устройств." msgstr[2] "Не загружено %d из %d устройств." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "%d package update in the feeds: %s" msgid_plural "%d package updates in the feeds: %s" msgstr[0] "В репозиториях %d обновление пакетов: %s" msgstr[1] "В репозиториях %d обновления пакетов: %s" msgstr[2] "В репозиториях %d обновлений пакетов: %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%d system package" msgstr "%d системный пакет" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%d system packages" msgstr "системных пакетов: %d" -#: web/src/admin/pages/components/activity.ts -msgid "%s %s automatically" -msgstr "%s %s - автоматически" +#: web/src/portal/setup.ts +#: web/src/portal/ui/morph.ts +msgid "%s (Android: %s)" +msgstr "%s (на Android: %s)" -#: web/src/admin/pages/components/activity.ts -msgid "%s %s by you" -msgstr "%s %s - вручную" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s (after %d repair)" msgstr "%s (после %d исправления)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s (after %d repairs)" msgstr "%s (исправлений: %d)" -#: web/src/admin/pages/settings/map.ts -msgid "%s (fallback: %s)" -msgstr "%s (запасной: %s)" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - %d repairs didn't help" msgstr "%s - исправления не помогли (%d)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - %s" msgstr "%s - %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - not repaired again (%d repairs didn't help)" msgstr "%s - больше не исправляется (исправления не помогли: %d)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s AAAA → %s is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." msgid_plural "%s AAAA → %s are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records." msgstr[0] "%s AAAA → %s: это не публичный адрес роутера, поэтому устройства, которые предпочитают IPv6, не смогут подключиться. Исправьте или удалите эту запись AAAA." msgstr[1] "%s AAAA → %s: это не публичные адреса роутера, поэтому устройства, которые предпочитают IPv6, не смогут подключиться. Исправьте или удалите эти записи AAAA." msgstr[2] "%s AAAA → %s: это не публичные адреса роутера, поэтому устройства, которые предпочитают IPv6, не смогут подключиться. Исправьте или удалите эти записи AAAA." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router." msgid_plural "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router." msgstr[0] "%s AAAA → %s, но у роутера нет публичного IPv6-адреса: устройства, которые предпочитают IPv6, не смогут подключиться. Удалите эту запись AAAA или настройте IPv6 на роутере." msgstr[1] "%s AAAA → %s, но у роутера нет публичного IPv6-адреса: устройства, которые предпочитают IPv6, не смогут подключиться. Удалите эти записи AAAA или настройте IPv6 на роутере." msgstr[2] "%s AAAA → %s, но у роутера нет публичного IPv6-адреса: устройства, которые предпочитают IPv6, не смогут подключиться. Удалите эти записи AAAA или настройте IPv6 на роутере." -#: web/src/admin/cores/awg.ts -msgid "%s AmneziaWG device stops connecting until it imports its configuration again (from their personal link or from you)." -msgid_plural "%s AmneziaWG devices stop connecting until they import their configuration again (from their personal link or from you)." -msgstr[0] "%s устройство AmneziaWG перестанет подключаться, пока заново не импортирует конфигурацию (по личной ссылке или от вас)." -msgstr[1] "%s устройства AmneziaWG перестанут подключаться, пока заново не импортируют конфигурацию (по личной ссылке или от вас)." -msgstr[2] "%s устройств AmneziaWG перестанут подключаться, пока заново не импортируют конфигурацию (по личной ссылке или от вас)." +#: web/src/admin/flows/add-person.ts +msgid "%s GB" +msgstr "%s ГБ" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "%s GB a month" +msgstr "%s ГБ в месяц" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s GB in total" +msgstr "%s ГБ на весь срок" + +#: backend/i18n/messages.js msgid "%s MB free: settings may stop saving. Remove old backups (Settings → Backups) or shorten the history." msgstr "Свободно %s МБ: настройки могут перестать сохраняться. Удалите старые резервные копии («Настройки» → «Резервные копии») или сократите историю." @@ -130,155 +135,205 @@ msgstr "Свободно %s МБ: настройки могут перестат msgid "%s a day lately" msgstr "%s в день за последние дни" -#: web/src/admin/access.ts -#: web/src/admin/device.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "%s added" msgstr "Добавлено: %s" -#: web/src/admin/pages/components/activity.ts -msgid "%s added by you" -msgstr "Вы добавили: %s" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/invite.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s address" msgid_plural "%s addresses" msgstr[0] "%s адрес" msgstr[1] "%s адреса" msgstr[2] "%s адресов" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "%s already exists." msgstr "Имя «%s» уже занято." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "%s already has %d device. Remove one first to lower the limit to %d." msgid_plural "%s already has %d devices. Remove one first to lower the limit to %d." msgstr[0] "%s: уже %d устройство. Чтобы снизить лимит до %d, сначала удалите одно из них." msgstr[1] "%s: уже %d устройства. Чтобы снизить лимит до %d, сначала удалите одно из них." msgstr[2] "%s: уже %d устройств. Чтобы снизить лимит до %d, сначала удалите одно из них." -#: web/src/admin/device.ts -msgid "%s already has %s of %s device. As admin you can still add one." -msgid_plural "%s already has %s of %s devices. As admin you can still add one." -msgstr[0] "%s: уже %s из %s устройства. Как администратор вы всё равно можете добавить ещё одно." -msgstr[1] "%s: уже %s из %s устройств. Как администратор вы всё равно можете добавить ещё одно." -msgstr[2] "%s: уже %s из %s устройств. Как администратор вы всё равно можете добавить ещё одно." - #: web/src/admin/netcheck.ts msgid "%s already uses %s." msgstr "%s уже использует %s." -#: web/src/admin/pages/components/awg.ts -msgid "%s and %s" -msgstr "%s и %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s and %s are not in one circle" msgstr "%s и %s не в одном круге" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s and %s overlap: each packet type needs values of its own." msgstr "%s и %s пересекаются: у каждого типа пакетов должны быть свои значения." -#: web/src/admin/cores/awg.ts -msgid "%s applied" -msgstr "Маскировка «%s» применена" +#: web/src/admin/pages/settings/networks.ts +msgid "%s asked for it on their page" +msgstr "%s просит это на своей странице" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s asked on their page: accept or decline" +msgstr "%s просит на своей странице: примите или отклоните" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s asks for a network behind it" +msgid_plural "%s asks for networks behind it" +msgstr[0] "%s просит сеть за ним" +msgstr[1] "%s просит сети за ним" +msgstr[2] "%s просит сети за ним" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s asks to add this router" +msgstr "%s просит добавить этот роутер" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s asks to add this router on their page" +msgstr "%s просит добавить этот роутер на своей странице" + +#: web/src/admin/events/clock.ts +msgid "%s at %s" +msgstr "%s в %s" + +#: backend/i18n/messages.js +msgid "%s behind %s is not a network a router may have behind it." +msgstr "%s за роутером %s не может быть сетью за роутером." + +#: backend/i18n/messages.js +msgid "%s behind %s is written twice, or is one more than a router may have." +msgstr "%s за роутером %s записана дважды или лишняя: у роутера их больше, чем можно." + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with %s behind %s." +msgstr "%s за роутером %s пересекается с сетью %s за роутером %s." + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with %s, which the router has itself." +msgstr "%s за роутером %s пересекается с сетью %s, которая есть у самого роутера." + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with the tunnel network of %s (%s)." +msgstr "%s за роутером %s пересекается с сетью туннеля %s (%s)." #: web/src/admin/events/render.ts msgid "%s blocked %s for 15 min after too many wrong codes" msgstr "%s заблокировал %s на 15 мин: слишком много неверных кодов" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "%s build" msgstr "сборка %s" -#: web/src/admin/cores/awg.ts -msgid "%s byte" -msgid_plural "%s bytes" -msgstr[0] "%s байт" -msgstr[1] "%s байта" -msgstr[2] "%s байт" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: %s" msgstr "%s недоступно: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -msgid "%s can't be reached: it is outside their allowed hours" -msgstr "%s недоступно: сейчас вне часов доступа владельца" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: it is turned off" msgstr "%s недоступно: устройство выключено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: their access has ended" msgstr "%s недоступно: доступ владельца закончился" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: their server is turned off" msgstr "%s недоступно: сервер владельца выключен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they are paused" msgstr "%s недоступно: владелец на паузе" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they have no server" msgstr "%s недоступно: у владельца нет сервера" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they used up their data" msgstr "%s недоступно: владелец исчерпал лимит трафика" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: %s" msgstr "%s не может подключиться: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -msgid "%s can't connect: it is outside their allowed hours" -msgstr "%s не может подключиться: сейчас вне часов доступа" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: their access has ended" msgstr "%s не может подключиться: доступ закончился" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: their server is turned off" msgstr "%s не может подключиться: сервер выключен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they are paused" msgstr "%s не может подключиться: на паузе" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they have no server" msgstr "%s не может подключиться: нет сервера" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they used up their data" msgstr "%s не может подключиться: лимит трафика исчерпан" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s can't use the network interface %s: it exists and isn't Dawnline's." msgstr "Сервер %s не может использовать сетевой интерфейс %s: он уже существует и создан не Dawnline." -#: web/src/admin/pages/components/activity.ts -msgid "%s check failed" -msgstr "%s: ошибка проверки" +#: backend/i18n/messages.js +msgid "%s cannot be changed for several people at once." +msgstr "%s нельзя менять сразу у нескольких человек." -#: web/src/admin/pages/overview.ts -msgid "%s city" -msgid_plural "%s cities" -msgstr[0] "%s город" -msgstr[1] "%s города" -msgstr[2] "%s городов" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s change" +msgid_plural "%s changes" +msgstr[0] "%s изменение" +msgstr[1] "%s изменения" +msgstr[2] "%s изменений" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/changes.ts +msgid "%s change applied" +msgid_plural "%s changes applied" +msgstr[0] "%s изменение применено" +msgstr[1] "%s изменения применены" +msgstr[2] "%s изменений применено" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s change is not applied: it will be lost." +msgid_plural "%s changes are not applied: they will be lost." +msgstr[0] "%s изменение не применено и пропадёт." +msgstr[1] "%s изменения не применены и пропадут." +msgstr[2] "%s изменений не применены и пропадут." + +#: web/src/admin/pages/people/person/index.ts +msgid "%s change was not applied" +msgid_plural "%s changes were not applied" +msgstr[0] "%s изменение не применено" +msgstr[1] "%s изменения не применены" +msgstr[2] "%s изменений не применено" + +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/server/overview.ts +#: web/src/admin/pages/settings/health.ts +msgid "%s check passed" +msgid_plural "%s checks passed" +msgstr[0] "%s проверка в порядке" +msgstr[1] "%s проверки в порядке" +msgstr[2] "%s проверок в порядке" + +#: web/src/portal/ui/wait-way.ts +msgid "%s connected" +msgstr "Подключено: %s" + +#: web/src/admin/pages/settings/stages.ts msgid "%s copied" -msgstr "Скопировано: %s" +msgstr "%s: скопировано" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s covers %s and is valid for more than 14 days." msgstr "%s покрывает %s и действует ещё больше 14 дней." @@ -287,53 +342,80 @@ msgid "%s d ago" msgstr "%s дн. назад" #: web/src/admin/events/model.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/people/card.ts msgid "%s day" msgid_plural "%s days" msgstr[0] "%s день" msgstr[1] "%s дня" msgstr[2] "%s дней" -#: web/src/admin/pages/person/dialogs.ts -msgid "%s day before" -msgid_plural "%s days before" -msgstr[0] "За %s день" -msgstr[1] "За %s дня" -msgstr[2] "За %s дней" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/term.ts msgid "%s day left" msgid_plural "%s days left" msgstr[0] "остался %s день" msgstr[1] "осталось %s дня" msgstr[2] "осталось %s дней" -#: web/src/admin/access.ts +#: web/src/admin/pages/overview/now.ts +msgid "%s days" +msgstr "%s дней" + +#: web/src/admin/widgets/week-use.ts +msgid "%s days ago" +msgstr "%s дн. назад" + +#: web/src/admin/flows/circle.ts msgid "%s deleted" msgstr "Удалено: %s" +#: web/src/admin/flows/invite.ts +#: web/src/admin/flows/restore.ts #: web/src/admin/map.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/overview/head.ts +#: web/src/admin/pages/overview/now.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/settings/pending-dock.ts +#: web/src/admin/people/lines.ts msgid "%s device" msgid_plural "%s devices" msgstr[0] "%s устройство" msgstr[1] "%s устройства" msgstr[2] "%s устройств" -#: web/src/admin/pages/person/dialogs.ts -msgid "%s device gets a new address and stops connecting until it imports its configuration again (from the personal link or from you). Circles and home networks of the old server are left behind." -msgid_plural "%s devices get new addresses and stop connecting until they import their configuration again (from the personal link or from you). Circles and home networks of the old server are left behind." -msgstr[0] "%s устройство получит новый адрес и не сможет подключаться, пока снова не импортирует конфигурацию (по личной ссылке или от вас). Круги и домашние сети старого сервера не переносятся." -msgstr[1] "%s устройства получат новые адреса и не смогут подключаться, пока снова не импортируют конфигурацию (по личной ссылке или от вас). Круги и домашние сети старого сервера не переносятся." -msgstr[2] "%s устройств получат новые адреса и не смогут подключаться, пока снова не импортируют конфигурацию (по личной ссылке или от вас). Круги и домашние сети старого сервера не переносятся." +#: web/src/admin/pages/settings/disguise.ts +msgid "%s device fetches its configuration again" +msgid_plural "%s devices fetch their configuration again" +msgstr[0] "%s устройство заберёт настройку заново" +msgstr[1] "%s устройства заберут настройку заново" +msgstr[2] "%s устройств заберут настройку заново" -#: web/src/admin/pages/server.ts -msgid "%s device gets a new address and stops connecting until it imports its configuration again (from their personal link or from you)." -msgid_plural "%s devices get new addresses and stop connecting until they import their configuration again (from their personal link or from you)." -msgstr[0] "%s устройство получит новый адрес и не сможет подключиться, пока снова не импортирует конфигурацию (по личной ссылке или от вас)." -msgstr[1] "%s устройства получат новые адреса и не смогут подключиться, пока снова не импортируют конфигурацию (по личной ссылке или от вас)." -msgstr[2] "%s устройств получат новые адреса и не смогут подключиться, пока снова не импортируют конфигурацию (по личной ссылке или от вас)." +#: web/src/admin/flows/server-change.ts +msgid "%s device fetches its configuration again to drop the extra routes." +msgid_plural "%s devices fetch their configuration again to drop the extra routes." +msgstr[0] "%s устройство заберёт настройку заново, чтобы убрать лишние маршруты." +msgstr[1] "%s устройства заберут настройку заново, чтобы убрать лишние маршруты." +msgstr[2] "%s устройств заберут настройку заново, чтобы убрать лишние маршруты." + +#: web/src/admin/pages/people/person/index.ts +msgid "%s device fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices fetch their configuration again. Until then they work the old way." +msgstr[0] "%s устройство заберёт настройку заново. До этого оно работает по-старому." +msgstr[1] "%s устройства заберут настройку заново. До этого они работают по-старому." +msgstr[2] "%s устройств заберут настройку заново. До этого они работают по-старому." + +#: web/src/admin/flows/server-change.ts +msgid "%s device fetches the configuration" +msgid_plural "%s devices fetch the configuration" +msgstr[0] "%s устройство заберёт настройку" +msgstr[1] "%s устройства заберут настройку" +msgstr[2] "%s устройств заберут настройку" #: web/src/admin/map.ts msgid "%s device in %s, %s" @@ -349,59 +431,139 @@ msgstr[0] "%s устройство: город неизвестен, %s" msgstr[1] "%s устройства: город неизвестен, %s" msgstr[2] "%s устройств: город неизвестен, %s" -#: web/src/admin/pages/person/pickers.ts -msgid "%s device in use" -msgid_plural "%s devices in use" -msgstr[0] "Используется %s устройство" -msgstr[1] "Используются %s устройства" -msgstr[2] "Используется %s устройств" +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "%s device keeps asking the old DNS until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices keep asking the old DNS until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "%s устройство продолжит спрашивать прежний DNS, пока заново не заберёт настройку. Подключение не прервётся." +msgstr[1] "%s устройства продолжат спрашивать прежний DNS, пока заново не заберут настройку. Подключение не прервётся." +msgstr[2] "%s устройств продолжат спрашивать прежний DNS, пока заново не заберут настройку. Подключение не прервётся." -#: web/src/admin/pages/person/dialogs.ts -msgid "%s device is disconnected immediately and the personal link stops working." -msgid_plural "All %s devices are disconnected immediately and the personal link stops working." -msgstr[0] "%s устройство сразу отключится, а личная ссылка перестанет работать." -msgstr[1] "Все %s устройства сразу отключатся, а личная ссылка перестанет работать." -msgstr[2] "Все %s устройств сразу отключатся, а личная ссылка перестанет работать." +#: web/src/admin/flows/server-change.ts +msgid "%s device keeps its old keep-alive until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices keep their old keep-alive until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "%s устройство будет держать связь по-прежнему, пока заново не заберёт настройку. Подключение не прервётся." +msgstr[1] "%s устройства будут держать связь по-прежнему, пока заново не заберут настройку. Подключение не прервётся." +msgstr[2] "%s устройств будут держать связь по-прежнему, пока заново не заберут настройку. Подключение не прервётся." -#: web/src/admin/pages/people.ts -msgid "%s device is disconnected immediately and the personal link stops working. Usage history is kept in backups." -msgid_plural "All %s devices are disconnected immediately and the personal link stops working. Usage history is kept in backups." -msgstr[0] "%s устройство сразу отключится, а личная ссылка перестанет работать. История трафика останется в резервных копиях." -msgstr[1] "Все %s устройства сразу отключатся, а личная ссылка перестанет работать. История трафика останется в резервных копиях." -msgstr[2] "Все %s устройств сразу отключатся, а личная ссылка перестанет работать. История трафика останется в резервных копиях." +#: web/src/admin/pages/people/map-view.ts +msgid "%s device online" +msgid_plural "%s devices online" +msgstr[0] "%s устройство в сети" +msgstr[1] "%s устройства в сети" +msgstr[2] "%s устройств в сети" -#: web/src/admin/pages/overview.ts -msgid "%s device needs its configuration again (networks or DNS changed)." -msgid_plural "%s devices need their configuration again (networks or DNS changed)." -msgstr[0] "%s устройству нужна новая конфигурация (изменились сети или DNS)." -msgstr[1] "%s устройствам нужна новая конфигурация (изменились сети или DNS)." -msgstr[2] "%s устройствам нужна новая конфигурация (изменились сети или DNS)." +#: web/src/admin/flows/server-change.ts +msgid "%s device reaches the new home networks once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices reach the new home networks once they fetch their configuration again. Until then they work the old way." +msgstr[0] "%s устройство увидит новые домашние сети, когда заново заберёт настройку. До этого всё работает по-старому." +msgstr[1] "%s устройства увидят новые домашние сети, когда заново заберут настройку. До этого всё работает по-старому." +msgstr[2] "%s устройств увидят новые домашние сети, когда заново заберут настройку. До этого всё работает по-старому." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/server-change.ts +msgid "%s device reaches these networks once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices reach these networks once they fetch their configuration again. Until then they work the old way." +msgstr[0] "%s устройство попадёт в эти сети, когда получит конфигурацию заново. До тех пор оно работает по-старому." +msgstr[1] "%s устройства попадут в эти сети, когда получат конфигурацию заново. До тех пор они работают по-старому." +msgstr[2] "%s устройств попадут в эти сети, когда получат конфигурацию заново. До тех пор они работают по-старому." + +#: web/src/admin/flows/server-change.ts +msgid "%s device sees the others once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices see the others once they fetch their configuration again. Until then they work the old way." +msgstr[0] "%s устройство увидит остальных, когда заново заберёт настройку. До этого всё работает по-старому." +msgstr[1] "%s устройства увидят друг друга, когда заново заберут настройку. До этого всё работает по-старому." +msgstr[2] "%s устройств увидят друг друга, когда заново заберут настройку. До этого всё работает по-старому." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stays on the old MTU until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices stay on the old MTU until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "%s устройство останется на прежнем MTU, пока заново не заберёт настройку. Подключение не прервётся." +msgstr[1] "%s устройства останутся на прежнем MTU, пока заново не заберут настройку. Подключение не прервётся." +msgstr[2] "%s устройств останутся на прежнем MTU, пока заново не заберут настройку. Подключение не прервётся." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again." +msgid_plural "%s devices stop connecting until they fetch their configuration again." +msgstr[0] "%s устройство перестанет подключаться, пока не заберёт настройку заново." +msgstr[1] "%s устройства перестанут подключаться, пока не заберут настройку заново." +msgstr[2] "%s устройств перестанут подключаться, пока не заберут настройку заново." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old address." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old address." +msgstr[0] "%s устройство перестанет подключаться, пока заново не заберёт настройку: в ней прежний адрес." +msgstr[1] "%s устройства перестанут подключаться, пока заново не заберут настройку: в ней прежний адрес." +msgstr[2] "%s устройств перестанут подключаться, пока заново не заберут настройку: в ней прежний адрес." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old disguise." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old disguise." +msgstr[0] "%s устройство перестанет подключаться, пока заново не заберёт настройку: в ней прежняя маскировка." +msgstr[1] "%s устройства перестанут подключаться, пока заново не заберут настройку: в ней прежняя маскировка." +msgstr[2] "%s устройств перестанут подключаться, пока заново не заберут настройку: в ней прежняя маскировка." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old port." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old port." +msgstr[0] "%s устройство перестанет подключаться, пока заново не заберёт настройку: в ней прежний порт." +msgstr[1] "%s устройства перестанут подключаться, пока заново не заберут настройку: в ней прежний порт." +msgstr[2] "%s устройств перестанут подключаться, пока заново не заберут настройку: в ней прежний порт." + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: its address is from the old network." +msgid_plural "%s devices stop connecting until they fetch their configuration again: their addresses are from the old network." +msgstr[0] "%s устройство перестанет подключаться, пока заново не заберёт настройку: его адрес из прежней сети." +msgstr[1] "%s устройства перестанут подключаться, пока заново не заберут настройку: их адреса из прежней сети." +msgstr[2] "%s устройств перестанут подключаться, пока заново не заберут настройку: их адреса из прежней сети." + +#: web/src/admin/flows/move-person.ts +msgid "%s device stops connecting until it takes its set-up again: %s has its own address and key." +msgid_plural "%s devices stop connecting until they take their set-up again: %s has its own address and key." +msgstr[0] "%s устройство перестанет подключаться, пока заново не заберёт настройку: у сервера %s свой адрес и ключ." +msgstr[1] "%s устройства перестанут подключаться, пока заново не заберут настройку: у сервера %s свой адрес и ключ." +msgstr[2] "%s устройств перестанут подключаться, пока заново не заберут настройку: у сервера %s свой адрес и ключ." + +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s device will fetch the configuration" +msgid_plural "%s devices will fetch the configuration" +msgstr[0] "заберёт настройку %s устройство" +msgstr[1] "заберут настройку %s устройства" +msgstr[2] "заберут настройку %s устройств" + +#: web/src/admin/flows/server-change.ts +msgid "%s device works the old way until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices work the old way until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "%s устройство работает по-старому, пока не заберёт настройку заново. Связь не прерывается." +msgstr[1] "%s устройства работают по-старому, пока не заберут настройку заново. Связь не прерывается." +msgstr[2] "%s устройств работают по-старому, пока не заберут настройку заново. Связь не прерывается." + +#: web/src/admin/people/card.ts +msgid "%s does not connect" +msgstr "%s не подключается" + +#: backend/i18n/messages.js msgid "%s does not cover %s (it has %s): browsers will warn." msgstr "%s не покрывает %s (в нём: %s): браузеры будут предупреждать." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not exist." msgstr "Интерфейса %s нет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not overlap other networks." msgstr "%s не пересекается с другими сетями." -#: web/src/admin/cores/awg.ts -msgid "%s does not resolve right now, and V2RayTun on Android connects by IP address only." -msgstr "Сейчас не удаётся узнать IP-адрес %s, а V2RayTun на Android подключается только по IP-адресу." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not resolve." msgstr "%s не разрешается в IP-адрес." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s doesn't reach %s" msgstr "%s: сеть %s недоступна" #: web/src/admin/events/model.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/log/index.ts msgid "%s entry" msgid_plural "%s entries" msgstr[0] "%s запись" @@ -409,41 +571,40 @@ msgstr[1] "%s записи" msgstr[2] "%s записей" #: web/src/admin/events/model.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s event" msgid_plural "%s events" msgstr[0] "%s событие" msgstr[1] "%s события" msgstr[2] "%s событий" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "%s event removed" msgid_plural "%s events removed" msgstr[0] "Удалено %s событие" msgstr[1] "Удалено %s события" msgstr[2] "Удалено %s событий" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s expires within 14 days." msgstr "%s истекает в ближайшие 14 дней." -#: web/src/admin/pages/components/activity.ts -msgid "%s found by a check" -msgstr "Проверка нашла: %s" +#: web/src/admin/events/timeline.ts +msgid "%s failure" +msgid_plural "%s failures" +msgstr[0] "сбоев: %s" +msgstr[1] "сбоев: %s" +msgstr[2] "сбоев: %s" -#: web/src/admin/pages/components/activity.ts -msgid "%s found by the automatic check" -msgstr "Автоматическая проверка нашла: %s" - -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "%s from the OpenWrt feeds. Dawnline sets the rest up when they arrive." msgstr "Пакеты %s из репозиториев OpenWrt. Остальное Dawnline настроит после их установки." -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "%s from the OpenWrt feeds. Services that use them restart for a moment." msgstr "Пакеты %s из репозиториев OpenWrt. Службы, которые их используют, ненадолго перезапустятся." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s goes through Cloudflare; in Russia such connections often stall after ~16 KB." msgstr "%s идёт через Cloudflare; в России такие соединения часто зависают после ~16 КБ." @@ -451,179 +612,203 @@ msgstr "%s идёт через Cloudflare; в России такие соеди msgid "%s h ago" msgstr "%s ч назад" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home and Internet" msgstr "%s: доступ «Дом и интернет»" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only" msgstr "%s: доступ «Только дом»" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only: only DNS and the portal on the router." msgstr "%s: доступ «Только дом», на роутере доступны только DNS и портал." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only: their device's own internet reaches it, not the tunnel." msgstr "%s: доступ «Только дом», этот адрес доступен через собственный интернет устройства, а не через туннель." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/behind-ask.ts +msgid "%s has Internet access: all of that place’s internet will go through this tunnel." +msgstr "%s с доступом в интернет: весь интернет того объекта пойдёт через этот туннель." + +#: backend/i18n/messages.js msgid "%s has Internet only" msgstr "%s: доступ «Только интернет»" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Internet only." msgstr "%s: доступ «Только интернет»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Internet only: only DNS and the portal on the router." msgstr "%s: доступ «Только интернет», на роутере доступны только DNS и портал." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s has a tag that is not closed with >." msgstr "%s: тег не закрыт символом >." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s has an invalid interface name \"%s\"." msgstr "У сервера %s недопустимое имя интерфейса «%s»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has never connected" msgstr "%s ещё ни разу не подключалось" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "%s has no IPv4 address." msgstr "У %s нет IPv4-адреса." -#: web/src/admin/access.ts -msgid "%s has no home access: their devices aren't reachable anyway" -msgstr "%s: нет доступа к домашней сети - устройства всё равно недоступны" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "%s has no room for every device on %s." msgstr "В подсети %s не хватит адресов для всех устройств сервера %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has no server" msgstr "У устройства %s нет сервера" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has only some home services" msgstr "%s: доступны только некоторые домашние сервисы" -#: web/src/admin/pages/overview.ts -msgid "%s has used 90% of the data limit." -msgstr "%s: израсходовано 90% лимита трафика." +#: web/src/admin/events/timeline.ts +msgid "%s hour" +msgid_plural "%s hours" +msgstr[0] "%s час" +msgstr[1] "%s часа" +msgstr[2] "%s часов" -#: web/src/admin/ui/badges.ts -msgid "%s home service only" -msgid_plural "%s home services only" -msgstr[0] "Только %s домашний сервис" -msgstr[1] "Только %s домашних сервиса" -msgstr[2] "Только %s домашних сервисов" +#: web/src/admin/pages/people/card.ts +msgid "%s hour in 7 days" +msgid_plural "%s hours in 7 days" +msgstr[0] "за 7 дней в сети %s ч" +msgstr[1] "за 7 дней в сети %s ч" +msgstr[2] "за 7 дней в сети %s ч" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/overview/now.ts +msgid "%s in 30 days" +msgstr "%s за 30 дней" + +#: web/src/admin/pages/settings/router/history.ts msgid "%s in memory" msgstr "%s в памяти" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s in memory, %s on flash" msgstr "%s в памяти, %s во флеш-памяти" -#: web/src/admin/pages/person/limits.ts #: web/src/shared/format.ts msgid "%s in total" msgstr "%s всего" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/widgets/net-switches.ts +msgid "%s interface is not offered" +msgid_plural "%s interfaces are not offered" +msgstr[0] "%s интерфейс не предлагается" +msgstr[1] "%s интерфейса не предлагаются" +msgstr[2] "%s интерфейсов не предлагаются" + +#: backend/i18n/messages.js msgid "%s is %s, one of %s's home services" msgstr "%s: это %s, один из домашних сервисов человека %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "%s is 0 or 1." msgstr "Значение %s: 0 или 1." -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "%s is AmneziaWG 1.0 junk only, which networks learned to spot; it is not offered any more. Switch to %s or %s: devices import their configuration again." msgstr "Маскировка «%s» - это только мусорные пакеты AmneziaWG 1.0, которые сети научились распознавать; её больше не предлагают. Перейдите на «%s» или «%s»: устройства заново импортируют конфигурацию." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is active" msgstr "%s: доступ активен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is at home (%s)" msgstr "%s в домашней сети (%s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/system/model.ts +msgid "%s is available" +msgstr "доступна %s" + +#: backend/i18n/messages.js +msgid "%s is behind %s" +msgstr "%s стоит за роутером %s" + +#: backend/i18n/messages.js +msgid "%s is behind this device" +msgstr "%s стоит за этим устройством" + +#: backend/i18n/messages.js msgid "%s is connected" msgstr "%s подключено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is down." msgstr "%s не работает." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is down: %s." msgstr "%s не работает: %s." -#: web/src/admin/pages/person/pickers.ts -msgid "%s is in %s" -msgstr "%s теперь в круге «%s»" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is in %s, which %s doesn't reach" msgstr "%s в сети %s, недоступной для %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is in home network %s" msgstr "%s в домашней сети %s" -#: web/src/admin/pages/person/pickers.ts -msgid "%s is in no circle" -msgstr "%s теперь без круга" +#: backend/i18n/messages.js +msgid "%s is in the list twice." +msgstr "%s в списке дважды." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down." msgstr "Сервер %s остановлен." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise has values AmneziaWG cannot take. %s" msgstr "Сервер %s остановлен: в его маскировке есть значения, которые AmneziaWG не примет. %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise needs AmneziaWG %s (installed: %s)." msgstr "Сервер %s остановлен: для его маскировки нужен AmneziaWG %s (установлен %s)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise needs AmneziaWG %s (installed: none)." msgstr "Сервер %s остановлен: для его маскировки нужен AmneziaWG %s (не установлен)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is missing." msgid_plural "%s are missing." msgstr[0] "Не установлено: %s." msgstr[1] "Не установлено: %s." msgstr[2] "Не установлено: %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "%s is not a bridge, so Dawnline cannot join the LAN as a device." msgstr "%s - не мост, поэтому Dawnline не может подключиться к LAN как устройство." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is not a common home subnet: the networks people connect from rarely use the same addresses." msgstr "%s: не самая частая домашняя подсеть: сети, из которых подключаются люди, редко используют те же адреса." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "%s is not a package Dawnline manages" msgstr "%s - не пакет, которым управляет Dawnline" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/shared/nets.ts +msgid "%s is not a private network (10.x, 172.16–31.x, 192.168.x)." +msgstr "%s не частная сеть (10.x, 172.16–31.x, 192.168.x)." + +#: backend/i18n/messages.js msgid "%s is not an IP address." msgstr "%s не является IP-адресом." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s is not in a firewall zone, so the server port cannot be opened on it." msgstr "%s не входит ни в одну зону межсетевого экрана, поэтому открыть на нём порт сервера нельзя." @@ -631,148 +816,209 @@ msgstr "%s не входит ни в одну зону межсетевого э msgid "%s is not in any home network of this server: nobody would reach it." msgstr "%s не входит ни в одну домашнюю сеть этого сервера: до него никто не достучится." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is not one of %s's home services" msgstr "%s не входит в домашние сервисы человека %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is not one of Dawnline's tunnels." msgstr "%s - не туннель Dawnline." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is on another server" msgstr "%s на другом сервере" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is on the internet" msgstr "%s в интернете" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/card.ts +msgid "%s is on two devices at once" +msgstr "%s на двух устройствах сразу" + +#: backend/i18n/messages.js msgid "%s is one of the most common home subnets. On a network with the same addresses, people with home access reach your home instead of their own: their printer or TV there is out of reach while connected, with LAN Bypass too. A rarer subnet for your home network avoids it, for example 10.37.12.0/24." msgstr "%s: одна из самых распространённых домашних подсетей. В сети с такими же адресами люди с доступом к дому попадают к вам домой, а не в свою сеть: их принтер или телевизор там недоступен, пока они подключены, даже с обходом локальной сети. Это исправит более редкая подсеть для вашей домашней сети, например 10.37.12.0/24." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s is part of %s; choose %s instead." msgstr "%s входит в %s, выберите %s." -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/person-acts.ts +msgid "%s is paused" +msgstr "%s: на паузе" + +#: web/src/admin/flows/person-acts.ts +msgid "%s is paused again" +msgstr "%s: снова на паузе" + +#: web/src/admin/flows/add-person.ts +#: web/src/admin/flows/invite.ts msgid "%s is ready" msgstr "%s: всё готово" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/people/diagnosis.ts +msgid "%s is running" +msgstr "Сервер %s работает" + +#: web/src/admin/people/diagnosis.ts +msgid "%s is running, last connection %s" +msgstr "Сервер %s работает, последнее подключение %s" + +#: web/src/shared/nets.ts +msgid "%s is taken: it is %s. The two ends need different ranges." +msgstr "%s занята: это %s. Двум концам нужны разные диапазоны." + +#: backend/i18n/messages.js msgid "%s is the WAN." msgstr "%s и есть WAN." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router" msgstr "%s: адрес этого роутера" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router on a network %s doesn't reach" msgstr "%s: адрес этого роутера в сети, недоступной для %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router: DNS is open to everyone" msgstr "%s: адрес этого роутера, DNS открыт для всех" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router: the personal portal is open to everyone" msgstr "%s: адрес этого роутера, портал открыт для всех" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/shared/nets.ts +msgid "%s is too wide: /16 at the most." +msgstr "%s слишком широкая: не шире /16." + +#: backend/i18n/messages.js +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/people/diagnosis.ts msgid "%s is turned off" msgstr "Устройство %s выключено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/move-person.ts +msgid "%s is turned off: devices do not connect until it is on." +msgstr "Сервер %s выключен: устройства не подключатся, пока его не включите." + +#: web/src/admin/flows/device-acts.ts +msgid "%s is turned on" +msgstr "%s включено" + +#: backend/i18n/messages.js msgid "%s is up, listening on UDP %d." msgstr "%s работает, слушает UDP %d." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s isn't connected right now" msgstr "%s сейчас не подключено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s isn't in %s's home network" msgstr "%s не входит в домашнюю сеть сервера %s" -#: web/src/admin/cores/awg.ts -msgid "%s junk" -msgid_plural "%s junk" -msgstr[0] "%s пакет мусора" -msgstr[1] "%s пакета мусора" -msgstr[2] "%s пакетов мусора" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "%s left" -msgstr "осталось %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s may not contain # or a line break." msgstr "%s не может содержать # или перенос строки." -#: web/src/admin/widgets/readouts.ts -msgid "%s min %s s ago" -msgstr "%s мин %s с назад" - #: web/src/shared/format.ts msgid "%s min ago" msgstr "%s мин назад" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s month" msgid_plural "%s months" msgstr[0] "%s месяц" msgstr[1] "%s месяца" msgstr[2] "%s месяцев" -#: web/src/admin/widgets/health.ts -msgid "%s more in Diagnostics" -msgstr "Ещё %s в диагностике" +#: web/src/admin/pages/overview/waiting.ts +msgid "%s more" +msgstr "Ещё %s" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/people/card.ts +msgctxt "problems" +msgid "%s more" +msgstr "ещё %s" + +#: web/src/admin/flows/server-change.ts +msgid "%s more is not set up yet: it gets the new one right away." +msgid_plural "%s more are not set up yet: they get the new one right away." +msgstr[0] "Ещё %s не настроено: получит новую сразу." +msgstr[1] "Ещё %s не настроены: получат новую сразу." +msgstr[2] "Ещё %s не настроены: получат новую сразу." + +#: web/src/admin/flows/awg-build.ts msgid "%s moves to %s with OpenWrt %s." msgstr "Сборка %s перейдёт на AmneziaWG %s с OpenWrt %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 10-100, up to 65535." msgstr "%s: нужно число или диапазон вида 10-100, не больше 65535." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 100-200, up to 4294967295." msgstr "%s: нужно число или диапазон вида 100-200, не больше 4294967295." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 5-15, from 1 to 65535." msgstr "%s: нужно число или диапазон вида 5-15, от 1 до 65535." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js +msgid "%s must be a value, not a list." +msgstr "%s: нужно значение, а не список." + +#: backend/i18n/messages.js msgid "%s must be a whole number from 0 to 65535." msgstr "%s: нужно целое число от 0 до 65535." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be at least 12 with header protection." msgstr "%s: с защитой заголовков нужно не меньше 12." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be from %d to %d." msgstr "%s: от %d до %d." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be on or off." msgstr "%s: нужно on или off." -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%s needs a manual switch in Components" msgstr ": %s нужно включить вручную в «Компонентах»" -#: web/src/admin/pages/overview.ts -msgid "%s needs its configuration again." -msgstr "%s: нужна новая конфигурация." +#: web/src/admin/widgets/reach.ts +msgid "%s network" +msgid_plural "%s networks" +msgstr[0] "%s сеть" +msgstr[1] "%s сети" +msgstr[2] "%s сетей" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/shared/nets.ts +msgid "%s network behind one router at the most." +msgid_plural "%s networks behind one router at the most." +msgstr[0] "Не больше %s сети за одним роутером." +msgstr[1] "Не больше %s сетей за одним роутером." +msgstr[2] "Не больше %s сетей за одним роутером." + +#: web/src/admin/pages/people/map-view.ts +msgid "%s now" +msgid_plural "%s now" +msgstr[0] "%s сейчас" +msgstr[1] "%s сейчас" +msgstr[2] "%s сейчас" + +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/ui/filter-bar.ts +#: web/src/admin/widgets/limit-meter.ts msgid "%s of %s" msgstr "%s из %s" @@ -784,171 +1030,184 @@ msgstr "%s из %s ГБ" msgid "%s of %s GB this month" msgstr "%s из %s ГБ в этом месяце" -#: web/src/admin/pages/settings/portal.ts -msgid "%s of %s check passed" -msgid_plural "%s of %s checks passed" -msgstr[0] "Пройдено %s из %s проверки" -msgstr[1] "Пройдено %s из %s проверок" -msgstr[2] "Пройдено %s из %s проверок" +#: web/src/admin/pages/settings/stages.ts +msgid "%s of %s addresses taken" +msgstr "%s из %s адресов занято" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -msgid "%s of %s device" -msgid_plural "%s of %s devices" -msgstr[0] "%s из %s устройства" -msgstr[1] "%s из %s устройств" -msgstr[2] "%s из %s устройств" +#: web/src/admin/pages/server/overview.ts +msgid "%s of %s fine" +msgstr "%s из %s в порядке" -#: web/src/admin/pages/components/index.ts -msgid "%s of %s needs an update" -msgid_plural "%s of %s need an update" -msgstr[0] "%s из %s требует обновления" -msgstr[1] "%s из %s требуют обновления" -msgstr[2] "%s из %s требуют обновления" +#: web/src/admin/pages/overview/health.ts +msgid "%s of %s passed" +msgstr "%s из %s в порядке" -#: web/src/admin/pages/settings/backups.ts -msgid "%s older backup" -msgid_plural "%s older backups" -msgstr[0] "%s старая копия" -msgstr[1] "%s старые копии" -msgstr[2] "%s старых копий" +#: web/src/admin/flows/add-device.ts +msgid "%s of %s slot free" +msgid_plural "%s of %s slots free" +msgstr[0] "Свободно %s из %s места" +msgstr[1] "Свободно %s из %s мест" +msgstr[2] "Свободно %s из %s мест" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/server-change.ts +msgid "%s of them belongs to someone without access now: it fetches it when access is back." +msgid_plural "%s of them belong to people without access now: they fetch it when access is back." +msgstr[0] "%s из них у человека без доступа: заберёт, когда доступ вернётся." +msgstr[1] "%s из них у людей без доступа: заберут, когда доступ вернётся." +msgstr[2] "%s из них у людей без доступа: заберут, когда доступ вернётся." + +#: web/src/admin/pages/settings/router/history.ts msgid "%s on flash" msgstr "%s во флеш-памяти" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s on this router" msgstr "%s на этом роутере" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/index.ts msgid "%s online" msgstr "%s в сети" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/portal/setup.ts +msgid "%s or %s" +msgstr "%s или %s" + +#: backend/i18n/messages.js msgid "%s overlaps %s." msgstr "%s пересекается с %s." -#: web/src/admin/pages/people.ts -msgid "%s paused" -msgstr "%s: доступ приостановлен" +#: web/src/admin/pages/settings/router/updates.ts +msgid "%s package update" +msgid_plural "%s package updates" +msgstr[0] "%s обновление пакетов" +msgstr[1] "%s обновления пакетов" +msgstr[2] "%s обновлений пакетов" -#: web/src/admin/access.ts +#: web/src/admin/flows/restore.ts #: web/src/admin/map.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/pages/settings/check.ts +#: web/src/admin/widgets/visibility.ts msgid "%s person" msgid_plural "%s people" msgstr[0] "%s человек" msgstr[1] "%s человека" msgstr[2] "%s человек" -#: web/src/admin/interfaces.ts -msgid "%s person has Home-only access: their devices need the configuration again to reach the new networks." -msgid_plural "%s people have Home-only access: their devices need the configuration again to reach the new networks." -msgstr[0] "У %s человека доступ только к домашней сети: чтобы видеть новые сети, устройствам нужно заново получить конфигурацию." -msgstr[1] "У %s человек доступ только к домашней сети: чтобы видеть новые сети, устройствам нужно заново получить конфигурацию." -msgstr[2] "У %s человек доступ только к домашней сети: чтобы видеть новые сети, устройствам нужно заново получить конфигурацию." +#: web/src/admin/pages/people/notices.ts +msgid "%s person has not fetched it yet" +msgid_plural "%s people have not fetched it yet" +msgstr[0] "%s человек ещё не забрал" +msgstr[1] "%s человека ещё не забрали" +msgstr[2] "%s человек ещё не забрали" -#: web/src/admin/pages/person/activity.ts -msgid "%s place in 30 days" -msgid_plural "%s places in 30 days" -msgstr[0] "%s место за 30 дней" -msgstr[1] "%s места за 30 дней" -msgstr[2] "%s мест за 30 дней" +#: web/src/admin/pages/people/notices.ts +msgid "%s person without access" +msgid_plural "%s people without access" +msgstr[0] "без доступа %s человек" +msgstr[1] "без доступа %s человека" +msgstr[2] "без доступа %s человек" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/circle.ts +msgid "%s picked" +msgid_plural "%s picked" +msgstr[0] "%s выбран" +msgstr[1] "%s выбрано" +msgstr[2] "%s выбрано" + +#: web/src/admin/pages/people/map-view.ts +msgid "%s place" +msgid_plural "%s places" +msgstr[0] "%s место" +msgstr[1] "%s места" +msgstr[2] "%s мест" + +#: backend/i18n/messages.js msgid "%s points at %s, not this router (%s)." msgstr "%s указывает на %s, а не на этот роутер (%s)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s points at %s, not this router (WAN %s). Check your DNS / DDNS." msgstr "%s указывает на %s, а не на этот роутер (WAN %s). Проверьте DNS / DDNS." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s points at this router (%s)." msgstr "%s указывает на этот роутер (%s)." -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s problem needs attention." -msgid_plural "%s problems need attention." -msgstr[0] "%s проблема требует внимания." -msgstr[1] "%s проблемы требуют внимания." -msgstr[2] "%s проблем требуют внимания." +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/system/model.ts +msgid "%s problem" +msgid_plural "%s problems" +msgstr[0] "%s проблема" +msgstr[1] "%s проблемы" +msgstr[2] "%s проблем" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "%s random packet of %s–%s bytes before each handshake." msgid_plural "%s random packets of %s–%s bytes before each handshake." msgstr[0] "%s случайный пакет размером %s–%s байт перед каждым рукопожатием." msgstr[1] "%s случайных пакета размером %s–%s байт перед каждым рукопожатием." msgstr[2] "%s случайных пакетов размером %s–%s байт перед каждым рукопожатием." -#: web/src/admin/pages/overview.ts -msgid "%s reached the data limit." -msgstr "%s: достигнут лимит трафика." - -#: web/src/admin/pages/person/pickers.ts -msgid "%s reaches %s" -msgstr "%s: доступ к %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s reaches %s." msgstr "%s: доступны сети %s." -#: web/src/admin/pages/person/pickers.ts -msgid "%s reaches every home network" -msgstr "%s: доступ ко всем домашним сетям" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s reaches no home network." msgstr "%s: нет доступа ни к одной домашней сети." -#: web/src/admin/access.ts +#: web/src/admin/widgets/feed.ts +msgid "%s reconnect" +msgid_plural "%s reconnects" +msgstr[0] "%s переподключение" +msgstr[1] "%s переподключения" +msgstr[2] "%s переподключений" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "%s removed" msgstr "Удалено: %s" -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s repair" -msgid_plural "%s repairs" -msgstr[0] "%s попытка исправления" -msgstr[1] "%s попытки исправления" -msgstr[2] "%s попыток исправления" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s repair today, last %s at %s" -msgid_plural "%s repairs today, last %s at %s" -msgstr[0] "%s исправление сегодня, последнее - %s в %s" -msgstr[1] "%s исправления сегодня, последнее - %s в %s" -msgstr[2] "%s исправлений сегодня, последнее - %s в %s" - -#: web/src/admin/pages/people.ts -msgid "%s resumed" -msgstr "%s: доступ возобновлён" - -#: web/src/admin/device-link.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "%s s" msgstr "%s с" -#: web/src/admin/widgets/readouts.ts -msgid "%s s ago" -msgstr "%s с назад" +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/overview/head.ts +msgid "%s server" +msgid_plural "%s servers" +msgstr[0] "%s сервер" +msgstr[1] "%s сервера" +msgstr[2] "%s серверов" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/widgets/reach.ts +msgid "%s service" +msgid_plural "%s services" +msgstr[0] "%s сервис" +msgstr[1] "%s сервиса" +msgstr[2] "%s сервисов" + +#: web/src/admin/events/timeline.ts msgid "%s since %s" msgstr "%s с %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "%s still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations." msgstr "%s по-прежнему выдают устройствам старый адрес: укажите публичный адрес в настройках сервера (имя DDNS продолжит работать), после этого устройствам понадобятся новые конфигурации." -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "%s still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations." msgstr "%s по-прежнему выдаёт устройствам старый адрес: укажите публичный адрес в настройках сервера (имя DDNS продолжит работать), после этого устройствам понадобятся новые конфигурации." -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/updater/jobs.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "%s system package" msgid_plural "%s system packages" msgstr[0] "%s системный пакет" @@ -959,115 +1218,167 @@ msgstr[2] "%s системных пакетов" msgid "%s takes over when the tunnel is down." msgstr "Когда туннель не работает, используется %s." -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/header.ts #: web/src/shared/format.ts msgid "%s this month" msgstr "%s в этом месяце" -#: web/src/admin/pages/person/activity.ts -msgid "%s time" -msgid_plural "%s times" -msgstr[0] "%s раз" -msgstr[1] "%s раза" -msgstr[2] "%s раз" - -#: web/src/admin/pages/overview.ts -msgid "%s today" -msgstr "%s сегодня" - -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "%s update" msgid_plural "%s updates" msgstr[0] "%s обновление" msgstr[1] "%s обновления" msgstr[2] "%s обновлений" -#: web/src/admin/pages/components/activity.ts -msgid "%s update failed" -msgstr "%s: ошибка обновления" - -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "%s updated" msgstr "Обновлено: %s" -#: web/src/admin/pages/components/activity.ts -msgid "%s updated automatically" -msgstr "%s: обновлено автоматически" +#: web/src/admin/widgets/limit-meter.ts +msgid "%s used of the limit are let go, and a new month begins when they next connect." +msgstr "%s из лимита обнулятся, а новый месяц начнётся со следующего подключения." -#: web/src/admin/pages/components/activity.ts -msgid "%s updated by you" -msgstr "%s: обновлено вручную" +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/system/model.ts +msgid "%s warning" +msgid_plural "%s warnings" +msgstr[0] "%s предупреждение" +msgstr[1] "%s предупреждения" +msgstr[2] "%s предупреждений" -#: web/src/admin/pages/overview.ts -msgid "%s uses %s now - devices need their configuration again" -msgstr "%s теперь использует %s - устройствам нужна новая конфигурация" +#: web/src/admin/widgets/visibility.ts +msgid "%s with internet only see nobody under any rule." +msgstr "%s только с интернетом не видят никого при любом правиле." -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s warning." -msgid_plural "%s warnings." -msgstr[0] "%s предупреждение." -msgstr[1] "%s предупреждения." -msgstr[2] "%s предупреждений." +#: web/src/admin/pages/settings/disguise.ts +msgid "%s with the values in use" +msgstr "%s с нынешними значениями" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s year" msgid_plural "%s years" msgstr[0] "%s год" msgstr[1] "%s года" msgstr[2] "%s лет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/settings/changes.ts +msgid "%s · %s" +msgstr "%s · %s" + +#: web/src/admin/pages/people/cards.ts +msgid "%s · %s more above" +msgstr "%s · ещё %s выше" + +#: web/src/admin/flows/setup.ts +msgid "%s · %s. Waiting for its first connection with the new configuration." +msgstr "%s · %s. Ждём первого подключения с новой настройкой." + +#: web/src/admin/pages/people/device/index.ts +msgid "%s · %s: %s?" +msgstr "%s · %s: %s?" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s · auto" +msgstr "%s · авто" + +#: web/src/admin/widgets/config-card.ts +msgid "%s · automatic" +msgstr "%s · авто" + +#: backend/i18n/messages.js msgid "%s · interface settings" msgstr "%s · настройки интерфейса" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s · restored" msgstr "%s · восстановлено" -#: web/src/admin/pages/person/limits.ts -msgid "%s – %s (router time)" -msgstr "%s – %s (время роутера)" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s (Cloudflare). %s reaches the router only if this name is DNS-only there, or use the router's IP." msgstr "%s → %s (Cloudflare). %s дойдёт до роутера, только если для этого имени там включён режим «DNS only»; или используйте IP роутера." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s (this router)." msgstr "%s → %s (этот роутер)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS." msgid_plural "%s → %s: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS." msgstr[0] "%s → %s: только IPv6, и это не публичный адрес роутера: ни одно устройство не подключится. Проверьте DNS / DDNS." msgstr[1] "%s → %s: только IPv6, и это не публичные адреса роутера: ни одно устройство не подключится. Проверьте DNS / DDNS." msgstr[2] "%s → %s: только IPv6, и это не публичные адреса роутера: ни одно устройство не подключится. Проверьте DNS / DDNS." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router." msgstr "%s → %s: только IPv6, но у роутера нет публичного IPv6-адреса: ни одно устройство не подключится. Проверьте DNS / DDNS или настройте IPv6 на роутере." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, so only devices with IPv6 connect (the router's IPv4 %s has no name)." msgstr "%s → %s: только IPv6, поэтому подключатся лишь устройства с IPv6 (у IPv4-адреса роутера %s нет имени)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, so only devices with IPv6 connect." msgstr "%s → %s: только IPv6, поэтому подключатся лишь устройства с IPv6." +#: web/src/admin/flows/move-person.ts +msgid "%s → %s?" +msgstr "%s → %s?" + +#: web/src/admin/people/lines.ts +msgid "%s%% of the data limit" +msgstr "%s %% лимита" + #: web/src/admin/places/render.ts msgid "%s%% of the time" msgstr "%s%% времени" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/limit-meter.ts msgid "%s%% used" -msgstr "Использовано %s%%" +msgstr "использовано %s%%" -#: web/src/admin/pages/overview.ts -msgid "%s, online" -msgstr "%s, в сети" +#: web/src/admin/pages/log/clear.ts +msgid "%s+ day" +msgid_plural "%s+ days" +msgstr[0] "%s+ дн." +msgstr[1] "%s+ дн." +msgstr[2] "%s+ дн." + +#: web/src/admin/events/clock.ts +msgid "%s, %s" +msgstr "%s, %s" + +#: web/src/admin/flows/invite.ts +msgid "%s, %s over HTTP" +msgstr "%s, по HTTP: %s" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s, last 30 days" +msgstr "%s, последние 30 дней" + +#: web/src/admin/widgets/week-use.ts +msgid "%s, last 7 days" +msgstr "%s, последние 7 дней" + +#: web/src/shared/format.ts +msgid "%s/s" +msgstr "%s/с" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/limit-meter.ts +#: web/src/admin/widgets/reach.ts +msgid "%s: %s" +msgstr "%s: %s" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s: %s accepted" +msgstr "%s: %s принята" #: web/src/admin/map.ts msgid "%s: %s device in %s" @@ -1083,196 +1394,327 @@ msgstr[0] "%s: %s устройство, город неизвестен" msgstr[1] "%s: %s устройства, город неизвестен" msgstr[2] "%s: %s устройств, город неизвестен" -#: web/src/admin/disguise.ts -msgid "%s: %s of 4" -msgstr "%s: %s из 4" +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "%s: +%s GB until the reset" +msgstr "%s: +%s ГБ до сброса" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." msgstr "%s: тег <%s> не примут приложения AmneziaWG: используйте с чётным числом шестнадцатеричных цифр, , или с N от 1 до 1000 либо ." +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/device/index.ts +msgid "%s: access resumed" +msgstr "%s: доступ возобновлён" + +#: web/src/admin/flows/person-acts.ts +msgid "%s: access until %s" +msgstr "%s: доступ до %s" + +#: web/src/admin/flows/person-acts.ts +msgid "%s: access with no end date" +msgstr "%s: доступ бессрочный" + #: web/src/admin/events/model.ts msgid "%s: automatic" msgstr "%s: автоматически" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/people/lines.ts +msgid "%s: needs a new configuration" +msgstr "%s: нужна новая настройка" + +#: web/src/admin/pages/overview/servers.ts +msgid "%s: no server, no access" +msgstr "%s: сервера нет, доступа нет" + +#: web/src/admin/people/card.ts +msgid "%s: nothing gets through" +msgstr "%s: данные не проходят" + +#: web/src/admin/pages/people/card.ts +msgid "%s: open, link, device, pause" +msgstr "%s: открыть, ссылка, устройство, пауза" + +#: web/src/admin/places/render.ts +msgid "%s: replay this period" +msgstr "%s: перемотка периода" + +#: web/src/admin/flows/move-person.ts +msgid "%s: server %s" +msgstr "%s: сервер %s" + +#: web/src/admin/pages/people/person/devices.ts +msgid "%s: set-up, turn off, new keys, remove" +msgstr "%s: настройка, выключить, новые ключи, удалить" + +#: web/src/admin/people/diagnosis.ts +msgid "%s: the VPN does not connect from the network it is on now. Its attempts reach the router, but the answer does not reach the device. The configuration is right, the network is in the way. Try another one: mobile data instead of Wi‑Fi, or the other way round. If that does not help, write to me." +msgstr "%s: VPN не подключается из нынешней сети. Попытки доходят до роутера, а ответ до устройства не доходит. Настройка верная, мешает сеть. Попробуйте другую: мобильный интернет вместо Wi‑Fi или наоборот. Если не поможет, напишите мне." + +#: web/src/admin/people/card.ts +msgid "%s: the connection keeps dropping" +msgstr "%s: связь рвётся" + +#: backend/i18n/messages.js msgid "%s: the device's own network handles it." msgstr "%s: этот трафик идёт через собственную сеть устройства." +#: backend/i18n/messages.js +msgid "%s: the tunnel carries this network, and the rules see a host there as they see the router." +msgstr "%s: туннель несёт эту сеть, и правила видят узел в ней так же, как сам роутер." + +#: web/src/admin/pages/people/card.ts +msgid "%s: traffic in the last 7 days" +msgstr "%s: трафик за 7 дней" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s: usage reset" +msgstr "%s: использование сброшено" + +#: web/src/admin/pages/people/card.ts +#: web/src/shared/format.ts +msgid "%sd" +msgstr "%s д" + #: web/src/shared/format.ts msgid "%sd %sh" msgstr "%s д %s ч" +#: web/src/admin/pages/people/card.ts +#: web/src/shared/format.ts +msgid "%sh" +msgstr "%s ч" + #: web/src/shared/format.ts msgid "%sh %sm" msgstr "%s ч %s мин" +#: web/src/admin/pages/people/card.ts #: web/src/shared/format.ts msgid "%sm" msgstr "%s мин" -#: web/src/admin/pages/overview.ts -msgid "%s’s access %s." -msgstr "%s: доступ %s." - -#: web/src/admin/pages/overview.ts -msgid "%s’s access has ended." -msgstr "%s: доступ закончился." - -#: web/src/admin/pages/overview.ts -msgid "%s’s end date passed (%s) · access kept." -msgstr "%s: дата окончания прошла (%s) · доступ сохранён." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "(%d more)" msgstr "(ещё %d)" -#: web/src/admin/pages/components/hero.ts -msgid "+%s more in What’s new" -msgid_plural "+%s more in What’s new" -msgstr[0] "Ещё %s пункт в «Что нового»" -msgstr[1] "Ещё %s пункта в «Что нового»" -msgstr[2] "Ещё %s пунктов в «Что нового»" +#: web/src/admin/people/lines.ts +msgid "+%s GB" +msgstr "+%s ГБ" -#: web/src/admin/widgets/readouts.ts -msgid "+%s%% vs average" -msgstr "+%s%% к среднему" +#: web/src/admin/people/lines.ts +msgid "+%s GB until %s" +msgstr "+%s ГБ до %s" -#: web/src/admin/pages/person/limits.ts -msgid "+1 month" -msgstr "+1 месяц" +#: web/src/admin/widgets/limit-meter.ts +msgid "+%s GB until the reset" +msgstr "+%s ГБ до сброса" -#: web/src/admin/pages/person/limits.ts -msgid "+1 week" -msgstr "+1 неделя" +#: web/src/admin/widgets/term.ts +msgid "+%s month" +msgid_plural "+%s months" +msgstr[0] "+ %s месяц" +msgstr[1] "+ %s месяца" +msgstr[2] "+ %s месяцев" -#: web/src/admin/pages/person/limits.ts -msgid "+1 year" -msgstr "+1 год" +#: web/src/admin/widgets/config-card.ts +msgid "1280–1500, or empty: automatic" +msgstr "1280–1500, или пусто: авто" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "+10 GB this month" -msgstr "+10 ГБ в этом месяце" - -#: web/src/admin/pages/person/limits.ts -msgid "+3 months" -msgstr "+3 месяца" - -#: web/src/admin/pages/people.ts -msgid "1 month" -msgstr "1 месяц" - -#: web/src/admin/pages/people.ts -msgid "1 year" -msgstr "1 год" - -#: web/src/admin/pages/overview.ts -msgid "15 min" -msgstr "15 мин" - -#: web/src/admin/pages/overview.ts -msgid "2 min" -msgstr "2 мин" - -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "24h" msgstr "24 ч" -#: web/src/admin/pages/people.ts -msgid "3 months" -msgstr "3 месяца" - -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/device/traffic.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/limit-meter.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "30 days" msgstr "30 дней" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "4500 is IPsec’s port: most networks let it through." msgstr "4500 - порт IPsec: большинство сетей его пропускают." -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "7 days" msgstr "7 дней" -#: web/src/admin/pages/server.ts -msgid "A DDNS name keeps links working when your IP changes; not through Cloudflare (use a DNS-only name or an IP)" -msgstr "С именем DDNS ссылки работают и после смены IP; не через Cloudflare (нужно имя в режиме «DNS only» или IP)" +#: web/src/admin/flows/restore.ts +msgid "A Dawnline backup: people, devices, servers and their keys." +msgstr "Копия Dawnline: люди, устройства, серверы и ключи." -#: web/src/admin/pages/overview.ts -msgid "A DDNS name would follow it by itself." -msgstr "С DDNS-именем адрес обновлялся бы сам." +#: web/src/admin/widgets/link-values.ts +msgid "A device is silent while it has nothing to send: behind NAT it may not be reachable from home until it speaks first." +msgstr "Устройство молчит, пока ему нечего передать: за NAT до него может быть не достучаться из дома, пока оно само не выйдет на связь." -#: web/src/admin/cores/awg.ts +#: web/src/admin/widgets/link-values.ts +msgid "A device sends a packet every %s s: it stays reachable from home behind its network’s NAT. A little battery on phones." +msgstr "Устройство шлёт пакет каждые %s с: остаётся доступным из дома за NAT своей сети. Немного расходует батарею телефона." + +#: web/src/admin/pages/settings/check.ts +msgid "A device, or 10.0.1.11" +msgstr "Устройство или 10.0.1.11" + +#: web/src/admin/pages/settings/stages.ts +msgid "A device’s own value is set on its page and is not changed here." +msgstr "Своё значение у устройства задаётся на его странице и здесь не меняется." + +#: web/src/admin/servers/params.ts msgid "A first packet shaped like a DNS answer." msgstr "Первый пакет выглядит как ответ DNS." +#: web/src/admin/flows/portal-sheets.ts +msgid "A full path on the router, starting with /." +msgstr "Полный путь на роутере, начиная с /." + +#: web/src/admin/pages/settings/check.ts +msgid "A home service, or 192.168.1.10:445" +msgstr "Домашний сервис или 192.168.1.10:445" + #: web/src/admin/netcheck.ts msgid "A hostname has no spaces." msgstr "В имени хоста не бывает пробелов." -#: web/src/admin/pages/server.ts -msgid "A hostname or IP address of your router on the internet; not through Cloudflare (use a DNS-only name or an IP). IPv6 works too, and is the way out of CGNAT" -msgstr "Имя хоста или IP-адрес роутера в интернете; не через Cloudflare (нужно имя в режиме «DNS only» или IP). Подходит и IPv6 - это выход из CGNAT" +#: web/src/admin/pages/settings/router/portal.ts +msgid "A link nobody was given is sent to this address, so the portal does not show itself to a stranger." +msgstr "Ссылка, которую никому не выдавали, уходит на этот адрес: постороннему портал себя не показывает." + +#: web/src/admin/pages/settings/router/portal.ts +msgid "A link nobody was given opens a bare “Not found” page." +msgstr "Ссылка, которую никому не выдавали, открывает пустую страницу «Не найдено»." + +#: web/src/admin/pages/people/pick.ts +msgid "A month on from the end date (or from today once it has passed)" +msgstr "На месяц от даты окончания (или от сегодня, если она прошла)" + +#: backend/i18n/messages.js +msgid "A network behind a router has no route" +msgstr "К сети за роутером нет маршрута" + +#: backend/i18n/messages.js +msgid "A network behind a router isn’t in effect" +msgstr "Сеть за роутером не действует" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "A new AmneziaWG module restarts every tunnel." +msgstr "Новый модуль AmneziaWG перезапускает все туннели." + +#: web/src/admin/people/lines.ts +msgid "A new configuration is needed: %s device" +msgid_plural "A new configuration is needed: %s devices" +msgstr[0] "Нужна новая настройка: %s устройство" +msgstr[1] "Нужна новая настройка: %s устройства" +msgstr[2] "Нужна новая настройка: %s устройств" + +#: web/src/admin/flows/invite.ts +msgid "A new link for %s?" +msgstr "%s: сделать новую ссылку?" #: web/src/admin/netcheck.ts msgid "A number of GB, up to 100000." msgstr "Число ГБ, не больше 100 000." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/networks.ts +msgid "A packet crosses the router twice" +msgstr "Пакет проходит роутер дважды" + +#: web/src/admin/pages/settings/router/portal.ts msgid "A page where each person adds and manages their devices with their personal link." msgstr "Страница, где каждый по своей личной ссылке добавляет свои устройства и управляет ими." -#: web/src/admin/pages/server.ts -msgid "A page where each person adds their own devices with their personal link" -msgstr "Страница, где каждый человек сам добавляет свои устройства по личной ссылке" +#: backend/i18n/messages.js +msgid "A route to a network behind a router couldn't be set: %s." +msgstr "Не удалось задать маршрут к сети за роутером: %s." -#: web/src/admin/pages/settings/updates.ts -msgid "A set time keeps tunnel restarts out of the evening; the run happens within an hour of it." -msgstr "С заданным временем туннели не перезапускаются по вечерам; обновление начнётся в течение часа от него." +#: web/src/admin/pages/settings/networks.ts +msgid "A router and every network behind it wait in the card above for your answer. Taking a network away is the person’s to do at once." +msgstr "Роутер и каждая сеть за ним ждут вашего ответа в карточке выше. Убрать сеть человек может сам, сразу." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/networks.ts +msgid "A router and its networks work as soon as a person adds them, and other people’s devices fetch their configuration again." +msgstr "Роутер и его сети работают, как только человек их добавил, а устройства других людей получают конфигурацию заново." + +#: web/src/admin/pages/settings/networks.ts +msgid "A router brings its own network along: home devices and people with home access reach it through the tunnel, and it reaches what its person reaches." +msgstr "Роутер приводит с собой свою сеть: домашние устройства и люди с доступом к дому попадают в неё через туннель, а ей доступно то же, что его человеку." + +#: backend/i18n/messages.js +msgid "A router has %d networks behind it at the most." +msgstr "За одним роутером может быть не больше %d сетей." + +#: web/src/admin/pages/settings/networks.ts +msgid "A router is added at once and connects as one device; the networks behind it wait for your answer." +msgstr "Роутер добавляется сразу и подключается как одно устройство; сети за ним ждут вашего ответа." + +#: backend/i18n/messages.js +msgid "A router reaches its own network without the tunnel." +msgstr "Роутер попадает в свою сеть без туннеля." + +#: web/src/admin/pages/settings/networks.ts +msgid "A router waits for your answer; once it is taken, its person changes its networks with no answer of yours." +msgstr "Роутер ждёт вашего ответа; после этого человек меняет его сети сам, без подтверждения." + +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/settings/router/history.ts +msgid "A spreadsheet" +msgstr "Таблица" + +#: web/src/admin/flows/versions.ts +msgid "A version by its tag" +msgstr "Версия по тегу" + +#: web/src/admin/pages/settings/router/portal.ts msgid "ACME isn’t installed. With it the router gets a certificate and browsers stop warning." msgstr "ACME не установлен. С ним роутер получит сертификат, и браузеры перестанут предупреждать." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "ACME isn’t installed. With it the router gets a certificate for %s and browsers stop warning." msgstr "ACME не установлен. С ним роутер получит сертификат для %s, и браузеры перестанут предупреждать." -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts +#: web/src/portal/setup.ts +msgid "APK file on" +msgstr "APK-файл на" + +#: web/src/admin/flows/behind-ask.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-values.ts +msgid "Accept" +msgstr "Принять" + +#: web/src/admin/widgets/net-values.ts +msgid "Accept %s" +msgstr "Принять %s" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/diagnosis.ts msgid "Access" msgstr "Доступ" -#: web/src/admin/pages/people.ts -msgid "Access %s (router time)" -msgstr "Доступ %s (время роутера)" - -#: web/src/admin/pages/person/limits.ts -msgid "Access & limits" -msgstr "Доступ и лимиты" - -#: web/src/admin/pages/person/limits.ts -msgid "Access and limits" -msgstr "Доступ и лимиты" - -#: web/src/admin/ui/badges.ts -msgid "Access ended" -msgstr "Доступ закончился" - -#: web/src/admin/pages/people.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Access ended %s" msgstr "Доступ закончился %s" -#: web/src/admin/pages/person/limits.ts -msgid "Access ends" -msgstr "Срок доступа" - -#: web/src/admin/pages/people.ts -msgid "Access ends %s" -msgstr "Окончание доступа: %s" +#: web/src/admin/people/lines.ts +msgid "Access ended %s: resumed without a new end date, it ends again at once." +msgstr "Доступ закончился %s: возобновление без продления сразу закончится снова." #: web/src/admin/events/render.ts msgid "Access ends in %s day" @@ -1296,7 +1738,7 @@ msgstr "Доступ закончится через несколько дней msgid "Access ends today (%s)." msgstr "Доступ закончится сегодня (%s)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Access must be lan, internet or both." msgstr "Доступ должен быть lan, internet или both." @@ -1316,215 +1758,250 @@ msgstr "Доступ возобновлён" msgid "Access resumed - %s" msgstr "Доступ возобновлён: %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Access rules" msgstr "Правила доступа" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Access rules aren’t loaded" msgstr "Правила доступа не загружены" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "Access rules couldn't be updated (%s): the previous rules stay, so this change isn't in effect yet." msgstr "Не удалось обновить правила доступа (%s): действуют прежние правила, поэтому изменение пока не вступило в силу." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "Access rules couldn't load (%s): no device is loaded into the tunnels until they do." msgstr "Не удалось загрузить правила доступа (%s): пока они не загрузятся, ни одно устройство не будет загружено в туннели." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Access rules loaded" msgstr "Правила доступа загружены" -#: web/src/admin/interfaces.ts -msgid "Access saved" -msgstr "Доступ сохранён" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "Access until %s" msgstr "Доступ до %s" -#: web/src/admin/pages/person/limits.ts -msgid "Access: %s" -msgstr "Доступ: %s" +#: web/src/admin/pages/people/pick.ts +msgid "Actions with the selected" +msgstr "Действия с выбранными" -#: web/src/shared/format.ts -msgid "Active" -msgstr "Активен" - -#: web/src/admin/pages/components/awg.ts -msgctxt "build" -msgid "Active" -msgstr "Используется" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/device.ts -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts +#: backend/i18n/messages.js msgid "Activity" msgstr "События" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Activity log" msgstr "Журнал событий" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Activity: %s." msgstr "События: %s." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Add" msgstr "Добавить" -#: web/src/admin/device.ts -msgid "Add a device for %s" -msgstr "Новое устройство: %s" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Add Tunnel" +msgstr "Добавить туннель" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +msgid "Add a device · %s" +msgstr "Устройство · %s" + +#: web/src/admin/pages/people/device/link.ts +msgid "Add a second device" +msgstr "Добавить второе устройство" + +#: web/src/admin/flows/new-server.ts msgid "Add a server" msgstr "Добавить сервер" -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/pages/settings/router/portal.ts +msgid "Add an address" +msgstr "Добавить адрес" + +#: web/src/admin/flows/add-device.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/people/lines.ts msgid "Add device" msgstr "Добавить устройство" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Add from devices at home" msgstr "Добавить из домашних устройств" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/person/head.ts msgid "Add note" msgstr "Добавить заметку" -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/person/devices.ts +msgid "Add over the limit" +msgstr "Добавить сверх лимита" + +#: web/src/admin/pages/people/cards.ts +#: web/src/admin/pages/people/index.ts msgid "Add person" msgstr "Добавить человека" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/overview/servers.ts msgid "Add server" msgstr "Добавить сервер" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Add service" msgstr "Добавить сервис" -#: web/src/admin/invite.ts -msgid "Add the device and connect" -msgstr "Добавьте устройство и подключитесь" +#: web/src/admin/pages/people/cards.ts +msgid "Add someone and send them their personal link: they add their devices themselves." +msgstr "Добавьте человека и отправьте ему личную ссылку: устройства он добавит сам." -#: web/src/admin/device.ts -msgid "Added" -msgstr "Добавлено" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Add the Russian translation" +msgstr "Добавить русский перевод" -#: web/src/admin/device.ts -msgid "Added %s" -msgstr "Добавлено %s" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Add the Russian translation?" +msgstr "Добавить русский перевод?" -#: web/src/admin/pages/person/header.ts -msgctxt "date" -msgid "Added %s" -msgstr "Дата добавления: %s" +#: backend/i18n/messages.js +msgid "Add the router as a new device: a device cannot be made one here." +msgstr "Добавьте роутер как новое устройство: сделать им это устройство здесь нельзя." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/flows/invite.ts +msgid "Added on the portal through the old link: they keep working until they are removed." +msgstr "Добавлены на портале по старой ссылке: работают, пока их не удалить." + +#: web/src/admin/pages/settings/networks.ts +msgid "Adding a router" +msgstr "Добавление роутера" + +#: web/src/admin/pages/settings/networks.ts +msgid "Adding a router on people’s pages" +msgstr "Добавление роутера на личных страницах" + +#: web/src/admin/flows/server-change.ts +msgid "Adding a router on people’s pages: %s?" +msgstr "Добавление роутера на личных страницах: %s?" + +#: backend/i18n/messages.js msgid "Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link." msgstr "Сейчас добавить устройство нельзя: VPN-сервер не готов. Обратитесь к тому, кто прислал вам эту ссылку." -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Adding the Russian translation" msgstr "Добавление русского перевода" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/entry.ts msgid "Address" msgstr "Адрес" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/entry.ts msgid "Address copied" msgstr "Адрес скопирован" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/widgets/entry.ts +msgid "Address for devices" +msgstr "Адрес для устройств" + +#: web/src/admin/flows/server-change.ts +msgid "Address for devices: %s?" +msgstr "Адрес для устройств: %s?" + +#: web/src/admin/widgets/config-card.ts +msgid "Address in the tunnel" +msgstr "Адрес в туннеле" + +#: backend/i18n/messages.js msgid "Address must be an IPv4 address." msgstr "Адрес должен быть IPv4-адресом." -#: web/src/admin/pages/server.ts -msgid "Address range" -msgstr "Диапазон адресов" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Address removed: %s" +msgstr "Адрес убран: %s" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/entry.ts +msgid "Address · the portal’s" +msgstr "Адрес · как у портала" + +#: web/src/admin/pages/settings/stages.ts +msgid "Address: %s" +msgstr "Адрес: %s" + +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/config-card.ts msgid "Addresses" msgstr "Адреса" -#: web/src/admin/pages/server.ts -msgid "Addresses devices get inside the tunnel" -msgstr "Адреса, которые устройства получают внутри туннеля" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Adds the LAN this router uses." msgstr "Добавляет LAN, которую использует этот роутер." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/device/index.ts +msgid "Advice copied: send it to them" +msgstr "Совет скопирован: отправьте его" + +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Advice · %s" +msgstr "Совет · %s" + +#: backend/i18n/messages.js msgid "Agent" msgstr "Агент" -#: web/src/admin/pages/person/limits.ts -msgid "Alert at 90%" -msgstr "Предупреждение при 90%" - -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/widgets/reach.ts msgid "All" msgstr "Все" -#: web/src/admin/pages/settings/portal.ts -msgid "All %s check passed" -msgid_plural "All %s checks passed" -msgstr[0] "%s проверка пройдена" -msgstr[1] "Все %s проверки пройдены" -msgstr[2] "Все %s проверок пройдены" +#: web/src/admin/flows/places-closeup.ts +msgid "All devices" +msgstr "Все устройства" -#: web/src/admin/device.ts -msgid "All activity" -msgstr "Все события" - -#: web/src/admin/logs.ts -msgid "All categories" -msgstr "Все категории" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "All checks passed." -msgstr "Все проверки пройдены." - -#: web/src/admin/updater/operation.ts -msgid "All components" -msgstr "Все компоненты" - -#: web/src/admin/events/render.ts -msgid "All devices removed, end date reached" -msgstr "Все устройства удалены: срок доступа закончился" - -#: web/src/admin/pages/overview.ts -msgid "All good. Nothing needs you right now." -msgstr "Всё в порядке. Сейчас ничего не требует вашего внимания." - -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "All in Log" msgstr "Все в журнале" -#: web/src/admin/pages/components/activity.ts -msgid "All in Log →" -msgstr "Всё в журнале →" +#: web/src/admin/widgets/rollout.ts +msgid "All in People" +msgstr "Все в Людях" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -#: web/src/admin/access.ts +#: web/src/admin/flows/add-person.ts +msgid "All of it can be changed later on their page. Their invite comes next, in this sheet." +msgstr "Всё это можно поменять потом, на странице человека. После создания здесь же появится приглашение." + +#: web/src/admin/widgets/reach.ts +msgid "All of them includes networks added to the server later; a choice keeps them out." +msgstr "«Все» включают и сети, добавленные на сервер позже; выбранные вручную их не включают." + +#: web/src/admin/pages/people/map-view.ts +msgid "All places" +msgstr "Все места" + +#: backend/i18n/messages.js +#: web/src/admin/flows/home-service.ts msgid "All ports" msgstr "Все порты" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "All ports, or e.g. 445, 5000" msgstr "Все порты или, например, 445, 5000" @@ -1532,31 +2009,22 @@ msgstr "Все порты или, например, 445, 5000" msgid "All ports." msgstr "Все порты." -#: web/src/admin/pages/person/pickers.ts -msgid "Allow fewer devices" -msgstr "Уменьшить лимит устройств" +#: web/src/admin/pages/server/index.ts +msgid "All servers" +msgstr "Все серверы" -#: web/src/admin/pages/person/pickers.ts -msgid "Allow more devices" -msgstr "Увеличить лимит устройств" - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Allowed" msgstr "Разрешено" -#: web/src/admin/pages/person/limits.ts -msgid "Allowed %s–%s" -msgstr "Доступ %s–%s" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "Allowed hours" -msgstr "Часы доступа" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Allowed: %s" msgstr "Разрешены: %s" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Almost as fast" +msgstr "Почти так же быстро" + #: web/src/admin/netcheck.ts msgid "Already has %s device: remove %s first, or allow more." msgid_plural "Already has %s devices: remove %s first, or allow more." @@ -1571,140 +2039,118 @@ msgstr[0] "Уже %s устройство: сначала удалите одн msgstr[1] "Уже %s устройства: сначала удалите одно или разрешите больше." msgstr[2] "Уже %s устройств: сначала удалите одно или разрешите больше." -#: web/src/admin/invite.ts -msgid "Also" -msgstr "Ещё" +#: web/src/admin/flows/setup.ts +msgid "AmneziaVPN key" +msgstr "Ключ AmneziaVPN" -#: web/src/admin/disguise.ts -msgid "AmneziaVPN 4.8.12 or newer, AmneziaWG 2.0+ apps" -msgstr "AmneziaVPN 4.8.12 и новее, приложения с AmneziaWG 2.0+" - -#: web/src/admin/cores/awg.ts -msgid "AmneziaVPN → %s. Keep it private." -msgstr "AmneziaVPN → %s. Никому его не показывайте." - -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "AmneziaWG %s is installed" msgstr "AmneziaWG %s установлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG %s: no source publishes this build for this firmware any more" msgstr "AmneziaWG %s: ни один источник больше не публикует эту сборку для этой прошивки" #: web/src/admin/disguise.ts -msgid "AmneziaWG 2.0+ apps" -msgstr "Приложения с AmneziaWG 2.0+" +msgid "AmneziaWG 2.0+, AmneziaVPN 4.8.12+" +msgstr "AmneziaWG 2.0+, AmneziaVPN 4.8.12+" #: web/src/admin/disguise.ts -msgid "AmneziaWG 2.0: junk packets, padded packets and a first packet that looks like DNS. For networks that learned to spot 1.0-style junk." -msgstr "AmneziaWG 2.0: мусорные пакеты, пакеты с дополнением и первый пакет, похожий на DNS. Для сетей, которые научились распознавать мусор в духе 1.0." +msgid "AmneziaWG 3.1+, not V2RayTun" +msgstr "AmneziaWG 3.1+, без V2RayTun" -#: web/src/admin/disguise.ts -msgid "AmneziaWG 3.1 apps" -msgstr "Приложения с AmneziaWG 3.1" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "AmneziaWG 3.1: encrypted headers, random tails and extra padding on data packets." msgstr "AmneziaWG 3.1: зашифрованные заголовки, случайные хвосты и дополнительное заполнение пакетов данных." -#: web/src/admin/disguise.ts -msgid "AmneziaWG 3.1: encrypted packet headers, random tails and sizes, jittered timing, and a first packet that looks like DNS." -msgstr "AmneziaWG 3.1: зашифрованные заголовки пакетов, случайные хвосты и размеры, плавающие тайминги и первый пакет, похожий на DNS." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG answers may not reach devices" msgstr "Ответы AmneziaWG могут не доходить до устройств" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG answers reach devices" -msgstr "Ответы AmneziaWG доходят до устройств" +#: web/src/admin/flows/awg-build.ts +msgid "AmneziaWG build" +msgstr "Сборка AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG devices loaded" -msgstr "Устройства загружены в AmneziaWG" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG firewall" -msgstr "Межсетевой экран для AmneziaWG" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG firewall rules are missing" msgstr "Нет правил межсетевого экрана для AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG installed" msgstr "AmneziaWG установлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG is down" msgstr "AmneziaWG не работает" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "AmneziaWG is installed" msgstr "AmneziaWG установлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is installed, but its kernel module doesn't load on this firmware" msgstr "AmneziaWG установлен, но его модуль ядра не загружается на этой прошивке" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is missing from the router" msgstr ": AmneziaWG нет на роутере" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed" msgstr "AmneziaWG не установлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed (%s): install it in Dawnline → Components." msgstr "AmneziaWG не установлен (%s): установите его в Dawnline → Компоненты." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced." msgstr "AmneziaWG не установлен: установите его в Dawnline → Компоненты, затем выберите «Сбалансированную»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum." msgstr "AmneziaWG не установлен: установите его в Dawnline → Компоненты, затем выберите «Максимальную»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components." msgstr "AmneziaWG не установлен: установите его в Dawnline → Компоненты." -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "AmneziaWG is off by default: a new kernel module restarts every tunnel." msgstr "AmneziaWG по умолчанию выключен: новый модуль ядра перезапускает все туннели." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is running again" msgstr ": AmneziaWG снова работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is running again · accepting connections on port %d" msgstr ": AmneziaWG снова работает · принимает подключения на порту %d" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is up to date (%s)" msgstr "Установлена актуальная версия AmneziaWG (%s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG isn't accepting connections on port %d" msgstr ": AmneziaWG не принимает подключения на порту %d" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG isn't running" msgstr ": AmneziaWG не работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/disguise.ts msgid "AmneziaWG isn’t installed" msgstr "AmneziaWG не установлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG needs a build for the new firmware" msgstr "Для новой прошивки нужна сборка AmneziaWG" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates.ts +#: web/src/admin/system/model.ts msgid "AmneziaWG not installed" msgstr "AmneziaWG не установлен" @@ -1712,255 +2158,343 @@ msgstr "AmneziaWG не установлен" msgid "AmneziaWG port" msgstr "порт AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG port is free" -msgstr "Порт AmneziaWG свободен" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG port is taken" msgstr "Порт AmneziaWG занят" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG running" -msgstr "AmneziaWG работает" - -#: web/src/admin/cores/awg.ts -msgid "AmneziaWG saved" -msgstr "Настройки AmneziaWG сохранены" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG subnet is unique" -msgstr "Подсеть AmneziaWG уникальна" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG subnet overlaps another network" msgstr "Подсеть AmneziaWG пересекается с другой сетью" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG update is available: %s → %s" msgstr "Доступно обновление AmneziaWG: %s → %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "AmneziaWG's kernel module doesn't load on this firmware: reinstall a build for this kernel in Components." msgstr "Модуль ядра AmneziaWG не загружается на этой прошивке: переустановите сборку для этого ядра в «Компонентах»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "AmneziaWG: more" +msgstr "AmneziaWG: ещё" + +#: backend/i18n/messages.js msgid "AmneziaWG’s kernel module doesn’t load" msgstr "Модуль ядра AmneziaWG не загружается" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "AmneziaWG’s kernel module doesn’t load on this firmware" msgstr "Модуль ядра AmneziaWG не загружается на этой прошивке" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc +#: web/src/admin/pages/settings/first.ts +msgid "An AmneziaWG server on this router and personal links for people. It takes a couple of minutes: the address, the disguise, the portal." +msgstr "Сервер AmneziaWG на этом роутере и личные ссылки для людей. Займёт пару минут: адрес, маскировка, портал." + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "An IPv4 address; empty: none" +msgstr "IPv4-адрес; пусто: нет" + +#: web/src/admin/pages/settings/check.ts +msgid "An address and port, like 192.168.1.10:445" +msgstr "Адрес и порт, например 192.168.1.10:445" + +#: web/src/admin/pages/settings/router/remove.ts +msgid "An admin with write access can remove it." +msgstr "Удалить может администратор с правом записи." + +#: web/src/admin/pages/settings/first.ts +msgid "An admin with write access sets the server up." +msgstr "Сервер настраивает администратор с правом записи." + +#: backend/i18n/messages.js msgid "An update is running: wait for it to finish, then remove Dawnline." msgstr "Идёт обновление: дождитесь его окончания, затем удалите Dawnline." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc -#: web/src/admin/pages/components/index.ts +#: web/src/admin/widgets/rollout.ts +msgid "And %s more device" +msgid_plural "And %s more devices" +msgstr[0] "И ещё %s устройство" +msgstr[1] "И ещё %s устройства" +msgstr[2] "И ещё %s устройств" + +#: web/src/admin/pages/settings/router/portal.ts +msgid "Another address" +msgstr "На другой адрес" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/index.ts msgid "Another component action is already running" msgstr "Уже выполняется другое действие с компонентами" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/card.ts +msgid "Answer" +msgstr "Ответить" + +#: web/src/admin/pages/people/person/devices.ts +msgid "Answer the request" +msgstr "Ответить на запрос" + +#: backend/i18n/messages.js msgid "Answers from %s are swallowed by a proxy on the router (%s): clients get no reply." msgstr "Ответы с порта %s перехватывает прокси на роутере (%s): клиенты не получают ответа." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Answers from %s go straight out." msgstr "Ответы с порта %s уходят напрямую." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Answers from %s go straight out. A proxy on the router diverts its own traffic (%s); these answers skip it." msgstr "Ответы с порта %s уходят напрямую. Прокси на роутере перенаправляет свой трафик (%s), но эти ответы его минуют." -#: web/src/admin/pages/settings/portal.ts -msgid "Answers reach visitors" -msgstr "Ответы доходят до посетителей" +#: backend/i18n/messages.js +msgid "Answers reach devices" +msgstr "Ответы доходят до устройств" #: web/src/admin/disguise.ts +#: web/src/admin/widgets/disguise-levels.ts msgid "Any WireGuard app" msgstr "Любое приложение WireGuard" -#: web/src/admin/pages/person/limits.ts -msgid "Any time" -msgstr "В любое время" +#: web/src/admin/flows/setup.ts +msgid "App" +msgstr "Приложение" -#: web/src/admin/pages/settings/portal.ts -msgid "Appearance" -msgstr "Внешний вид" +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Apply" +msgstr "Применить" -#: web/src/admin/cores/awg.ts -msgid "Applies at once: every AmneziaWG device imports its configuration again." -msgstr "Применяется сразу: каждое устройство AmneziaWG заново импортирует конфигурацию." +#: web/src/admin/flows/server-change.ts +msgid "Apply %s change?" +msgid_plural "Apply %s changes?" +msgstr[0] "Применить %s изменение?" +msgstr[1] "Применить %s изменения?" +msgstr[2] "Применить %s изменений?" -#: web/src/admin/disguise.ts -msgid "Apps with AmneziaWG 3.1 (current AmneziaVPN)" -msgstr "Приложения с AmneziaWG 3.1 (актуальный AmneziaVPN)" +#: web/src/admin/pages/people/person/index.ts +msgid "Apply the changes for %s?" +msgstr "Применить изменения для «%s»?" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/flows/restore.ts +msgid "Apply the settings" +msgstr "Применить настройки" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Apps" +msgstr "Приложения" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "As soon as a check finds it." +msgstr "Сразу, как только проверка найдёт обновление." + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "As soon as found" -msgstr "Сразу" +msgstr "Сразу, как найдётся" -#: web/src/admin/device-link.ts -msgid "As the server: %s" -msgstr "Как у сервера: %s" +#: web/src/admin/widgets/config-card.ts +msgid "As the server" +msgstr "Как у сервера" -#: web/src/admin/pages/settings/updates.ts +#: web/src/shared/format.ts +msgid "Ask me first" +msgstr "Сначала напишите мне" + +#: web/src/admin/events/timeline.ts +msgid "Asked for on its owner’s page. It can connect once you accept it." +msgstr "Запрошен на странице владельца. Сможет подключиться, когда вы его примете." + +#: web/src/admin/flows/new-server.ts +msgid "Asking the router what it has…" +msgstr "Спрашиваем роутер…" + +#: web/src/admin/widgets/entry.ts +msgid "Asking the router where it points…" +msgstr "Спрашиваем роутер, куда он указывает…" + +#: web/src/admin/people/card.ts +msgid "Asks for the network %s behind %s" +msgid_plural "Asks for the networks %s behind %s" +msgstr[0] "Просит сеть %s за %s" +msgstr[1] "Просит сети %s за %s" +msgstr[2] "Просит сети %s за %s" + +#: web/src/admin/people/card.ts +msgid "Asks for the router %s" +msgstr "Просит роутер %s" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "At a set time" msgstr "В заданное время" -#: web/src/admin/cores/awg.ts -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/reach.ts +msgid "At least one home network must stay." +msgstr "Хотя бы одна домашняя сеть должна остаться." + +#: web/src/admin/pages/settings/router/history.ts +msgid "At most" +msgstr "Не больше" + +#: backend/i18n/messages.js +msgid "At most %d people at once." +msgstr "Не больше %d человек за раз." + +#: web/src/admin/pages/settings/networks.ts +msgid "At once" +msgstr "Сразу" + +#: web/src/admin/widgets/link-values.ts +#: web/src/admin/widgets/net-switches.ts msgid "Auto" msgstr "Авто" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Auto-detect LAN" msgstr "Определять LAN автоматически" -#: web/src/admin/interfaces.ts -msgid "Auto-detect WAN" -msgstr "Определять WAN автоматически" - -#: web/src/admin/pages/components/hero.ts -msgid "Auto-update" -msgstr "Автообновление" +#: web/src/admin/widgets/config-card.ts +msgid "Automatic" +msgstr "Авто" #: web/src/admin/netcheck.ts msgid "Automatic by device type and disguise: %s for computers and routers, %s for phones and tablets." msgstr "Автоматически по типу устройства и маскировке: %s для компьютеров и роутеров, %s для телефонов и планшетов." -#: web/src/admin/pages/settings/portal.ts -msgid "Automatic certificate" -msgstr "Сертификат выбирается автоматически" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "Automatic update: %s" msgstr "Автообновление: %s" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: AmneziaWG" -msgstr "Автообновление: AmneziaWG" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Automatic updates" +msgstr "Автоматические обновления" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: Dawnline" -msgstr "Автообновление: Dawnline" +#: web/src/admin/widgets/link-values.ts +msgid "Automatic: %s, phones %s" +msgstr "Авто: %s, телефонам %s" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: components" -msgstr "Автообновление компонентов" +#: web/src/admin/pages/settings/router/updates.ts +msgid "Available: %s" +msgstr "Есть %s" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: system packages" -msgstr "Автообновление системных пакетов" - -#: web/src/admin/device-link.ts -msgid "Automatic: %s" -msgstr "Автоматически: %s" - -#: web/src/admin/cores/awg.ts #: web/src/shared/format.ts msgid "B" msgstr "Б" -#: web/src/admin/pages/server.ts +#: web/src/portal/ui/sheet.ts msgid "Back" msgstr "Назад" -#: web/src/admin/pages/person/index.ts -msgid "Back to Servers" -msgstr "Назад к серверам" - #: web/src/admin/places/render.ts msgid "Back to now" msgstr "Вернуться к текущему моменту" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/ui/subpage.ts +msgid "Back to the list" +msgstr "Назад к списку" + +#: web/src/admin/ui/subpage.ts +msgid "Back to the list · Esc" +msgstr "Назад к списку · Esc" + +#: web/src/admin/pages/settings/router/backups.ts msgid "Back up now" msgstr "Создать копию" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/restore.ts +msgid "Back up the current state" +msgstr "Копия текущего состояния" + +#: backend/i18n/messages.js msgid "Background agent isn’t running" msgstr "Фоновый агент не запущен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Background agent running" msgstr "Фоновый агент работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Backing up configuration" msgstr "Создание резервной копии настроек" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "Backup" msgstr "Резервное копирование" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Backup created" msgstr "Резервная копия создана" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Backup deleted" msgstr "Резервная копия удалена" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup does not contain /etc/config/dawnline." msgstr "В резервной копии нет /etc/config/dawnline." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup failed: %s" msgstr "Не удалось создать резервную копию: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup failed: the archive could not be written (is the flash full?)" msgstr "Не удалось создать резервную копию: архив не записан (не заполнена ли флеш-память?)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup is too large." msgstr "Резервная копия слишком большая." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup not found." msgstr "Резервная копия не найдена." -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/index.ts msgid "Backups" msgstr "Резервные копии" -#: web/src/admin/pages/settings/backups.ts -msgid "Backups contain private keys: keep downloads safe. JSON moves everything except usage history to another router." -msgstr "В резервных копиях есть приватные ключи: храните скачанные файлы надёжно. JSON переносит на другой роутер всё, кроме истории трафика." +#: web/src/admin/pages/settings/router/backups.ts +msgid "Backups contain private keys: keep downloads safe." +msgstr "В копиях приватные ключи: храните их бережно." + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Balance" +msgstr "Баланс" -#: web/src/admin/cores/awg.ts #: web/src/admin/disguise.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Balanced" msgstr "Сбалансированная" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Balanced needs AmneziaWG 2.0 or newer on the router: install a current build in Dawnline → Components." msgstr "Для «Сбалансированной» нужен AmneziaWG 2.0 или новее на роутере: установите актуальную сборку в Dawnline → Компоненты." -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before import" msgstr "Перед импортом" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts +msgid "Before removing Dawnline" +msgstr "Перед удалением Dawnline" + +#: web/src/admin/system/model.ts msgid "Before removing a server" msgstr "Перед удалением сервера" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before restore" msgstr "Перед восстановлением" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before update" msgstr "Перед обновлением" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Behind Cloudflare · often stalls in Russia" msgstr "За Cloudflare · в России часто зависает" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Blocked" msgstr "Заблокировано" @@ -1968,330 +2502,371 @@ msgstr "Заблокировано" msgid "Blocked portal sign-ins and devices that can’t connect properly (tunnels and services are in the service log)" msgstr "Заблокированные входы на портал и устройства, которые не могут нормально подключиться (туннели и службы - в журнале служб)" -#: web/src/admin/access.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +msgctxt "access" msgid "Both" -msgstr "Дом и интернет" +msgstr "Оба" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Both are %s's devices" msgstr "Оба устройства принадлежат человеку %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Both are in %s" msgstr "Оба в круге «%s»" -#: web/src/admin/pages/person/index.ts -msgid "Breadcrumb" -msgstr "Навигационная цепочка" +#: web/src/admin/widgets/net-values.ts +msgid "Bring %s back" +msgstr "Вернуть %s" -#: web/src/admin/pages/person/limits.ts -msgid "Browse the internet through your router. No access to devices at home, and home cannot reach theirs." -msgstr "Интернет через ваш роутер. Домашние устройства недоступны, и из дома к устройствам человека тоже не подключиться." +#: web/src/admin/widgets/net-values.ts +msgid "Bring it back" +msgstr "Вернуть" -#: web/src/admin/widgets/access-picker.ts -msgid "Browse the internet through your router. No access to devices at home." -msgstr "Интернет через ваш роутер. Домашние устройства недоступны." - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings." msgstr "После этого браузеры перестанут открывать портал. Обновите его через ACME или выберите другой сертификат в «Настройках»." -#: web/src/admin/pages/components/awg.ts -msgid "Build and translation" -msgstr "Сборка и перевод" - #: web/src/admin/logs.ts msgid "By" msgstr "Кто" -#: web/src/admin/pages/diagnostics/log.ts -msgid "CSV (spreadsheet)" -msgstr "CSV (таблица)" +#: web/src/admin/pages/people/filters.ts +msgid "By attention, in groups" +msgstr "По вниманию, группами" -#: web/src/admin/pages/person/limits.ts -msgid "Can reach" -msgstr "Доступно" +#: web/src/admin/pages/settings/router/history.ts +msgid "By day" +msgstr "По дням" -#: web/src/admin/pages/server.ts -#: web/src/admin/ui/modal.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "By hand" +msgstr "Вручную" + +#: web/src/admin/widgets/limit-meter.ts +msgid "By month" +msgstr "По месяцам" + +#: web/src/admin/flows/ask.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/flows/uninstall.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Cancel" msgstr "Отмена" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/settings/pending-dock.ts +msgctxt "changes" +msgid "Cancel" +msgstr "Отменить" + +#: web/src/admin/pages/people/pick.ts +msgid "Cancel selection" +msgstr "Отменить выбор" + +#: backend/i18n/messages.js msgid "Cannot detect the firmware target" msgstr "Не удаётся определить платформу прошивки" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Cannot reach github.com/%s" msgstr "Нет связи с github.com/%s" -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/servers/state.ts msgid "Can’t start" msgstr "Не запускается" +#: web/src/admin/flows/invite.ts +msgid "Card" +msgstr "Карточка" + +#: web/src/admin/pages/people/index.ts +msgid "Cards" +msgstr "Карточки" + #: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Category" msgstr "Категория" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Certificate" msgstr "Сертификат" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Certificate file" msgstr "Файл сертификата" -#: web/src/admin/pages/settings/portal.ts -msgid "Certificate saved" -msgstr "Сертификат сохранён" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Certificate: %s" +msgstr "Сертификат: %s" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Certificates (ACME)" msgstr "Сертификаты (ACME)" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/defaults.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/ui/edit-rows.ts +#: web/src/admin/ui/measure.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/entry.ts +#: web/src/admin/widgets/net-values.ts +#: web/src/admin/widgets/visibility.ts msgid "Change" msgstr "Изменить" -#: web/src/admin/pages/people.ts -msgid "Change limit" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Change files" +msgstr "Сменить файлы" + +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Change the build" +msgstr "Сменить сборку" + +#: web/src/admin/flows/server-change.ts +msgid "Change the home networks?" +msgstr "Изменить домашние сети?" + +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "Change the limit" msgstr "Изменить лимит" -#: web/src/admin/device-link.ts -msgid "Change the MTU" -msgstr "Изменить MTU" +#: web/src/admin/flows/server-change.ts +msgid "Change the networks behind routers?" +msgstr "Изменить сети за роутерами?" -#: web/src/admin/device-link.ts -msgid "Change the keep-alive" -msgstr "Изменить keep-alive" - -#: web/src/admin/pages/server.ts -msgid "Change the tunnel network" -msgstr "Сменить сеть туннеля" - -#: web/src/admin/device.ts -msgid "Changed network" -msgstr "Сменило сеть" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Changed: %s." msgstr "Изменено: %s." -#: web/src/admin/pages/server.ts -msgid "Changing it marks devices “Update config” until they import again" -msgstr "После изменения устройства помечаются «Обновить конфигурацию», пока не импортируют её заново" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Changes that wait to be applied" +msgstr "Изменения, которые ждут применения" -#: web/src/admin/cores/awg.ts -msgid "Changing these marks devices “Update config” until they import again" -msgstr "После изменения устройства помечаются «Обновить конфигурацию», пока не импортируют её заново" +#: web/src/admin/pages/settings/networks.ts +msgid "Changing a router’s networks on people’s pages" +msgstr "Изменение сетей роутера на личных страницах" -#: web/src/admin/access.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/server-change.ts +msgid "Changing a router’s networks on people’s pages: %s?" +msgstr "Изменение сетей роутера на личных страницах: %s?" + +#: web/src/admin/pages/settings/networks.ts +msgid "Changing its networks" +msgstr "Изменение сетей" + +#: web/src/portal/setup.ts +msgid "Channel on" +msgstr "Канал в" + +#: web/src/admin/pages/settings/check.ts msgid "Check" msgstr "Проверить" -#: web/src/admin/access.ts -msgid "Check access" -msgstr "Проверка доступа" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Check AmneziaWG" +msgstr "Проверить AmneziaWG" -#: web/src/admin/pages/components/index.ts -msgid "Check all" -msgstr "Проверить все" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Check Dawnline" +msgstr "Проверить Dawnline" -#: web/src/admin/pages/settings/updates.ts -msgid "Check automatically" -msgstr "Проверять автоматически" +#: web/src/admin/pages/settings/check.ts +msgid "Check a path" +msgstr "Проверить путь" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/pages/overview/health.ts +msgid "Check again" +msgstr "Проверить снова" + +#: backend/i18n/messages.js msgid "Check every 6h, 12h, 1d or 7d." msgstr "Проверять можно раз в 6 ч, 12 ч, 1 день или 7 дней." -#: web/src/admin/pages/components/index.ts -msgid "Check failed" -msgstr "Ошибка проверки" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Check for new versions" +msgstr "Проверять новые версии" -#: web/src/admin/pages/components/index.ts -msgid "Check for updates" -msgstr "Проверить обновления" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Check for updates to see the builds for this router." msgstr "Проверьте обновления, чтобы увидеть сборки для этого роутера." -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates.ts +msgid "Check now" +msgstr "Проверить сейчас" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Check system packages" msgstr "Проверить системные пакеты" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/restore.ts +msgid "Check the backup" +msgstr "Проверить копию" + +#: web/src/admin/flows/restore.ts +msgid "Check the file" +msgstr "Проверить файл" + +#: web/src/admin/flows/operation.ts +msgid "Checked" +msgstr "Проверено" + +#: web/src/admin/pages/settings/router/updates.ts +msgid "Checked %s" +msgstr "Проверено %s" + +#: web/src/admin/people/diagnosis.ts +msgid "Checked once it is fixed" +msgstr "Проверится после исправления" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking AmneziaWG" msgstr "Проверка AmneziaWG" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking Dawnline" msgstr "Проверка Dawnline" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates.ts +#: web/src/admin/updater/jobs.ts msgid "Checking all components" msgstr "Проверка всех компонентов" -#: web/src/admin/pages/components/index.ts -msgid "Checking components" -msgstr "Проверка компонентов" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/components/packages.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking system packages" msgstr "Проверка системных пакетов" +#: web/src/admin/pages/server/overview.ts +msgid "Checking the server…" +msgstr "Проверяем сервер…" + +#: web/src/admin/flows/portal-sheets.ts #: web/src/admin/netcheck.ts -#: web/src/admin/pages/settings/portal.ts msgid "Checking where it points…" msgstr "Проверяем, куда он указывает…" -#: web/src/admin/pages/components/index.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Checking…" msgstr "Проверка…" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Checks" -msgstr "Проверки" - -#: web/src/admin/interfaces.ts -msgid "Choose %s to include it." -msgstr "Выберите %s, чтобы включить его." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Choose a device on at least one side." msgstr "Выберите устройство хотя бы с одной стороны." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -msgid "Choose a disguise on the Server page: it replaces the values set by hand." -msgstr "Выберите маскировку на странице сервера: она заменит значения, заданные вручную." +#: backend/i18n/messages.js +msgid "Choose a disguise in Settings → Disguise: it replaces the values set by hand." +msgstr "Выберите маскировку в «Настройки» → «Маскировка»: она заменит значения, заданные вручную." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/restore.ts +msgid "Choose a file" +msgstr "Выбрать файл" + +#: backend/i18n/messages.js msgid "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443)." msgstr "Выберите свободный порт от 1 до 65535 (кроме 22, 53, 80 и 443)." -#: web/src/admin/pages/people.ts -msgid "Choose a server on their page" -msgstr "Выберите сервер на странице человека" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/people/lines.ts +msgid "Choose a server" +msgstr "Выбрать сервер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Choose a system log level: errors, warnings, normal or verbose." msgstr "Выберите уровень системного журнала: ошибки, предупреждения, обычный или подробный." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Choose another interface name in the server settings." msgstr "Выберите другое имя интерфейса в настройках сервера." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Choose the interface that leads to the internet." msgstr "Выберите интерфейс, через который роутер выходит в интернет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/widgets/reach.ts +msgid "Circle" +msgstr "Круг" + +#: backend/i18n/messages.js msgid "Circle %s: server %s does not exist." msgstr "Круг %s: сервера %s нет." -#: web/src/admin/interfaces.ts -msgid "Circles" -msgstr "Круги" +#: web/src/admin/flows/move-person.ts +msgid "Circles and home networks of the old server stay behind." +msgstr "Круги и домашние сети старого сервера не переносятся." -#: web/src/admin/pages/person/activity.ts -msgid "City-level, from the client IP" -msgstr "С точностью до города, по IP-адресу клиента" +#: web/src/admin/pages/settings/router/history.ts +msgid "City and operator by IP, through %s. Map tiles load in your browser from CARTO." +msgstr "Город и оператор по IP, через %s. Карта загружается в вашем браузере с CARTO." -#: web/src/admin/pages/overview.ts -msgid "City-level, from the client IP · locations cached on the router" -msgstr "С точностью до города, по IP клиента · местоположения кешируются на роутере" - -#: web/src/admin/device.ts -#: web/src/admin/logs.ts -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Clear" msgstr "Очистить" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/activity.ts -msgid "Clear %s's activity" -msgstr "Очистить события: %s" - -#: web/src/admin/pages/settings/logs.ts -msgid "Clear activity" -msgstr "Очистить события" - -#: web/src/admin/pages/settings/logs.ts -msgid "Clear one person or device from their own page." -msgstr "Данные одного человека или устройства очищаются на его странице." - -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/log/index.ts msgid "Clear the log" msgstr "Очистить журнал" -#: web/src/admin/logs.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Clears %s's daily and monthly traffic history. Their person's totals and data limit are not changed." msgstr "Очищает историю трафика устройства %s по дням и месяцам. Итоги и лимит трафика его владельца не меняются." -#: web/src/admin/logs.ts -msgid "Clears %s's traffic history and that of their devices. Their data limit starts again from zero." -msgstr "Очищает историю трафика человека %s и всех его устройств. Лимит трафика начнёт считаться с нуля." - -#: web/src/admin/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Clears traffic history for everyone. Data limits start again from zero." msgstr "Очищает историю трафика у всех. Лимиты трафика начнут считаться с нуля." -#: web/src/admin/device.ts -msgid "Client IP" -msgstr "IP клиента" +#: web/src/admin/pages/people/device/index.ts +msgid "Client IP: where its last connection came from · %s" +msgstr "IP клиента: откуда пришло последнее подключение · %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Clock is set" msgstr "Часы настроены" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Clock isn’t set" msgstr "Часы не настроены" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/ui/drawer.ts -#: web/src/admin/ui/toast.ts -#: web/src/admin/updater/notes.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/flows/restore.ts +#: web/src/portal/ui/sheet.ts msgid "Close" msgstr "Закрыть" -#: web/src/admin/widgets/tiles.ts -msgid "Collecting… 1 point a second" -msgstr "Сбор данных… 1 точка в секунду" +#: web/src/portal/ui/wait-way.ts +msgid "Close this and open it again to keep checking." +msgstr "Закройте окно и откройте его снова, чтобы проверить ещё раз." -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts msgid "Colour" msgstr "Цвет" -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts msgid "Colour %s" msgstr "Цвет %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/settings/updates.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Components" msgstr "Компоненты" @@ -2299,46 +2874,46 @@ msgstr "Компоненты" msgid "Computers and routers get %s, phones and tablets %s." msgstr "Компьютеры и роутеры получат %s, телефоны и планшеты - %s." -#: web/src/admin/pages/person/devices.ts -msgid "Config" -msgstr "Конфигурация" - -#: web/src/admin/cores/awg.ts -msgid "Configuration" -msgstr "Конфигурация" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/setup.ts msgid "Configuration copied" msgstr "Конфигурация скопирована" -#: web/src/admin/ui/modal.ts -msgid "Confirm" -msgstr "Подтвердить" +#: web/src/admin/pages/server/settings.ts +msgid "Configuration of devices" +msgstr "Настройка устройств" -#: web/src/admin/device.ts -msgctxt "section" -msgid "Connect" -msgstr "Подключение" +#: web/src/portal/setup.ts +msgid "Confirm the import and connect" +msgstr "Подтвердите импорт и подключитесь" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts -msgid "Connected" -msgstr "Подключено" +#: web/src/admin/people/diagnosis.ts +msgid "Connected, handshake %s" +msgstr "Есть, рукопожатие %s" -#: web/src/admin/device.ts -msgid "Connected from %s" -msgstr "Подключено с %s" - -#: web/src/admin/pages/server.ts +#: web/src/admin/people/diagnosis.ts msgid "Connection" msgstr "Подключение" +#: web/src/admin/pages/people/device/index.ts +msgctxt "section" +msgid "Connection" +msgstr "Связь" + +#: web/src/admin/widgets/timeline.ts +msgid "Connection in the %s" +msgstr "Связь %s" + +#: web/src/admin/widgets/timeline.ts +msgid "Connection in the %s: ← → by stretch" +msgstr "Связь %s: ← → по отрезкам" + #: web/src/admin/events/model.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Connection keeps dropping" msgstr "Связь постоянно рвётся" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js #: web/src/admin/events/model.ts msgid "Connections" msgstr "Подключения" @@ -2347,140 +2922,152 @@ msgstr "Подключения" msgid "Connects, disconnects and IP changes" msgstr "Подключения, отключения и смена IP" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "AmneziaVPN app" msgid "Continue" msgstr "Продолжить" +#: web/src/portal/ui/feedback.ts +msgid "Copied" +msgstr "Скопировано" + #: web/src/admin/ui/files.ts msgid "Copied to clipboard" msgstr "Скопировано в буфер обмена" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/setup.ts +#: web/src/admin/flows/whats-new.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Copy" msgstr "Скопировать" -#: web/src/admin/cores/awg.ts -msgid "Copy AmneziaVPN config" -msgstr "Скопировать конфигурацию AmneziaVPN" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/widgets/entry.ts msgid "Copy address" msgstr "Скопировать адрес" -#: web/src/admin/cores/awg.ts -msgid "Copy as config" -msgstr "Скопировать как конфиг" +#: web/src/admin/pages/settings/disguise.ts +msgid "Copy as configuration" +msgstr "Скопировать как конфигурацию" -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/flows/invite.ts msgid "Copy link" msgstr "Скопировать ссылку" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Copy log" msgstr "Скопировать журнал" -#: web/src/admin/invite.ts -msgid "Copy this link" -msgstr "Скопировать эту ссылку" +#: web/src/admin/pages/people/device/link.ts +msgid "Copy the advice" +msgstr "Скопировать совет" + +#: web/src/admin/widgets/rollout.ts +msgid "Copy the portal link: %s" +msgstr "Скопировать ссылку на портал: %s" + +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/config-card.ts +msgid "Copy: %s" +msgstr "Скопировать: %s" #: web/src/admin/ui/files.ts +#: web/src/portal/ui/feedback.ts msgid "Copying is blocked here. Select the text and copy it by hand." msgstr "Копирование здесь заблокировано. Выделите текст и скопируйте его вручную." -#: web/src/admin/invite.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +msgid "Core" +msgstr "Ядро" + +#: web/src/admin/flows/invite-card.ts msgid "Could not draw the card" msgstr "Не удалось нарисовать карточку" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Could not find a free id, try again." msgstr "Не удалось подобрать свободный идентификатор, попробуйте ещё раз." +#: web/src/admin/shell/qr.ts +msgid "Could not load the QR code. Reload the page to try again." +msgstr "Не удалось загрузить QR-код. Обновите страницу и попробуйте снова." + #: web/src/admin/map.ts msgid "Could not load the map library (no internet access from this browser?)" msgstr "Не удалось загрузить библиотеку карты (нет доступа в интернет из этого браузера?)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: web/src/admin/shell/maps.ts +msgid "Could not load the map. Reload the page to try again." +msgstr "Карта не загрузилась. Обновите страницу, чтобы попробовать снова." + +#: web/src/admin/shell/style.ts +msgid "Could not load the page’s styles. Reload the page to try again." +msgstr "Оформление страницы не загрузилось. Обновите страницу, чтобы попробовать снова." + +#: backend/i18n/messages.js msgid "Couldn't load devices into %s: %s." msgstr "Сервер %s не принял устройства: %s." -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Couldn't read the devices at home." msgstr "Не удалось получить список домашних устройств." -#: web/src/admin/widgets/tiles.ts -msgid "Couldn't read the live speed: %s" -msgstr "Не удалось получить скорость: %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc +#: backend/i18n/messages.js msgid "Couldn't save /etc/config/dawnline: %s. Is the flash full?" msgstr "Не удалось сохранить /etc/config/dawnline: %s. Возможно, заполнена флеш-память?" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc +#: backend/i18n/messages.js msgid "Couldn't save /etc/config/dawnline: the write failed. Is the flash full?" msgstr "Не удалось сохранить /etc/config/dawnline: ошибка записи. Возможно, заполнена флеш-память?" -#: web/src/admin/pages/server.ts -msgid "Couldn't show people: %s" -msgstr "Не удалось показать людей: %s" +#: backend/i18n/messages.js +msgid "Couldn't set the routes to the networks behind routers (%s): they aren't reachable yet." +msgstr "Не удалось задать маршруты к сетям за роутерами (%s): пока они недоступны." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Couldn't write %s. Is the flash full?" msgstr "Не удалось записать %s. Не заполнена ли флеш-память?" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/limit-meter.ts +msgid "Count" +msgstr "Считать" + +#: backend/i18n/messages.js msgid "Counts traffic and enforces end dates and quotas." msgstr "Считает трафик и следит за датами окончания и лимитами трафика." -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/add-person.ts msgid "Create" msgstr "Создать" -#: web/src/admin/pages/person/dialogs.ts -msgid "Create a new link?" -msgstr "Создать новую ссылку?" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Create from QR code" +msgstr "Создать из QR-кода" -#: web/src/admin/pages/people.ts -msgid "Create and copy link" -msgstr "Создать и скопировать ссылку" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Create from file or archive" +msgstr "Создать из файла или архива" -#: web/src/admin/pages/person/dialogs.ts -msgid "Create new link" -msgstr "Создать ссылку" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Create server" msgstr "Создать сервер" -#: web/src/admin/pages/people.ts -msgid "Created. Turn on the personal portal in Settings to get a link, or add devices for them here." -msgstr "Человек добавлен. Включите личный портал в настройках, чтобы получить ссылку, или добавьте устройства здесь." - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Creating the server restarts the network for a few seconds: AmneziaWG was installed after the network started." msgstr "При создании сервера сеть перезапустится на несколько секунд: AmneziaWG установили уже после её запуска." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Cross-site request refused." msgstr "Запрос с другого сайта отклонён." -#: web/src/admin/disguise.ts -msgid "Current" -msgstr "Текущая" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Current parameters" msgstr "Текущие параметры" -#: web/src/admin/pages/person/limits.ts -msgid "Custom" -msgstr "Свой" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/disguise.ts msgctxt "disguise" msgid "Custom" msgstr "Своя" @@ -2489,114 +3076,165 @@ msgstr "Своя" msgid "DNS" msgstr "DNS" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "DNS for Home-only devices" msgstr "DNS для домашнего доступа" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "DNS for Home-only devices isn’t working" msgstr "DNS для домашнего доступа не работает" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/stages.ts msgid "DNS for devices" msgstr "DNS для устройств" -#: web/src/admin/cores/awg.ts -msgid "DNS-like first packets" -msgstr "Первые пакеты как DNS" +#: web/src/admin/flows/server-change.ts +msgid "DNS for devices: %s?" +msgstr "DNS для устройств: «%s»?" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/overview/health.ts +msgid "DNS, ports, certificates: it takes a moment." +msgstr "DNS, порты, сертификаты: это занимает немного времени." + +#: web/src/admin/pages/settings/stages.ts +msgid "DNS: %s" +msgstr "DNS: %s" + +#: web/src/admin/pages/settings/networks.ts +msgid "DNS: this router" +msgstr "DNS отвечает роутер" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Daily" msgstr "Раз в день" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Daily traffic" msgstr "Трафик по дням" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Daily traffic history must be 7-1830 days." msgstr "История трафика по дням: от 7 до 1830 дней." -#: web/src/admin/pages/server.ts -msgid "Danger zone" -msgstr "Опасная зона" +#: web/src/admin/events/render.ts +msgid "Data is back after the limit" +msgstr "Трафик снова доступен" -#: web/src/admin/pages/person/limits.ts -msgid "Data" -msgstr "Трафик" - -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/ui/badges.ts -msgid "Data limit" -msgstr "Лимит трафика" - -#: web/src/admin/pages/person/limits.ts -msgid "Data limit %s GB" -msgstr "Лимит трафика: %s ГБ" - -#: web/src/admin/pages/person/limits.ts -msgid "Data limit (GB)" -msgstr "Лимит трафика (ГБ)" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Data limit must be a positive number of GB." msgstr "Лимит трафика должен быть положительным числом ГБ." -#: web/src/admin/pages/person/limits.ts -msgid "Data limit period" -msgstr "Период лимита трафика" - -#: web/src/admin/pages/people.ts -#: web/src/shared/format.ts +#: web/src/admin/events/render.ts +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Data limit reached" msgstr "Лимит трафика исчерпан" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/events/timeline.ts +msgid "Data limit reached %s" +msgstr "Лимит трафика исчерпан %s" + +#: web/src/admin/widgets/term.ts msgid "Date" msgstr "Дата" #: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json +#: web/src/admin/shell/nav.ts msgid "Dawnline" msgstr "Dawnline" -#: web/src/admin/updater/operation.ts -msgid "Dawnline %s is installed." -msgstr "Dawnline %s установлен." +#: web/src/admin/flows/operation.ts +msgid "Dawnline %s is installed" +msgstr "Dawnline %s установлен" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: web/src/admin/pages/settings/router/notice.ts +msgid "Dawnline %s is out" +msgstr "Есть Dawnline %s" + +#: web/src/admin/flows/restore.ts +msgid "Dawnline backup" +msgstr "копия Dawnline" + +#: backend/i18n/messages.js msgid "Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed." msgstr "Dawnline его не останавливал: перезапустилась сеть роутера, его остановили вручную или он завершился с ошибкой." -#: web/src/admin/pkgs.ts +#: web/src/admin/pages/people/map-view.ts +msgid "Dawnline does not look up the city and network of an address, so there is no map. It is turned on in System, under History and storage." +msgstr "Dawnline не определяет город и сеть по адресу, поэтому карты нет. Это включается в Системе, в разделе «История и хранение»." + +#: web/src/admin/flows/restore.ts +msgid "Dawnline export" +msgstr "выгрузка Dawnline" + +#: web/src/admin/flows/restore.ts +msgid "Dawnline has %s, %s and %s now." +msgstr "Сейчас в Dawnline %s, %s и %s." + +#: web/src/admin/updater/install.ts msgid "Dawnline installs the AmneziaWG build made for this firmware and loads it. If the network service has to restart to learn it, connections drop for a few seconds." msgstr "Dawnline установит сборку AmneziaWG для этой прошивки и загрузит её. Если для этого понадобится перезапустить сетевую службу, соединения прервутся на несколько секунд." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/admin/flows/operation.ts +msgid "Dawnline is installed" +msgstr "Dawnline установлен" + +#: web/src/admin/failure.ts +msgid "Dawnline is not answering on the router right now: it may be restarting. Try again in a moment." +msgstr "Dawnline сейчас не отвечает на роутере: возможно, он перезапускается. Попробуйте ещё раз чуть позже." + +#: web/src/admin/shell/waiting.ts +msgid "Dawnline is starting" +msgstr "Dawnline запускается" + +#: web/src/admin/api.ts +msgid "Dawnline is starting on the router: this page fills in when it answers." +msgstr "Dawnline запускается на роутере: страница заполнится, когда он ответит." + +#: backend/i18n/messages.js msgid "Dawnline is up to date (%s)" msgstr "Установлена актуальная версия Dawnline (%s)" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/settings/router/backups.ts +msgid "Dawnline makes one itself before an update and before a restore. You can make one now too." +msgstr "Dawnline сделает её сам перед обновлением и перед восстановлением. Можно и сейчас." + +#: web/src/admin/flows/uninstall.ts msgid "Dawnline removed" msgstr "Dawnline удалён" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Dawnline update is available: %s → %s" msgstr "Доступно обновление Dawnline: %s → %s" -#: web/src/admin/updater/operation.ts -msgid "Dawnline updated to %s" -msgstr "Dawnline обновлён до %s" - #: web/src/admin/state/live.ts msgid "Dawnline was updated to %s: reload the page." msgstr "Dawnline обновлён до версии %s: перезагрузите страницу." -#: web/src/admin/widgets/tiles.ts -msgid "Days this device was used" -msgstr "Дни с трафиком на устройстве" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Dawnline: more" +msgstr "Dawnline: ещё" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/behind-ask.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-values.ts +msgid "Decline" +msgstr "Отклонить" + +#: web/src/admin/widgets/net-values.ts +msgid "Decline %s" +msgstr "Отклонить %s" + +#: web/src/shared/format.ts +msgid "Declined" +msgstr "Отклонено" + +#: web/src/admin/flows/behind-ask.ts +msgid "Declined: %s reads so on their page" +msgstr "Отклонено: %s увидит это на своей странице" + +#: backend/i18n/messages.js msgid "Default device limit must be 1-32." msgstr "Лимит устройств по умолчанию: от 1 до 32." @@ -2604,47 +3242,37 @@ msgstr "Лимит устройств по умолчанию: от 1 до 32." msgid "Default: a packet every 25 s keeps NAT open and “Connected” accurate." msgstr "По умолчанию: пакет каждые 25 с держит NAT открытым, а статус «Подключено» - точным." -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Delete" msgstr "Удалить" -#: web/src/admin/pages/person/dialogs.ts -msgid "Delete %s?" -msgstr "Удалить «%s»?" - -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Delete this backup?" msgstr "Удалить эту резервную копию?" -#: web/src/admin/pages/person/dialogs.ts -msgid "Deleted" -msgstr "Удалено" - -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/settings/router/remove.ts msgid "Deletes the tunnel, firewall rules, access table and hostnames Dawnline created, and stops the service. People and keys are kept in a backup." msgstr "Удаляет туннель, правила межсетевого экрана, таблицу доступа и имена хостов, созданные Dawnline, и останавливает службу. Люди и ключи сохраняются в резервной копии." +#: web/src/admin/pages/settings/router/history.ts +msgid "Depth" +msgstr "Глубина" + #: web/src/admin/logs.ts msgid "Detail" msgstr "Подробности" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/settings/portal.ts -msgid "Details" -msgstr "Подробнее" - -#: web/src/admin/device.ts -msgctxt "section" -msgid "Details" -msgstr "Сведения" +#: web/src/admin/pages/settings/networks.ts +msgid "Detect automatically" +msgstr "Определять автоматически" +#: web/src/admin/flows/places-closeup.ts #: web/src/admin/logs.ts #: web/src/admin/map.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/people/diagnosis.ts #: web/src/shared/format.ts msgid "Device" msgstr "Устройство" @@ -2685,47 +3313,47 @@ msgstr "Устройство %s снова подключается нормал msgid "Device %s has a connection problem" msgstr "У устройства %s проблема с подключением" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: MTU %d is not between 1280 and 1500." msgstr "Устройство %s (%s): MTU %d вне пределов от 1280 до 1500." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is also used by device %s of %s." msgstr "Устройство %s (%s): адрес %s уже занят устройством %s (%s)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is not a plain IPv4 address." msgstr "Устройство %s (%s): адрес %s не является обычным IPv4-адресом." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is outside %s's tunnel %s." msgstr "Устройство %s (%s): адрес %s вне туннеля сервера %s (%s)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is the router's own address on %s." msgstr "Устройство %s (%s): адрес %s принадлежит самому роутеру на сервере %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address (none) is not a plain IPv4 address." msgstr "Устройство %s (%s): нет IPv4-адреса." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: keep-alive %d is not between 0 and 600 seconds." msgstr "Устройство %s (%s): keep-alive %d вне пределов от 0 до 600 секунд." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the preshared key is not a key." msgstr "Устройство %s (%s): общий ключ (PSK) некорректен." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the private key is not a key." msgstr "Устройство %s (%s): приватный ключ некорректен." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the public key is not a key." msgstr "Устройство %s (%s): публичный ключ некорректен." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the public key is the server's own." msgstr "Устройство %s (%s): публичный ключ совпадает с ключом сервера." @@ -2757,91 +3385,87 @@ msgstr "Устройство %s включено" msgid "Device %s went offline" msgstr "Устройство %s отключилось" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s: person %s does not exist." msgstr "Устройство %s: человека %s нет." -#: web/src/admin/pages/person/pickers.ts -msgid "Device DNS - devices need their configuration again" -msgstr "DNS устройства - устройствам нужна новая конфигурация" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Device addresses" msgstr "Адреса устройств" -#: web/src/admin/cores/awg.ts -msgid "Device addresses come from it." -msgstr "Из неё выдаются адреса устройств." +#: web/src/admin/pages/settings/stages.ts +msgid "Device addresses come from it. Change it when it clashes with a network a device connects from." +msgstr "Из неё устройства получают адреса. Меняйте, если она совпадает с сетью, из которой подключается устройство." -#: web/src/admin/pages/server.ts -msgid "Device addresses: %s" -msgstr "Адреса устройств: %s" - -#: web/src/admin/device.ts -msgid "Device disabled" -msgstr "Устройство отключено" - -#: web/src/admin/device.ts -msgid "Device enabled" -msgstr "Устройство включено" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Device hostnames" msgstr "Имена устройств" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/pages/people/person/index.ts +msgid "Device limit" +msgstr "Лимит устройств" + +#: backend/i18n/messages.js msgid "Device limit must be between 1 and 32." msgstr "Лимит устройств: от 1 до 32." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device limit reached (%d)." msgstr "Достигнут лимит устройств (%d)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Device not found." msgstr "Устройство не найдено." -#: web/src/admin/device.ts -msgid "Device removed" -msgstr "Устройство удалено" +#: web/src/admin/pages/log/filters.ts +msgid "Device: %s" +msgstr "Устройство: %s" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/stages.ts msgid "Devices" msgstr "Устройства" -#: web/src/admin/pages/person/dialogs.ts -msgid "Devices added through the old link keep working until they are removed. Remove them too:" -msgstr "Устройства, добавленные по старой ссылке, продолжат работать, пока их не удалят. Удалить и их:" +#: web/src/admin/pages/settings/stages.ts +msgid "Devices are given %s, the router is %s now. A DDNS name would follow it by itself." +msgstr "Устройства получают %s, а у роутера теперь %s. Имя DDNS следовало бы за ним само." -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts -msgid "Devices are marked “Update config” until they import again." -msgstr "Устройства помечены «Обновить конфигурацию», пока не импортируют её заново." - -#: web/src/admin/pages/people.ts -msgid "Devices can’t connect" -msgstr "Устройства не могут подключиться" - -#: web/src/admin/pages/people.ts -msgid "Devices can’t connect until you resume" -msgstr "Устройства не подключатся, пока вы не возобновите доступ" - -#: web/src/admin/pages/overview.ts -msgid "Devices connect once it is on" -msgstr "Устройства подключатся после включения сервера" - -#: web/src/admin/pages/server.ts -msgid "Devices connect to" -msgstr "Куда подключаются устройства" +#: web/src/admin/flows/add-device.ts +msgid "Devices at home reach them through it." +msgstr "Домашние устройства попадут в них через него." #: web/src/admin/netcheck.ts msgid "Devices connect to %s." msgstr "Устройства подключаются к %s." +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices do not connect until the end date is moved." +msgstr "Устройства не подключатся, пока вы не продлите срок." + +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices do not connect while access is paused." +msgstr "Устройства не подключатся, пока доступ на паузе." + +#: web/src/admin/people/lines.ts +msgid "Devices do not connect while the server is turned off." +msgstr "Устройства не подключатся, пока сервер выключен." + +#: web/src/admin/flows/behind-ask.ts +msgid "Devices do not see each other on this server: only home devices will reach it." +msgstr "На этом сервере устройства друг друга не видят: в сеть попадут только домашние." + +#: web/src/admin/widgets/rollout.ts +msgid "Devices fetch it by their own portal link" +msgstr "Устройства забирают её по своей ссылке портала" + +#: web/src/admin/ui/edit-rows.ts +msgid "Devices fetch their configuration again after this change" +msgstr "После этого изменения устройства забирают настройку заново" + #: web/src/admin/netcheck.ts msgid "Devices get %s – %s, the router %s." msgstr "Устройства получат адреса %s – %s, роутер - %s." @@ -2850,59 +3474,69 @@ msgstr "Устройства получат адреса %s – %s, роутер msgid "Devices get names like %s." msgstr "Устройства получат имена вида %s." -#: web/src/admin/pages/server.ts -msgid "Devices have %s addresses now. A new range when it clashes with a network you connect to; every device then needs its configuration again." -msgstr "Сейчас у устройств адреса %s. Смените диапазон, если он пересекается с сетью, к которой вы подключаетесь; затем каждому устройству снова понадобится конфигурация." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices in one circle reach each other." msgstr "Устройства одного круга видят друг друга." -#: web/src/admin/pages/components/awg.ts +#: backend/i18n/messages.js +msgid "Devices loaded" +msgstr "Устройства загружены" + +#: web/src/admin/flows/awg-build.ts msgid "Devices need AmneziaVPN 3.1 or newer." msgstr "На устройствах нужен AmneziaVPN 3.1 или новее." -#: web/src/admin/interfaces.ts -msgid "Devices of different people never reach each other; a person's own devices don't either." -msgstr "Устройства разных людей никогда не видят друг друга; устройства одного человека - тоже." +#: web/src/admin/widgets/visibility.ts +msgid "Devices never reach each other: neither other people’s, nor a person’s own." +msgstr "Устройства не видят друг друга: ни чужие, ни свои." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices of different servers never reach each other." msgstr "Устройства разных серверов никогда не видят друг друга." -#: web/src/admin/access.ts +#: web/src/admin/widgets/visibility.ts +msgid "Devices of everyone with home access reach each other, as devices at home do." +msgstr "Устройства всех, у кого есть доступ домой, видят друг друга, как домашние." + +#: web/src/admin/flows/circle.ts msgid "Devices of people in one circle reach each other. A person is in one circle at a time." msgstr "Устройства людей из одного круга видят друг друга. Человек может быть только в одном круге." -#: web/src/admin/interfaces.ts -msgid "Devices of people with home access reach each other, like home devices do. Internet-only people never." -msgstr "Устройства людей с доступом к домашней сети видят друг друга, как домашние устройства. Люди только с интернетом - никогда." - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Devices per person" msgstr "Устройств на человека" -#: web/src/admin/interfaces.ts -msgid "Devices reach each other" -msgstr "Связь между устройствами" +#: web/src/admin/widgets/visibility.ts +msgid "Devices reach each other inside a circle. Everyone reaches their own devices." +msgstr "Устройства видят друг друга внутри круга. Свои устройства видит каждый." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices reach each other on this server" msgstr "На этом сервере устройства видят друг друга" -#: web/src/admin/interfaces.ts -msgid "Devices reach each other: %s" -msgstr "Связь между устройствами: %s" - -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts msgid "Devices see each other" msgstr "Устройства видят друг друга" +#: web/src/admin/pages/settings/networks.ts +msgid "Devices see each other: %s" +msgstr "Видят друг друга: %s" + +#: web/src/admin/flows/server-change.ts +msgid "Devices see each other: %s?" +msgstr "Устройства видят друг друга: %s?" + #: web/src/admin/netcheck.ts msgid "Devices send a packet every %s s to keep NAT open (a little battery on phones)." msgstr "Устройства отправляют пакет каждые %s с, чтобы NAT не закрылся (на телефонах это немного расходует батарею)." -#: web/src/admin/access.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices stay connected, but only the portal and the router’s DNS open." +msgstr "Устройства в сети, но открываются только портал и DNS роутера." + +#: web/src/admin/flows/home-service.ts msgid "Devices that got an address from this router. Pick the ports to open, or all ports." msgstr "Устройства, получившие адрес от этого роутера. Выберите, какие порты открыть, или все порты." @@ -2910,162 +3544,163 @@ msgstr "Устройства, получившие адрес от этого р msgid "Devices use %s - home names and your LAN’s DNS filters no longer apply to them." msgstr "Устройства используют %s - домашние имена и DNS-фильтры вашей LAN на них больше не действуют." -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "Device’s own DNS" msgstr "DNS устройства" -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/diagnostics/index.ts -msgid "Diagnostics" -msgstr "Диагностика" +#: web/src/admin/pages/settings/networks.ts +msgid "Direct" +msgstr "Напрямую" -#: web/src/admin/device.ts -msgid "Disable" -msgstr "Отключить" - -#: web/src/admin/ui/badges.ts +#: web/src/admin/people/diagnosis.ts msgid "Disabled" msgstr "Отключено" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +msgid "Disabled by you" +msgstr "Выключено вами" + +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/disguise-levels.ts msgid "Disguise" msgstr "Маскировка" -#: web/src/admin/disguise.ts -msgid "Disguise method" -msgstr "Способ маскировки" +#: web/src/admin/pages/settings/disguise.ts +msgid "Disguise: %s" +msgstr "Маскировка: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/server-change.ts +msgid "Disguise: %s?" +msgstr "Маскировка: %s?" + +#: web/src/admin/pages/settings/check.ts +msgid "Does a home service not open? Check the path to it." +msgstr "Не открывается домашний сервис? Проверьте путь до него." + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Does not look like a VPN" +msgstr "Не похож на VPN" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Domain" +msgstr "Домен" + +#: backend/i18n/messages.js msgid "Domain may use lowercase letters, digits, dashes and dots." msgstr "В домене можно использовать строчные латинские буквы, цифры, дефисы и точки." -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/people/pick.ts msgid "Done" msgstr "Готово" -#: web/src/admin/device.ts -#: web/src/admin/events/render.ts -msgid "Done by you in LuCI" -msgstr "Сделано вами в LuCI" - -#: web/src/admin/pages/person/dialogs.ts -msgid "Don’t warn" -msgstr "Не предупреждать" - -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Download" msgstr "Скачать" -#: web/src/admin/widgets/tiles.ts -msgctxt "speed" -msgid "Download" -msgstr "Приём" +#: web/src/admin/flows/setup.ts +msgid "Download .conf" +msgstr "Скачать .conf" -#: web/src/admin/cores/awg.ts -msgid "Download AmneziaWG config" -msgstr "Скачать конфигурацию AmneziaWG" - -#: web/src/admin/invite.ts -msgid "Download card" -msgstr "Скачать карточку" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Download failed: %s" msgstr "Не удалось скачать: %s" -#: web/src/admin/pages/settings/logs.ts -msgid "Download the log as %s" -msgstr "Скачать журнал в %s" +#: web/src/portal/setup.ts +msgid "Download for Linux" +msgstr "Скачать для Linux" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/portal/setup.ts +msgid "Download for Mac" +msgstr "Скачать для Mac" + +#: web/src/portal/setup.ts +msgid "Download for Windows" +msgstr "Скачать для Windows" + +#: web/src/portal/setup.ts +msgid "Download from" +msgstr "Скачать с сайта" + +#: web/src/portal/setup.ts +msgid "Download on the" +msgstr "Загрузите в" + +#: web/src/admin/pages/settings/router/history.ts +msgid "Download the log" +msgstr "Скачать журнал" + +#: web/src/admin/pages/log/index.ts +msgid "Download what is shown now" +msgstr "Скачать то, что показано сейчас" + +#: web/src/portal/ui/bars.ts +msgid "Downloaded" +msgstr "Получено" + +#: backend/i18n/messages.js msgid "Downloading %s" msgstr "Скачивание %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Downloading %s from %s" msgstr "Скачивание %s из %s" -#: web/src/admin/pages/settings/updates.ts -msgid "Downloads and installs new versions of the components below." -msgstr "Скачивает и устанавливает новые версии выбранных ниже компонентов." +#: backend/i18n/messages.js +msgid "Each change needs the id of a person." +msgstr "У каждого изменения должен быть id человека." -#: web/src/admin/access.ts -msgid "Each other" -msgstr "Друг с другом" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Easy to block" +msgstr "Легко заблокировать" -#: web/src/admin/access.ts -msgid "Edit" -msgstr "Изменить" - -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "Edit %s" msgstr "Изменить «%s»" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/person/head.ts msgid "Edit note" msgstr "Изменить заметку" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Empty" msgstr "Пусто" -#: web/src/admin/pages/server.ts -msgid "Empty = the portal’s address (%s)." -msgstr "Пусто - адрес портала (%s)." - -#: web/src/admin/pages/server.ts -msgid "Empty = the portal’s address." -msgstr "Пусто - адрес портала." - #: web/src/admin/netcheck.ts msgid "Empty: automatic. Lower it when big pages hang on this device." msgstr "Пусто: автоматически. Уменьшите, если на этом устройстве зависают большие страницы." -#: web/src/admin/device.ts -msgid "Enable" -msgstr "Включить" +#: web/src/admin/people/diagnosis.ts +msgid "Enabled, its configuration is current" +msgstr "Включено, настройка актуальна" -#: web/src/admin/pages/settings/portal.ts -msgid "Enable portal" -msgstr "Включить портал" +#: web/src/admin/flows/person-acts.ts +msgid "End date as it was" +msgstr "Срок как был" -#: web/src/admin/cores/awg.ts -msgid "Encrypted headers" -msgstr "Зашифрованные заголовки" - -#: web/src/admin/pages/people.ts -msgid "End date" -msgstr "Дата окончания" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "End date must be YYYY-MM-DD." msgstr "Дата окончания должна быть в формате ГГГГ-ММ-ДД." -#: web/src/admin/events/render.ts -msgid "End date passed (%s) · access kept" -msgstr "Срок доступа закончился (%s) · доступ сохранён" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "End dates and quotas use the router clock." msgstr "Даты окончания и лимиты трафика считаются по часам роутера." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Endpoint must be a hostname or IP address." msgstr "Адрес сервера должен быть именем хоста или IP-адресом." -#: web/src/admin/pages/components/hero.ts -msgid "English only" -msgstr "Только английский" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Enter a circle name: up to 32 characters, without < > \" or \\." msgstr "Введите название круга: до 32 символов, без < > \" и обратной косой черты." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Enter a device name: up to %d letters, digits, spaces and - _ ." msgstr "Введите название устройства: до %d букв, цифр, пробелов и - _ ." @@ -3077,292 +3712,339 @@ msgstr "Введите имя хоста или IP-адрес." msgid "Enter a name." msgstr "Введите имя." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc +#: backend/i18n/messages.js msgid "Enter a name: up to 48 characters, without < > \" or \\." msgstr "Введите имя: до 48 символов, без < > \" и обратной косой черты." -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Enter a release tag like 0.3.1" msgstr "Введите тег релиза, например 0.3.1" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Enter a time as HH:MM, 00:00 to 23:59." msgstr "Введите время в формате ЧЧ:ММ, от 00:00 до 23:59." -#: web/src/admin/pages/person/limits.ts -msgid "Enter both times, like 07:00 and 23:00." -msgstr "Укажите оба времени, например 07:00 и 23:00." +#: web/src/admin/ui/edit-rows.ts +#: web/src/portal/ui/inline-edit.ts +msgid "Enter: save, Esc: cancel" +msgstr "Enter: сохранить, Esc: отменить" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/log/days.ts +msgid "Entries appear when someone connects." +msgstr "Записи появятся, когда кто-нибудь подключится." + +#: backend/i18n/messages.js msgid "Error: %s" msgstr "Ошибка: %s" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Errors only" msgstr "Только ошибки" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts +msgctxt "measure" +msgid "Events" +msgstr "Событий" + +#: web/src/admin/pages/settings/router/history.ts msgid "Every 10 min" msgstr "Каждые 10 мин" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Every 12 h" msgstr "Каждые 12 ч" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Every 6 h" msgstr "Каждые 6 ч" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Every device has a key and an address of its own inside its server." msgstr "У каждого устройства свой ключ и свой адрес на его сервере." -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts msgid "Every interface restarts. Connections drop for a few seconds." msgstr "Все интерфейсы перезапустятся. Соединения прервутся на несколько секунд." -#: web/src/admin/pages/diagnostics/health.ts -msgid "Every minute it checks the tunnels and services and repairs what it can on its own." -msgstr "Каждую минуту проверяет туннели и службы и само исправляет, что может." - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Every step lets it through" msgstr "Проходит все шаги" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts msgid "Everyone" msgstr "Все" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/people/card.ts +msgid "Everyone else" +msgstr "Остальные" + +#: web/src/admin/flows/uninstall.ts msgid "Everyone is disconnected and the tunnel, firewall rules and portal are removed. A backup is made first. Type “%s” to confirm." msgstr "Все будут отключены, а туннель, правила межсетевого экрана и портал - удалены. Сначала будет сделана резервная копия. Чтобы подтвердить, введите «%s»." -#: web/src/admin/pages/overview.ts -msgid "Everyone online" -msgstr "Все в сети" +#: web/src/admin/pages/settings/networks.ts +msgid "Everyone with home access reaches these, unless their page leaves one out." +msgstr "До них доходят все с доступом домой, если на их странице сеть не исключена." -#: web/src/admin/interfaces.ts -msgid "Everyone with home access reaches these, unless their page leaves one out; their devices can be reached from here too. Click one to add or remove it." -msgstr "Все, у кого есть доступ к домашней сети, видят эти сети, если на их странице какая-то не исключена; их устройства тоже доступны отсюда. Нажмите на сеть, чтобы добавить или убрать её." +#: web/src/admin/pages/people/map-view.ts +msgid "Everyone’s places, not only %s" +msgstr "Места всех, не только %s" -#: web/src/admin/logs.ts -msgid "Everything" -msgstr "Все" +#: web/src/admin/pages/overview/waiting.ts +msgid "Everyone’s terms, limits and connections are in order." +msgstr "Сроки, лимиты и связь у всех в порядке." -#: web/src/admin/pages/diagnostics/index.ts -msgid "Everything Dawnline depends on, checked live. The watchdog repairs what it can on its own." -msgstr "Всё, от чего зависит Dawnline, проверяется в реальном времени. Автовосстановление само исправляет, что может." - -#: web/src/admin/pages/components/index.ts #: web/src/admin/updater/jobs.ts msgid "Everything is up to date" msgstr "Всё актуально" -#: web/src/admin/pages/settings/backups.ts -msgid "Everything returns to %s. The current state is backed up first." -msgstr "Всё вернётся к состоянию этой копии (%s). Текущее состояние сначала сохранится в резервную копию." +#: web/src/admin/overview/model.ts +msgid "Everything works" +msgstr "Всё работает" -#: web/src/admin/pages/settings/portal.ts -msgid "Example code; each person gets their own three words." -msgstr "Код для примера: у каждого человека свои три слова." +#: web/src/portal/flows/device-form.ts +msgid "Except %s: those addresses lead to the home network." +msgstr "Кроме %s: эти адреса ведут в домашнюю сеть." -#: web/src/shared/format.ts -msgid "Expired" -msgstr "Срок истёк" - -#: web/src/admin/device.ts -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/index.ts msgid "Export" msgstr "Экспорт" -#: web/src/admin/pages/person/activity.ts -msgid "Export CSV" -msgstr "Экспорт CSV" - -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Export JSON" msgstr "Экспорт JSON" -#: web/src/admin/pages/person/activity.ts -msgid "Export or clear" -msgstr "Экспорт или очистка" +#: web/src/admin/pages/log/index.ts +msgid "Export the log" +msgstr "Экспорт журнала" -#: web/src/admin/pages/people.ts -msgid "Extend 1 month" -msgstr "Продлить на месяц" +#: web/src/admin/pages/people/pick.ts +msgid "Extend" +msgstr "Продлить" -#: web/src/admin/pages/people.ts -msgid "Extended by 1 month" -msgstr "Продлено на месяц" +#: web/src/admin/people/lines.ts +msgid "Extend and resume" +msgstr "Продлить и возобновить" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Extend to %s" +msgstr "Продлить до %s" + +#: web/src/admin/pages/people/pick.ts +msgid "Extended: %s" +msgstr "Продлено: %s" + +#: web/src/admin/pages/people/pick.ts +msgid "Extension undone" +msgstr "Продление отменено" + +#: backend/i18n/messages.js msgid "Extra data must be a positive number of GB." msgstr "Дополнительный трафик должен быть положительным числом ГБ." -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Extra packets sent before the handshake." msgstr "Дополнительные пакеты перед рукопожатием." -#: web/src/admin/updater/operation.ts -msgid "Failed" -msgstr "Ошибка" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Failed to load versions: %s" msgstr "Не удалось загрузить версии: %s" -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Fallback DNS" msgstr "Запасной DNS" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Fallback DNS must be an IPv4 address (or empty for none)." msgstr "Резервный DNS должен быть IPv4-адресом (или оставьте поле пустым, если он не нужен)." -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Fallback DNS: %s?" +msgstr "Резервный DNS: %s?" + +#: web/src/admin/flows/circle.ts msgid "Family" msgstr "Семья" -#: web/src/admin/cores/awg.ts +#: web/src/admin/widgets/rollout.ts +msgid "Fetched: %s of %s" +msgstr "Забрали: %s из %s" + +#: web/src/admin/ui/stepper.ts +msgid "Fewer: %s" +msgstr "Меньше: %s" + +#: web/src/admin/flows/restore.ts msgid "File" msgstr "Файл" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "File %s does not exist." msgstr "Файл %s не существует." -#: web/src/admin/pages/people.ts -msgid "Find a person or device" -msgstr "Найти человека или устройство" +#: web/src/admin/flows/circle.ts +msgid "Find a person" +msgstr "Найти человека" -#: web/src/admin/pages/people.ts -msgid "Find…" -msgstr "Найти…" +#: web/src/admin/pages/people/index.ts +msgid "Find a person, a device or an address" +msgstr "Найти человека, устройство или адрес" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/settings/networks.ts +msgid "Find at home" +msgstr "Найти дома" + +#: web/src/admin/pages/log/filters.ts +msgid "Find in the log" +msgstr "Найти в журнале" + +#: web/src/admin/people/diagnosis.ts +msgid "Fine" +msgstr "В порядке" + +#: backend/i18n/messages.js +#: web/src/admin/flows/operation.ts msgid "Finished" msgstr "Готово" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Firewall" msgstr "Межсетевой экран" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "Firewall rules" +msgstr "Правила межсетевого экрана" + +#: backend/i18n/messages.js msgid "Firewall zone or WAN rule is missing." msgstr "Нет зоны межсетевого экрана или правила WAN." -#: web/src/admin/pages/server.ts -msgid "First three numbers of the device addresses" -msgstr "Первые три числа адресов устройств" - -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Fix" msgstr "Исправить" -#: web/src/admin/pages/settings/defaults.ts -msgid "For Home-only devices using home names: %s" -msgstr "Для устройств только с домашней сетью и домашними именами: %s" +#: web/src/admin/pages/overview/health.ts +msgid "Fix in Settings" +msgstr "К настройке" -#: web/src/admin/pages/server.ts -msgid "For every device" -msgstr "Для всех устройств" +#: web/src/admin/people/diagnosis.ts +msgid "Flowing" +msgstr "Идёт" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/log/index.ts +msgid "For a script" +msgstr "Для скрипта" + +#: web/src/admin/disguise.ts +msgid "For networks that block everything. Slower." +msgstr "Для сетей, где режут всё подряд. Медленнее." + +#: web/src/admin/widgets/disguise-levels.ts +msgid "For networks that block hard" +msgstr "Для жёстких блокировок" + +#: web/src/admin/widgets/limit-meter.ts +msgid "For the whole term" +msgstr "За весь срок" + +#: web/src/admin/widgets/limit-meter.ts +msgid "For the whole term: it does not reset" +msgstr "На весь срок: не сбрасывается" + +#: web/src/admin/flows/setup.ts +msgid "Form" +msgstr "Форма" + +#: web/src/admin/flows/new-server.ts msgid "Forward the UDP port on the upstream router to this one and use a DDNS name or that router’s public address here." msgstr "Пробросьте UDP-порт с вышестоящего роутера на этот и укажите здесь имя DDNS или публичный адрес того роутера." -#: web/src/admin/pages/settings/portal.ts -msgid "Found automatically" -msgstr "Найден автоматически" - -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Free certificate from Let’s Encrypt" msgstr "Бесплатный сертификат от Let’s Encrypt" -#: web/src/admin/pages/person/pickers.ts -msgid "Free slot" -msgstr "Свободное место" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Free space on the router" msgstr "Свободное место на роутере" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts msgid "From" -msgstr "С" +msgstr "Откуда" #: web/src/admin/netcheck.ts msgid "From 0 to 600 seconds." msgstr "От 0 до 600 секунд." #: web/src/admin/netcheck.ts +#: web/src/admin/widgets/link-values.ts msgid "From 1280 to 1500." msgstr "От 1280 до 1500." -#: web/src/admin/access.ts -msgid "From the rules on this server" -msgstr "По правилам этого сервера" +#: web/src/admin/flows/packages.ts +msgid "From the OpenWrt feeds, for what Dawnline uses on this router." +msgstr "Из репозиториев OpenWrt, для того, чем Dawnline пользуется на этом роутере." -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "From your DDNS name." msgstr "Из вашего имени DDNS." -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "From your Let’s Encrypt certificate." msgstr "Из вашего сертификата Let’s Encrypt." -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Full speed" +msgstr "Полная скорость" + +#: web/src/admin/widgets/limit-meter.ts #: web/src/shared/format.ts msgid "GB" msgstr "ГБ" -#: web/src/shared/format.ts -msgid "Gbit/s" -msgstr "Гбит/с" +#: web/src/admin/widgets/limit-meter.ts +msgid "GB, or empty: no limit" +msgstr "ГБ, или пусто: без лимита" -#: web/src/admin/device.ts -msgid "Generate" -msgstr "Создать" +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +msgid "General" +msgstr "Основное" -#: web/src/admin/cores/awg.ts -msgid "Generate and apply" -msgstr "Создать и применить" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/server-change.ts msgid "Generate new disguise values?" msgstr "Создать новые значения маскировки?" -#: web/src/admin/device.ts -msgid "Generate new keys?" -msgstr "Создать новые ключи?" +#: web/src/portal/setup.ts +msgid "Get it on" +msgstr "Доступно в" -#: web/src/admin/cores/awg.ts -msgid "Generate new values" -msgstr "Создать новые значения" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub API rate limit reached: try again in an hour." msgstr "Достигнут лимит запросов к API GitHub: попробуйте через час." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub did not answer, trying mirrors" msgstr "GitHub не ответил, пробуем зеркала" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "GitHub mirrors" msgstr "Зеркала GitHub" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub: %s" msgstr "GitHub: %s" -#: web/src/admin/cores/awg.ts -msgid "H1–H4 random" -msgstr "H1–H4 случайные" +#: web/src/admin/pages/server/device-dialog.ts +msgid "Give the device a name." +msgstr "Дайте устройству название." -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/invite.ts +msgid "HTTP: not encrypted" +msgstr "HTTP: без шифрования" + +#: web/src/admin/flows/packages.ts msgid "HTTPS for the portal" msgstr "HTTPS для портала" @@ -3370,11 +4052,11 @@ msgstr "HTTPS для портала" msgid "HTTPS here, plain HTTP for links on IP addresses on %s." msgstr "Здесь HTTPS, а на %s - обычный HTTP для ссылок с IP-адресом." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "HTTPS isn't available on this router: install %s." msgstr "HTTPS на этом роутере недоступен: установите %s." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "HTTPS isn’t available on this router" msgstr "HTTPS на этом роутере недоступен" @@ -3382,83 +4064,66 @@ msgstr "HTTPS на этом роутере недоступен" msgid "HTTPS on this port, opened on WAN." msgstr "HTTPS на этом порту, открыт на WAN." -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Handshake and key timers vary within these ranges instead of WireGuard’s fixed values." msgstr "Таймеры рукопожатия и ключей меняются в этих пределах вместо фиксированных значений WireGuard." #: web/src/admin/events/model.ts +#: web/src/portal/ui/wait-way.ts msgid "Handshake complete, but no data" msgstr "Рукопожатие есть, но данных нет" -#: web/src/admin/pages/diagnostics/index.ts -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/server/overview.ts msgid "Health" msgstr "Состояние" -#: web/src/admin/invite.ts +#: web/src/admin/flows/invite-card.ts msgid "Hi, %s" msgstr "Привет, %s" -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/portal.ts -msgid "Hide" -msgstr "Скрыть" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Hidden" +msgstr "Скрытность" -#: web/src/admin/cores/awg.ts -msgid "Hide key" -msgstr "Скрыть ключ" +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/index.ts +msgid "History and storage" +msgstr "История и хранение" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc -#: web/src/admin/access.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts #: web/src/admin/map.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts msgid "Home" msgstr "Дом" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/add-person.ts +msgctxt "access" +msgid "Home" +msgstr "Дом. сеть" + +#: backend/i18n/messages.js msgid "Home access includes the router." msgstr "Доступ к домашней сети включает и роутер." -#: web/src/admin/interfaces.ts -msgid "Home access reaches %s" -msgstr "Домашний доступ: %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home access reaches every home network." msgstr "Доступ к домашней сети открывает все домашние сети." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home and Internet" msgstr "Дом и интернет" -#: web/src/admin/widgets/access-picker.ts -msgid "Home devices and the internet, all through your router." -msgstr "Домашние устройства и интернет - всё через ваш роутер." - -#: web/src/admin/pages/person/limits.ts -msgid "Home devices and the internet, all through your router. Home reaches their devices too." -msgstr "Домашние устройства и интернет - всё через ваш роутер. Из дома устройства человека тоже доступны." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home devices reach only people with home access." msgstr "Домашние устройства могут связаться только с людьми, у которых есть доступ к домашней сети." -#: web/src/admin/access.ts -msgid "Home devices reach the devices of people with home access, on the networks those people reach. Paused, ended and over-the-limit people reach nothing." -msgstr "Домашние устройства видят устройства людей с доступом к домашней сети - в тех сетях, которые доступны этим людям. Люди на паузе, с закончившимся доступом или исчерпанным лимитом не видят ничего." - -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "Home names" msgstr "Домашние имена" -#: web/src/admin/pages/person/pickers.ts -msgid "Home names on - devices need their configuration again" -msgstr "Домашние имена включены - устройствам нужна новая конфигурация" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/reach.ts #: web/src/shared/format.ts msgid "Home network" msgstr "Домашняя сеть" @@ -3467,19 +4132,16 @@ msgstr "Домашняя сеть" msgid "Home network + Internet" msgstr "Домашняя сеть и интернет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Home network addresses" msgstr "Адреса домашней сети" -#: web/src/admin/pages/person/pickers.ts -msgid "Home networks %s reaches. Networks added to the server later stay out." -msgstr "%s: доступны отмеченные домашние сети. Сети, добавленные на сервер позже, останутся недоступны." +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/reach.ts +msgid "Home networks" +msgstr "Домашние сети" -#: web/src/admin/pages/person/pickers.ts -msgid "Home networks %s reaches: all of them. Untick one to keep %s out of it." -msgstr "%s: доступны все домашние сети. Снимите отметку с сети, чтобы закрыть её для человека %s." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home only" msgstr "Только дом" @@ -3487,381 +4149,456 @@ msgstr "Только дом" msgid "Home router" msgstr "Домашний роутер" -#: web/src/admin/access.ts +#: web/src/admin/widgets/reach.ts msgid "Home services" msgstr "Домашние сервисы" -#: web/src/admin/pages/person/pickers.ts -msgid "Home services updated" -msgstr "Домашние сервисы обновлены" +#: web/src/admin/pages/settings/networks.ts +msgid "Home services · shared by all servers" +msgstr "Домашние сервисы · общие для всех серверов" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Home-like link" msgstr "Домашний маршрут" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Home-only devices that use home names ask it while the tunnel is down." +msgstr "Его спрашивают устройства только с домашней сетью и домашними именами, пока туннель не работает." + +#: web/src/admin/flows/home-service.ts msgid "Home-only people can be limited to these instead of whole networks (chosen on their page). Shared by all servers." msgstr "Людей с доступом только к домашней сети можно ограничить этими сервисами вместо целых сетей (выбирается на странице человека). Общие для всех серверов." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Hourly" msgstr "Раз в час" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Hours must look like 07:00-23:00." -msgstr "Часы доступа указываются так: 07:00-23:00." +#: web/src/admin/pages/settings/networks.ts +msgid "How devices’ internet traffic leaves" +msgstr "Как интернет-трафик устройств выходит наружу" -#: web/src/admin/pages/settings/updates.ts -msgid "How Dawnline keeps its components current. Every Dawnline update makes a backup of the settings first." -msgstr "Как Dawnline поддерживает компоненты в актуальном состоянии. Перед каждым обновлением Dawnline делает резервную копию настроек." - -#: web/src/admin/pages/server.ts -msgid "How devices reach the internet" -msgstr "Как устройства выходят в интернет" - -#: web/src/admin/pages/settings/updates.ts -msgid "How often" -msgstr "Как часто" - -#: web/src/admin/pages/settings/portal.ts -msgid "How the portal listens (80 and 443 stay free)" -msgstr "Как портал принимает подключения (80 и 443 остаются свободны)" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "I1-I5 together must be at most 2000 characters, not %d." msgstr "I1–I5 вместе: не больше 2000 символов, сейчас %d." -#: web/src/admin/pages/overview.ts -msgid "Idle right now" -msgstr "Сейчас без трафика" +#: web/src/admin/pages/settings/stages.ts +msgid "IP addresses, separated by commas; empty: this router" +msgstr "IP-адреса через запятую; пусто: этот роутер" -#: web/src/admin/interfaces.ts -msgid "If the router’s DNS hands out proxy addresses, those sites won’t open without it." -msgstr "Если DNS роутера выдаёт адреса прокси, без этого такие сайты не откроются." +#: web/src/admin/widgets/entry.ts +msgid "IPsec’s port" +msgstr "Порт IPsec" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Import" msgstr "Импортировать" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Import JSON" msgstr "Импорт JSON" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import Tunnel(s) from File…" +msgstr "Импорт туннелей из файла…" + +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import config from Clipboard" msgstr "Импорт из буфера обмена" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import config from QRcode" msgstr "Импорт из QR-кода" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import from clipboard" msgstr "Импорт из буфера обмена" -#: web/src/admin/pages/settings/backups.ts -msgid "Import?" -msgstr "Импортировать?" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import from file or archive" +msgstr "Импорт из файла или архива" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/setup.ts +msgid "Import the file in AmneziaWG on the device" +msgstr "Импортируйте файл в AmneziaWG на устройстве" + +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import tunnel(s) from file…" +msgstr "Импорт туннелей из файла…" + +#: web/src/admin/flows/restore.ts msgid "Imported" msgstr "Импортировано" -#: web/src/admin/cores/awg.ts -msgid "In every device configuration" -msgstr "В конфигурации каждого устройства" +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts +msgid "In circles" +msgstr "Круги" -#: web/src/admin/pages/people.ts -msgid "In total" -msgstr "Всего" +#: web/src/admin/widgets/visibility.ts +msgid "In no circle: %s. They reach only their own devices." +msgstr "Без круга: %s. Видят только свои устройства." -#: web/src/admin/pages/person/limits.ts -msgid "Includes +%s GB extra this month" -msgstr "В этом месяце +%s ГБ дополнительно" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "In the background; the components above say what it found." +msgstr "В фоне; что нашлось, видно в компонентах выше." -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "In use: %s" +msgstr "Используются: %s" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Includes +%s GB extra until the reset." +msgstr "Включая +%s ГБ сверху до сброса." + +#: web/src/portal/setup.ts msgctxt "AmneziaVPN app" msgid "Insert" msgstr "Вставить" -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/packages.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pkgs.ts -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/awg-build.ts +#: web/src/admin/flows/install.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/flows/versions.ts +#: web/src/admin/pages/settings/disguise.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/servers/fixes.ts msgid "Install" msgstr "Установить" -#: web/src/admin/invite.ts -msgid "Install %s on the device" -msgstr "Установите %s на устройство" +#: web/src/admin/flows/versions.ts +msgid "Install %s" +msgstr "Установить %s" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Install ACME" msgstr "Установить ACME" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install ACME certificates?" msgstr "Установить сертификаты ACME?" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Install AmneziaWG %s?" msgstr "Установить AmneziaWG %s?" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Install AmneziaWG first" msgstr "Сначала установите AmneziaWG" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install AmneziaWG?" msgstr "Установить AmneziaWG?" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Install Dawnline %s?" msgstr "Установить Dawnline %s?" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install HTTPS for the portal?" msgstr "Установить HTTPS для портала?" -#: web/src/admin/pages/settings/updates.ts -msgid "Install automatically" -msgstr "Устанавливать автоматически" +#: web/src/portal/setup.ts +msgid "Install from" +msgstr "Установить с сайта" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc +#: backend/i18n/messages.js msgid "Install it in Dawnline → Components." msgstr "Установите его в Dawnline → Компоненты." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -msgid "Install that AmneziaWG build in Dawnline → Components, or switch the disguise on the Server page." -msgstr "Установите эту сборку AmneziaWG в Dawnline → Компоненты или смените маскировку на странице сервера." +#: backend/i18n/messages.js +msgid "Install that AmneziaWG build in Settings → Updates, or switch the disguise in Settings → Disguise." +msgstr "Установите эту сборку AmneziaWG в «Настройки» → «Обновления» или смените маскировку в «Настройки» → «Маскировка»." -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install the home-like link?" msgstr "Установить домашний маршрут?" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Install updates immediately or scheduled." msgstr "Обновления устанавливаются сразу или по расписанию." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Install what it finds" +msgstr "Устанавливать найденное" + +#: backend/i18n/messages.js msgid "Installation failed" msgstr "Установка не удалась" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Installed" msgstr "Установлена" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installed Dawnline %s is newer than the release %s" msgstr "Установленная версия Dawnline %s новее релиза %s" -#: web/src/admin/updater/jobs.ts -msgid "Installed version is newer than the release (%s)" -msgstr "Установленная версия новее релиза (%s)" +#: web/src/admin/flows/versions.ts +msgid "Installed: %s. Another version can be installed once the job under way is over." +msgstr "Установлена %s. Другую версию можно будет поставить, когда закончится текущая задача." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/versions.ts +msgid "Installed: %s. Every release on GitHub, newest first." +msgstr "Установлена %s. Все выпуски с GitHub, сначала новые." + +#: backend/i18n/messages.js msgid "Installing %s" msgstr "Установка: %s" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing ACME certificates" msgstr "Установка сертификатов ACME" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pkgs.ts +#: web/src/admin/flows/awg-build.ts +#: web/src/admin/updater/install.ts msgid "Installing AmneziaWG" msgstr "Установка AmneziaWG" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Installing Dawnline %s" msgstr "Установка Dawnline %s" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing HTTPS for the portal" msgstr "Установка HTTPS для портала" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installing package" msgstr "Установка пакета" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Installing the %s build" msgstr "Установка сборки %s" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing the home-like link" msgstr "Установка домашнего маршрута" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installing the translation" msgstr "Установка перевода" -#: web/src/admin/cores/awg.ts -msgid "Interface" -msgstr "Интерфейс" +#: web/src/admin/pages/settings/stages.ts +msgid "Interface and key" +msgstr "Интерфейс и ключ" -#: web/src/admin/interfaces.ts -msgid "Interface %s" -msgstr "Интерфейс %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Interface name: 1-12 lowercase letters, digits or _." msgstr "Имя интерфейса: 1–12 строчных латинских букв, цифр или _." -#: web/src/admin/access.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/reach.ts #: web/src/shared/format.ts msgid "Internet" msgstr "Интернет" -#: web/src/admin/interfaces.ts -msgid "Internet interface" -msgstr "Интерфейс интернета" - -#: web/src/admin/pages/person/pickers.ts -msgid "Internet keeps working exactly as without the VPN. Reach home devices by IP address." -msgstr "Интернет работает так же, как без VPN. К домашним устройствам обращайтесь по IP-адресу." - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts msgid "Internet like a home device" msgstr "Интернет как у домашних устройств" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet like a home device isn’t working" msgstr "Интернет как у домашних устройств не работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet like a home device not bypassed" msgstr "Интернет как у домашних устройств: без обхода" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Internet only" msgstr "Только интернет" -#: web/src/admin/interfaces.ts -msgid "Internet straight to %s" -msgstr "Интернет напрямую через %s" +#: web/src/admin/flows/circle.ts +msgid "Internet only · %s" +msgstr "Только интернет · %s" -#: web/src/admin/pages/overview.ts -msgid "Internet through the LAN is off: %s" -msgstr "Интернет через LAN выключен: %s" - -#: web/src/admin/interfaces.ts -msgid "Internet traffic enters %s as %s, so whatever handles home traffic (proxies, filters, DNS) handles it too." -msgstr "Интернет-трафик входит в %s с адресом %s, поэтому всё, что обрабатывает домашний трафик (прокси, фильтры, DNS), обрабатывает и его." - -#: web/src/admin/interfaces.ts -msgid "Internet traffic enters the router from your LAN, so whatever handles home traffic (proxies, filters, DNS) handles it too." -msgstr "Интернет-трафик входит в роутер из вашей LAN, поэтому всё, что обрабатывает домашний трафик (прокси, фильтры, DNS), обрабатывает и его." - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Internet traffic goes straight to the WAN for now." msgstr "Пока интернет-трафик идёт прямо в WAN." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet traffic leaves through WAN directly." msgstr "Интернет-трафик уходит напрямую через WAN." -#: web/src/admin/interfaces.ts -msgid "Internet traffic will enter the router from your LAN, so it is handled like any home device. Save to turn on." -msgstr "Интернет-трафик будет входить в роутер из вашей LAN и обрабатываться как трафик любого домашнего устройства. Сохраните, чтобы включить." +#: web/src/admin/pages/settings/networks.ts +msgid "Internet traffic: %s" +msgstr "Интернет-трафик: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/flows/server-change.ts +msgid "Internet traffic: %s?" +msgstr "Интернет-трафик: %s?" + +#: backend/i18n/messages.js msgid "Invalid JSON." msgstr "Некорректный JSON." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid backup name." msgstr "Недопустимое имя резервной копии." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid option %s." msgstr "Недопустимый параметр %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Invalid port %s." msgstr "Недопустимый порт %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Invalid public key." msgstr "Недопустимый публичный ключ." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid section %s." msgstr "Недопустимая секция %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Invalid service id." msgstr "Недопустимый идентификатор сервиса." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Invalid value for %s." msgstr "Недопустимое значение для %s." -#: web/src/admin/invite.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Invite" +msgstr "Пригласить" + +#: web/src/admin/flows/invite.ts msgid "Invite %s" msgstr "Приглашение: %s" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -msgid "Invite card" -msgstr "Карточка приглашения" +#: web/src/admin/flows/invite.ts +msgid "Invite · %s" +msgstr "Приглашение · %s" -#: web/src/admin/invite.ts -msgid "Invite card for %s" -msgstr "Карточка приглашения: %s" +#: web/src/admin/flows/new-keys.ts +msgid "Issue new keys" +msgstr "Выдать новые ключи" #: web/src/admin/events/model.ts msgid "It connects, but the connection breaks every few minutes: the network may be cutting it." msgstr "Устройство подключается, но связь рвётся каждые несколько минут: возможно, её обрывает сеть." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/people/diagnosis.ts +msgid "It has never connected" +msgstr "Подключений не было" + +#: web/src/admin/events/timeline.ts +msgid "It has not connected yet" +msgstr "Подключений ещё не было" + +#: web/src/admin/pages/settings/router/notice.ts +msgid "It installs on its own at %s." +msgstr "Установится автоматически в %s." + +#: web/src/admin/pages/settings/router/notice.ts +msgid "It installs on its own soon." +msgstr "Скоро установится автоматически." + +#: web/src/admin/flows/behind-ask.ts +msgid "It is asked for again" +msgstr "Запрос возвращён" + +#: backend/i18n/messages.js msgid "It is in the tunnel network %s." msgstr "Он входит в сеть туннеля %s." -#: web/src/admin/pages/components/hero.ts -msgid "It is older than %s. A backup of the settings is made first; restore it from Settings if something looks wrong." -msgstr "Эта версия старше %s. Сначала будет создана резервная копия настроек - если что-то пойдёт не так, восстановите её в «Настройках»." +#: web/src/admin/flows/versions.ts +msgid "It is older than %s. A backup of the settings is made first; restore it from Backups if something looks wrong." +msgstr "Она старше %s. Сначала будет сделана копия настроек; если что-то пойдёт не так, восстановите её в разделе «Резервные копии»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves like a home device would." msgstr "Трафик выходит так же, как у домашнего устройства." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves through %s." msgstr "Трафик выходит через %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves through the WAN." msgstr "Трафик выходит через WAN." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/shared/format.ts +msgid "It shares addresses with a network here" +msgstr "Пересекается с сетью здесь" + +#: web/src/admin/pages/people/index.ts +msgid "It was removed, or the link is out of date. Its events stay in the log for as long as the log keeps them." +msgstr "Его удалили, или ссылка устарела. События устройства остаются в журнале, пока журнал их хранит." + +#: web/src/admin/people/diagnosis.ts +msgid "Its attempts reach the router since %s, no answer reaches the device" +msgstr "Попытки доходят до роутера с %s, ответа устройство не получает" + +#: web/src/admin/people/diagnosis.ts +msgid "Its configuration changed after it was set up: the device has the old one." +msgstr "Настройка изменилась после выдачи: на устройстве старая." + +#: backend/i18n/messages.js msgid "Its configuration doesn't send it to the router" msgstr "Конфигурация устройства не направляет этот трафик на роутер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/people/diagnosis.ts +msgid "Its configuration is current, so the network it connects from is in the way. Let it try another: mobile data instead of Wi‑Fi, or the other way round." +msgstr "Настройка актуальна, значит мешает сеть, из которой оно подключается. Пусть попробует другую: мобильную вместо Wi‑Fi или наоборот." + +#: backend/i18n/messages.js msgid "Its configuration sends it to the router" msgstr "Конфигурация устройства направляет этот трафик на роутер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Its configuration stops working at once. It can be added again here or on the portal." +msgstr "Его настройка перестанет работать сразу. Добавить его снова можно и здесь, и на портале." + +#: web/src/admin/flows/new-keys.ts +msgid "Its configuration stops working at once. Set the device up again: the new one opens next." +msgstr "Нынешняя настройка перестанет работать сразу. Настройте устройство заново: новая откроется следом." + +#: web/src/admin/events/timeline.ts +msgid "Its configuration was given out, but the device has never connected." +msgstr "Настройку выдали, но устройство ни разу не подключалось." + +#: web/src/admin/people/diagnosis.ts +msgid "Its owner added this router on their page: it connects once you accept it." +msgstr "Владелец добавил этот роутер на своей странице: он подключится, когда вы его примете." + +#: web/src/admin/widgets/timeline.ts +msgid "Its server’s settings changed" +msgstr "Настройки сервера изменились" + +#: web/src/admin/widgets/timeline.ts +msgid "Its settings changed" +msgstr "Настройка изменилась" + +#: web/src/admin/pages/settings/router/backups.ts +msgid "JSON moves everything except usage history to another router." +msgstr "JSON переносит на другой роутер всё, кроме истории трафика." + +#: backend/i18n/messages.js msgid "Jmin must not be larger than Jmax." msgstr "Jmin не может быть больше Jmax." -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Junk packets" msgstr "Мусорные пакеты" @@ -3877,89 +4614,85 @@ msgstr "Только имя, без порта (порт задаётся на msgid "KB" msgstr "КБ" -#: web/src/admin/pages/person/dialogs.ts -msgid "Keep access" -msgstr "Сохранить доступ" - -#: web/src/admin/pages/settings/logs.ts -msgid "Keep activity" -msgstr "Хранить события" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Keep activity for 0 (no age limit) to 9999 days." msgstr "Хранить события можно от 0 (без ограничения по сроку) до 9999 дней." -#: web/src/admin/pages/person/pickers.ts -msgid "Keep at least one network, or choose Internet only." -msgstr "Оставьте хотя бы одну сеть или выберите доступ «Интернет»." +#: web/src/admin/flows/server-change.ts +msgid "Keep devices apart?" +msgstr "Закрыть устройства друг от друга?" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/history.ts +msgid "Keep the log" +msgstr "Хранить журнал" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Keep the previous version" msgstr "Хранить прошлую версию" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts +#: web/src/admin/pages/settings/disguise.ts +msgid "Keep the values in use" +msgstr "Оставить нынешние значения" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "Keep-alive" msgstr "Keep-alive" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Keep-alive must be 0-600 seconds." msgstr "Keep-alive: от 0 до 600 секунд." -#: web/src/admin/device-link.ts -msgid "Keep-alive of %s" -msgstr "Keep-alive для «%s»" +#: web/src/admin/widgets/link-values.ts +msgid "Keep-alive: %s" +msgstr "Keep-alive: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/flows/server-change.ts +msgid "Keep-alive: %s?" +msgstr "Keep-alive: %s?" + +#: backend/i18n/messages.js msgid "Keeping AmneziaWG %s for rollback" msgstr "Сохранение AmneziaWG %s для отката" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Keeping Dawnline %s for rollback" msgstr "Сохранение Dawnline %s для отката" -#: web/src/admin/pages/components/hero.ts -msgid "Kept after the next update" -msgstr "Сохранится после следующего обновления" - #: web/src/admin/events/model.ts msgid "Kept for %s, %s, %s." msgstr "Хранятся %s, %s, %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Kernel module, awg tool and the netifd protocol are present." msgstr "Модуль ядра, утилита awg и протокол netifd на месте." -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/setup.ts msgid "Key" msgstr "Ключ" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts +#: web/src/admin/flows/setup.ts msgid "Key copied" msgstr "Ключ скопирован" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Key file" msgstr "Файл ключа" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Key generation failed (is amneziawg-tools installed?)." msgstr "Не удалось создать ключ (установлен ли amneziawg-tools?)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Key generation failed (no random data)." msgstr "Не удалось создать ключ (нет случайных данных)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Key generation failed." msgstr "Не удалось создать ключ." -#: web/src/admin/device-link.ts -#: web/src/admin/device.ts #: web/src/admin/events/model.ts +#: web/src/portal/flows/device-form.ts msgid "LAN Bypass" msgstr "Обход локальной сети" @@ -3971,59 +4704,116 @@ msgstr "обход локальной сети выкл." msgid "LAN Bypass on" msgstr "обход локальной сети вкл." -#: web/src/admin/widgets/tiles.ts -msgid "Last 30 days" -msgstr "За 30 дней" +#: web/src/admin/pages/overview/now.ts +msgid "Last 24 hours" +msgstr "За 24 часа" -#: web/src/admin/device.ts -#: web/src/admin/widgets/spark.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/widgets/week-use.ts msgid "Last 7 days" msgstr "За 7 дней" -#: web/src/admin/pages/components/hero.ts -msgid "Last check" -msgstr "Последняя проверка" +#: web/src/admin/pages/people/device/link.ts +msgid "Last handshake %s" +msgstr "Последнее рукопожатие %s" -#: web/src/admin/pages/people.ts -msgctxt "sort" -msgid "Last seen" -msgstr "По активности" +#: web/src/admin/people/diagnosis.ts +msgid "Last one %s" +msgstr "Последнее %s" -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts +#: web/src/admin/pages/people/filters.ts +msgid "Last online" +msgstr "Был в сети" + +#: web/src/admin/events/timeline.ts +msgid "Last online %s" +msgstr "В сети %s" + +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/rollout.ts msgid "Last seen %s" msgstr "В сети %s" -#: web/src/admin/pages/overview.ts -msgid "Last: %s, %s" -msgstr "Последнее подключение: %s, %s" +#: web/src/admin/people/card.ts +msgid "Last seen in %s" +msgstr "Последний раз: %s" + +#: web/src/admin/pages/people/device/link.ts +msgid "Last time %s" +msgstr "Последний раз %s" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Latest" +msgstr "Последнее" #: web/src/admin/updater/jobs.ts msgid "Latest version is installed" msgstr "Установлена последняя версия" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Latest version · checked %s" +msgstr "Последняя версия · проверено %s" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Leave" +msgstr "Уйти" + #: web/src/admin/netcheck.ts msgid "Leave out https:// - just the name." msgstr "Без https:// - только имя." +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Leave without applying?" +msgstr "Уйти, не применив?" + #: web/src/admin/netcheck.ts msgid "Letters, digits, spaces and - _ . only." msgstr "Только буквы, цифры, пробелы и - _ ." -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Let’s Encrypt certificate for the portal" msgstr "Сертификат Let’s Encrypt для портала" -#: web/src/admin/pages/person/limits.ts -msgid "Limit hours" -msgstr "Ограничить часы" +#: web/src/admin/pages/settings/networks.ts +msgid "Like a home device" +msgstr "Как у домашнего устройства" -#: web/src/admin/cores/awg.ts -#: web/src/admin/invite.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "Limit" +msgstr "Лимит" + +#: web/src/admin/flows/person-acts.ts +msgid "Limit as it was" +msgstr "Лимит как был" + +#: web/src/admin/people/card.ts +msgid "Limit nearly reached" +msgstr "Лимит почти" + +#: web/src/admin/people/card.ts +msgid "Limit reached" +msgstr "Лимит исчерпан" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Limit: %s. Change" +msgstr "Лимит: %s. Изменить" + +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/people/card.ts +msgid "Link" +msgstr "Ссылка" + +#: web/src/admin/flows/invite.ts msgid "Link copied" msgstr "Ссылка скопирована" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Links on %s use plain HTTP: the link and the VPN keys in configurations travel unencrypted." msgstr "Ссылки на %s используют обычный HTTP: ссылка и ключи VPN в конфигурациях передаются без шифрования." @@ -4035,7 +4825,7 @@ msgstr "Ссылкам с IP-адресом нужен и порт %s, но он msgid "Links on IP addresses also need the next port: choose a lower one." msgstr "Ссылкам с IP-адресом нужен и следующий порт: выберите порт поменьше." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Links on IP addresses use plain HTTP on the next port (%d), which the portal cannot take. Choose another portal port." msgstr "Ссылки с IP-адресом используют обычный HTTP на следующем порту (%d), а его портал занять не может. Выберите другой порт портала." @@ -4043,128 +4833,90 @@ msgstr "Ссылки с IP-адресом используют обычный HT msgid "Links use %s." msgstr "В ссылках будет %s." -#: web/src/admin/pages/settings/portal.ts -msgid "Links will open for the people you send them to." -msgstr "Ссылки откроются у тех, кому вы их отправите." +#: web/src/admin/flows/portal-sheets.ts +msgid "Links work on every picked address; the first is the main one." +msgstr "Ссылки работают на всех выбранных адресах; первый из них основной." -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts -msgid "Listening" -msgstr "Приём подключений" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Listening on TCP %d." msgstr "Слушает TCP %d." -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/new-server.ts msgid "Listening port" msgstr "Порт прослушивания" -#: web/src/admin/pages/overview.ts -msgid "Live tunnel" -msgstr "Активный туннель" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/changes.ts +#: web/src/admin/pages/settings/networks.ts msgid "Loading interfaces…" msgstr "Загрузка интерфейсов…" -#: web/src/admin/pages/server.ts -msgid "Loading people…" -msgstr "Загружаем людей…" - -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "Loading release notes…" msgstr "Загрузка описания релиза…" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Loading the kernel module" msgstr "Загрузка модуля ядра" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Loading versions…" msgstr "Загрузка версий…" -#: web/src/admin/device.ts -msgid "Loading…" -msgstr "Загрузка…" - -#: web/src/admin/device.ts -msgid "Local address" -msgstr "Локальный адрес" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Location cache" msgstr "Кэш местоположений" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Location cache cleared" msgstr "Кэш местоположений очищен" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/map.ts -msgid "Locations" -msgstr "Места" - -#: web/src/admin/pages/person/activity.ts -msgid "Locations are off" -msgstr "Определение мест выключено" - -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -msgid "Locations are off. %s." -msgstr "Определение мест выключено. %s." - -#: web/src/admin/pages/diagnostics/index.ts +#: web/src/admin/pages/log/index.ts +#: web/src/admin/shell/nav.ts +#: web/src/admin/widgets/feed.ts msgid "Log" msgstr "Журнал" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Log copied" msgstr "Журнал скопирован" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Log size must be 100-20000 events." msgstr "Размер журнала: от 100 до 20 000 событий." -#: web/src/admin/pages/settings/logs.ts -msgid "Logs & history" -msgstr "Журналы и история" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Looked %s" -msgstr "Проверено %s" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Looking for devices at home…" msgstr "Ищем устройства в домашней сети…" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Looking for the %s build for OpenWrt %s" msgstr "Поиск сборки %s для OpenWrt %s" -#: web/src/admin/pages/settings/updates.ts -msgid "Looks for new versions in the background; Components shows what it found and the service log names it." -msgstr "Ищет новые версии в фоне; найденное видно в «Компонентах» и в журнале службы." +#: web/src/admin/pages/overview/health.ts +msgid "Looks every minute and repairs the tunnels and services it can. It never reboots the router." +msgstr "Смотрит раз в минуту и чинит туннели и службы, которые может. Роутер не перезагружает." #: web/src/admin/netcheck.ts msgid "Lowercase letters, digits, dashes and dots." msgstr "Строчные латинские буквы, цифры, дефисы и точки." +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Lowercase letters, digits, dashes and dots; empty: lan" +msgstr "Строчные буквы, цифры, дефисы и точки; пусто: lan" + #: web/src/admin/netcheck.ts msgid "Lowercase only." msgstr "Только строчные буквы." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "LuCI link" msgstr "Связь с LuCI" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "LuCI pages for AmneziaWG" msgstr "Страницы LuCI для AmneziaWG" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "LuCI pages for Dawnline" msgstr "Страницы LuCI для Dawnline" @@ -4172,12 +4924,11 @@ msgstr "Страницы LuCI для Dawnline" msgid "MB" msgstr "МБ" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "MTU is now automatic" msgstr ": MTU теперь выбирается автоматически" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "MTU must be 1280-1500." msgstr "MTU: от 1280 до 1500." @@ -4185,60 +4936,69 @@ msgstr "MTU: от 1280 до 1500." msgid "MTU must be 1280–1500, or empty for automatic." msgstr "MTU - от 1280 до 1500 или пусто для автоматического выбора." -#: web/src/admin/device-link.ts -msgid "MTU of %s" -msgstr "MTU для «%s»" +#: web/src/admin/widgets/link-values.ts +msgid "MTU: %s" +msgstr "MTU: %s" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/server-change.ts +msgid "MTU: %s?" +msgstr "MTU: %s?" + +#: web/src/admin/system/model.ts +msgid "Made by hand" +msgstr "Сделана вручную" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Made by the router: browsers warn until a certificate covers the address." msgstr "Создан роутером: браузеры будут предупреждать, пока у адреса нет настоящего сертификата." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Main" msgstr "Основной" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts +msgid "Main address: %s" +msgstr "Основной адрес: %s" + +#: web/src/admin/flows/invite.ts +msgid "Make a new link" +msgstr "Сделать новую ссылку" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Make main" msgstr "Сделать основным" -#: web/src/admin/pages/settings/backups.ts -msgid "Manual" -msgstr "Вручную" +#: web/src/admin/pages/people/index.ts +msgid "Map" +msgstr "Карта" -#: web/src/admin/pages/settings/map.ts -msgid "Map & locations" -msgstr "Карта и местоположения" +#: web/src/admin/widgets/place-rows.ts +msgid "Map and replay" +msgstr "Карта и повтор" + +#: web/src/admin/widgets/disguise-levels.ts +msgctxt "disguise" +msgid "Max" +msgstr "Максимум" -#: web/src/admin/cores/awg.ts #: web/src/admin/disguise.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Maximum" msgstr "Максимальная" -#: web/src/admin/pages/settings/logs.ts -msgid "Maximum events" -msgstr "Максимум событий" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Maximum needs AmneziaWG 3.1 on the router (kmod-amneziawg, amneziawg-tools 3.1): install a 3.1 build in Dawnline → Components." msgstr "Для «Максимальной» нужен AmneziaWG 3.1 на роутере (kmod-amneziawg, amneziawg-tools 3.1): установите сборку 3.1 в Dawnline → Компоненты." -#: web/src/admin/pages/settings/logs.ts -msgid "Maximum size" -msgstr "Максимальный размер" - -#: web/src/shared/format.ts -msgid "Mbit/s" -msgstr "Мбит/с" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Memory only" msgstr "Только в памяти" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Method not allowed." msgstr "Метод не поддерживается." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Missing: %s." msgstr "Не хватает: %s." @@ -4246,102 +5006,95 @@ msgstr "Не хватает: %s." msgid "Mobile" msgstr "Мобильный" -#: web/src/admin/pages/person/limits.ts -msgid "Monthly" -msgstr "В месяц" +#: web/src/admin/widgets/limit-meter.ts +msgctxt "limit" +msgid "Month" +msgstr "Месяц" -#: web/src/admin/pages/people.ts -msgid "Monthly data (GB)" -msgstr "Трафик в месяц (ГБ)" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Monthly data must be a positive number of GB." msgstr "Месячный лимит трафика должен быть положительным числом ГБ." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Monthly traffic" msgstr "Трафик по месяцам" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Monthly traffic history must be 1-120 months." msgstr "История трафика по месяцам: от 1 до 120 месяцев." -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/pages/settings/backups.ts -msgid "More" -msgstr "Ещё" +#: web/src/admin/ui/stepper.ts +msgid "More: %s" +msgstr "Больше: %s" -#: web/src/admin/pages/overview.ts -msgid "Most: %s" -msgstr "Больше всех: %s" +#: web/src/admin/pages/overview/now.ts +msgid "Most in 30 days:" +msgstr "Больше всех за 30 дней:" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/flows/move-person.ts msgid "Move" msgstr "Перенести" -#: web/src/admin/pages/person/dialogs.ts -msgid "Move %s to another server" -msgstr "Перенос на другой сервер: %s" +#: web/src/admin/pages/people/person/head.ts +msgid "Move to another server" +msgstr "Перенести на другой сервер" -#: web/src/admin/pages/person/header.ts -msgid "Move to server…" -msgstr "Перенести на сервер…" +#: web/src/admin/flows/move-person.ts +msgid "Move · %s" +msgstr "Перенести · %s" -#: web/src/admin/pages/person/dialogs.ts -msgid "Moved to %s" -msgstr "Перенесено на %s" +#: web/src/admin/pages/people/person/head.ts +msgid "Move, rename, note, pause, remove" +msgstr "Перенос, имя, заметка, пауза, удаление" + +#: web/src/admin/pages/settings/router/backups.ts +msgid "Moving to another router" +msgstr "Перенос на другой роутер" #: web/src/admin/netcheck.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Must start with http:// or https://." msgstr "Адрес должен начинаться с http:// или https://." -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "NAS" msgstr "NAS" -#: web/src/admin/device.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts msgid "Name" msgstr "Имя" -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgctxt "circle or service" msgid "Name" msgstr "Название" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -msgctxt "person" -msgid "Name" -msgstr "Имя" +#: web/src/admin/widgets/config-card.ts +msgid "Name copied" +msgstr "Имя скопировано" -#: web/src/admin/pages/people.ts -msgctxt "sort" -msgid "Name" -msgstr "По имени" +#: web/src/admin/widgets/config-card.ts +msgid "Name in the network" +msgstr "Имя в сети" -#: web/src/admin/pages/server.ts -msgid "Name: %s" -msgstr "Имя: %s" +#: web/src/admin/pages/people/index.ts +msgid "Name, device, IP" +msgstr "Имя, устройство, IP" -#: web/src/admin/device.ts -msgid "Named after its type: %s." -msgstr "Имя по типу: %s." +#: web/src/admin/widgets/reach.ts +msgid "Names" +msgstr "Имена" #: web/src/admin/netcheck.ts msgid "Names can’t contain < > \" or \\." msgstr "В имени не может быть символов < > \" и обратной косой черты." -#: web/src/admin/pages/person/pickers.ts -msgid "Names like %s work. Internet names are resolved at home, so they depend on the tunnel (%s takes over when it is down)." -msgstr "Работают имена вроде %s. Интернет-имена разрешаются дома, поэтому зависят от туннеля (когда он недоступен, их разрешает %s)." - -#: web/src/admin/pages/person/pickers.ts -msgid "Names like %s work. Internet names are resolved at home, so they depend on the tunnel - with no fallback set, they stop when it is down." -msgstr "Работают имена вроде %s. Интернет-имена разрешаются дома, поэтому зависят от туннеля - без резервного DNS они перестают работать, когда туннель недоступен." - #: web/src/admin/map.ts msgid "Near %s" msgstr "Рядом: %s" @@ -4350,15 +5103,11 @@ msgstr "Рядом: %s" msgid "Near the server" msgstr "Рядом с сервером" -#: web/src/admin/pages/person/limits.ts -msgid "Need a little more this month?" -msgstr "Нужно чуть больше в этом месяце?" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Needs %s." msgstr "Требуется: %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Needs %s. Internet traffic leaves through WAN directly until then." msgstr "Нужно установить %s. До тех пор интернет-трафик уходит напрямую через WAN." @@ -4378,209 +5127,306 @@ msgstr "Нужен AmneziaWG 3.1 на роутере: сначала устан msgid "Needs AmneziaWG on the router." msgstr "Нужен AmneziaWG на роутере." -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +msgid "Needs a decision" +msgstr "Нужно решение" + +#: web/src/admin/people/diagnosis.ts +msgid "Needs a new configuration" +msgstr "Нужна новая настройка" + +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/ui/rail.ts msgid "Needs attention" msgstr "Требует внимания" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/net-values.ts +msgid "Network" +msgstr "Сеть" + +#: backend/i18n/messages.js +msgid "Network %s is not private (10.x, 172.16-31.x, 192.168.x)." +msgstr "Сеть %s не частная (10.x, 172.16-31.x, 192.168.x)." + +#: backend/i18n/messages.js +msgid "Network %s is not written like 192.168.2.0/24." +msgstr "Сеть %s записана не так: нужен вид 192.168.2.0/24." + +#: backend/i18n/messages.js +msgid "Network %s is taken on this server. Ask the admin which addresses are free." +msgstr "Сеть %s занята на этом сервере. Спросите администратора, какие адреса свободны." + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is behind %s (%s). Two sites need different addresses." +msgstr "Сеть %s занята: сеть %s стоит за роутером %s (%s). Двум площадкам нужны разные адреса." + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is behind your %s. Two sites need different addresses." +msgstr "Сеть %s занята: сеть %s стоит за вашим роутером %s. Двум площадкам нужны разные адреса." + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is the tunnel network of %s. The two ends of a tunnel need different addresses." +msgstr "Сеть %s занята: %s это сеть туннеля %s. Двум концам туннеля нужны разные адреса." + +#: backend/i18n/messages.js +msgid "Network %s is taken: the router has %s itself. The two ends of a tunnel need different addresses." +msgstr "Сеть %s занята: сеть %s есть у самого роутера. Двум концам туннеля нужны разные адреса." + +#: backend/i18n/messages.js +msgid "Network %s is too wide: /%d at the most." +msgstr "Сеть %s слишком широкая: не шире /%d." + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/net-values.ts +msgid "Network behind it" +msgstr "Сеть за ним" + +#: web/src/admin/widgets/config-card.ts +msgid "Network copied" +msgstr "Сеть скопирована" + +#: backend/i18n/messages.js msgid "Network interface %s already exists." msgstr "Сетевой интерфейс %s уже существует." -#: web/src/admin/interfaces.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/reach.ts msgid "Networks" msgstr "Сети" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js +msgid "Networks %s and %s share addresses." +msgstr "У сетей %s и %s общие адреса." + +#: backend/i18n/messages.js msgid "Networks a person does not reach cannot reach them either." msgstr "Из сетей, недоступных человеку, к нему тоже нельзя подключиться." -#: web/src/admin/pages/components/hero.ts -msgid "Never" -msgstr "Никогда" +#: web/src/admin/pages/settings/networks.ts +msgid "Networks behind %s" +msgstr "Сети за %s" -#: web/src/admin/pages/people.ts -msgid "Never connected" -msgstr "Подключений не было" +#: web/src/admin/flows/add-device.ts +#: web/src/admin/widgets/config-card.ts +msgid "Networks behind it" +msgstr "Сети за ним" -#: web/src/admin/pages/server.ts -msgid "Never reached from the internet yet - test with a phone on mobile data." -msgstr "Из интернета ещё никто не подключался - проверьте с телефона через мобильный интернет." +#: web/src/admin/pages/settings/networks.ts +msgid "Networks behind people’s routers" +msgstr "Сети за роутерами людей" -#: web/src/admin/access.ts -#: web/src/admin/pages/person/pickers.ts +#: backend/i18n/messages.js +msgid "Networks behind routers" +msgstr "Сети за роутерами" + +#: web/src/admin/flows/circle.ts +#: web/src/admin/widgets/visibility.ts msgid "New circle" msgstr "Новый круг" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/widgets/rollout.ts +msgid "New configuration" +msgstr "Новая настройка" + +#: web/src/admin/pages/people/notices.ts +msgid "New configuration for %s" +msgid_plural "New configuration for %s" +msgstr[0] "Новая настройка у %s" +msgstr[1] "Новая настройка у %s" +msgstr[2] "Новая настройка у %s" + +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/widgets/rollout.ts +msgid "New configuration: %s of %s" +msgstr "Новая настройка: у %s из %s" + +#: web/src/admin/pages/settings/disguise.ts +msgid "New disguise values" +msgstr "Новые значения маскировки" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/timeline.ts msgid "New keys" msgstr "Новые ключи" -#: web/src/admin/device.ts -msgid "New keys %s" -msgstr "Ключи обновлены %s" - -#: web/src/admin/device.ts -msgid "New keys generated" -msgstr "Новые ключи созданы" - #: web/src/admin/events/render.ts msgid "New keys issued for device %s on the portal" msgstr "Для устройства %s выпущены новые ключи через портал" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/flows/new-keys.ts +msgid "New keys · %s" +msgstr "Новые ключи · %s" + +#: web/src/admin/flows/invite.ts msgid "New link" msgstr "Новая ссылка" -#: web/src/admin/pages/person/dialogs.ts -msgid "New link copied" -msgstr "Новая ссылка скопирована" +#: web/src/admin/flows/invite.ts +msgid "New link made" +msgstr "Новая ссылка готова" -#: web/src/admin/pages/person/dialogs.ts -msgid "New link created" -msgstr "Новая ссылка создана" +#: web/src/admin/flows/invite.ts +msgid "New link made, %s device removed" +msgid_plural "New link made, %s devices removed" +msgstr[0] "Новая ссылка готова, удалено %s устройство" +msgstr[1] "Новая ссылка готова, удалено %s устройства" +msgstr[2] "Новая ссылка готова, удалено %s устройств" -#: web/src/admin/pages/person/dialogs.ts -msgid "New link created, %s device removed" -msgid_plural "New link created, %s devices removed" -msgstr[0] "Новая ссылка создана, %s устройство удалено" -msgstr[1] "Новая ссылка создана, %s устройства удалены" -msgstr[2] "Новая ссылка создана, %s устройств удалено" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts +#: web/src/admin/pages/settings/router/index.ts msgid "New people" msgstr "Новые люди" -#: web/src/admin/cores/awg.ts -msgid "New values applied" -msgstr "Новые значения применены" +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "New person" +msgstr "Новый человек" -#: web/src/admin/pages/components/index.ts -msgid "Newer than release" -msgstr "Новее релиза" +#: web/src/admin/pages/settings/disguise.ts +msgid "New values" +msgstr "Новые значения" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts +msgid "Newer than the release (%s)" +msgstr "Новее выпуска (%s)" + +#: web/src/admin/pages/settings/router/history.ts msgid "Newest events are kept when the log is full." msgstr "Когда журнал заполнен, сохраняются самые новые события." -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Next" msgstr "Далее" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Nightly" msgstr "Ночная" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Nightly when something changed, and before every restore, import or update. The last 10 are kept." msgstr "Каждую ночь, если что-то изменилось, а также перед каждым восстановлением, импортом и обновлением. Хранятся последние 10." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/settings/networks.ts +msgctxt "devices see each other" +msgid "No" +msgstr "Нет" + +#: backend/i18n/messages.js msgid "No %s build for OpenWrt %s in %s, or it could not be verified" msgstr "Нет сборки %s для OpenWrt %s в %s, или её не удалось проверить" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "No AmneziaWG build for OpenWrt %s (%s) yet" msgstr "Для OpenWrt %s (%s) пока нет сборки AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "No AmneziaWG build for OpenWrt %s yet" msgstr "Для OpenWrt %s пока нет сборки AmneziaWG" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-switches.ts msgid "No IPv4 network" msgstr "Нет сети IPv4" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No LAN detected." msgstr "LAN не обнаружена." -#: web/src/admin/interfaces.ts -msgid "No WAN found" -msgstr "WAN не найден" - -#: web/src/admin/device.ts -msgid "No activity yet." -msgstr "Событий пока нет." - -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "No answer" msgstr "Нет ответа" -#: web/src/admin/pages/settings/backups.ts -msgid "No backups yet." -msgstr "Резервных копий пока нет." +#: web/src/admin/pages/settings/router/backups.ts +msgid "No backups yet" +msgstr "Копий пока нет" -#: web/src/admin/pages/components/awg.ts -msgid "No build" -msgstr "Нет сборки" - -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "No circle" msgstr "Без круга" -#: web/src/admin/pages/person/limits.ts -msgid "No data limit" -msgstr "Без лимита трафика" +#: web/src/portal/ui/wait-way.ts +msgid "No connection yet" +msgstr "Подключения пока нет" -#: web/src/admin/pages/overview.ts -msgid "No device has connected yet" -msgstr "Ещё ни одно устройство не подключалось" +#: web/src/admin/pages/people/map-view.ts +msgid "No connections from a known place in this period." +msgstr "За этот период подключений с известным местом не было." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/events/timeline.ts +msgid "No connections in the %s" +msgstr "Подключений не было %s" + +#: web/src/admin/widgets/timeline.ts +msgid "No connections in this period" +msgstr "За этот период подключений не было" + +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/rollout.ts +msgid "No connections yet" +msgstr "Подключений не было" + +#: backend/i18n/messages.js msgid "No device uses %s" msgstr "Адрес %s не занят ни одним устройством" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "No devices found in the home network right now." msgstr "Сейчас в домашней сети не найдено устройств." -#: web/src/admin/pages/server.ts -msgid "No devices on this server yet: nothing else changes." -msgstr "На этом сервере пока нет устройств: больше ничего не изменится." +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "No devices yet" +msgstr "Ещё нет устройств" -#: web/src/admin/pages/person/limits.ts -msgid "No end" -msgstr "Бессрочно" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/widgets/term.ts msgid "No end date" msgstr "Бессрочно" -#: web/src/admin/pages/diagnostics/log.ts -msgid "No events match." -msgstr "Подходящих событий нет." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "No free address left on %s." msgstr "На сервере %s не осталось свободных адресов." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free address on %s." msgstr "В сети %s нет свободного адреса." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "No free addresses left in the server subnet." msgstr "В подсети сервера не осталось свободных адресов." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free link-local range for the internal link." msgstr "Для внутреннего канала нет свободного диапазона link-local." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free routing table." msgstr "Нет свободной таблицы маршрутизации." -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/net-switches.ts msgid "No home network: Home access reaches nothing but this router." msgstr "Нет домашней сети: с домашним доступом виден только этот роутер." -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "No junk packets." msgstr "Мусорных пакетов нет." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "No limit" +msgstr "Без лимита" + +#: web/src/admin/pages/settings/router/history.ts msgctxt "retention" msgid "No limit" msgstr "Без ограничений" @@ -4590,120 +5436,168 @@ msgid "No locations in this period." msgstr "За этот период мест нет." #: web/src/admin/map.ts -#: web/src/admin/pages/person/activity.ts msgid "No locations yet" msgstr "Мест пока нет" -#: web/src/admin/pages/components/hero.ts -msgid "No more versions." -msgstr "Больше версий нет." +#: web/src/admin/pages/log/days.ts +msgid "No log entry fits these filters." +msgstr "Под эти фильтры не подходит ни одна запись журнала." -#: web/src/admin/interfaces.ts -msgid "No netifd interface" -msgstr "Нет интерфейса netifd" +#: web/src/admin/pages/people/map-view.ts +msgid "No map of places" +msgstr "Карты мест нет" -#: web/src/admin/pages/people.ts -msgid "No one here right now." -msgstr "Сейчас здесь никого нет." +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/net-values.ts +msgid "No network behind it" +msgstr "Сети за ним нет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "No other policy routing ahead of the tunnel rules." msgstr "Другой маршрутизации по политикам перед правилами туннеля нет." -#: web/src/admin/pages/people.ts -msgid "No people yet. Add someone and send them their personal link." -msgstr "Пока никого нет. Добавьте человека и отправьте ему личную ссылку." +#: web/src/admin/pages/people/cards.ts +msgid "No people yet" +msgstr "Людей пока нет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/people/map-view.ts +msgid "No places in this period" +msgstr "Нет мест за этот период" + +#: backend/i18n/messages.js msgid "No previous AmneziaWG build is kept on the router" msgstr "На роутере нет сохранённой предыдущей сборки AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "No previous Dawnline version is kept on the router" msgstr "На роутере нет сохранённой предыдущей версии Dawnline" -#: web/src/admin/pages/diagnostics/health.ts -msgid "No problems in the last 7 days." -msgstr "За последние 7 дней проблем не было." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "No public address: devices will not know where to connect." msgstr "Нет публичного адреса: устройства не узнают, куда подключаться." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "No release %s in %s." msgstr "Нет релиза %s в %s." -#: web/src/admin/pages/people.ts -#: web/src/admin/ui/badges.ts -#: web/src/shared/format.ts +#: web/src/admin/pages/settings/networks.ts +msgid "No routers yet: a router is a person’s device of the kind «Router»." +msgstr "Роутеров пока нет: роутер добавляется человеку как устройство типа «Роутер»." + +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "No server" msgstr "Нет сервера" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/diagnosis.ts +msgid "No server chosen" +msgstr "Не выбран" + +#: web/src/admin/pages/overview/index.ts +msgid "No server is running" +msgstr "Ни один сервер не работает" + +#: backend/i18n/messages.js +#: web/src/admin/pages/people/index.ts msgid "No server yet" msgstr "Сервера пока нет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "No server yet." msgstr "Сервера пока нет." -#: web/src/admin/pages/people.ts -msgid "No server yet. %s before adding people." -msgstr "Сервера ещё нет. %s, прежде чем добавлять людей." +#: web/src/admin/flows/move-person.ts +msgid "No server yet: their devices have nowhere to connect." +msgstr "Сервера пока нет: устройствам некуда подключиться." -#: web/src/admin/access.ts -msgid "No services yet: pick ports of a device below." -msgstr "Сервисов пока нет: выберите порты устройства ниже." +#: web/src/admin/pages/settings/networks.ts +msgid "No services yet." +msgstr "Сервисов пока нет." -#: web/src/admin/widgets/tiles.ts -msgid "No traffic yet." -msgstr "Трафика пока нет." +#: web/src/admin/pages/people/index.ts +msgid "No such device" +msgstr "Устройства нет" -#: web/src/admin/cores/awg.ts -msgid "No values yet" -msgstr "Значений пока нет" +#: web/src/admin/pages/log/days.ts +msgid "No such entries" +msgstr "Таких записей нет" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/people/index.ts +msgid "No such person" +msgstr "Человека нет" + +#: web/src/admin/flows/versions.ts msgid "No versions found." msgstr "Версии не найдены." -#: web/src/admin/pages/server.ts -msgid "Nobody can connect. Turn it on to bring the tunnel back." -msgstr "Никто не может подключиться. Включите сервер, чтобы вернуть туннель." +#: web/src/admin/widgets/visibility.ts +msgid "Nobody" +msgstr "Никто" -#: web/src/admin/pages/person/pickers.ts -msgid "Nobody else in %s yet" -msgstr "В круге «%s» пока больше никого" +#: web/src/admin/flows/circle.ts +msgid "Nobody by that name." +msgstr "Никого с таким именем." -#: web/src/admin/pages/overview.ts -msgid "Nobody is connected" -msgstr "Никто не подключён" +#: web/src/admin/widgets/entry.ts +msgid "Nobody has reached it from the internet yet" +msgstr "Из интернета ещё никто не подключался" -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/ui/controls.ts +#: web/src/admin/pages/people/map-view.ts +msgid "Nobody is online now" +msgstr "Сейчас никого нет в сети" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody is online now." +msgstr "Сейчас никого нет в сети." + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody is paused." +msgstr "На паузе никого нет." + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody matches “%s”." +msgstr "Никого по запросу «%s»." + +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/people/cards.ts +msgid "Nobody on this server yet." +msgstr "На этом сервере пока никого." + +#: web/src/admin/pages/overview/waiting.ts +msgid "Nobody waits for a decision" +msgstr "Решения никто не ждёт" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody waits for a decision." +msgstr "Никто не ждёт решения." + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody waits for a new configuration." +msgstr "Никто не ждёт новую настройку." + +#: web/src/admin/pages/settings/router/defaults.ts msgid "None" msgstr "Нет" -#: web/src/admin/pages/people.ts -msgctxt "end date" -msgid "None" -msgstr "Бессрочно" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "None in use" +msgstr "Не нужны" #: web/src/admin/netcheck.ts msgid "None: without the tunnel those devices have no DNS." msgstr "Нет: без туннеля у этих устройств не будет DNS." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Normal" msgstr "Обычный" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Not a Dawnline export." msgstr "Файл не является экспортом Dawnline." -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Not a JSON file." msgstr "Это не файл JSON." @@ -4711,231 +5605,354 @@ msgstr "Это не файл JSON." msgid "Not a usable address (no spaces or quotes)." msgstr "Неподходящий адрес (без пробелов и кавычек)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Not a valid backup archive." msgstr "Файл не является корректным архивом резервной копии." -#: web/src/admin/pages/components/index.ts -msgid "Not checked" -msgstr "Не проверено" +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/entry.ts +#: web/src/admin/widgets/link-values.ts +#: web/src/admin/widgets/visibility.ts +msgid "Not applied yet. Now: %s" +msgstr "Ещё не применено. Сейчас: %s" -#: web/src/admin/ui/badges.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Not checked yet" +msgstr "Ещё не проверялось" + +#: web/src/admin/pages/settings/router/updates.ts +msgid "Not checked yet." +msgstr "Ещё не проверялось." + +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/people/diagnosis.ts +msgid "Not connected" +msgstr "Не подключено" + +#: web/src/admin/people/card.ts +msgid "Not connected for %s" +msgstr "Не подключался %s" + +#: web/src/admin/people/card.ts msgid "Not connected yet" -msgstr "Ещё не подключалось" +msgstr "Ещё не подключался" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "Not enough free space on the router: %d MB free, about %d MB needed. Remove old backups or packages first" msgstr "Недостаточно места на роутере: свободно %d МБ, нужно около %d МБ. Сначала удалите старые резервные копии или пакеты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Not every device is loaded into AmneziaWG" msgstr "Не все устройства загружены в AmneziaWG" -#: web/src/admin/interfaces.ts +#: web/src/admin/updater/jobs.ts +msgid "Not everything was checked" +msgstr "Проверено не всё" + +#: web/src/admin/widgets/rollout.ts +msgid "Not fetched yet" +msgstr "Ещё не забрали" + +#: web/src/admin/pages/settings/networks.ts msgid "Not found now: using %s." msgstr "Сейчас не найден: используется %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc -#: web/src/admin/interfaces.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/networks.ts msgid "Not found." msgstr "Не найден." -#: web/src/admin/interfaces.ts -msgid "Not in a firewall zone: the firewall rejects this traffic." -msgstr "Не в зоне межсетевого экрана: он отклоняет этот трафик." +#: web/src/admin/flows/restore.ts +msgid "Not imported" +msgstr "Не импортировано" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/updater/jobs.ts msgid "Not installed" msgstr "Не установлено" -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Not on this router" +msgstr "На этом роутере недоступно" + +#: web/src/admin/pages/settings/networks.ts msgid "Not present right now" msgstr "Сейчас отсутствует" -#: web/src/admin/pages/diagnostics/log.ts -msgid "Not recorded: %s." -msgstr "Не записываются: %s." +#: web/src/admin/flows/restore.ts +msgid "Not restored" +msgstr "Не восстановлено" -#: web/src/admin/pages/server.ts +#: web/src/admin/servers/state.ts msgid "Not running" msgstr "Не работает" -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts +#: web/src/admin/people/diagnosis.ts msgid "Not set up yet" msgstr "Ещё не настроено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Not set up." msgstr "Не настроено." -#: web/src/admin/pages/settings/portal.ts -msgid "Not set: the certificate is picked automatically." -msgstr "Не заданы: сертификат выбирается автоматически." +#: web/src/admin/flows/operation.ts +msgid "Not started" +msgstr "Не запущено" -#: web/src/admin/widgets/readouts.ts -msgid "Not used" -msgstr "Без трафика" - -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/ui/rail.ts msgid "Not working" msgstr "Не работает" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Not working: %s" msgstr "Не работает: %s" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note" msgstr "Заметка" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note removed" msgstr "Заметка удалена" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note saved" msgstr "Заметка сохранена" -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/people/person/head.ts +msgid "Note: %s. Edit" +msgstr "Заметка: %s. Изменить" + +#: web/src/admin/widgets/feed.ts +msgid "Nothing about them in the log yet." +msgstr "В журнале о нём пока ничего." + +#: web/src/admin/widgets/feed.ts +msgid "Nothing about this device in the log yet." +msgstr "В журнале об этом устройстве пока ничего нет." + +#: web/src/admin/flows/operation.ts msgid "Nothing else was changed." msgstr "Больше ничего не изменилось." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/people/cards.ts +msgid "Nothing found" +msgstr "Ничего не найдено" + +#: backend/i18n/messages.js msgid "Nothing listens on TCP %d." msgstr "TCP %d никто не слушает." -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Nothing matched" msgstr "Ничего не найдено" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: web/src/admin/pages/log/days.ts +msgid "Nothing matches “%s”." +msgstr "По запросу «%s» ничего нет." + +#: backend/i18n/messages.js +msgid "Nothing to change for %s." +msgstr "Для %s нечего менять." + +#: backend/i18n/messages.js +msgid "Nothing to change." +msgstr "Нечего менять." + +#: backend/i18n/messages.js msgid "Nothing to install" msgstr "Нечего устанавливать" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/settings.uc +#: backend/i18n/messages.js msgid "Nothing to save." msgstr "Нечего сохранять." -#: web/src/admin/pages/person/activity.ts -msgid "Nothing yet." -msgstr "Пока ничего нет." +#: web/src/admin/flows/restore.ts +msgid "Nothing was changed." +msgstr "Ничего не изменилось." -#: web/src/admin/pages/overview.ts -msgid "Nothing yet. Connections, new devices and pauses appear here." -msgstr "Пока ничего. Здесь появятся подключения, новые устройства и паузы." +#: web/src/admin/pages/people/map-view.ts +msgctxt "period" +msgid "Now" +msgstr "Сейчас" -#: web/src/admin/access.ts -msgid "Now in %s" -msgstr "Сейчас в круге «%s»" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/traffic.ts +msgctxt "speed" +msgid "Now" +msgstr "Сейчас" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Now %s. Updating restarts the service for a few seconds; tunnels stay up." +msgstr "Сейчас %s. Обновление перезапустит службу на несколько секунд, туннели не трогает." + +#: web/src/admin/flows/move-person.ts +msgid "Now on %s. Access, end date and limits stay." +msgstr "Сейчас: %s. Доступ, срок и лимиты остаются." + +#: web/src/admin/pages/settings/networks.ts msgid "Now: %s, was %s." msgstr "Сейчас: %s, было %s." -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Now: %s." msgstr "Сейчас: %s." -#: web/src/admin/pages/diagnostics/health.ts -msgid "OK" -msgstr "Работает" +#: web/src/admin/pages/people/card.ts +msgid "Of the limit" +msgstr "Из лимита" -#: web/src/admin/device-link.ts #: web/src/admin/disguise.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/edit-rows.ts +#: web/src/admin/widgets/disguise-levels.ts msgid "Off" msgstr "Выкл." +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts +msgctxt "keep-alive" +msgid "Off" +msgstr "Выкл." + +#: web/src/admin/pages/settings/router/portal.ts +msgctxt "portal" +msgid "Off" +msgstr "Выключен" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgctxt "updates" +msgid "Off" +msgstr "Не проверять" + #: web/src/admin/netcheck.ts msgid "Off: NAT may close the tunnel when idle, and “Connected” lags." msgstr "Выкл.: NAT может закрыть туннель при простое, а статус «Подключено» будет запаздывать." -#: web/src/admin/interfaces.ts -msgid "Off: internet traffic goes straight to the WAN, the fastest way. DNS still goes through this router. Proxies and filters here handle the tunnel only if you %s." -msgstr "Выкл.: интернет-трафик идёт прямо в WAN, это самый быстрый путь. DNS по-прежнему через роутер. Прокси и фильтры на роутере обработают туннель, только если вы %s." - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Off: only you add devices, from LuCI. On: people manage their devices within the limits you set." msgstr "Выкл.: устройства добавляете только вы, в LuCI. Вкл.: люди сами управляют своими устройствами в заданных вами пределах." -#: web/src/admin/pages/diagnostics/health.ts -msgid "Off: problems are only written to the log. Nothing is repaired on its own." -msgstr "Выключено: проблемы только записываются в журнал. Само ничего не исправляется." +#: web/src/admin/pages/settings/router/portal.ts +msgid "Off: personal links do not open." +msgstr "Выключен: личные ссылки не открываются." -#: web/src/admin/pages/people.ts +#: web/src/portal/setup.ts +msgid "Official release on GitHub" +msgstr "Официальная версия на GitHub" + +#: web/src/admin/widgets/timeline.ts msgid "Offline" msgstr "Не в сети" -#: web/src/admin/pages/settings/logs.ts -msgid "Older events are removed automatically." -msgstr "Более старые события удаляются автоматически." +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/people/card.ts +msgid "Offline for %s" +msgstr "Не в сети %s" -#: web/src/admin/logs.ts -msgid "Older than %s day" -msgid_plural "Older than %s days" -msgstr[0] "Старше %s дня" -msgstr[1] "Старше %s дней" -msgstr[2] "Старше %s дней" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Older than must be a number of days." msgstr "Возраст нужно указать числом дней." -#: web/src/admin/pages/components/hero.ts -msgid "Older →" -msgstr "Старше →" - -#: web/src/admin/device-link.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/edit-rows.ts msgid "On" msgstr "Вкл." -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts +#: web/src/portal/setup.ts msgid "On GitHub" msgstr "На GitHub" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "On one of the networks %s reaches." msgstr "В одной из сетей, доступных для %s." +#: web/src/admin/pages/settings/networks.ts +msgid "On request" +msgstr "По запросу" + +#: web/src/admin/pages/people/person/index.ts +msgid "On the map" +msgstr "На карте" + #: web/src/admin/events/model.ts msgid "On two devices at once" msgstr "На двух устройствах сразу" -#: web/src/admin/device-link.ts -msgid "On, except %s (home)" -msgstr "Вкл., кроме %s (дом)" +#: web/src/admin/people/diagnosis.ts +msgid "One configuration is on two devices, and they push each other out." +msgstr "Одна настройка стоит на двух устройствах, и они вытесняют друг друга." -#: web/src/admin/pages/server.ts -msgid "One more server: another port or disguise for networks where the first does not get through, or its own home access rules. People are moved between servers from their page." -msgstr "Ещё один сервер: другой порт или маскировка для сетей, где первый не проходит, или свои правила доступа к домашней сети. Людей переносят между серверами на их странице." +#: web/src/admin/flows/new-server.ts +msgid "One more server: another port or disguise for networks the first does not get through, or its own home access rules." +msgstr "Ещё один сервер: другой порт или маскировка для сетей, где первый не проходит, или свои правила доступа домой." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "One of the networks %s reaches." msgstr "Одна из сетей, доступных для %s." -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/widgets/reach.ts +msgid "One of the two must stay: otherwise their devices reach nothing." +msgstr "Один из двух доступов должен остаться: иначе устройствам некуда ходить." + +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/overview/now.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/timeline.ts msgid "Online" msgstr "В сети" -#: web/src/admin/map.ts -msgid "Online now" -msgstr "В сети" +#: web/src/admin/pages/people/card.ts +msgid "Online for %s" +msgstr "В сети %s" -#: web/src/admin/pages/person/pickers.ts -msgid "Only %s's own devices" -msgstr "%s: только свои устройства" +#: web/src/admin/widgets/rollout.ts +msgid "Online now, on the old configuration" +msgstr "В сети сейчас, со старой настройкой" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/overview/now.ts +msgid "Online now: %s" +msgstr "Сейчас в сети: %s" + +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/people/card.ts +msgid "Online since %s" +msgstr "В сети с %s" + +#: web/src/admin/people/lines.ts +msgid "Online · %s" +msgstr "В сети · %s" + +#: web/src/admin/people/diagnosis.ts +msgid "Online · data limit reached" +msgstr "В сети · лимит исчерпан" + +#: web/src/admin/events/timeline.ts +msgid "Online, but only the portal and the router’s DNS open." +msgstr "С тех пор в сети, но открываются только портал и DNS роутера." + +#: web/src/admin/pages/people/person/head.ts +msgid "Only a backup brings them back." +msgstr "Вернуть можно только из резервной копии." + +#: backend/i18n/messages.js +msgid "Only a router has networks behind it." +msgstr "Сети могут быть только за роутером." + +#: backend/i18n/messages.js msgid "Only devices of people with home access can be reached." msgstr "Доступны только устройства людей с доступом к домашней сети." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Only home devices reach people's devices." msgstr "Связаться с устройствами людей могут только домашние устройства." @@ -4943,53 +5960,57 @@ msgstr "Связаться с устройствами людей могут т msgid "Only letters, digits, - _ ." msgstr "Только буквы, цифры, - _ ." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Only people with home access reach other devices." msgstr "Связаться с другими устройствами могут только люди с доступом к домашней сети." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "Only the admin can change how a device connects." msgstr "Менять настройки подключения устройства может только администратор." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "Only the admin can turn devices off." msgstr "Отключать устройства может только администратор." -#: web/src/admin/pages/person/pickers.ts -msgid "Only the selected services at home." -msgstr "Только выбранные домашние сервисы." +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/timeline.ts +msgid "Only the portal and the router’s DNS" +msgstr "Только портал и DNS роутера" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Only you see this" msgstr "Видно только вам" -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/devices.ts msgid "Open" msgstr "Открыть" #: web/src/admin/map.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/settings/networks.ts msgid "Open %s" msgstr "Открыть «%s»" -#: web/src/admin/pages/server.ts -#: web/src/admin/widgets/health.ts -msgid "Open Components" -msgstr "Открыть компоненты" +#: web/src/portal/setup.ts +msgctxt "step" +msgid "Open %s" +msgstr "Откройте %s" -#: web/src/admin/pages/overview.ts -msgid "Open Diagnostics" -msgstr "Открыть диагностику" +#: backend/i18n/messages.js +msgid "Open Overview → Health." +msgstr "Откройте «Обзор» → «Состояние»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc -msgid "Open Diagnostics → Health." -msgstr "Откройте «Диагностика» → «Состояние»." +#: web/src/admin/flows/new-server.ts +#: web/src/admin/servers/fixes.ts +msgid "Open Updates" +msgstr "Открыть обновления" -#: web/src/admin/pages/people.ts -msgid "Open Settings" -msgstr "Открыть настройки" +#: web/src/portal/setup.ts +msgid "Open a terminal in the folder with the file" +msgstr "Откройте терминал в папке с файлом" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Open on GitHub" msgstr "Открыть на GitHub" @@ -4997,43 +6018,78 @@ msgstr "Открыть на GitHub" msgid "Open person" msgstr "Открыть страницу человека" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Open the OpenWrt package list" msgstr "Открыть список пакетов OpenWrt" -#: web/src/admin/invite.ts -msgid "Open the link or scan the code" -msgstr "Откройте ссылку или отсканируйте код" +#: web/src/admin/flows/places-closeup.ts +msgid "Open the device" +msgstr "Открыть устройство" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/pages/people/card.ts +msgid "Open the device %s" +msgstr "Открыть устройство %s" + +#: web/src/admin/pages/people/index.ts +msgid "Open the log" +msgstr "Открыть журнал" + +#: web/src/admin/widgets/place-rows.ts +msgid "Open the map and the replay" +msgstr "Открыть карту и повтор" + +#: web/src/admin/pages/people/device/link.ts +msgid "Open the server" +msgstr "Открыть сервер" + +#: web/src/admin/pages/people/map-view.ts +msgid "Open the setting" +msgstr "Открыть настройку" + +#: web/src/admin/flows/add-person.ts +msgid "Open their page" +msgstr "Открыть страницу человека" + +#: backend/i18n/messages.js msgid "Open this link over HTTPS to get the connection settings." msgstr "Чтобы получить настройки подключения, откройте эту ссылку по HTTPS." -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/people/diagnosis.ts +msgid "Open until %s" +msgstr "Открыт до %s" + +#: web/src/admin/people/diagnosis.ts +msgid "Open with no end date" +msgstr "Открыт, бессрочно" + +#: web/src/admin/flows/packages.ts msgid "OpenSSL for uhttpd" msgstr "OpenSSL для uhttpd" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/portal/setup.ts +msgid "OpenWrt packages" +msgstr "Пакеты OpenWrt" + +#: web/src/portal/setup.ts +msgid "OpenWrt packages + kmod" +msgstr "Пакеты OpenWrt + kmod" + +#: web/src/admin/flows/new-server.ts msgid "Opened on the WAN firewall automatically." msgstr "Порт открывается в межсетевом экране WAN автоматически." -#: web/src/admin/updater/operation.ts -msgid "Operation completed" -msgstr "Операция завершена" +#: web/src/admin/shell/waiting.ts +msgid "Opening the page" +msgstr "Открываем страницу" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "Operation failed" msgstr "Операция не удалась" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Operation log" msgstr "Журнал операции" -#: web/src/admin/updater/operation.ts -msgid "Operation started. Waiting for log output…" -msgstr "Операция запущена. Ожидание записей журнала…" - #: web/src/admin/netcheck.ts msgid "Optional. No data limit." msgstr "Необязательно. Без лимита трафика." @@ -5042,82 +6098,104 @@ msgstr "Необязательно. Без лимита трафика." msgid "Optional. No end date." msgstr "Необязательно. Без даты окончания." -#: web/src/admin/interfaces.ts +#: web/src/admin/flows/portal-sheets.ts +msgid "Or another one:" +msgstr "Или другой:" + +#: web/src/portal/setup.ts +msgid "Or, with wireguard-tools," +msgstr "Или через wireguard-tools:" + +#: web/src/admin/pages/people/filters.ts +msgid "Order" +msgstr "Порядок" + +#: web/src/admin/pages/people/filters.ts +msgid "Order: %s" +msgstr "Порядок: %s" + #: web/src/shared/format.ts msgid "Other" msgstr "Другое" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Other address" msgstr "Другой адрес" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/invite.ts +msgid "Other addresses" +msgstr "Ещё адреса" + +#: backend/i18n/messages.js msgid "Other addresses must be hostnames or IP addresses." msgstr "Другие адреса должны быть именами хостов или IP-адресами." -#: web/src/admin/interfaces.ts -msgid "Other interfaces" -msgstr "Другие интерфейсы" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Other policy routing bypasses the home-device path" msgstr "Другая маршрутизация по политикам обходит путь домашних устройств" -#: web/src/admin/pages/people.ts -#: web/src/shared/format.ts -msgid "Outside allowed hours" -msgstr "Вне часов доступа" +#: web/src/admin/flows/versions.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Other versions" +msgstr "Другие версии" -#: web/src/admin/ui/badges.ts -msgid "Outside hours" -msgstr "Вне расписания" - -#: web/src/admin/pages/person/devices.ts -msgid "Over the limit" -msgstr "Сверх лимита" - -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/person/devices.ts msgid "Over the limit: admins can still add" msgstr "Сверх лимита: администратор всё равно может добавить" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +msgid "Over the limit: on the portal they have %s, you can add more" +msgstr "Сверх лимита: на портале их %s, вы можете добавить больше" + +#: web/src/admin/pages/server/index.ts +#: web/src/admin/shell/nav.ts msgid "Overview" msgstr "Обзор" +#: web/src/admin/widgets/link-values.ts +msgid "Own" +msgstr "Своё" + +#: web/src/admin/widgets/link-values.ts +msgid "Own: %s" +msgstr "Своё: %s" + #: web/src/shared/format.ts msgid "PC" msgstr "Компьютер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Package installation failed" msgstr "Установка пакетов не удалась" -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Packages and versions" +msgstr "Пакеты и версии" + +#: web/src/admin/servers/params.ts msgid "Packet types" msgstr "Типы пакетов" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Padding" msgstr "Дополнение" -#: web/src/admin/pages/components/hero.ts -msgid "Page %s" -msgstr "Страница %s" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Parameters copied" msgstr "Параметры скопированы" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Parameters copied. The header protection key is in each device’s file." msgstr "Параметры скопированы. Ключ защиты заголовков есть в файле каждого устройства." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Paths on the router. Leave both empty to pick a certificate automatically." msgstr "Пути на роутере. Оставьте оба поля пустыми, чтобы сертификат выбирался автоматически." -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/people/pick.ts msgid "Pause" msgstr "Приостановить" @@ -5126,14 +6204,15 @@ msgctxt "replay" msgid "Pause" msgstr "Пауза" -#: web/src/admin/pages/person/dialogs.ts -msgid "Pause access" -msgstr "Приостановить доступ" +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/pick.ts +msgid "Pause lifted" +msgstr "Пауза снята" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/ui/badges.ts -#: web/src/shared/format.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Paused" msgstr "На паузе" @@ -5145,28 +6224,46 @@ msgstr "Приостановится после %s ГБ за всё время." msgid "Paused after %s GB this month, resumed on the 1st." msgstr "Приостановится после %s ГБ за месяц и возобновится 1-го числа." -#: web/src/admin/pages/people.ts -msgid "Paused until it resets on %s" -msgstr "На паузе до сброса лимита %s" +#: web/src/admin/pages/people/pick.ts +msgid "Paused again" +msgstr "Снова на паузе" -#: web/src/admin/pages/people.ts -msgid "Paused until the limit is raised" -msgstr "На паузе, пока лимит не увеличат" +#: backend/i18n/messages.js +msgid "Paused must be true or false." +msgstr "Пауза: нужно true или false." -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/access.ts +#: web/src/admin/people/card.ts +msgid "Paused since %s" +msgstr "На паузе с %s" + +#: web/src/admin/people/lines.ts +msgid "Paused · access ended" +msgstr "На паузе · доступ закончился" + +#: web/src/admin/pages/settings/check.ts +msgid "Paused, ended and over-the-limit people reach nothing." +msgstr "Люди на паузе, с закончившимся доступом или исчерпанным лимитом не доходят никуда." + +#: web/src/admin/pages/people/pick.ts +msgid "Paused: %s" +msgstr "На паузе: %s" + +#: backend/i18n/messages.js #: web/src/admin/events/model.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/index.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/index.ts msgid "People" msgstr "Люди" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "People and devices are inconsistent" msgstr "Данные людей и устройств не согласованы" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "People and devices consistent" msgstr "Данные людей и устройств согласованы" @@ -5174,34 +6271,43 @@ msgstr "Данные людей и устройств согласованы" msgid "People and their devices added, changed, paused, removed" msgstr "Люди и их устройства: добавление, изменение, пауза, удаление" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "People limited to this service lose access to it." msgstr "Люди, у которых доступ только к этому сервису, потеряют его." -#: web/src/admin/interfaces.ts -msgid "People with Home or Both" -msgstr "Для людей с доступом к домашней сети" +#: web/src/admin/flows/restore.ts +msgid "People, devices and servers from a Dawnline export (usage history is not in it)." +msgstr "Люди, устройства и серверы из выгрузки Dawnline (истории трафика в ней нет)." -#: web/src/admin/interfaces.ts -msgid "People with Internet or Both" -msgstr "Для людей с доступом в интернет" +#: web/src/admin/pages/settings/router/portal.ts +msgid "People’s links work on every address; the first is the main one and goes into invitations." +msgstr "Ссылки людей работают на каждом адресе; первый - основной, он стоит в приглашениях." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/networks.ts +msgid "People’s pages offer no «Router» among the kinds: only you add one, on a person’s page." +msgstr "На личных страницах нет типа «Роутер»: его добавляете только вы, на странице человека." + +#: web/src/admin/pages/settings/router/history.ts msgid "Per-day history behind the charts." msgstr "Дневная история для графиков." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Per-month totals; data limits use the current month." msgstr "Итоги по месяцам; лимиты трафика считаются по текущему месяцу." +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts +msgid "Period" +msgstr "Период" + #: web/src/admin/logs.ts +#: web/src/admin/pages/log/filters.ts msgid "Person" msgstr "Человек" -#: web/src/admin/events/render.ts -msgid "Person %s - all devices removed, end date reached" -msgstr "%s: все устройства удалены - наступила дата окончания" - #: web/src/admin/events/render.ts msgid "Person %s added device %s" msgstr "%s: добавлено устройство %s" @@ -5214,6 +6320,10 @@ msgstr "%s: добавлено устройство %s через портал" msgid "Person %s changed device %s on their portal" msgstr "Пользователь %s изменил настройки устройства %s в личном портале" +#: web/src/admin/events/render.ts +msgid "Person %s has data again after the limit" +msgstr "%s: трафик снова доступен" + #: web/src/admin/events/render.ts msgid "Person %s issued new keys for device %s on their portal" msgstr "%s: выпущены новые ключи для устройства %s через портал" @@ -5226,6 +6336,10 @@ msgstr "%s: доступ приостановлен" msgid "Person %s paused - %s" msgstr "%s: доступ приостановлен - %s" +#: web/src/admin/events/render.ts +msgid "Person %s reached the data limit" +msgstr "%s: лимит трафика исчерпан" + #: web/src/admin/events/render.ts msgid "Person %s removed device %s" msgstr "%s: удалено устройство %s" @@ -5246,19 +6360,19 @@ msgstr "%s: доступ возобновлён" msgid "Person %s resumed - %s" msgstr "%s: доступ возобновлён - %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: circle %s does not exist." msgstr "Человек %s: круга %s нет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: has the same personal link as %s." msgstr "Человек %s: личная ссылка совпадает со ссылкой человека %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: home service %s does not exist." msgstr "Человек %s: домашнего сервиса %s нет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: server %s does not exist." msgstr "Человек %s: сервера %s нет." @@ -5273,37 +6387,28 @@ msgstr[2] "%s: доступ закончится через %s дней" msgid "Person %s’s access ends in a few days" msgstr "%s: доступ закончится через несколько дней" -#: web/src/admin/events/render.ts -msgid "Person %s’s end date passed (%s) · access kept" -msgstr "%s: дата окончания прошла (%s) · доступ сохранён" +#: web/src/admin/pages/log/filters.ts +msgid "Person: %s" +msgstr "Человек: %s" -#: web/src/admin/pages/person/index.ts -msgid "Person not found" -msgstr "Человек не найден" - -#: web/src/admin/pages/people.ts -msgid "Person removed" -msgstr "Человек удалён" - -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/invite.ts msgid "Personal link copied" msgstr "Личная ссылка скопирована" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "Personal links" msgstr "Личные ссылки" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js #: web/src/admin/events/render.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Personal portal" msgstr "Личный портал" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Personal portal isn’t working" msgstr "Личный портал не работает" @@ -5311,63 +6416,70 @@ msgstr "Личный портал не работает" msgid "Phone" msgstr "Телефон" -#: web/src/admin/pages/settings/portal.ts -msgid "Pick one or more; the first is the main link" -msgstr "Выберите один или несколько; первый - для основной ссылки" +#: web/src/admin/pages/people/map-view.ts +msgid "Pick a period to see where they connected from before." +msgstr "Выберите период, чтобы увидеть, откуда подключались раньше." -#: web/src/admin/pages/settings/portal.ts -msgid "Plain HTTP" -msgstr "Обычный HTTP" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Pick automatically" +msgstr "Выбирать автоматически" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/portal/setup.ts +msgid "Pick the file and connect" +msgstr "Выберите файл и подключитесь" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/index.ts +msgid "Places" +msgstr "Места" + +#: backend/i18n/messages.js msgid "Plain HTTP links" msgstr "Ссылки по обычному HTTP" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Plain HTTP: the link and VPN keys travel unencrypted" msgstr "Обычный HTTP: ссылка и ключи VPN передаются без шифрования" -#: web/src/admin/cores/awg.ts -msgid "Plain WireGuard" -msgstr "Обычный WireGuard" - #: web/src/admin/disguise.ts -msgid "Plain WireGuard-compatible traffic. Fastest, but easy to recognise and block." -msgstr "Обычный трафик, совместимый с WireGuard. Самый быстрый, но его легко распознать и заблокировать." +msgid "Plain WireGuard. Fast, but easy to recognise and block." +msgstr "Обычный WireGuard. Быстро, но легко узнать и заблокировать." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Plain resolver on port %d." msgstr "Простой резолвер на порту %d." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Plain resolver running next to the LAN (%s)." msgstr "Простой резолвер работает рядом с LAN (%s)." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at %s, not this router" msgstr "Указывает на %s, а не на этот роутер" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at this router · Let’s Encrypt certificate" msgstr "Указывает на этот роутер · сертификат Let’s Encrypt" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at this router · no certificate yet" msgstr "Указывает на этот роутер · сертификата пока нет" -#: web/src/admin/pages/settings/portal.ts -msgid "Points here" -msgstr "Указывает сюда" +#: web/src/admin/widgets/entry.ts +msgid "Points to this router" +msgstr "Указывает на этот роутер" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Policy routing and the veth pair" msgstr "Маршрутизация по политикам и пара veth" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Policy routing on the router (%s) sends marked traffic straight out, past the home-device path: tunnel traffic it matches skips your LAN's proxies and filters." msgstr "Маршрутизация по политикам на роутере (%s) отправляет помеченный трафик напрямую, в обход пути домашних устройств: трафик туннеля, который под неё попадает, минует прокси и фильтры вашей LAN." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Port" msgstr "Порт" @@ -5378,110 +6490,111 @@ msgstr[0] "Порт %s." msgstr[1] "Порты %s." msgstr[2] "Порты %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js +msgid "Port is free" +msgstr "Порт свободен" + +#: backend/i18n/messages.js msgid "Port must be 1-65535." msgstr "Порт: от 1 до 65535." -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Port of %s" msgstr "Порт %s" -#: web/src/admin/cores/awg.ts -msgid "Port, MTU and keep-alive apply at once." -msgstr "Порт, MTU и keep-alive применяются сразу." +#: web/src/admin/pages/settings/router/portal.ts +msgid "Port: %s" +msgstr "Порт: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js #: web/src/admin/events/model.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/first.ts msgid "Portal" msgstr "Портал" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address" msgstr "Адрес портала" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address doesn’t point here" msgstr "Адрес портала ведёт не сюда" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address isn’t set" msgstr "Адрес портала не задан" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address points here" msgstr "Адрес портала ведёт сюда" -#: web/src/admin/pages/settings/portal.ts -msgid "Portal addresses" -msgstr "Адреса портала" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal answers may not reach visitors" msgstr "Ответы портала могут не доходить до посетителей" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal answers reach visitors" msgstr "Ответы портала доходят до посетителей" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal certificate" msgstr "Сертификат портала" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal certificate needs attention" msgstr "Сертификат портала требует внимания" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Portal is off" msgstr "Портал выключен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/rollout.ts +msgid "Portal link · %s" +msgstr "Ссылка на портал · %s" + +#: web/src/admin/widgets/rollout.ts +msgid "Portal link · %s copied" +msgstr "Ссылка на портал · %s скопирована" + +#: backend/i18n/messages.js msgid "Portal links use plain HTTP" msgstr "Ссылки на портал идут по обычному HTTP" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Portal port must be 1-65535." msgstr "Порт портала: от 1 до 65535." -#: web/src/admin/pages/server.ts -msgid "Portal port: %s" -msgstr "Порт портала: %s" - -#: web/src/admin/pages/settings/portal.ts -msgid "Portal running" -msgstr "Портал работает" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Ports" msgstr "Порты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Ports %s" msgstr "Порты %s" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Ports they announce over Bonjour. Pick what to open, or all ports." msgstr "Порты, которые устройства объявляют через Bonjour. Выберите, что открыть, или все порты." -#: web/src/admin/interfaces.ts -msgid "Ports: %s" -msgstr "Порты: %s" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Pre-filled when you add someone." msgstr "Подставляется при добавлении человека." -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/versions.ts +#: web/src/admin/flows/whats-new.ts msgid "Pre-release" msgstr "Пререлиз" -#: web/src/admin/access.ts +#: web/src/admin/pages/overview/now.ts +msgid "Previous %s" +msgstr "Предыдущие %s" + +#: web/src/admin/flows/home-service.ts msgid "Printer" msgstr "Принтер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Private addresses outside the home network are blocked." msgstr "Частные адреса вне домашней сети заблокированы." @@ -5489,923 +6602,913 @@ msgstr "Частные адреса вне домашней сети забло msgid "Problems" msgstr "Проблемы" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Protection" msgstr "Защита" -#: web/src/admin/pages/settings/map.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Provider" msgstr "Сервис" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +msgid "Proxies and filters" +msgstr "Прокси и фильтры" + +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts msgid "Public address" msgstr "Публичный адрес" -#: web/src/admin/pages/overview.ts -msgid "Public address changed: %s still gives devices %s, the router is %s now." -msgstr "Публичный адрес изменился: сервер %s всё ещё выдаёт устройствам %s, а у роутера теперь %s." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Public address must be a hostname or IP address." msgstr "Публичный адрес должен быть именем хоста или IP-адресом." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Public address needs attention" msgstr "Публичный адрес требует внимания" -#: web/src/admin/pages/server.ts -msgid "Public address: %s" -msgstr "Публичный адрес: %s" - -#: web/src/admin/device.ts -msgid "Public key" -msgstr "Публичный ключ" - -#: web/src/admin/cores/awg.ts -msgid "Public key copied" -msgstr "Публичный ключ скопирован" - -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts #: web/src/shared/qr.ts msgid "QR code" msgstr "QR-код" -#: web/src/admin/pages/person/devices.ts -msgid "QR, file, key, rename, new keys, remove" -msgstr "QR-код, файл, ключ, переименование, новые ключи, удаление" +#: web/src/portal/setup.ts +msgctxt "AmneziaVPN app" +msgid "QR code" +msgstr "QR-код" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Random bytes in front of handshake, cookie and data packets, so their sizes do not match WireGuard." msgstr "Случайные байты перед пакетами рукопожатия, cookie и данных, чтобы их размеры не совпадали с WireGuard." -#: web/src/admin/widgets/access-picker.ts -msgid "Reach devices at home (NAS, printer, cameras). Internet stays on their own connection." -msgstr "Доступ к домашним устройствам (NAS, принтер, камеры). Интернет - через собственное подключение." +#: web/src/admin/widgets/entry.ts +msgid "Reached from the internet" +msgstr "Доходит из интернета" -#: web/src/admin/pages/person/limits.ts -msgid "Reach devices at home, and home reaches theirs. Internet stays on their own connection." -msgstr "Доступ к домашним устройствам, а из дома - к устройствам человека. Интернет - через собственное подключение." +#: web/src/admin/pages/settings/networks.ts +msgid "Read again" +msgstr "Прочитать заново" -#: web/src/admin/pages/server.ts -msgid "Reached from the internet %s." -msgstr "Последнее подключение из интернета: %s." +#: web/src/admin/shell/waiting.ts +msgid "Reading the router" +msgstr "Читаем роутер" -#: web/src/admin/interfaces.ts -msgid "Read the interfaces again" -msgstr "Заново прочитать интерфейсы" - -#: web/src/admin/pages/settings/portal.ts -msgid "Ready" -msgstr "Готово" - -#: web/src/admin/pages/settings/portal.ts -msgid "Ready to share" -msgstr "Можно делиться ссылками" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Recent problems" -msgstr "Недавние проблемы" - -#: web/src/admin/pages/settings/portal.ts -msgid "Recommended" -msgstr "Рекомендуется" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Record" msgstr "Записывать" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Redirect must be a full http:// or https:// address." msgstr "Перенаправление должно вести на полный адрес http:// или https://." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "Refreshing package lists" msgstr "Обновление списков пакетов" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Reinstall" +msgstr "Переустановить" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstall %s" msgstr "Переустановить %s" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Reinstall AmneziaWG?" +msgstr "Переустановить AmneziaWG?" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstall this build" msgstr "Переустановить эту сборку" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstalling AmneziaWG" msgstr "Переустановка AmneziaWG" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstalling Dawnline" msgstr "Переустановка Dawnline" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "RejectAfterTime must be at most 180 seconds." msgstr "RejectAfterTime: не больше 180 секунд." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s has no %s: it stays as it is" msgstr "В релизе %s нет %s: остаётся как есть" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s has no translation into %s: install a release that has one" msgstr "В релизе %s нет перевода на язык %s: установите релиз, в котором он есть" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s publishes no checksum for %s: not installing an unverified package" msgstr "Релиз %s не публикует контрольную сумму для %s: непроверенный пакет устанавливаться не будет" -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "Release notes copied" msgstr "Описание релиза скопировано" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Release tag" msgstr "Тег релиза" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Reload devices" msgstr "Обновить устройства" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "Reload now" msgstr "Обновить страницу" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Reloading the kernel module (%d tunnel restarts)" msgid_plural "Reloading the kernel module (%d tunnels restart)" msgstr[0] "Перезагрузка модуля ядра (перезапускается %d туннель)" msgstr[1] "Перезагрузка модуля ядра (перезапускаются %d туннеля)" msgstr[2] "Перезагрузка модуля ядра (перезапускаются %d туннелей)" -#: web/src/admin/updater/operation.ts -msgid "Reloading the page…" -msgstr "Перезагружаем страницу…" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Remote desktop" msgstr "Удалённый рабочий стол" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/server/settings.ts +msgid "Removal" +msgstr "Удаление" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/flows/uninstall.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/server-bar.ts +#: web/src/admin/widgets/net-values.ts msgid "Remove" msgstr "Удалить" -#: web/src/admin/access.ts +#: web/src/admin/widgets/net-values.ts msgid "Remove %s" -msgstr "Удалить «%s»" +msgstr "Убрать %s" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Remove %s?" msgstr "Удалить «%s»?" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/remove.ts msgid "Remove Dawnline" msgstr "Удалить Dawnline" -#: web/src/admin/pages/settings/danger.ts -msgid "Remove Dawnline from this router" -msgstr "Удалить Dawnline с этого роутера" - -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/flows/uninstall.ts msgid "Remove Dawnline?" msgstr "Удалить Dawnline?" -#: web/src/admin/pages/person/pickers.ts -msgid "Remove a device first to lower the limit" -msgstr "Чтобы уменьшить лимит, сначала удалите устройство" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Remove the Russian translation" +msgstr "Убрать русский перевод" -#: web/src/admin/pages/server.ts -msgid "Remove server" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Remove the Russian translation?" +msgstr "Убрать русский перевод?" + +#: web/src/admin/ui/filter-bar.ts +msgid "Remove the filter" +msgstr "Убрать фильтр" + +#: web/src/admin/ui/filter-bar.ts +msgid "Remove the filter: %s" +msgstr "Убрать фильтр: %s" + +#: web/src/admin/pages/server/settings.ts +msgid "Remove the server" msgstr "Удалить сервер" -#: web/src/admin/pages/person/dialogs.ts -msgid "Remove their devices" -msgstr "Удалить устройства" +#: web/src/admin/flows/invite.ts +msgid "Remove with it" +msgstr "Удалить вместе с ней" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -msgid "Removed" -msgstr "Удалено" +#: web/src/admin/pages/log/filters.ts +msgid "Removed device" +msgstr "Удалённое устройство" -#: web/src/admin/device.ts -msgid "Removed %s" -msgstr "Удалено %s" +#: web/src/admin/pages/log/filters.ts +msgid "Removed person" +msgstr "Удалённый человек" -#: web/src/admin/pages/person/activity.ts -msgid "Removes events about %s and their devices." -msgstr "Удаляет события о человеке %s и его устройствах." - -#: web/src/admin/device.ts -msgid "Removes events about %s." -msgstr "Будут удалены события устройства «%s»." - -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Removes events from the log on the router." msgstr "Удаляет события из журнала на роутере." -#: web/src/admin/pages/server.ts -msgid "Removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first." -msgid_plural "Removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first." -msgstr[0] "Удаляет туннель, его правила межсетевого экрана и %s человека со всеми устройствами. Сначала создаётся резервная копия." -msgstr[1] "Удаляет туннель, его правила межсетевого экрана и %s человек со всеми устройствами. Сначала создаётся резервная копия." -msgstr[2] "Удаляет туннель, его правила межсетевого экрана и %s человек со всеми устройствами. Сначала создаётся резервная копия." - -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Removing the Russian translation" msgstr "Удаление русского перевода" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Removing the translation" msgstr "Удаление перевода" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Rename" msgstr "Переименовать" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Rename %s" msgstr "Переименовать «%s»" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/dialogs.ts -msgid "Renamed" -msgstr "Переименовано" +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/server/settings.ts +msgid "Renamed: %s" +msgstr "Новое имя: %s" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Repair" msgstr "Исправить" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Repaired by the watchdog at %s" -msgstr "Исправлено автовосстановлением в %s" +#: web/src/admin/flows/restore.ts +msgid "Replace people, devices and servers" +msgstr "Заменить людей, устройства и серверы" -#: web/src/admin/pages/settings/backups.ts -msgid "Replace the current Dawnline configuration with %s? The current state is backed up first." -msgstr "Заменить текущую конфигурацию Dawnline на %s? Сначала текущее состояние сохранится в резервную копию." +#: web/src/admin/flows/restore.ts +msgid "Replaces everything Dawnline has now. The current state is backed up first." +msgstr "Заменит всё, что сейчас в Dawnline. Перед этим Dawnline сам сделает копию текущего состояния." #: web/src/admin/places/render.ts msgid "Replay this period" msgstr "Воспроизвести период" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/people/diagnosis.ts +msgid "Request declined" +msgstr "Запрос отклонён" + +#: backend/i18n/messages.js msgid "Request too large." msgstr "Слишком большой запрос." -#: web/src/admin/interfaces.ts -msgid "Rescan" -msgstr "Обновить" - -#: web/src/admin/device.ts -#: web/src/admin/logs.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/filter-bar.ts msgid "Reset" msgstr "Сбросить" -#: web/src/admin/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Reset all traffic history?" msgstr "Сбросить всю историю трафика?" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/days.ts +#: web/src/admin/pages/people/cards.ts +msgid "Reset the filters" +msgstr "Сбросить фильтры" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Reset traffic" +msgstr "Сбросить трафик" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Reset traffic history for %s?" msgstr "Сбросить историю трафика: %s?" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/limit-meter.ts msgid "Reset usage" -msgstr "Сбросить трафик" +msgstr "Сбросить использование" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/widgets/limit-meter.ts +msgid "Reset usage for %s?" +msgstr "Сбросить использование: %s?" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Resets in %s" +msgstr "Сбросится через %s" + +#: backend/i18n/messages.js msgid "Resolver" msgstr "Резолвер" -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts +#: web/src/admin/servers/fixes.ts msgid "Restart network" msgstr "Перезапустить сеть" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Restart service" msgstr "Перезапустить службу" -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts msgid "Restart the network?" msgstr "Перезапустить сеть?" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Restarting the network so it knows AmneziaWG (connections drop for a few seconds)" msgstr "Перезапуск сети, чтобы она узнала об AmneziaWG (соединения прервутся на несколько секунд)" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Restarting the network so it knows AmneziaWG: back in a few seconds" msgstr "Перезапускаем сеть, чтобы она узнала об AmneziaWG: через несколько секунд всё вернётся" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Restarting with the new settings." msgstr "Перезапускается с новыми настройками." -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Restore" msgstr "Восстановить" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +msgid "Restore a backup" +msgstr "Восстановить копию" + +#: web/src/admin/pages/settings/first.ts +msgid "Restore from a backup" +msgstr "Восстановить из копии" + +#: web/src/admin/pages/settings/router/backups.ts msgid "Restore from file" msgstr "Восстановить из файла" -#: web/src/admin/pages/settings/backups.ts -msgid "Restore from file?" -msgstr "Восстановить из файла?" +#: web/src/admin/flows/restore.ts +msgid "Restore the files" +msgstr "Восстановить файлы" -#: web/src/admin/pages/settings/backups.ts -msgid "Restore this backup?" -msgstr "Восстановить эту копию?" - -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Restored" msgstr "Восстановлено" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/people/lines.ts msgid "Resume" msgstr "Возобновить" -#: web/src/admin/pages/person/header.ts -msgid "Resumed" -msgstr "Доступ возобновлён" +#: web/src/admin/pages/people/device/link.ts +msgid "Resume access" +msgstr "Возобновить" -#: web/src/admin/pages/people.ts -msgid "Right now" -msgstr "Прямо сейчас" +#: web/src/admin/pages/people/pick.ts +msgid "Resumed: %s" +msgstr "Возобновлено: %s" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/ui/rename-title.ts +msgid "Return to save, Esc to cancel" +msgstr "Return сохраняет, Esc отменяет" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back" msgstr "Откатить" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back AmneziaWG to %s?" msgstr "Откатить AmneziaWG до %s?" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back to %s" msgstr "Откатить до %s" -#: web/src/admin/pages/components/hero.ts -msgid "Roll back to Dawnline %s?" -msgstr "Откатить Dawnline до %s?" - -#: web/src/admin/pages/components/hero.ts -msgid "Rollback" -msgstr "Откат" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Rolling back AmneziaWG" msgstr "Откат AmneziaWG" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Rolling back Dawnline" msgstr "Откат Dawnline" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Rolling back to %s" msgstr "Откат на версию %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/settings/networks.ts #: web/src/shared/format.ts msgid "Router" msgstr "Роутер" -#: web/src/admin/pages/settings/updates.ts -msgid "Run a check or an update by hand in Components." -msgstr "Проверить или обновить вручную можно в «Компонентах»." +#: web/src/admin/flows/behind-ask.ts +msgid "Router %s accepted" +msgstr "Роутер %s принят" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Run again" -msgstr "Повторить" +#: web/src/admin/pages/settings/networks.ts +msgid "Routers on people’s pages" +msgstr "Роутеры на личных страницах" -#: web/src/admin/pages/people.ts -msgid "Run the setup wizard" -msgstr "Запустите мастер настройки" +#: backend/i18n/messages.js +msgid "Routes" +msgstr "Маршруты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "Run the setup wizard on the Server tab." -msgstr "Запустите мастер настройки на вкладке «Сервер»." +#: web/src/portal/setup.ts +msgid "Run" +msgstr "Выполните" -#: web/src/admin/pages/server.ts +#: web/src/admin/servers/state.ts msgid "Running" msgstr "Работает" -#: web/src/admin/pages/diagnostics/health.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/overview/health.ts msgid "Running checks…" msgstr "Идут проверки…" +#: web/src/admin/servers/state.ts +msgid "Running for %s" +msgstr "Работает %s" + #: web/src/admin/netcheck.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Runs within an hour after %s (router time)." msgstr "Запускается в течение часа после %s (по времени роутера)." -#: web/src/admin/pages/components/hero.ts -msgid "Russian" -msgstr "Русский" - -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Russian translation" msgstr "Русский перевод" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "S2 must not be S1 + 56: the handshake initiation and response would have the same size." msgstr "S2 не может равняться S1 + 56: начальный и ответный пакеты рукопожатия будут одного размера." -#: web/src/admin/access.ts -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts -#: web/src/admin/device.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/map.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/flows/text-sheet.ts msgid "Save" msgstr "Сохранить" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Save the log every 10min, hourly or off." msgstr "Сохранение журнала: каждые 10 минут, каждый час или выключено." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Save to flash" msgstr "Запись во флеш-память" -#: web/src/admin/access.ts -#: web/src/admin/device-link.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/map.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pages/settings/updates.ts -msgid "Saved" -msgstr "Сохранено" - -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Saves the replaced Dawnline or AmneziaWG package on flash, so Roll back works without internet. Under 1 MB." msgstr "Хранит заменённый пакет Dawnline или AmneziaWG во флеш-памяти, чтобы откат работал без интернета. Меньше 1 МБ." -#: web/src/admin/invite.ts +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Scan from QR code" +msgstr "Сканировать QR-код" + +#: web/src/admin/flows/setup.ts +msgid "Scan it with the app on the device" +msgstr "Отсканируйте приложением на устройстве" + +#: web/src/admin/flows/invite-card.ts msgid "Scan to connect to %s" msgstr "Сканируйте для подключения к %s" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -msgid "Scan with AmneziaVPN or AmneziaWG on the device." -msgstr "Отсканируйте в AmneziaVPN или AmneziaWG на устройстве." - -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -msgid "Scan with AmneziaVPN or any WireGuard app on the device." -msgstr "Отсканируйте в AmneziaVPN или любом приложении WireGuard на устройстве." - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Screen sharing" msgstr "Общий экран" +#: web/src/admin/widgets/link-values.ts +msgid "Seconds" +msgstr "Секунды" + +#: web/src/admin/widgets/config-card.ts +msgid "Seconds, or empty: as the server" +msgstr "Секунды, или пусто: как у сервера" + #: web/src/admin/netcheck.ts msgid "Seconds. Empty: as the server. Longer saves battery; behind some NATs it then drops." msgstr "В секундах. Пусто: как у сервера. Чем дольше, тем меньше расход батареи, но за некоторыми NAT связь тогда рвётся." -#: web/src/admin/pages/overview.ts -msgid "Seen recently" -msgstr "Недавно в сети" +#: web/src/admin/ui/rail.ts +msgid "Sections" +msgstr "Разделы" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/visibility.ts +msgid "See each other" +msgstr "Видят друг друга" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Seen at home as %s" +msgstr "Видны дома как %s" + +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/pick.ts +msgid "Select" +msgstr "Выбрать" + +#: web/src/admin/pages/people/cards.ts +#: web/src/admin/pages/people/pick.ts +msgid "Select all" +msgstr "Выбрать всех" + +#: web/src/admin/pages/people/index.ts +msgid "Select several: extend, pause, resume. Or hold a card." +msgstr "Выбрать нескольких: продлить, приостановить, возобновить. Или удерживайте карточку." + +#: web/src/admin/pages/people/pick.ts +msgid "Selected: %s" +msgstr "Выбрано: %s" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Self-signed" msgstr "Самоподписанный" -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -msgid "Send %s the card or the link. They open it, add their devices and connect - no account needed." -msgstr "Отправьте карточку или ссылку: %s откроет её, добавит свои устройства и подключится - аккаунт не нужен." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js #: web/src/admin/events/render.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/first.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/feed.ts msgid "Server" msgstr "Сервер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Server %d" msgstr "Сервер %d" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/people/card.ts +msgid "Server %s is turned off" +msgstr "Сервер %s выключен" + +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/overview/servers.ts +msgid "Server %s turned off again" +msgstr "Сервер %s снова выключен" + +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/overview/servers.ts +msgid "Server %s turned on" +msgstr "Сервер %s включён" + +#: backend/i18n/messages.js msgid "Server %s: %s" msgstr "Сервер %s: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: %s is one of the router's own network interfaces." msgstr "Сервер %s: %s - один из собственных сетевых интерфейсов роутера." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: UDP %s is also used by %s." msgstr "Сервер %s: порт UDP %s уже занят сервером %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: interface %s is also used by %s." msgstr "Сервер %s: интерфейс %s уже занят сервером %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Server ID may use lowercase letters, digits and underscores." msgstr "В ID сервера можно использовать строчные латинские буквы, цифры и подчёркивания." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Server configured" msgstr "Сервер настроен" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Server created" msgstr "Сервер создан" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Server is disabled." msgstr "Сервер выключен." -#: web/src/shared/format.ts -msgid "Server is turned off" -msgstr "Сервер выключен" - -#: web/src/admin/ui/badges.ts -msgid "Server off" -msgstr "Сервер выключен" - -#: web/src/admin/cores/awg.ts -msgid "Server public key" -msgstr "Публичный ключ сервера" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Server removed" msgstr "Сервер удалён" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "Server turned off" msgstr "Сервер выключен" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Server turned on" msgstr "Сервер включён" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/move-person.ts +msgid "Server · %s" +msgstr "Сервер · %s" + +#: backend/i18n/messages.js msgid "Server → Access → Home network." msgstr "Сервер → Доступ → Домашняя сеть." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +msgid "Server: %s" +msgstr "Сервер: %s" + +#: backend/i18n/messages.js msgid "Server: Enter a name: up to 48 characters, without < > \" or \\." msgstr "Сервер: введите имя до 48 символов, без < > \" и обратной косой черты." -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc -#: web/src/admin/pages/person/index.ts -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/servers.ts msgid "Servers" msgstr "Серверы" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: web/src/admin/pages/settings/networks.ts +msgid "Service" +msgstr "Сервис" + +#: backend/i18n/messages.js msgid "Service: Enter a name: up to 48 characters, without < > \" or \\." msgstr "Сервис: введите имя до 48 символов, без < > \" и обратной косой черты." -#: web/src/admin/updater/operation.ts -msgid "Services are back. Reloading…" -msgstr "Службы снова работают. Перезагрузка страницы…" +#: web/src/admin/widgets/reach.ts +msgid "Services" +msgstr "Сервисы" -#: web/src/admin/updater/operation.ts -msgid "Services restarted. Reload the page to use the new version." -msgstr "Службы перезапущены. Обновите страницу, чтобы перейти на новую версию." +#: backend/i18n/messages.js +msgid "Set a server up in Settings." +msgstr "Настройте сервер в «Настройках»." -#: web/src/admin/cores/awg.ts -msgid "Set by hand" -msgstr "Задана вручную" +#: web/src/admin/widgets/config-card.ts +msgid "Set in Network" +msgstr "Задать в «Сети»" -#: web/src/admin/pages/person/limits.ts -msgid "Set the hours, then press Enter" -msgstr "Укажите часы и нажмите Enter" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Set the public hostname in Settings so links can be generated." msgstr "Укажите публичное имя хоста в «Настройках», чтобы создавать ссылки." -#: web/src/admin/pages/person/devices.ts -msgid "Set up %s" -msgstr "Настроить %s" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/first.ts msgid "Set up Dawnline" msgstr "Настройка Dawnline" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Set up a server first." msgstr "Сначала настройте сервер." -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/index.ts +msgid "Set up the server" +msgstr "Настроить сервер" + +#: web/src/admin/pages/people/index.ts msgid "Set up the server first, then add people." msgstr "Сначала настройте сервер, затем добавляйте людей." -#: web/src/admin/pages/people.ts -msgid "Set up the server first." -msgstr "Сначала настройте сервер." +#: web/src/admin/widgets/config-card.ts +msgid "Set-up" +msgstr "Настройка" -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/setup.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Set-up · %s" +msgstr "Настройка · %s" + +#: web/src/admin/pages/people/device/index.ts +msgid "Set-up, rename, turn off, reset traffic, new keys, remove" +msgstr "Настройка, переименовать, выключить, сбросить трафик, новые ключи, удалить" + +#: web/src/admin/pages/server/index.ts #: web/src/admin/pages/settings/index.ts +#: web/src/admin/shell/nav.ts msgid "Settings" msgstr "Настройки" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: web/src/admin/pages/server/overview.ts +msgid "Settings › %s" +msgstr "Настройки › %s" + +#: web/src/admin/pages/settings/index.ts +msgid "Settings’ sections" +msgstr "Разделы настроек" + +#: backend/i18n/messages.js msgid "Setup failed: %s" msgstr "Не удалось настроить: %s" -#: web/src/admin/invite.ts -msgid "Share card" -msgstr "Поделиться карточкой" +#: web/src/admin/flows/invite.ts +msgid "Share" +msgstr "Поделиться" -#: web/src/admin/invite.ts -msgid "Share link" -msgstr "Поделиться ссылкой" - -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/days.ts msgid "Show %s more of %s" msgstr "Показать ещё %s из %s" -#: web/src/admin/pages/person/devices.ts -msgid "Show QR" -msgstr "Показать QR-код" +#: web/src/admin/flows/versions.ts +msgid "Show older" +msgstr "Показать более старые" -#: web/src/admin/device.ts -msgid "Show QR code" -msgstr "Показать QR-код" +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Show set-up" +msgstr "Показать настройку" -#: web/src/admin/cores/awg.ts -msgid "Show key" -msgstr "Показать ключ" - -#: web/src/admin/pages/person/activity.ts -msgid "Show map" -msgstr "Показать карту" - -#: web/src/admin/pages/components/index.ts -msgid "Show progress" -msgstr "Показать ход выполнения" - -#: web/src/admin/device.ts -msgid "Show the new configuration" -msgstr "Показать новую конфигурацию" - -#: web/src/admin/pages/settings/map.ts -msgid "Show where people connect from on the Overview and person pages, at city level." -msgstr "Показывать в «Обзоре» и на страницах людей, откуда они подключаются, - с точностью до города." - -#: web/src/admin/pages/settings/portal.ts -msgid "Show “Not found”" -msgstr "Показывать «Не найдено»" - -#: web/src/admin/pages/person/activity.ts -msgid "Shown after a device connects" -msgstr "Появятся после подключения устройства" - -#: web/src/admin/device.ts -msgid "Shown in the portal and in the app." -msgstr "Видно на портале и в приложении." - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -msgid "Shown in their portal and apps." -msgstr "Показывается на портале и в приложениях." - -#: web/src/admin/pages/person/dialogs.ts -msgid "Shown in their portal and on the Overview." -msgstr "Показывается на портале и на странице «Обзор»." +#: web/src/admin/pages/people/card.ts +msgid "Show set-up · %s" +msgstr "Показать настройку · %s" #: web/src/admin/netcheck.ts msgid "Shown on the person cards." msgstr "Показывается на карточках людей." -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Shown to people in their portal and apps." msgstr "Видно людям в портале и приложениях." -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Shown to people who may reach it." msgstr "Видно тем, у кого есть к нему доступ." -#: web/src/admin/cores/awg.ts -msgid "Signature packets" -msgstr "Пакеты-сигнатуры" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Signatures" msgstr "Сигнатуры" -#: web/src/admin/interfaces.ts -msgid "Slower: every packet crosses the router twice. On a dual-core router expect up to a third less speed, and lost packets at full load." -msgstr "Медленнее: каждый пакет проходит через роутер дважды. На двухъядерном роутере скорость ниже до трети, а на пределе теряются пакеты." +#: web/src/admin/pages/settings/router/backups.ts +msgid "Size" +msgstr "Размер" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts -msgid "So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard" -msgstr "Чтобы сети, блокирующие VPN, не распознали туннель. «Выкл.» - обычный WireGuard" +#: web/src/admin/pages/people/map-view.ts +msgid "Skip to the list of places" +msgstr "К списку городов" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Slower" +msgstr "Медленнее" #: web/src/admin/map.ts msgid "Someone" msgstr "Кто-то" -#: web/src/admin/pages/people.ts -msgid "Sort" -msgstr "Сортировка" +#: backend/i18n/messages.js +#: web/src/admin/failure.ts +msgid "Something went wrong on the router. Try again; if it goes on, look at the Log." +msgstr "На роутере что-то пошло не так. Попробуйте ещё раз; если повторится, загляните в Журнал." -#: web/src/admin/pages/components/hero.ts -msgid "Source" -msgstr "Источник" +#: web/src/admin/failure.ts +msgid "Something went wrong on this page. Try again; if it goes on, reload the page." +msgstr "На странице что-то пошло не так. Попробуйте ещё раз; если повторится, перезагрузите страницу." -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/cores/awg.ts -#: web/src/admin/disguise.ts +#: backend/i18n/messages.js +#: web/src/admin/widgets/disguise-levels.ts msgid "Speed" msgstr "Скорость" -#: web/src/admin/widgets/tiles.ts +#: web/src/admin/pages/overview/now.ts msgid "Speed now" msgstr "Скорость сейчас" -#: web/src/admin/widgets/tiles.ts -msgid "Speed over the last 2 minutes" -msgstr "Скорость за последние 2 минуты" - #: web/src/admin/disguise.ts msgid "Standard (old)" msgstr "Стандартная (старая)" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Starts within a minute" -msgstr "Запустится в течение минуты" +#: web/src/admin/pages/settings/first.ts +msgid "Start" +msgstr "Начать" -#: web/src/admin/device.ts -msgid "Status" -msgstr "Статус" +#: web/src/admin/flows/job-stage.ts +msgid "Starting…" +msgstr "Запуск…" -#: web/src/admin/cores/awg.ts -#: web/src/admin/disguise.ts -msgid "Stealth" -msgstr "Скрытность" +#: web/src/admin/flows/new-server.ts +msgid "Step %s of %s" +msgstr "Шаг %s из %s" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Stops at step %s of %s" msgstr "Останавливается на шаге %s из %s" -#: web/src/admin/pages/server.ts -msgid "Stops the tunnel and disconnects everyone on it. Settings and people are kept." -msgstr "Останавливает туннель и отключает всех, кто через него подключён. Настройки и люди сохраняются." - -#: web/src/admin/pages/settings/logs.ts -msgid "Stored data" -msgstr "Хранимые данные" +#: web/src/admin/pages/settings/networks.ts +msgid "Straight to the WAN, past this router’s proxies and filters." +msgstr "Сразу в WAN, мимо прокси и фильтров роутера." #: web/src/admin/disguise.ts msgid "Strong (old)" msgstr "Усиленная (старая)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js +msgid "Subnet is unique" +msgstr "Подсеть уникальна" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/stages.ts msgid "Subnet must look like 10.77.0.0/24." msgstr "Подсеть указывается так: 10.77.0.0/24." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Subnet overlaps %s." msgstr "Подсеть пересекается с %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "Such a network is not in effect: change it in the server's Network settings." +msgstr "Такая сеть не действует: измените её в настройках сервера, раздел «Сеть»." + +#: backend/i18n/messages.js msgid "Such devices are left out of the tunnels: fix or remove them." msgstr "Такие устройства не загружаются в туннели: исправьте или удалите их." -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switch" msgstr "Переключить" -#: web/src/admin/cores/awg.ts -msgid "Switch and apply" -msgstr "Переключить и применить" +#: web/src/admin/disguise.ts +msgid "Switch the disguise to Balanced?" +msgstr "Сменить маскировку на Сбалансированную?" -#: web/src/admin/cores/awg.ts -msgid "Switch to %s" -msgstr "Применить «%s»" +#: web/src/admin/disguise.ts +msgid "Switch the disguise to Maximum?" +msgstr "Сменить маскировку на Максимальную?" -#: web/src/admin/cores/awg.ts -msgid "Switch to %s?" -msgstr "Перейти на маскировку «%s»?" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switch to AmneziaWG %s?" msgstr "Переключиться на AmneziaWG %s?" -#: web/src/admin/cores/awg.ts -msgid "Switch to Balanced or Maximum" -msgstr "Перейдите на «Сбалансированную» или «Максимальную»" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Switched-off categories are not logged from now on." msgstr "Выключенные категории больше не записываются." -#: web/src/admin/pages/components/awg.ts -msgid "Switching restarts %s for a few seconds." -msgstr "Переключение перезапустит %s на несколько секунд." - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching restarts %s tunnel for a few seconds: %s. Devices keep their configurations." msgid_plural "Switching restarts %s tunnels for a few seconds: %s. Devices keep their configurations." msgstr[0] "Переключение перезапустит %s туннель на несколько секунд: %s. Конфигурации устройств сохранятся." msgstr[1] "Переключение перезапустит %s туннеля на несколько секунд: %s. Конфигурации устройств сохранятся." msgstr[2] "Переключение перезапустит %s туннелей на несколько секунд: %s. Конфигурации устройств сохранятся." -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching restarts the tunnel for a few seconds: %s. Devices keep their configurations." msgstr "Переключение перезапустит туннель на несколько секунд: %s. Конфигурации устройств сохранятся." -#: web/src/admin/pages/components/awg.ts -msgid "Switching takes a few seconds." -msgstr "Переключение займёт несколько секунд." - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching takes a few seconds. Devices keep their configurations." msgstr "Переключение займёт несколько секунд. Конфигурации устройств сохранятся." -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching to AmneziaWG %s" msgstr "Переход на AmneziaWG %s" -#: web/src/admin/logs.ts -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/filters.ts msgid "System" msgstr "Система" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "System log" msgstr "Системный журнал" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/settings/updates.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-policy.ts +#: web/src/admin/pages/settings/router/updates-rows.ts #: web/src/admin/updater/jobs.ts msgid "System packages" msgstr "Системные пакеты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "System packages are up to date" msgstr "Системные пакеты актуальны" +#: web/src/admin/flows/operation.ts +msgid "System packages are updated" +msgstr "Системные пакеты обновлены" + +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "System packages: more" +msgstr "Системные пакеты: ещё" + #: web/src/shared/format.ts msgid "TB" msgstr "ТБ" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Choose another port in Settings." msgstr "TCP %d уже использует %s. Выберите другой порт в «Настройках»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Choose another portal port." msgstr "TCP %d уже занят: %s. Выберите другой порт портала." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Links on IP addresses use plain HTTP on the port after the portal's. Choose another portal port." msgstr "TCP %d уже занят: %s. Ссылки с IP-адресом используют обычный HTTP на порту, следующем за портом портала. Выберите другой порт портала." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is sent on by port forward “%s”. Choose another portal port." msgstr "TCP %d перенаправляется пробросом порта «%s». Выберите другой порт портала." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Table inet dawnline enforces who may reach LAN and the internet." msgstr "Таблица inet dawnline определяет, кому доступны LAN и интернет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Table inet dawnline is missing: no device is loaded into the tunnels until it is back." msgstr "Таблицы inet dawnline нет: пока она не вернётся, ни одно устройство не загружается в туннели." @@ -6413,96 +7516,131 @@ msgstr "Таблицы inet dawnline нет: пока она не вернётс msgid "Tablet" msgstr "Планшет" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Tag, e.g. 0.3.1" msgstr "Тег, например 0.3.1" +#: web/src/admin/flows/restore.ts +msgid "Takes up to a minute. Keep this open." +msgstr "Займёт до минуты. Не закрывайте." + +#: web/src/portal/setup.ts +msgid "Tap “%s” and connect" +msgstr "Нажмите «%s» и подключитесь" + +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +msgid "Term" +msgstr "Срок" + +#: web/src/admin/people/card.ts +msgid "Term limit reached" +msgstr "Лимит на срок исчерпан" + +#: web/src/admin/flows/setup.ts +msgid "Text" +msgstr "Текст" + +#: web/src/admin/pages/log/filters.ts +msgid "Text, person, IP" +msgstr "Текст, человек, IP" + #: web/src/admin/netcheck.ts msgid "That date has passed: access would end at once." msgstr "Эта дата уже прошла: доступ закончится сразу." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "That id is taken." msgstr "Этот идентификатор уже занят." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "That is the same device" msgstr "Это то же самое устройство" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "The %s build" +msgstr "Сборка %s" + +#: web/src/admin/flows/awg-build.ts msgid "The %s build, %s." msgstr "Сборка %s, версия %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/portal/setup.ts +msgid "The APK is for phones without Google Play, or where the store hides the app." +msgstr "APK - для телефонов без Google Play или если магазин скрывает приложение." + +#: backend/i18n/messages.js msgid "The AmneziaWG update is installed and starts after a reboot." msgstr "Обновление AmneziaWG установлено и заработает после перезагрузки." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The AmneziaWG update waits for a reboot" msgstr "Обновление AmneziaWG ждёт перезагрузки" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "The ISP shares one address: devices can only connect if the ISP gives you a public address or IPv6. Ask them, or use a DDNS name that points at an IPv6 address." msgstr "Провайдер делит один адрес между многими абонентами: устройства смогут подключиться, только если он выдаст вам публичный адрес или IPv6. Спросите у провайдера или используйте имя DDNS, которое указывает на IPv6-адрес." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/net-switches.ts +msgid "The LAN this router uses, found by itself. Turn «Auto-detect LAN» off to choose it yourself." +msgstr "LAN этого роутера, найдена автоматически. Чтобы выбрать самому, выключите «Определять LAN автоматически»." + +#: backend/i18n/messages.js msgid "The WAN address %s is CGNAT (shared by the ISP): %s cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6." msgstr "Адрес WAN %s - CGNAT (общий у провайдера): %s нельзя пробросить на этот роутер снаружи, пока провайдер не даст публичный адрес или IPv6." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The WAN address %s is private: this router is behind another one. Forward %s on it, or devices cannot connect." msgstr "Адрес WAN %s - частный: этот роутер стоит за другим. Пробросьте на нём %s, иначе устройства не подключатся." -#: web/src/admin/interfaces.ts -msgid "The WAN, this server, ports and Wi-Fi of a bridge (they come with it) and interfaces without an IPv4 network." -msgstr "WAN, этот сервер, порты и Wi-Fi моста (они входят в него) и интерфейсы без сети IPv4." +#: web/src/admin/pages/settings/stages.ts +msgid "The address and UDP port devices connect to" +msgstr "Адрес и UDP-порт, по которым подключаются устройства" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js +msgid "The admin adds routers on this server. Ask them for one." +msgstr "На этом сервере роутеры добавляет администратор. Попросите его." + +#: backend/i18n/messages.js msgid "The admin has turned this device off." msgstr "Администратор отключил это устройство." -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/pages/overview/health.ts msgid "The agent has not checked in for %s min; cron restarts it after 5." msgstr "Агент не выходил на связь %s мин; cron перезапускает его через 5 мин." -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "The backup from %s is removed from the router." msgstr "Резервная копия (%s) будет удалена с роутера." -#: web/src/admin/pages/components/awg.ts -msgid "The build kept on the router is installed again. Every AmneziaWG tunnel restarts for a few seconds." -msgstr "Снова установится сборка, сохранённая на роутере. Все туннели AmneziaWG перезапустятся на несколько секунд." +#: web/src/admin/flows/operation.ts +#: web/src/admin/updater/jobs.ts +msgid "The check failed" +msgstr "Проверка не удалась" -#: web/src/admin/widgets/readouts.ts -msgid "The busiest of the %s days" -msgstr "Самый загруженный из %s дней" +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/overview/health.ts +msgid "The checks did not run" +msgstr "Проверки не запустились" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "The configuration in this file cannot be read." msgstr "Не удаётся прочитать конфигурацию из этого файла." -#: web/src/admin/pages/components/hero.ts -msgid "The copy kept on the router replaces %s. A backup of the settings is made first." -msgstr "Копия, сохранённая на роутере, заменит %s. Перед этим будет создана резервная копия настроек." +#: web/src/admin/widgets/timeline.ts +msgid "The connection failed" +msgstr "Связь не держится" -#: web/src/admin/device.ts -msgid "The current configuration on this device stops working until it is imported again." -msgstr "Текущая конфигурация на устройстве перестанет работать, пока вы не импортируете её заново." - -#: web/src/admin/pages/settings/defaults.ts -msgid "The default, 3. Pre-filled when you add someone." -msgstr "По умолчанию - 3. Подставляется при добавлении человека." +#: web/src/admin/pages/server/settings.ts +msgid "The core decides how devices connect: its protocol, its disguise and its apps. Everything below is this core’s own." +msgstr "Ядро определяет, как подключаются устройства: протокол, маскировку и приложения. Всё ниже относится только к этому ядру." #: web/src/admin/netcheck.ts msgid "The default, lan: devices get names like %s." msgstr "По умолчанию lan: устройства получат имена вида %s." -#: web/src/admin/device.ts -msgid "The device is disconnected immediately and its configuration stops working." -msgstr "Устройство сразу отключится, а его конфигурация перестанет работать." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The devices in AmneziaWG could not be checked" msgstr "Не удалось проверить устройства в AmneziaWG" @@ -6510,11 +7648,11 @@ msgstr "Не удалось проверить устройства в AmneziaWG msgid "The device’s address at home." msgstr "Адрес устройства в домашней сети." -#: web/src/admin/device.ts -msgid "The device’s local network stays reachable while connected, except %s: your home network." -msgstr "Локальная сеть устройства остаётся доступной при подключении, кроме %s: это ваша домашняя сеть." +#: web/src/admin/pages/people/device/index.ts +msgid "The device’s configuration changes. Until the new one is fetched on it, it works the old way. The new one opens next." +msgstr "Настройка устройства изменится. Пока на нём не заберут новую, оно работает по-старому. Новая откроется следом." -#: web/src/admin/device.ts +#: web/src/admin/flows/device-form.ts msgid "The device’s local network stays reachable while connected." msgstr "Локальная сеть устройства остаётся доступной при подключении." @@ -6522,59 +7660,75 @@ msgstr "Локальная сеть устройства остаётся дос msgid "The device’s network may be blocking the connection." msgstr "Возможно, сеть устройства блокирует подключение." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/settings/networks.ts +msgid "The fastest way" +msgstr "Самый быстрый путь" + +#: web/src/admin/flows/restore.ts +msgid "The file could not be read." +msgstr "Файл не удалось прочитать." + +#: backend/i18n/messages.js msgid "The firewall lets it through" msgstr "Межсетевой экран пропускает трафик" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The firmware changed (kernel %s → %s): the AmneziaWG build installed for it is gone. Install the build for this firmware." msgstr "Прошивка сменилась (ядро %s → %s): сборки AmneziaWG, установленной для прежней, больше нет. Установите сборку для этой прошивки." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "The header protection key is not a key." msgstr "Ключ защиты заголовков некорректен." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/pages/settings/disguise.ts +msgid "The header protection key is not shown here: each device’s file has it." +msgstr "Ключ защиты заголовков здесь не показан: он есть в файле каждого устройства." + +#: backend/i18n/messages.js msgid "The id may use lowercase letters, digits and underscores." msgstr "В идентификаторе можно использовать строчные латинские буквы, цифры и подчёркивания." -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "The interface with the default route: the server port opens there and Internet access leaves through it." msgstr "Интерфейс с маршрутом по умолчанию: на нём открывается порт сервера, и через него выходит доступ в интернет." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The kept AmneziaWG build was made for another firmware: it would not load on this one" msgstr "Сохранённая сборка AmneziaWG сделана для другой прошивки: на этой она не загрузится" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/awg-build.ts +msgid "The kernel module and its tools, made for this firmware." +msgstr "Модуль ядра и утилиты, собранные для этой прошивки." + +#: backend/i18n/messages.js msgid "The kernel module doesn't load. Reinstall a build for this kernel in Components." msgstr "Модуль ядра не загружается. Переустановите сборку для этого ядра в «Компонентах»." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The kernel module doesn't load: %s Reinstall a build for this kernel in Components." msgstr "Модуль ядра не загружается: %s Переустановите сборку для этого ядра в «Компонентах»." -#: web/src/admin/pages/components/index.ts -msgid "The latest release is %s" -msgstr "Последний релиз - %s" +#: web/src/admin/pages/overview/now.ts +msgid "The last 24 hours by the hour" +msgstr "Последние 24 часа по часам" -#: web/src/admin/cores/awg.ts -msgid "The link has the server’s IP address, not its name: if the address changes, set the device up again." -msgstr "В ссылке IP-адрес сервера, а не его имя: если адрес сменится, настройте устройство заново." +#: web/src/admin/people/lines.ts +msgid "The limit is for the whole term: raise it to give access back." +msgstr "Лимит на весь срок: увеличьте его, чтобы вернуть доступ." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The link is up but not attached to %s." msgstr "Домашний маршрут поднят, но не подключён к %s." -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/days.ts msgid "The log is empty." msgstr "Журнал пуст." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "The log lives in memory and is copied to flash. Memory only saves flash writes but is lost on reboot." msgstr "Журнал хранится в памяти и копируется во флеш-память. «Только в памяти» бережёт флеш-память, но при перезагрузке журнал теряется." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The main address is an IP: its links use plain HTTP." msgstr "Основной адрес - IP: ссылки на нём используют обычный HTTP." @@ -6582,55 +7736,67 @@ msgstr "Основной адрес - IP: ссылки на нём исполь msgid "The map library from the CDN is not the expected file: not loading it." msgstr "Библиотека карты из CDN не совпадает с ожидаемым файлом - она не будет загружена." -#: web/src/admin/pages/server.ts -msgid "The name people see, where devices find the router, and DNS. The port is on AmneziaWG." -msgstr "Имя, которое видят люди, адрес, по которому устройства находят роутер, и DNS. Порт - на вкладке AmneziaWG." +#: web/src/admin/widgets/limit-meter.ts +msgid "The month begins when they next connect" +msgstr "Месяц начнётся со следующего подключения" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The network doesn’t know AmneziaWG yet" msgstr "Сеть ещё не знает об AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The new AmneziaWG kernel module doesn't load on this firmware: the tunnels stay down until it does (see the log above)" msgstr "Новый модуль ядра AmneziaWG не загружается на этой прошивке: туннели не работают, пока он не загрузится (см. журнал выше)" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why." msgstr "Новая версия не ответила в LuCI, или её агент не запустился. Попробуйте ещё раз в «Компонентах» или установите её через install.sh, чтобы увидеть причину." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The old kernel module stays loaded (another AmneziaWG interface may use it): the AmneziaWG update is installed and starts after a reboot." msgstr "Старый модуль ядра остаётся загруженным (возможно, его использует другой интерфейс AmneziaWG): обновление AmneziaWG установлено и заработает после перезагрузки." -#: web/src/admin/pages/person/dialogs.ts -msgid "The old link stops working right away." -msgstr "Старая ссылка сразу перестанет работать." +#: web/src/admin/flows/invite.ts +msgid "The old link stops working right away. Send them the new one." +msgstr "Старая ссылка сразу перестанет работать. Отправьте новую." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/failure.ts +msgid "The page and the router do not agree on this request. Reload the page; if it goes on, update Dawnline." +msgstr "Страница и роутер не поняли друг друга. Перезагрузите страницу; если повторится, обновите Dawnline." + +#: web/src/admin/flows/operation.ts +msgid "The page reloads by itself in a few seconds." +msgstr "Страница обновится сама через несколько секунд." + +#: backend/i18n/messages.js msgid "The person has no server." msgstr "У человека нет сервера." -#: web/src/admin/pages/overview.ts -msgid "The personal portal is off." -msgstr "Личный портал выключен." - -#: web/src/admin/invite.ts +#: web/src/admin/flows/invite.ts msgid "The personal portal is off. Turn it on in Settings." msgstr "Личный портал выключен. Включите его в настройках." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/timeline.ts +msgid "The person’s access changed" +msgstr "Доступ изменился" + +#: web/src/admin/pages/settings/router/portal.ts msgid "The portal needs %s. It can’t start without them." msgstr "Для портала нужно: %s. Без этого он не запустится." -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts +msgid "The portal’s address" +msgstr "Адрес портала" + +#: web/src/admin/widgets/entry.ts +msgid "The portal’s address is used." +msgstr "Используется адрес портала." + +#: web/src/admin/flows/new-server.ts msgid "The portal’s address." msgstr "Адрес портала." -#: web/src/admin/pages/settings/portal.ts -msgid "The portal’s checks from Health" -msgstr "Проверки портала из раздела «Состояние»" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The resolver is not running; Home-only devices cannot resolve names." msgstr "Резолвер не запущен; устройства с домашним доступом не могут разрешать имена." @@ -6638,89 +7804,208 @@ msgstr "Резолвер не запущен; устройства с домаш msgid "The router answers again." msgstr "Роутер снова отвечает." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The router clock looks wrong; end dates will misbehave. Check NTP." msgstr "Часы роутера, похоже, идут неверно; даты окончания будут срабатывать неправильно. Проверьте NTP." +#: web/src/admin/failure.ts +msgid "The router could not be reached. Check the connection and try again." +msgstr "Роутер недоступен. Проверьте подключение и попробуйте ещё раз." + +#: web/src/admin/widgets/entry.ts +msgid "The router did not answer where it points." +msgstr "Роутер не ответил, куда указывает адрес." + +#: web/src/admin/pages/overview/health.ts +msgid "The router did not answer. Check again in a moment." +msgstr "Роутер не ответил. Проверьте снова чуть позже." + +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "The router did not take it." +msgstr "Роутер не принял изменение." + +#: web/src/portal/ui/wait-way.ts +msgid "The router drops its traffic: the address does not match." +msgstr "Роутер отбрасывает его трафик: адрес не совпадает." + +#: web/src/admin/people/diagnosis.ts +msgid "The router drops what it sends" +msgstr "Роутер отбрасывает то, что приходит" + +#: web/src/admin/flows/operation.ts +msgid "The router has not answered with the new version yet. Reload the page to use it." +msgstr "Роутер пока не ответил новой версией. Обновите страницу, чтобы перейти на неё." + +#: web/src/admin/shell/waiting.ts +msgid "The router is not answering yet" +msgstr "Роутер пока не отвечает" + #: web/src/admin/state/poller.ts msgid "The router is not answering: what you see may be out of date." msgstr "Роутер не отвечает: данные на экране могут быть устаревшими." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/operation.ts +msgid "The router is restarting its services. The page reloads by itself." +msgstr "Роутер перезапускает службы. Страница обновится сама." + +#: backend/i18n/messages.js msgid "The router is running out of flash" msgstr "На роутере заканчивается флеш-память" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "The router reaches it only while its VPN is on." msgstr "Роутер может связаться с устройством, только пока на нём включён VPN." -#: web/src/admin/pages/settings/map.ts -msgid "The router sends each new client IP to the provider once and caches the city. Map tiles load in your browser from CARTO; people never see the map." -msgstr "Роутер один раз отправляет сервису каждый новый IP клиента и запоминает город. Фрагменты карты загружаются в ваш браузер с CARTO; люди карту не видят." +#: web/src/admin/pages/settings/router/history.ts +msgid "The router sends each new client IP to the provider once and caches the city; the other one is the fallback." +msgstr "Роутер отправляет каждый новый IP клиента сервису один раз и запоминает город; второй сервис запасной." -#: web/src/admin/updater/operation.ts -msgid "The router stopped answering. The job may still finish: reopen Components in a minute." -msgstr "Роутер перестал отвечать. Задача ещё может завершиться: откройте «Компоненты» снова через минуту." +#: web/src/admin/flows/operation.ts +msgid "The router stopped answering. The job may still finish: open Settings in a minute." +msgstr "Роутер перестал отвечать. Задача может ещё завершиться: откройте Настройки через минуту." + +#: web/src/admin/flows/server-change.ts +msgid "The router stops letting devices reach each other at once." +msgstr "Роутер сразу перестанет пропускать устройства друг к другу." + +#: web/src/admin/failure.ts +msgid "The router took too long to answer. Try again." +msgstr "Роутер слишком долго не отвечал. Попробуйте ещё раз." + +#: web/src/admin/pages/settings/networks.ts +msgid "The router’s networks home access leads to" +msgstr "Сети роутера, в которые ведёт домашний доступ" + +#: web/src/admin/pages/settings/stages.ts +msgid "The router’s public address changed" +msgstr "Публичный адрес роутера сменился" + +#: web/src/admin/failure.ts +msgid "The router’s web server could not answer. Try again in a moment." +msgstr "Веб-сервер роутера не смог ответить. Попробуйте ещё раз чуть позже." #: web/src/admin/events/model.ts msgid "The same configuration connects from two places in turn. Give the other device its own." msgstr "Одна и та же конфигурация подключается по очереди из двух мест. Дайте второму устройству собственную." -#: web/src/admin/pages/overview.ts -msgid "The server is turned off" -msgstr "Сервер выключен" +#: web/src/admin/pages/server/overview.ts +msgid "The server is not running" +msgstr "Сервер не работает" -#: web/src/admin/logs.ts +#: web/src/admin/pages/server/index.ts +msgid "The server’s sections" +msgstr "Разделы сервера" + +#: web/src/admin/pages/log/clear.ts msgid "The service log was not cleared: %s" msgstr "Журнал служб не очищен: %s" -#: web/src/admin/pages/person/limits.ts -msgid "The start and the end must differ." -msgstr "Начало и конец должны различаться." +#: web/src/admin/widgets/link-values.ts +msgid "The size of a packet in the tunnel. Lower it when pages hang or the link drops on a mobile network." +msgstr "Размер пакета в туннеле. Уменьшайте, если страницы виснут или связь рвётся в мобильной сети." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "The translation could not be removed" msgstr "Не удалось удалить перевод" -#: web/src/admin/updater/operation.ts -msgid "The translation is installed." -msgstr "Перевод установлен." +#: web/src/admin/flows/operation.ts +msgid "The translation is installed" +msgstr "Перевод установлен" -#: web/src/admin/updater/operation.ts -msgid "The translation is removed." -msgstr "Перевод удалён." +#: web/src/admin/flows/operation.ts +msgid "The translation is removed" +msgstr "Перевод удалён" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/server/settings.ts +msgid "The tunnel core of this server · interface %s" +msgstr "Ядро туннеля этого сервера · интерфейс %s" + +#: backend/i18n/messages.js msgid "The tunnel could not be read, so its devices could not be checked." msgstr "Туннель не удалось прочитать, поэтому его устройства не проверены." -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/settings.ts +msgid "The tunnel is stopped: nobody on this server connects." +msgstr "Туннель остановлен: к этому серверу никто не подключается." + +#: web/src/admin/flows/new-server.ts msgid "The tunnel needs %s. Install the build made for this firmware, then create the server." msgstr "Для туннеля нужно: %s. Установите сборку для этой прошивки, затем создайте сервер." -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "The tunnel stops and %s person is disconnected until you turn it back on. Nothing is deleted." msgid_plural "The tunnel stops and %s people are disconnected until you turn it back on. Nothing is deleted." msgstr[0] "Туннель остановится и отключит %s человека до повторного включения сервера. Ничего не удаляется." msgstr[1] "Туннель остановится и отключит %s человек до повторного включения сервера. Ничего не удаляется." msgstr[2] "Туннель остановится и отключит %s человек до повторного включения сервера. Ничего не удаляется." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/updates.uc +#: web/src/admin/pages/server/overview.ts +msgid "The tunnel, the way in, the firewall and the home networks of this server." +msgstr "Туннель, вход, межсетевой экран и домашние сети этого сервера." + +#: backend/i18n/messages.js msgid "The update stopped unexpectedly." msgstr "Обновление неожиданно прервалось." -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "The values that replace WireGuard’s recognisable message types." msgstr "Значения, которые заменяют узнаваемые типы сообщений WireGuard." -#: web/src/admin/pages/person/dialogs.ts -msgid "Then" -msgstr "Действие" +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog is off." +msgstr "Автовосстановление выключено." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog is on: nothing needed a repair today." +msgstr "Автовосстановление включено: сегодня чинить было нечего." + +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog repaired %s %s." +msgstr "Автовосстановление починило «%s» %s." + +#: web/src/admin/pages/people/person/index.ts +msgid "Their devices have not connected from a known place yet." +msgstr "Устройства ещё не подключались из известного места." + +#: web/src/admin/people/lines.ts +msgid "Their devices have nowhere to connect until a server is chosen." +msgstr "Устройства некуда подключить, пока не выбран сервер." + +#: web/src/admin/pages/people/person/head.ts +msgid "Their link and %s stop working at once: %s." +msgstr "Ссылка и %s перестанут работать сразу: %s." + +#: web/src/admin/pages/people/person/head.ts +msgid "Their link stops working at once." +msgstr "Ссылка перестанет работать сразу." + +#: web/src/admin/people/card.ts +msgid "Their set-up was given out, but no device has connected yet." +msgstr "Настройку выдали, но ни одно устройство ещё не подключалось." + +#: web/src/admin/widgets/limit-meter.ts +msgid "Their traffic history is not changed." +msgstr "История трафика не меняется." + +#: web/src/admin/updater/jobs.ts +msgid "There is an update" +msgid_plural "There are updates" +msgstr[0] "Есть обновление" +msgstr[1] "Есть обновления" +msgstr[2] "Есть обновления" + +#: backend/i18n/messages.js msgid "There is no session the router could reach." msgstr "Нет сессии, через которую роутер мог бы связаться с устройством." +#: web/src/admin/flows/server-change.ts +msgid "They belong to %s person." +msgid_plural "They belong to %s people." +msgstr[0] "Они у %s человека." +msgstr[1] "Они у %s человек." +msgstr[2] "Они у %s человек." + #: web/src/admin/netcheck.ts msgid "They can add %s device themselves." msgid_plural "They can add %s devices themselves." @@ -6728,87 +8013,66 @@ msgstr[0] "Сможет добавить %s устройство самосто msgstr[1] "Сможет добавить %s устройства самостоятельно." msgstr[2] "Сможет добавить %s устройств самостоятельно." -#: web/src/admin/pages/person/pickers.ts -msgid "They can add a device here" -msgstr "Здесь можно добавить устройство" - -#: web/src/admin/pages/person/dialogs.ts -msgid "They have no devices yet: nothing else changes." -msgstr "Устройств пока нет - больше ничего не изменится." - -#: web/src/admin/pages/person/index.ts -msgid "They may have been removed." -msgstr "Возможно, этого человека удалили." - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "They need an app with AmneziaWG 2.0 or newer." msgstr "Понадобится приложение с AmneziaWG 2.0 или новее." -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "They need an app with AmneziaWG 3.1." msgstr "Понадобится приложение с AmneziaWG 3.1." -#: web/src/admin/logs.ts +#: web/src/admin/pages/people/index.ts +msgid "They were removed, or the link is out of date. Their devices’ events stay in the log for as long as the log keeps them." +msgstr "Его удалили, или ссылка устарела. События его устройств остаются в журнале, пока журнал их хранит." + +#: web/src/admin/pages/log/clear.ts msgid "This cannot be undone; export first if you want a copy." msgstr "Это нельзя отменить; если нужна копия, сначала сделайте экспорт." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "This configuration can't be used: %s" msgstr "Эту конфигурацию нельзя использовать: %s" -#: web/src/admin/cores/awg.ts -msgid "This device generated its own keys in the browser, so its full configuration only exists on that device." -msgstr "Это устройство создало ключи в браузере, поэтому полная конфигурация есть только на нём." - -#: web/src/admin/device.ts -msgid "This device has an older configuration: networks or DNS changed since it was set up. Import it again with the QR code, key or file below." -msgstr "На устройстве устаревшая конфигурация: после настройки изменились сети или DNS. Импортируйте её заново с помощью QR-кода, ключа или файла ниже." +#: backend/i18n/messages.js +msgid "This device asks for nothing." +msgstr "У этого устройства нет запроса." #: web/src/admin/events/model.ts msgid "This device is using an outdated configuration." msgstr "На этом устройстве устаревшая конфигурация." -#: web/src/admin/pages/person/devices.ts -msgid "This device made its own keys in the browser; its configuration only exists there." -msgstr "Это устройство создало ключи в браузере, поэтому его конфигурация есть только там." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "This is a SNAPSHOT firmware: the AmneziaWG projects publish builds for releases only" msgstr "Это прошивка SNAPSHOT: проекты AmneziaWG публикуют сборки только для релизов" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "This key is already in use." msgstr "Этот ключ уже используется." -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -msgid "This month" -msgstr "В этом месяце" +#: web/src/admin/failure.ts +msgid "This login may not do that." +msgstr "У этой учётной записи нет на это прав." -#: web/src/admin/pages/people.ts -msgid "This month by device" -msgstr "Этот месяц по устройствам" +#: web/src/shared/format.ts +msgid "This network is not needed here" +msgstr "Эта сеть здесь не нужна" -#: web/src/admin/pages/people.ts -msgid "This person was just removed." -msgstr "Этого человека только что удалили." +#: web/src/admin/flows/add-device.ts +msgid "This person already has a device with this name." +msgstr "У этого человека уже есть устройство с таким именем." -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "This release has no notes." msgstr "У этого релиза нет описания." -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "This removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first." msgid_plural "This removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first." msgstr[0] "Будут удалены туннель, его правила межсетевого экрана и %s человек со всеми устройствами. Сначала создаётся резервная копия." msgstr[1] "Будут удалены туннель, его правила межсетевого экрана и %s человека со всеми устройствами. Сначала создаётся резервная копия." msgstr[2] "Будут удалены туннель, его правила межсетевого экрана и %s человек со всеми устройствами. Сначала создаётся резервная копия." -#: web/src/admin/pages/settings/backups.ts -msgid "This replaces the whole Dawnline configuration on this router. The current state is backed up first." -msgstr "Вся конфигурация Dawnline на этом роутере будет заменена. Сначала текущее состояние сохранится в резервную копию." - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/stages.ts msgid "This router" msgstr "Этот роутер" @@ -6816,246 +8080,308 @@ msgstr "Этот роутер" msgid "This router (%s): queries go where your home network sends them, and home names work." msgstr "Этот роутер (%s): запросы идут туда же, куда и из домашней сети, и домашние имена работают." -#: web/src/admin/pages/server.ts -msgid "This router (recommended)" -msgstr "Этот роутер (рекомендуется)" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "This router runs an older AmneziaWG. %s becomes available with kmod-amneziawg and amneziawg-tools 3.1." msgstr "На этом роутере старая версия AmneziaWG. Маскировка «%s» станет доступна с kmod-amneziawg и amneziawg-tools 3.1." -#: web/src/admin/interfaces.ts +#: backend/i18n/messages.js +msgid "This router waits for an answer to its request: it has no configuration yet." +msgstr "Роутер ждёт ответа на запрос: конфигурации у него пока нет." + +#: web/src/admin/pages/settings/networks.ts msgid "This server" msgstr "Этот сервер" -#: web/src/admin/pages/server.ts -msgid "This server is off" -msgstr "Этот сервер выключен" - #: web/src/admin/netcheck.ts msgid "Three numbers, like 10.77.0." msgstr "Три числа, например 10.77.0." -#: web/src/admin/pages/server.ts -msgid "Through the home network" -msgstr "Через домашнюю сеть" +#: web/src/admin/pages/settings/networks.ts +msgid "Through this router’s proxies and filters, as from a device at home." +msgstr "Через прокси и фильтры роутера, как с устройства дома." + +#: web/src/admin/flows/new-server.ts +msgid "Through this router’s proxies and filters. Slower: up to a third on two cores." +msgstr "Через прокси и фильтры роутера. Медленнее: до трети скорости на двух ядрах." #: web/src/admin/logs.ts -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Time" msgstr "Время" -#: web/src/admin/pages/settings/updates.ts -msgid "Time: %s" -msgstr "Время: %s" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Timing" msgstr "Тайминги" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts msgid "To" -msgstr "До" +msgstr "Куда" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "To keep the old disguise for some people, add a second server and move them there." msgstr "Чтобы оставить старую маскировку части людей, добавьте второй сервер и перенесите их туда." -#: web/src/admin/events/render.ts +#: web/src/admin/pages/people/person/index.ts +msgid "To lower the limit, remove a device first" +msgstr "Чтобы снизить лимит, сначала удалите устройство" + +#: web/src/admin/pages/people/index.ts +msgid "To people" +msgstr "К людям" + +#: web/src/admin/events/clock.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/card.ts #: web/src/admin/places/model.ts -#: web/src/admin/widgets/readouts.ts +#: web/src/admin/widgets/week-use.ts msgid "Today" msgstr "Сегодня" -#: web/src/admin/widgets/tiles.ts -msgid "Today %s" -msgstr "Сегодня %s" - -#: web/src/admin/pages/settings/backups.ts -msgid "Today, %s" -msgstr "Сегодня, %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Too many changes in a short time. Try again in a few minutes." msgstr "Слишком много изменений за короткое время. Попробуйте ещё раз через несколько минут." -#: web/src/admin/device.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/people/device/traffic.ts msgid "Total" msgstr "Всего" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/limit-meter.ts msgid "Traffic" msgstr "Трафик" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/overview/now.ts +msgid "Traffic by day: the arrows pick a day" +msgstr "Трафик по дням: стрелки выбирают день" + +#: web/src/admin/disguise.ts +msgid "Traffic does not look like a VPN. About the same speed." +msgstr "Трафик не похож на VPN. Скорость почти та же." + +#: backend/i18n/messages.js msgid "Traffic enters %s as %s, so it is handled like any device on your LAN." msgstr "Трафик входит в %s как %s, поэтому обрабатывается как любое устройство вашей LAN." -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Traffic history" msgstr "История трафика" -#: web/src/admin/logs.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Traffic history reset" msgstr "История трафика сброшена" -#: web/src/admin/widgets/tiles.ts -msgid "Traffic, last 30 days" -msgstr "Трафик за последние 30 дней" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Translation" msgstr "Перевод" -#: web/src/admin/pages/components/activity.ts -msgid "Translation removed by you" -msgstr "Вы удалили перевод" - #: web/src/admin/netcheck.ts msgid "Try %s." msgstr "Попробуйте %s." -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/whats-new.ts msgid "Try again" msgstr "Повторить" -#: web/src/admin/pages/server.ts -msgid "Try another build in Components, or update OpenWrt. The server can’t start until it loads." -msgstr "Попробуйте другую сборку в разделе «Компоненты» или обновите OpenWrt. Пока модуль не загрузится, сервер не запустится." +#: web/src/admin/flows/new-server.ts +msgid "Try another build in System, under Updates, or update OpenWrt. The server can’t start until it loads." +msgstr "Попробуйте другую сборку в Системе, в разделе «Обновления», или обновите OpenWrt. Пока модуль не загрузится, сервер не запустится." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: web/src/admin/shell/waiting.ts +msgid "Trying again in a moment" +msgstr "Сейчас попробуем ещё раз" + +#: backend/i18n/messages.js msgid "Trying mirror %s" msgstr "Пробуем зеркало %s" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/stages.ts msgid "Tunnel" msgstr "Туннель" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Tunnel" msgstr "Туннель" -#: web/src/admin/pages/overview.ts -msgid "Tunnel %s is down." -msgstr "Туннель %s не работает." - -#: web/src/admin/device.ts -msgid "Tunnel address" -msgstr "Адрес в туннеле" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/stages.ts msgid "Tunnel network" msgstr "Сеть туннеля" -#: web/src/admin/pages/server.ts -msgid "Tunnel network changed" -msgstr "Сеть туннеля изменена" +#: web/src/admin/pages/server/settings.ts +msgid "Tunnel network and DNS" +msgstr "Сеть туннеля и DNS" -#: web/src/admin/cores/awg.ts -msgid "Tunnel subnet" -msgstr "Подсеть туннеля" +#: web/src/admin/pages/settings/stages.ts +msgid "Tunnel network: %s" +msgstr "Сеть туннеля: %s" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/server-change.ts +msgid "Tunnel network: %s?" +msgstr "Сеть туннеля: %s?" + +#: backend/i18n/messages.js +msgid "Tunnel running" +msgstr "Туннель работает" + +#: web/src/admin/pages/people/device/link.ts +msgid "Turn it on" +msgstr "Включить" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Turn off" msgstr "Выключить" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Turn off %s?" msgstr "Выключить %s?" -#: web/src/admin/pages/server.ts -msgid "Turn off this server" -msgstr "Выключить этот сервер" - -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Turn on" msgstr "Включить" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/add-person.ts +msgid "Turn on the personal portal in System to get their link, or add their devices yourself on their page." +msgstr "Включите личный портал в «Системе», чтобы получить ссылку, или добавьте устройства сами на странице человека." + +#: backend/i18n/messages.js msgid "Turn the device on again on its page." msgstr "Включите устройство на его странице." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/disguise.ts +msgid "Turn the disguise off?" +msgstr "Выключить маскировку?" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Turn the portal on to see its certificate." msgstr "Включите портал, чтобы увидеть его сертификат." -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -msgid "Turn them on in Settings" -msgstr "Включите его в настройках" +#: web/src/admin/people/lines.ts +msgid "Turn the server on" +msgstr "Включить сервер" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/move-person.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/servers/state.ts msgid "Turned off" msgstr "Выключен" -#: web/src/admin/device.ts +#: web/src/admin/pages/server/settings.ts +msgid "Turned on" +msgstr "Включён" + +#: web/src/admin/pages/server/settings.ts +msgid "Turning it off disconnects everyone on it; nothing is deleted." +msgstr "Если выключить, все на нём отключатся; ничего не удаляется." + #: web/src/admin/logs.ts msgid "Type" msgstr "Тип" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc +#: backend/i18n/messages.js msgid "Type \"remove\" to confirm." msgstr "Введите «remove», чтобы подтвердить." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/uninstall.ts +msgid "Type the word to confirm" +msgstr "Введите слово для подтверждения" + +#: backend/i18n/messages.js msgid "UDP %d is also used by %s." msgstr "UDP %d также использует %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "UDP %d is used by %s. Choose another port." msgstr "UDP %d занят: %s. Выберите другой порт." -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts +msgid "UDP %s" +msgstr "UDP %s" + +#: web/src/admin/flows/new-server.ts +#: web/src/admin/widgets/entry.ts msgid "UDP port" msgstr "UDP-порт" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js +#: web/src/admin/widgets/entry.ts msgid "UDP port must be 1-65535." msgstr "UDP-порт: от 1 до 65535." -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts msgid "UDP port: %s" msgstr "UDP-порт: %s" +#: web/src/admin/flows/server-change.ts +msgid "UDP port: %s?" +msgstr "Порт UDP: %s?" + #: web/src/admin/events/model.ts +#: web/src/portal/ui/wait-way.ts msgid "Unable to complete the handshake" msgstr "Не удаётся завершить рукопожатие" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: web/src/admin/shell/toast.ts +msgid "Undo" +msgstr "Отменить" + +#: web/src/admin/shell/toast.ts +msgid "Undone" +msgstr "Отменено" + +#: backend/i18n/messages.js msgid "Unexpected entry in backup: %s" msgstr "Неожиданная запись в резервной копии: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Unexpected file in backup: %s" msgstr "Неожиданный файл в резервной копии: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Unknown AmneziaWG build %s" msgstr "Неизвестная сборка AmneziaWG: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown DNS choice." msgstr "Неизвестный вариант DNS." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Unknown action." msgstr "Неизвестное действие." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js +msgid "Unknown answer." +msgstr "Неизвестный ответ." + +#: backend/i18n/messages.js msgid "Unknown category." msgstr "Неизвестная категория." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Unknown choice for devices reaching each other." msgstr "Неизвестный вариант связи между устройствами." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js +msgid "Unknown choice for routers on people's pages." +msgstr "Неизвестный вариант для роутеров на личных страницах." + +#: backend/i18n/messages.js msgid "Unknown circle." msgstr "Неизвестный круг." @@ -7063,38 +8389,35 @@ msgstr "Неизвестный круг." msgid "Unknown city" msgstr "Неизвестный город" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "Unknown component %s" msgstr "Неизвестный компонент: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown device type." msgstr "Неизвестный тип устройства." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown device." msgstr "Неизвестное устройство." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Unknown disguise method." msgstr "Неизвестный режим маскировки." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Unknown end action." -msgstr "Неизвестное действие по окончании доступа." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Unknown fix." msgstr "Неизвестное исправление." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Unknown links" msgstr "Неизвестные ссылки" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/pages/settings/router/portal.ts +msgid "Unknown links: “Not found”" +msgstr "Неизвестные ссылки: «Не найдено»" + +#: backend/i18n/messages.js msgid "Unknown location service." msgstr "Неизвестный сервис геолокации." @@ -7102,52 +8425,43 @@ msgstr "Неизвестный сервис геолокации." msgid "Unknown network" msgstr "Неизвестная сеть" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown page." msgstr "Неизвестная страница." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown person." msgstr "Неизвестный человек." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown release." msgstr "Неизвестный релиз." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown scope." msgstr "Неизвестная область сброса." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Unknown server." msgstr "Неизвестный сервер." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown service %s." msgstr "Неизвестный сервис %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Unknown service." msgstr "Неизвестный сервис." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Unknown setting %s." msgstr "Неизвестная настройка %s." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown update target." msgstr "Неизвестная цель обновления." -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "Unlimited" -msgstr "Без лимита" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Until they are installed, internet traffic goes straight to the WAN." msgstr "Пока они не установлены, интернет-трафик идёт прямо в WAN." @@ -7162,109 +8476,90 @@ msgstr[2] "Максимум %s символов (сейчас %s)." msgid "Up to %s characters." msgstr "Не больше %s символов." -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/networks.ts +msgid "Up to a third slower on two cores" +msgstr "До трети медленнее на двух ядрах" + +#: web/src/admin/updater/jobs.ts msgid "Up to date" msgstr "Актуально" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Update" msgstr "Обновить" -#: web/src/admin/updater/operation.ts -msgctxt "noun" -msgid "Update" -msgstr "Обновление" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Update AmneziaWG to %s?" +msgstr "Обновить AmneziaWG до %s?" -#: web/src/admin/pages/components/packages.ts -msgid "Update %s?" -msgstr "Обновить «%s»?" - -#: web/src/admin/pages/components/index.ts -msgid "Update available" -msgstr "Есть обновление" - -#: web/src/admin/updater/jobs.ts -msgid "Update available: %s" -msgstr "Доступно обновление: %s" - -#: web/src/admin/pages/person/devices.ts -msgid "Update config" -msgstr "Обновить конфигурацию" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "Update failed" msgstr "Обновление не удалось" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/notice.ts msgid "Update now" msgstr "Обновить сейчас" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Update the system packages?" +msgstr "Обновить системные пакеты?" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Update to %s" msgstr "Обновить до %s" -#: web/src/admin/updater/operation.ts -msgid "Updated %s" -msgstr "Обновлено: %s" - -#: web/src/admin/updater/operation.ts -msgid "Updated system packages" -msgstr "Системные пакеты обновлены" - -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Updates" msgstr "Обновления" -#: web/src/admin/pages/components/activity.ts -msgid "Updates, and checks that found something, show up here." -msgstr "Здесь появятся обновления и проверки, которые что-то нашли." - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc -#: web/src/admin/pages/components/packages.ts +#: backend/i18n/messages.js msgid "Updating %s" msgstr "Обновление: %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating AmneziaWG" msgstr "Обновление AmneziaWG" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating Dawnline" msgstr "Обновление Dawnline" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/updater/jobs.ts msgid "Updating components" msgstr "Обновление компонентов" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating system packages" msgstr "Обновление системных пакетов" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Updating…" msgstr "Обновление…" -#: web/src/admin/widgets/tiles.ts -msgctxt "speed" -msgid "Upload" -msgstr "Передача" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Upload is empty or too large." msgstr "Загруженный файл пуст или слишком большой." -#: web/src/admin/pages/people.ts -msgctxt "sort" +#: web/src/portal/ui/bars.ts +msgid "Uploaded" +msgstr "Отправлено" + +#: web/src/admin/pages/people/person/index.ts msgid "Usage" -msgstr "По трафику" +msgstr "Использование" #: web/src/admin/netcheck.ts +#: web/src/admin/widgets/link-values.ts msgid "Use 0–600 seconds." msgstr "Укажите от 0 до 600 секунд." @@ -7272,6 +8567,10 @@ msgstr "Укажите от 0 до 600 секунд." msgid "Use 1–32." msgstr "Укажите от 1 до 32." +#: web/src/admin/pages/settings/router/portal.ts +msgid "Use 1–65535." +msgstr "Используйте 1–65535." + #: web/src/admin/netcheck.ts msgid "Use HH:MM, 00:00–23:59." msgstr "Формат ЧЧ:ММ, 00:00–23:59." @@ -7292,7 +8591,7 @@ msgstr "Укажите порт от 1 до 65535." msgid "Use a private range: 10.x.x, 172.16–31.x or 192.168.x." msgstr "Нужен частный диапазон: 10.x.x, 172.16–31.x или 192.168.x." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x." msgstr "Нужен частный диапазон: 10.x.x.x, 172.16–31.x.x или 192.168.x.x." @@ -7304,231 +8603,261 @@ msgstr "Укажите IPv4-адрес, например 192.168.1.10." msgid "Use an IPv4 address, or leave it empty." msgstr "Укажите IPv4-адрес или оставьте поле пустым." -#: web/src/admin/pages/settings/portal.ts -msgid "Use files" -msgstr "Указать файлы" - -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/settings/stages.ts msgid "Use the new address" msgstr "Использовать новый адрес" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Use your own certificate" msgstr "Использовать свой сертификат" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Use your own files" +msgstr "Свои файлы" + #: web/src/admin/netcheck.ts msgid "Used by %s. Choose another port." msgstr "Порт занят: %s. Выберите другой." -#: web/src/admin/pages/settings/portal.ts -msgid "Used for HTTPS links" -msgstr "Для ссылок HTTPS" - -#: web/src/admin/widgets/readouts.ts -msgid "Used on %s of %s day" -msgid_plural "Used on %s of %s days" -msgstr[0] "С трафиком %s из %s дня" -msgstr[1] "С трафиком %s из %s дней" -msgstr[2] "С трафиком %s из %s дней" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Using a self-signed certificate: browsers will show a warning." msgstr "Используется самоподписанный сертификат: браузеры покажут предупреждение." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Using a self-signed certificate: browsers will show a warning. ACME can get a free Let’s Encrypt one." msgstr "Используется самоподписанный сертификат: браузеры покажут предупреждение. Через ACME можно получить бесплатный сертификат Let’s Encrypt." -#: web/src/admin/cores/awg.ts -msgid "V2RayTun on Android: %s, or copy the link and %s." -msgstr "V2RayTun на Android: %s или скопируйте ссылку и %s." +#: web/src/admin/people/diagnosis.ts +msgid "Usually it is the device’s network: worth trying another." +msgstr "Обычно это сеть устройства: стоит попробовать другую." -#: web/src/admin/cores/awg.ts -msgid "V2RayTun on Windows: %s, then set its mode to %s and connect. That mode needs administrator rights: the app offers to restart with them." -msgstr "V2RayTun на Windows: %s, затем выберите режим «%s» и подключитесь. Для этого режима нужны права администратора: приложение предложит перезапуститься с ними." +#: web/src/portal/setup.ts +msgid "V2RayTun’s own channel: news and updates of the app." +msgstr "Канал самого V2RayTun: новости и обновления приложения." -#: web/src/admin/interfaces.ts -msgid "VPN & tunnels" -msgstr "VPN и туннели" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Verbose (debug)" msgstr "Подробный (отладка)" -#: web/src/admin/pages/components/hero.ts -msgid "Versions" -msgstr "Версии" +#: web/src/admin/pages/people/index.ts +msgid "View" +msgstr "Вид" -#: web/src/admin/pages/overview.ts -msgid "View all" -msgstr "Показать все" +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/overview/head.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/settings/index.ts +msgid "View only" +msgstr "Только просмотр" -#: web/src/admin/device.ts -#: web/src/admin/ui/badges.ts -msgid "Waiting for the first connection" -msgstr "Ждём первого подключения" +#: web/src/admin/pages/settings/networks.ts +msgid "WAN interface" +msgstr "Интерфейс WAN" -#: web/src/admin/updater/operation.ts -msgid "Waiting for the router to restart its services (%s of 30)…" -msgstr "Ожидание перезапуска служб роутера (%s из 30)…" +#: web/src/admin/pages/settings/networks.ts +msgid "WAN: %s" +msgstr "WAN: %s" -#: web/src/admin/updater/operation.ts -msgid "Waiting for the router to restart its services…" -msgstr "Ожидание перезапуска служб роутера…" +#: web/src/admin/flows/server-change.ts +msgid "WAN: %s?" +msgstr "WAN: %s?" -#: web/src/admin/pages/person/dialogs.ts -msgid "Warn" -msgstr "Предупредить" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/overview/waiting.ts +msgid "Waiting for a decision" +msgstr "Ждут решения" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Warning must be 0-60 days." -msgstr "Предупреждать можно за 0–60 дней." +#: web/src/admin/pages/people/filters.ts +msgid "Waiting for a new configuration" +msgstr "Ждут новую настройку" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: web/src/admin/flows/job-stage.ts +msgid "Waiting for log output…" +msgstr "Ждём вывода журнала…" + +#: web/src/admin/shell/waiting.ts +msgid "Waiting for the backend" +msgstr "Ждём бэкенд" + +#: web/src/portal/ui/wait-way.ts +msgid "Waiting for the connection" +msgstr "Ждём подключения" + +#: web/src/admin/shell/waiting.ts +msgid "Waiting for the router" +msgstr "Ждём ответа роутера" + +#: web/src/admin/pages/overview/servers.ts +msgid "Waiting:" +msgstr "Ждут:" + +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +msgid "Waits for your answer" +msgstr "Ждёт вашего ответа" + +#: backend/i18n/messages.js msgid "Warning: %s sent a file that does not match GitHub's sha256, discarded" msgstr "Внимание: файл от %s не совпадает с sha256 из GitHub и удалён" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Warning: could not keep %s: %s" msgstr "Внимание: не удалось сохранить %s: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Warning: the installed build is no longer published, nothing to keep for rollback" msgstr "Внимание: установленная сборка больше не публикуется, сохранить для отката нечего" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Warnings and errors" msgstr "Предупреждения и ошибки" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/pages/diagnostics/health.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/health.ts msgid "Watchdog" msgstr "Автовосстановление" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog off" -msgstr "Автовосстановление выключено" +#: web/src/admin/pages/settings/stages.ts +msgid "Way in" +msgstr "Вход" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog on" -msgstr "Автовосстановление включено" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog repairs" -msgstr "Автовосстановление" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Web" msgstr "Веб" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Weekly" msgstr "Раз в неделю" -#: web/src/admin/device.ts -msgid "Went offline" -msgstr "Вышло из сети" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "What Dawnline writes to the router’s system log (logread -e dawnline). Verbose adds each step of a start and of applying settings." msgstr "Что Dawnline пишет в системный журнал роутера (logread -e dawnline). Подробный добавляет каждый шаг запуска и применения настроек." -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts -msgid "What people see" -msgstr "Что видят люди" +#: web/src/admin/pages/settings/stages.ts +msgid "What identifies the server to its devices" +msgstr "По чему устройства узнают сервер" -#: web/src/admin/pages/server.ts -msgid "Whatever handles home traffic on this router (proxies, filters, DNS) handles theirs too. Change it later under Servers → Access." -msgstr "Всё, что обрабатывает домашний трафик на этом роутере (прокси, фильтры, DNS), обработает и их трафик. Изменить можно позже в разделе Серверы → Доступ." +#: web/src/portal/flows/device-form.ts +msgid "What is it?" +msgstr "Что это за устройство?" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "What it installs" +msgstr "Что устанавливать" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/widgets/reach.ts +msgid "What they reach" +msgstr "Куда доходит" + +#: web/src/admin/flows/restore.ts +msgid "What was there before is kept in the backup “%s”." +msgstr "Прежнее состояние сохранено копией «%s»." + +#: web/src/admin/pages/settings/router/notice.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new" msgstr "Что нового" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/notice.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new in Dawnline %s" msgstr "Что нового в Dawnline %s" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new in the %s build" msgstr "Что нового в сборке %s" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "When" msgstr "Когда" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "When GitHub is unreachable, download through mirrors. Checksums are still verified." msgstr "Если GitHub недоступен, скачивать через зеркала. Контрольные суммы всё равно проверяются." -#: web/src/admin/pages/person/dialogs.ts -msgid "When access ends" -msgstr "Когда доступ закончится" - -#: web/src/admin/pages/person/limits.ts -msgid "When it ends: %s" -msgstr "По окончании: %s" - -#: web/src/admin/pages/person/limits.ts -msgid "When it ends: %s, warn %s day before" -msgid_plural "When it ends: %s, warn %s days before" -msgstr[0] "По окончании: %s, предупредить за %s день" -msgstr[1] "По окончании: %s, предупредить за %s дня" -msgstr[2] "По окончании: %s, предупредить за %s дней" - #: web/src/admin/logs.ts msgid "Where" msgstr "Место" -#: web/src/admin/pages/server.ts -msgid "Where devices connect to. A hostname that always points at your router (DDNS) keeps links working when your IP changes." -msgstr "Куда подключаются устройства. С именем хоста, которое всегда указывает на ваш роутер (DDNS), ссылки работают и после смены IP." +#: web/src/admin/widgets/place-rows.ts +msgid "Where %s has been" +msgstr "Где было: %s" -#: web/src/admin/pages/server.ts -msgid "Where devices reach AmneziaWG from the internet" -msgstr "Где устройства находят AmneziaWG из интернета" +#: web/src/admin/flows/new-server.ts +msgid "Where devices connect to. A name that always points at your router (DDNS) keeps links working when your IP changes." +msgstr "Адрес, к которому подключаются устройства. Имя, которое всегда указывает на роутер (DDNS), сохранит ссылки рабочими при смене IP." -#: web/src/admin/cores/awg.ts -msgid "Where devices reach this core from the internet" -msgstr "Куда устройства подключаются из интернета" +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Where it has been · %s" +msgstr "Где было · %s" -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Where people connect from" -msgstr "Откуда подключаются" +msgstr "Где подключаются" -#: web/src/admin/logs.ts +#: web/src/admin/flows/places-closeup.ts +msgid "Where they have been · %s" +msgstr "Где бывали · %s" + +#: web/src/admin/pages/log/filters.ts +msgid "Which entries" +msgstr "Какие записи" + +#: web/src/admin/pages/log/clear.ts msgid "Which events" msgstr "Какие события" -#: web/src/admin/access.ts -msgid "Who reaches what" -msgstr "Кому что доступно" +#: web/src/admin/pages/settings/networks.ts +msgid "Who reaches which service is picked on the person: People › a person › «What they reach»." +msgstr "Кому какой сервис доступен, выбирается у человека: Люди › человек › «Куда доходит»." -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/pages/people/notices.ts +msgid "Who waits" +msgstr "Кто ждёт" + +#: web/src/admin/widgets/reach.ts msgid "Whole home network" msgstr "Вся домашняя сеть" -#: web/src/admin/pages/person/pickers.ts -msgid "Whole home network. Pick services to narrow it down." -msgstr "Вся домашняя сеть. Выберите сервисы, чтобы ограничить доступ." +#: web/src/admin/widgets/limit-meter.ts +msgid "Whole term" +msgstr "Весь срок" -#: web/src/admin/access.ts -msgid "Why something does or does not connect" -msgstr "Почему соединение проходит или нет" +#: web/src/admin/pages/settings/router/backups.ts +msgid "Why" +msgstr "Почему" -#: web/src/admin/interfaces.ts -msgid "Within a circle: family sees family, guests see guests. Everyone reaches their own devices. Internet-only people never." -msgstr "Внутри круга: семья видит семью, гости - гостей. Каждый видит свои устройства. Люди только с интернетом - никогда." +#: web/src/admin/pages/server/settings.ts +msgid "With its %s person and all their devices. A backup is made first." +msgid_plural "With its %s people and all their devices. A backup is made first." +msgstr[0] "Вместе с %s человеком и всеми его устройствами. Сначала делается резервная копия." +msgstr[1] "Вместе с %s людьми и всеми их устройствами. Сначала делается резервная копия." +msgstr[2] "Вместе с %s людьми и всеми их устройствами. Сначала делается резервная копия." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: web/src/admin/people/card.ts +msgid "With the networks behind it: %s" +msgstr "С сетями за ним: %s" + +#: web/src/admin/flows/invite.ts +msgid "With this link %s adds their devices and takes their set-up. No account needed." +msgstr "По этой ссылке %s добавит свои устройства и заберёт настройку. Регистрация не нужна." + +#: web/src/admin/flows/behind-ask.ts +msgid "Without a reason" +msgstr "Без причины" + +#: backend/i18n/messages.js msgid "Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline." msgstr "Без kmod-nft-offload каждый пакет на этом пути дважды проходит через межсетевой экран. Установите его и перезапустите Dawnline." -#: web/src/admin/updater/operation.ts -msgid "Working…" -msgstr "Выполняется…" +#: web/src/admin/pages/settings/networks.ts +msgid "Works: traffic enters %s as %s." +msgstr "Работает: трафик входит в %s как %s." #: web/src/admin/netcheck.ts msgid "Wrong links are sent there instead of a “Not found”." @@ -7538,16 +8867,12 @@ msgstr "Неверные ссылки будут вести на этот адр msgid "Wrong links get a bare “Not found”." msgstr "По неверной ссылке откроется просто «Not found»." -#: web/src/admin/events/render.ts +#: web/src/admin/events/clock.ts +#: web/src/admin/pages/log/filters.ts #: web/src/admin/places/model.ts -#: web/src/admin/widgets/readouts.ts msgid "Yesterday" msgstr "Вчера" -#: web/src/admin/pages/settings/backups.ts -msgid "Yesterday, %s" -msgstr "Вчера, %s" - #: web/src/admin/events/render.ts msgid "You" msgstr "Вы" @@ -7572,6 +8897,10 @@ msgstr "Вы добавили человека %s" msgid "You added this person" msgstr "Вы добавили этого человека" +#: web/src/admin/flows/operation.ts +msgid "You can close this: the job carries on on the router." +msgstr "Можно закрыть: задача продолжится на роутере." + #: web/src/admin/events/model.ts msgid "You changed circle %s" msgstr "Вы изменили круг %s" @@ -7620,6 +8949,10 @@ msgstr "Вы экспортировали все настройки" msgid "You imported settings from a file" msgstr "Вы импортировали настройки из файла" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "You install from the rows above." +msgstr "Устанавливаете вы сами, из строк выше." + #: web/src/admin/events/render.ts msgid "You issued a new link for person %s" msgstr "Вы выпустили новую личную ссылку: %s" @@ -7740,51 +9073,68 @@ msgstr "Вы включили личный портал" msgid "You turned on the watchdog" msgstr "Вы включили автовосстановление" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your WAN address now - it may change; a DDNS name is better." msgstr "Ваш текущий адрес WAN - он может измениться; лучше имя DDNS." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Your access has ended." msgstr "Ваш доступ закончился." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Your access is paused." msgstr "Ваш доступ на паузе." -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Your address" msgstr "Ваш адрес" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Your files" msgstr "Ваши файлы" -#: web/src/admin/pages/settings/portal.ts -msgid "Your own files" -msgstr "Свои файлы" +#: web/src/portal/flows/device-form.ts +msgid "Your local network stays reachable while connected." +msgstr "Ваша локальная сеть остаётся доступной при подключении." -#: web/src/admin/invite.ts +#: web/src/portal/ui/wait-way.ts +msgid "Your network may be blocking the connection." +msgstr "Возможно, ваша сеть блокирует подключение." + +#: web/src/admin/flows/invite.ts msgid "Your personal VPN link" msgstr "Ваша личная ссылка на VPN" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your router has no public address (CGNAT)" msgstr "У роутера нет публичного адреса (CGNAT)" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your router is behind another router (WAN %s)" msgstr "Роутер стоит за другим роутером (WAN %s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/failure.ts +msgid "Your session has ended. Reload the page to sign in again." +msgstr "Сессия закончилась. Перезагрузите страницу, чтобы войти снова." + +#: backend/i18n/messages.js msgid "Zone %s and the WAN rule for UDP %d exist." msgstr "Зона %s и правило WAN для UDP %d на месте." +#: web/src/admin/system/model.ts +msgid "a check is running" +msgstr "идёт проверка" + +#: web/src/admin/widgets/feed.ts +msgid "a connection problem" +msgstr "проблема с подключением" + #: web/src/admin/events/render.ts +#: web/src/admin/widgets/feed.ts msgid "a device" msgstr "без имени" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "a new build needs a manual switch in Components" msgstr ": новую сборку нужно включить вручную в «Компонентах»" @@ -7792,63 +9142,90 @@ msgstr ": новую сборку нужно включить вручную в msgid "about %s by the reset on %s" msgstr "около %s к сбросу %s" -#: web/src/admin/widgets/readouts.ts -msgid "about average" -msgstr "около среднего" +#: web/src/admin/events/model.ts +msgid "accepted: %s" +msgstr "принято: %s" #: web/src/admin/events/model.ts msgid "access" msgstr "доступ" -#: web/src/admin/interfaces.ts -msgid "add its interface %s to their source interfaces yourself" -msgstr "сами добавите его интерфейс %s в их источники трафика" +#: web/src/admin/pages/overview/now.ts +msgid "across %s person" +msgid_plural "across %s people" +msgstr[0] "у %s человека" +msgstr[1] "у %s человек" +msgstr[2] "у %s человек" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "added by you" +msgstr "добавлен вручную" + +#: web/src/admin/pages/people/device/index.ts +msgid "added by you %s" +msgstr "добавлено вами %s" + +#: web/src/admin/pages/people/device/index.ts +msgid "added on the portal %s" +msgstr "добавлено с портала %s" #: web/src/admin/events/model.ts msgid "address %s" msgstr "адрес %s" -#: web/src/admin/pages/components/hero.ts -msgid "ahead of the latest release" -msgstr "новее последнего релиза" +#: web/src/admin/pages/people/card.ts +msgid "address in the tunnel" +msgstr "адрес в туннеле" + +#: web/src/admin/pages/settings/stages.ts +msgid "addresses taken" +msgstr "адресов занято" #: web/src/admin/events/render.ts msgid "all Cloudflare visitors" msgstr "всех посетителей через Cloudflare" -#: web/src/admin/access.ts -msgid "all networks" -msgstr "все сети" +#: web/src/admin/pages/settings/check.ts +msgid "all home networks" +msgstr "все домашние сети" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/networks.ts msgid "all ports" msgstr "все порты" -#: web/src/admin/events/model.ts -msgid "allowed hours" -msgstr "часы доступа" - #: web/src/admin/map.ts msgid "an unknown city" msgstr "неизвестный город" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/system/model.ts +msgid "an update is running" +msgstr "идёт обновление" + +#: web/src/admin/pages/overview/servers.ts +msgid "and %s more" +msgstr "и ещё %s" + +#: web/src/admin/widgets/reach.ts +msgid "and new ones" +msgstr "и новые" + +#: backend/i18n/messages.js msgid "another program on this router" msgstr "другая программа на этом роутере" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "answers again" msgstr "снова отвечает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk did not install %s %s (installed: %s)" msgstr "apk не установил %s %s (установлено: %s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk did not reinstall the version that is already installed" msgstr "apk не переустановил уже установленную версию" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk doesn't reinstall an installed version. Install a different release, or run install.sh on the router" msgstr "apk не переустанавливает уже установленную версию. Установите другой релиз или запустите install.sh на роутере" @@ -7860,93 +9237,103 @@ msgstr "приблизительно" msgid "approximate location" msgstr "приблизительное местоположение" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "are loaded again" msgstr "снова загружены" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "are missing" msgstr "отсутствуют" -#: web/src/admin/pages/components/hero.ts -msgid "as soon as found" -msgstr "сразу при обнаружении" +#: web/src/admin/pages/settings/networks.ts +msgid "as any other device" +msgstr "как любое другое устройство" -#: web/src/admin/device-link.ts +#: web/src/admin/widgets/config-card.ts msgid "as the server" msgstr "как у сервера" -#: web/src/admin/device-link.ts +#: web/src/admin/events/model.ts +msgid "asked for again: %s" +msgstr "снова запрошено: %s" + +#: web/src/admin/events/model.ts +msgid "asked for: %s" +msgstr "запрошено: %s" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "at home their device is seen as %s" +msgstr "дома его устройство видно как %s" + +#: web/src/admin/widgets/link-values.ts +msgid "auto" +msgstr "авто" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "automatic" msgstr "автоматически" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "automatic update failed" msgstr ": автоматическое обновление не удалось" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "automatically" +msgstr "автоматически" + +#: backend/i18n/messages.js msgid "background check failed: %s" msgstr ": ошибка фоновой проверки (%s)" -#: web/src/shared/format.ts -msgid "bit/s" -msgstr "бит/с" +#: web/src/admin/places/render.ts +msgid "before this period" +msgstr "до периода" -#: web/src/admin/device.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "by you" -msgstr "вами" +msgstr "вручную" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/widgets/link-values.ts +msgid "bytes, every device" +msgstr "байт, всем устройствам" + +#: backend/i18n/messages.js msgid "can't reach Dawnline (luci.dawnline is missing in rpcd)" msgstr "не видит Dawnline (в rpcd нет luci.dawnline)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "can't use the network interface %s: it exists and isn't Dawnline's" msgstr ": нельзя использовать сетевой интерфейс %s, он уже есть и создан не Dawnline" +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/system/model.ts +msgid "can’t start" +msgstr "не запускается" + #: web/src/admin/events/model.ts msgid "certificate" msgstr "сертификат" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate expires %s" msgstr ": сертификат истекает %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate expires within 7 days" msgstr ": сертификат истекает в течение 7 дней" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate renewed · valid until %s" msgstr ": сертификат обновлён · действует до %s" -#: web/src/admin/pages/components/index.ts -msgid "checked %s" -msgstr "проверено %s" +#: web/src/admin/system/model.ts +msgid "certificate: %s d" +msgstr "сертификат: %s дн." -#: web/src/admin/pages/components/hero.ts -msgid "checks daily" -msgstr "проверка ежедневно" - -#: web/src/admin/pages/components/hero.ts -msgid "checks every 12 h" -msgstr "проверка каждые 12 ч" - -#: web/src/admin/pages/components/hero.ts -msgid "checks every 6 h" -msgstr "проверка каждые 6 ч" - -#: web/src/admin/pages/components/hero.ts -msgid "checks off" -msgstr "проверка выкл." - -#: web/src/admin/pages/components/hero.ts -msgid "checks weekly" -msgstr "проверка раз в неделю" - -#: web/src/admin/access.ts -msgid "circle" -msgstr "в круге" +#: web/src/admin/pages/server/overview.ts +msgid "checking…" +msgstr "проверяем…" #: web/src/admin/events/model.ts msgctxt "setting" @@ -7957,42 +9344,51 @@ msgstr "круг" msgid "click to zoom in" msgstr "нажмите, чтобы приблизить" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/people/card.ts +msgid "client IP" +msgstr "IP клиента" + +#: web/src/portal/setup.ts +msgid "computer" +msgstr "компьютер" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "computer" +msgstr "компьютере" + +#: web/src/admin/widgets/link-values.ts +msgid "computers and routers" +msgstr "компьютерам и роутерам" + +#: backend/i18n/messages.js msgid "couldn't be repaired: %s" msgstr ": не удалось исправить (%s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "couldn't be updated - the previous rules stay, and changes to access wait until they load" msgstr "не обновились - действуют прежние, изменения доступа ждут их загрузки" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "couldn't load - no device is loaded into the tunnels until they do" msgstr "не загрузились - пока они не загрузятся, ни одно устройство не попадёт в туннели" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "couldn't load devices into the tunnel" msgstr ": не удалось загрузить устройства в туннель" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js +msgid "couldn't set a route to a network behind a router" +msgstr ": не удалось задать маршрут к сети за роутером" + +#: backend/i18n/messages.js msgid "couldn't start" msgstr ": не запускается" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "couldn't start · %d failed attempts in %d min" msgstr ": не запускается · неудачных попыток: %d за %d мин" -#: web/src/admin/pages/person/devices.ts -msgid "created %s by you." -msgstr "создано вами %s." - -#: web/src/admin/pages/person/devices.ts -msgid "created %s in the portal." -msgstr "создано на портале %s." - -#: web/src/admin/pages/components/hero.ts -msgid "daily at %s" -msgstr "ежедневно в %s" - #: web/src/admin/events/model.ts msgid "data limit" msgstr "лимит трафика" @@ -8005,14 +9401,58 @@ msgstr "период лимита трафика" msgid "data limit reached" msgstr "исчерпан лимит трафика" +#: web/src/admin/pages/settings/router/cert.ts +msgid "day" +msgid_plural "days" +msgstr[0] "день" +msgstr[1] "дня" +msgstr[2] "дней" + +#: web/src/admin/widgets/term.ts +msgid "day left" +msgid_plural "days left" +msgstr[0] "день остался" +msgstr[1] "дня осталось" +msgstr[2] "дней осталось" + +#: web/src/admin/widgets/term.ts +msgid "day since it ended" +msgid_plural "days since it ended" +msgstr[0] "день как закончился" +msgstr[1] "дня как закончился" +msgstr[2] "дней как закончился" + +#: web/src/admin/events/model.ts +msgid "declined: %s" +msgstr "отклонено: %s" + #: web/src/admin/map.ts +#: web/src/admin/pages/people/card.ts +#: web/src/portal/setup.ts msgid "device" msgstr "устройство" +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "device" +msgstr "устройстве" + +#: web/src/admin/flows/add-device.ts +#: web/src/admin/flows/behind-ask.ts +msgid "device fetches its configuration again" +msgid_plural "devices fetch their configuration again" +msgstr[0] "устройство получит конфигурацию заново" +msgstr[1] "устройства получат конфигурацию заново" +msgstr[2] "устройств получат конфигурацию заново" + #: web/src/admin/events/model.ts msgid "device limit" msgstr "лимит устройств" +#: web/src/admin/pages/settings/router/defaults.ts +msgid "device names in the home network are off" +msgstr "имена устройств в домашней сети выключены" + #: web/src/admin/events/model.ts msgid "devices kept apart" msgstr "устройства не видят друг друга" @@ -8025,10 +9465,6 @@ msgstr "устройства видят друг друга" msgid "devices reach each other in circles" msgstr "устройства видят друг друга внутри кругов" -#: web/src/admin/access.ts -msgid "direct" -msgstr "напрямую" - #: web/src/admin/events/model.ts msgid "disguise: %s" msgstr "маскировка: %s" @@ -8037,9 +9473,13 @@ msgstr "маскировка: %s" msgid "down" msgstr "остановка" -#: web/src/admin/pages/people.ts -msgid "e.g. Myata" -msgstr "например, Мята" +#: web/src/admin/pages/settings/check.ts +msgid "each other" +msgstr "друг друга" + +#: web/src/admin/pages/settings/check.ts +msgid "each other in circles" +msgstr "друг друга в кругах" #: web/src/admin/events/model.ts msgid "end date" @@ -8049,11 +9489,7 @@ msgstr "дата окончания" msgid "end date reached" msgstr "наступила дата окончания" -#: web/src/admin/pages/person/limits.ts -msgid "ended" -msgstr "закончился" - -#: web/src/admin/pages/people.ts +#: web/src/admin/widgets/term.ts msgid "ended %s" msgstr "закончился %s" @@ -8076,7 +9512,7 @@ msgstr "закончится завтра" msgid "error" msgstr "ошибка" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "every app" msgstr "все приложения" @@ -8084,21 +9520,21 @@ msgstr "все приложения" msgid "extra data" msgstr "дополнительный трафик" -#: web/src/admin/updater/operation.ts -msgid "failed" -msgstr "ошибка" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "failed - internet goes out directly for now" msgstr ": не работает - пока интернет идёт напрямую" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "failed: %s" msgstr ": ошибка (%s)" -#: web/src/admin/device.ts -msgid "from the portal" -msgstr "через портал" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "found by a check" +msgstr "нашла проверка" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "found by the automatic check" +msgstr "нашла автоматическая проверка" #: web/src/shared/pace.ts msgid "full in about %s day, %s" @@ -8107,11 +9543,19 @@ msgstr[0] "закончится примерно через %s день, %s" msgstr[1] "закончится примерно через %s дня, %s" msgstr[2] "закончится примерно через %s дней, %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/widgets/config-card.ts +msgid "given out %s" +msgstr "выдана %s" + +#: web/src/admin/pages/people/device/link.ts +msgid "handshake %s" +msgstr "рукопожатие %s" + +#: backend/i18n/messages.js msgid "has an invalid interface name \"%s\"" msgstr ": недопустимое имя интерфейса «%s»" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "home" msgstr "домашняя сеть" @@ -8127,95 +9571,115 @@ msgstr "домашние сети" msgid "home services" msgstr "домашние сервисы" -#: web/src/admin/pages/people.ts -msgid "in total" -msgstr "всего" +#: web/src/admin/pages/settings/check.ts +msgid "home services only" +msgstr "только домашние сервисы" -#: web/src/admin/pages/people.ts -msgid "includes +%s GB extra" -msgstr "включая +%s ГБ дополнительно" +#: web/src/admin/flows/circle.ts +msgid "in a circle they still reach nobody, until they get home access" +msgstr "в круге всё равно никого не видят, пока нет доступа домой" #: web/src/admin/events/render.ts msgid "info" msgstr "информация" -#: web/src/admin/pages/components/hero.ts -msgid "install any release" -msgstr "установить любой релиз" +#: web/src/admin/pages/server/settings.ts +msgid "installed" +msgstr "установлено" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/settings/first.ts +msgid "installed if needed, and the disguise picked" +msgstr "установим, если нужно, и выберем маскировку" + +#: backend/i18n/messages.js msgid "installed the %s build" msgstr ": установлена сборка %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "installed the %s build · %s" msgstr ": установлена сборка %s · %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/settings/stages.ts +msgid "interface" +msgstr "интерфейс" + +#: backend/i18n/messages.js msgid "interface %s" msgstr "интерфейс %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "interface %s has Dawnline's settings again" msgstr ": у интерфейса %s снова настройки Dawnline" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "interface %s was changed outside Dawnline" msgstr ": интерфейс %s изменён не через Dawnline" -#: web/src/admin/access.ts -msgid "internet" -msgstr "интернет" +#: web/src/admin/pages/settings/check.ts +msgid "internet directly" +msgstr "интернет напрямую" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/pages/settings/check.ts +msgid "internet like a home device" +msgstr "интернет как у домашнего устройства" + +#: web/src/admin/pages/settings/check.ts +msgid "internet on their own connection" +msgstr "интернет через своё подключение" + +#: web/src/admin/flows/circle.ts +msgid "internet only: reaches nobody yet" +msgstr "только интернет: пока никого не видит" + +#: backend/i18n/messages.js msgid "is kept down" msgstr ": остановлен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise has values AmneziaWG cannot take" msgstr ": остановлен, в маскировке есть значения, которые AmneziaWG не примет" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise needs AmneziaWG %s (installed: %s)" msgstr ": остановлен, для маскировки нужен AmneziaWG %s (установлен %s)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise needs AmneziaWG %s (installed: none)" msgstr ": остановлен, для маскировки нужен AmneziaWG %s (не установлен)" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "is off" msgstr "выключен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "is on · traffic enters %s as %s" msgstr "включён · трафик входит в %s как %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is ready again" msgstr "снова готов" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't answering on port %d" msgstr "не отвечает на порту %d" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "isn't installed: no tunnel can run - install it in Dawnline → Components" msgstr "не установлен: туннели не могут работать - установите его в Dawnline → Компоненты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc +#: backend/i18n/messages.js msgid "isn't installed: tunnels were left as they are" msgstr "не установлен: туннели оставлены как есть" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "isn't known to the network service - restart the network or reboot" msgstr "неизвестен сетевой службе - перезапустите сеть или роутер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't running" msgstr "не работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't running on this router (fw4): tunnels and the portal are closed" msgstr "не работает на этом роутере (fw4): туннели и портал закрыты" @@ -8223,18 +9687,14 @@ msgstr "не работает на этом роутере (fw4): туннели msgid "it needs its new configuration" msgstr "нужна новая конфигурация" +#: web/src/admin/pages/settings/networks.ts +msgid "it works as soon as it is added" +msgstr "работает, как только добавлена" + #: web/src/shared/format.ts msgid "just now" msgstr "только что" -#: web/src/shared/format.ts -msgid "kbit/s" -msgstr "кбит/с" - -#: web/src/admin/pages/person/limits.ts -msgid "keep access" -msgstr "сохранить доступ" - #: web/src/admin/events/model.ts msgid "keep-alive" msgstr "keep-alive" @@ -8243,100 +9703,155 @@ msgstr "keep-alive" msgid "keep-alive %s s" msgstr "keep-alive %s с" +#: web/src/admin/pages/log/index.ts +msgid "kept %s" +msgstr "хранится %s" + #: web/src/admin/events/model.ts msgid "kept in memory only (lost on reboot)" msgstr "только в памяти (пропадают при перезагрузке)" -#: web/src/admin/pages/components/hero.ts -msgid "kept on flash" -msgstr "во флеш-памяти" +#: web/src/admin/pages/log/index.ts +msgid "kept with no age limit" +msgstr "хранится без ограничения по сроку" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "kernel module isn't installed: no tunnel can run - install it in Dawnline → Components" msgstr ": модуль ядра не установлен, туннели не могут работать - установите его в Dawnline → Компоненты" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "kernel module isn't loaded" msgstr ": модуль ядра не загружен" -#: web/src/admin/widgets/tiles.ts -msgid "last 2 min" -msgstr "за 2 мин" +#: web/src/admin/pages/settings/stages.ts +msgid "key" +msgstr "ключ" -#: web/src/admin/pages/person/header.ts -msgid "last seen %s" -msgstr "в сети %s" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 24 hours" +msgstr "за 24 часа" -#: web/src/admin/pages/person/activity.ts -msgid "latest 10 of %s" -msgstr "последние 10 из %s" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 30 days" +msgstr "за 30 дней" -#: web/src/admin/pages/components/hero.ts -msgid "latest release" -msgstr "последний релиз" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 7 days" +msgstr "за 7 дней" -#: web/src/admin/interfaces.ts -msgid "leaves through %s" -msgstr "выход через %s" +#: web/src/admin/people/card.ts +msgid "last day" +msgstr "последний день" -#: web/src/admin/access.ts -msgid "like home" -msgstr "как из дома" +#: web/src/admin/pages/settings/router/backups.ts +msgid "latest %s" +msgstr "последняя %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/pages/settings/router/history.ts +msgctxt "measure" +msgid "limit" +msgstr "предел" + +#: web/src/admin/pages/people/card.ts +msgid "limit for the month" +msgstr "лимит на месяц" + +#: web/src/admin/pages/people/card.ts +msgid "limit for the whole term" +msgstr "лимит на весь срок" + +#: backend/i18n/messages.js msgid "loading it" msgstr "загружаем" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "loading them again" msgstr "загружаем заново" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/system/model.ts +msgid "log: %s d" +msgstr "журнал %s дн." + +#: web/src/admin/system/model.ts +msgid "log: no limit" +msgstr "журнал без срока" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "missing %s" msgstr "не хватает: %s" +#: web/src/admin/widgets/link-values.ts +msgid "mobile networks" +msgstr "мобильные сети" + +#: web/src/admin/widgets/entry.ts +msgid "most networks let it through" +msgstr "большинство сетей его пропускают" + #: web/src/admin/events/model.ts msgid "moved to %s" msgstr "перенос на %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "moved to word codes" msgstr "переведены на коды из слов" +#: web/src/admin/flows/circle.ts +msgid "moves from %s" +msgstr "перейдёт из «%s»" + #: web/src/admin/events/model.ts msgid "name" msgstr "имя" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/people/card.ts +msgid "name in the network" +msgstr "имя в сети" + +#: web/src/admin/pages/settings/stages.ts +msgid "needs attention" +msgstr "требует внимания" + +#: backend/i18n/messages.js msgid "netifd doesn't know the amneziawg protocol (AmneziaWG missing, or the network wasn't restarted after installing it)." msgstr "netifd не знает протокол amneziawg (AmneziaWG не установлен или сеть не перезапускали после установки)." -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed." msgstr "netifd читает обработчики протоколов при запуске, а запущен он был ещё до установки AmneziaWG." -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "network changed - Dawnline set itself up again" msgstr ": сеть изменилась, Dawnline настроился заново" +#: web/src/admin/events/model.ts +msgid "networks behind it: %s" +msgstr "сети за ним: %s" + #: web/src/shared/format.ts msgid "never" msgstr "никогда" -#: web/src/admin/pages/person/header.ts -msgid "never connected" -msgstr "подключений не было" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "next in %s" msgstr "следующая через %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "nightly backup failed: %s" msgstr ": ночная резервная копия не создана (%s)" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/widgets/reach.ts +msgid "no access" +msgstr "нет доступа" + +#: web/src/admin/flows/move-person.ts +#: web/src/admin/pages/overview/servers.ts msgid "no address" msgstr "нет адреса" @@ -8344,64 +9859,155 @@ msgstr "нет адреса" msgid "no age limit" msgstr "без ограничения срока" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/settings/router/index.ts +msgid "no backups" +msgstr "копий нет" + +#: backend/i18n/messages.js msgid "no circle" msgstr "без круга" -#: web/src/admin/pages/person/limits.ts -msgid "no end date" -msgstr "бессрочно" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "no device has to fetch anything" +msgstr "устройствам ничего забирать не нужно" -#: web/src/admin/interfaces.ts +#: web/src/admin/events/timeline.ts +msgid "no failures" +msgstr "сбоев не было" + +#: web/src/admin/widgets/net-switches.ts msgid "no firewall zone" msgstr "нет зоны межсетевого экрана" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts +msgid "no home" +msgstr "без дома" + +#: web/src/admin/pages/settings/networks.ts +msgid "no home network" +msgstr "домашней сети нет" + +#: web/src/admin/widgets/limit-meter.ts msgid "no limit" msgstr "без лимита" -#: web/src/admin/pages/diagnostics/health.ts -msgid "no repairs today" -msgstr "сегодня без исправлений" +#: web/src/admin/events/model.ts +msgid "no longer asked for: %s" +msgstr "запрос снят: %s" + +#: web/src/admin/events/model.ts +msgid "no networks behind it" +msgstr "сетей за ним нет" + +#: web/src/admin/events/model.ts +msgid "no reason given" +msgstr "без причины" #: web/src/admin/events/model.ts msgid "no server" msgstr "нет сервера" -#: web/src/admin/access.ts +#: web/src/admin/widgets/visibility.ts +msgid "nobody has home access yet" +msgstr "доступа домой пока ни у кого нет" + +#: web/src/admin/pages/overview/now.ts +msgid "nobody is connected" +msgstr "никто не подключён" + +#: web/src/admin/flows/circle.ts +#: web/src/admin/widgets/visibility.ts msgid "nobody yet" msgstr "пока никого" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "none" +msgstr "нет" + +#: web/src/admin/widgets/reach.ts +msgid "none picked: the whole home network" +msgstr "ни один не выбран: вся домашняя сеть" + +#: web/src/admin/flows/awg-build.ts msgid "none yet" msgstr "пока нет" -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "not V2RayTun" +msgstr "кроме V2RayTun" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/index.ts +#: web/src/admin/widgets/net-switches.ts +msgid "not applied" +msgstr "не применено" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "not checked yet" msgstr "ещё не проверено" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/check.ts +msgid "not each other" +msgstr "не друг друга" + +#: web/src/admin/pages/settings/networks.ts +msgid "not found" +msgstr "не найден" + +#: web/src/admin/flows/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "not installed" msgstr "не установлено" -#: web/src/admin/pages/people.ts -msgid "not set up" -msgstr "не настроено" +#: web/src/admin/pages/people/card.ts +msgid "not online in 7 days" +msgstr "за 7 дней не подключался" +#: web/src/admin/widgets/net-switches.ts +msgid "not present right now" +msgstr "сейчас отсутствует" + +#: web/src/admin/pages/log/index.ts +msgid "not recorded: %s" +msgstr "не записываются: %s" + +#: web/src/admin/flows/awg-build.ts #: web/src/admin/map.ts #: web/src/admin/places/render.ts -#: web/src/admin/widgets/readouts.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "now" msgstr "сейчас" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/networks.ts +msgid "now %s" +msgstr "сейчас %s" + +#: web/src/admin/ui/measure.ts +msgctxt "measure" +msgid "of" +msgstr "из" + +#: web/src/admin/pages/people/card.ts msgid "of %s" msgstr "из %s" +#: web/src/admin/system/model.ts +msgctxt "portal" +msgid "off" +msgstr "выключен" + +#: web/src/admin/pages/overview/health.ts +msgctxt "server" +msgid "off" +msgstr "выключен" + +#: web/src/admin/pages/settings/router/history.ts +msgid "older ones are removed on their own" +msgstr "старше удаляются сами" + #: web/src/admin/events/model.ts msgid "older than %s day" msgid_plural "older than %s days" @@ -8409,63 +10015,76 @@ msgstr[0] "старше %s дня" msgstr[1] "старше %s дней" msgstr[2] "старше %s дней" -#: web/src/admin/device.ts -msgid "on the portal" -msgstr "на портале" +#: web/src/admin/system/model.ts +msgctxt "portal" +msgid "on" +msgstr "включён" -#: web/src/admin/pages/overview.ts +#: web/src/admin/widgets/timeline.ts msgid "online" msgstr "в сети" -#: web/src/admin/pages/overview.ts -msgid "online for %s" -msgstr "в сети %s" +#: web/src/admin/events/timeline.ts +msgid "online %s in the %s" +msgstr "в сети %s %s" -#: web/src/admin/pages/people.ts -msgid "online from %s" -msgstr "в сети с адреса %s" - -#: web/src/admin/pages/person/header.ts +#: web/src/admin/widgets/feed.ts msgid "online now" msgstr "сейчас в сети" +#: web/src/admin/widgets/feed.ts +msgid "online until %s" +msgstr "в сети до %s" + +#: web/src/admin/widgets/timeline.ts +msgid "only the portal and DNS: the limit" +msgstr "только портал и DNS: лимит" + +#: web/src/admin/pages/settings/networks.ts +msgid "only you add one" +msgstr "добавляете только вы" + +#: web/src/admin/widgets/entry.ts +msgid "opened on the WAN firewall by itself" +msgstr "открывается на WAN сам" + #: web/src/admin/events/model.ts msgid "other addresses" msgstr "другие адреса" -#: web/src/admin/events/model.ts -msgid "outside allowed hours" -msgstr "вне часов доступа" - -#: web/src/admin/pages/person/pickers.ts -msgid "over the limit" -msgstr "сверх лимита" - #: web/src/admin/events/model.ts msgid "pause" msgstr "пауза" -#: web/src/admin/pages/person/limits.ts -msgid "pause access" -msgstr "приостановить доступ" - #: web/src/admin/events/model.ts msgid "paused by admin" msgstr "приостановлено администратором" +#: web/src/admin/pages/settings/first.ts +msgid "personal links people add their own devices with" +msgstr "личные ссылки, по которым люди добавят свои устройства" + +#: web/src/portal/setup.ts +msgid "phone" +msgstr "телефон" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "phone" +msgstr "телефоне" + +#: web/src/admin/widgets/link-values.ts +msgid "phones" +msgstr "телефонам" + #: web/src/admin/events/model.ts msgid "port %s" msgstr "порт %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "port forward “%s”" msgstr "проброс порта «%s»" -#: web/src/admin/access.ts -msgid "ports %s" -msgstr "порты %s" - #: web/src/admin/events/model.ts msgid "problems are only logged, nothing is repaired" msgstr "проблемы только записываются в журнал, ничего не исправляется" @@ -8474,80 +10093,81 @@ msgstr "проблемы только записываются в журнал, msgid "public address" msgstr "публичный адрес" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "public address changed · %s → %s" msgstr ": публичный адрес изменился · %s → %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "reaches Dawnline again" msgstr "снова видит Dawnline" +#: web/src/admin/events/model.ts +msgid "reason: %s" +msgstr "причина: %s" + #: web/src/admin/events/model.ts msgid "redirect" msgstr "перенаправление" -#: web/src/admin/pages/components/hero.ts -msgid "release %s" -msgstr "релиз %s" - -#: web/src/admin/pages/components/hero.ts -msgid "released %s" -msgstr "вышел %s" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "reloading rpcd" msgstr "перезагружаем rpcd" -#: web/src/admin/pages/person/limits.ts -msgid "remove their devices" -msgstr "удалить устройства" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "removed by you" +msgstr "удалён вручную" #: web/src/admin/events/render.ts msgid "repair" msgstr "исправление" -#: web/src/admin/pages/person/limits.ts -msgid "resets on the 1st" -msgstr "сброс 1-го числа" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "restarted · version %s" msgstr "перезапущен · версия %s" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "restarting for the AmneziaWG update" msgstr ": перезапуск для обновления AmneziaWG" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "restarting it" msgstr "перезапускаем" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "restoring them" msgstr "восстанавливаем" -#: web/src/admin/cores/awg.ts -msgid "router %s" -msgstr "роутер %s" +#: web/src/portal/setup.ts +msgid "router" +msgstr "роутер" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/settings/stages.ts +msgctxt "in the tunnel" +msgid "router" +msgstr "роутер" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "router" +msgstr "роутере" + +#: backend/i18n/messages.js msgid "rules for Dawnline are in place again" msgstr ": правила Dawnline снова на месте" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "rules for Dawnline aren't loaded" msgstr ": правила Dawnline не загружены" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "rules for Dawnline were changed or removed" msgstr ": правила Dawnline изменены или удалены" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "runs again" msgstr "снова работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "runs without its fast path" msgstr "работает без ускорения" @@ -8559,9 +10179,9 @@ msgstr "записываются во флеш-память каждые 10 ми msgid "saved to flash hourly" msgstr "записываются во флеш-память раз в час" -#: web/src/admin/pages/people.ts -msgid "seen %s" -msgstr "в сети %s" +#: web/src/admin/widgets/link-values.ts +msgid "seconds, up to 600" +msgstr "секунд, до 600" #: web/src/admin/events/model.ts msgid "server" @@ -8571,105 +10191,184 @@ msgstr "сервер" msgid "server turned off" msgstr "сервер выключен" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "server “%s”" msgstr "сервер «%s»" -#: web/src/admin/access.ts -msgid "services" -msgstr "сервисы" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgctxt "key" msgid "set" msgstr "задан" -#: web/src/admin/device-link.ts -msgid "set when it was added" -msgstr "выбрано при добавлении" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "setting it up again" msgstr "настраиваем заново" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/admin/widgets/timeline.ts +msgid "settings changed" +msgstr "настройка изменилась" + +#: backend/i18n/messages.js msgid "sha256 matches the release (%s…)" msgstr "sha256 совпадает с релизом (%s…)" -#: web/src/admin/widgets/readouts.ts -msgid "so far" -msgstr "пока" +#: web/src/admin/pages/settings/router/history.ts +msgid "since %s" +msgstr "с %s" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "started" msgstr ": запущен" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "started with the router · version %s" msgstr "запущен вместе с роутером · версия %s" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "started · accepting connections on port %s" msgstr ": запущен · принимает подключения на порту %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "started · version %s" msgstr "запущен · версия %s" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "stopped unexpectedly" msgstr ": неожиданно остановился" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "stopped unexpectedly - started again" msgstr "неожиданно остановился - запущен снова" +#: web/src/portal/setup.ts +msgid "tablet" +msgstr "планшет" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "tablet" +msgstr "планшете" + +#: web/src/admin/pages/settings/first.ts +msgid "the address and port: we check the router can be reached from the internet" +msgstr "адрес и порт: проверим, что роутер виден из интернета" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "the check failed" +msgstr "проверка не удалась" + #: web/src/admin/events/model.ts msgid "the file holds private keys" msgstr "в файле есть приватные ключи" -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/reach.ts +msgid "the home network" +msgstr "домашняя сеть" + +#: web/src/admin/pages/settings/check.ts +msgid "the home networks their pages pick" +msgstr "домашние сети, выбранные на их страницах" + +#: web/src/admin/pages/settings/networks.ts msgid "the link is down" msgstr "связь не установлена" +#: web/src/admin/servers/behind.ts +msgid "the network behind %s" +msgstr "сеть за устройством %s" + #: web/src/admin/events/render.ts msgid "the old link stopped working" msgstr "старая больше не работает" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/entry.ts +msgid "the portal’s address" +msgstr "адрес портала" + +#: web/src/admin/pages/settings/check.ts +msgid "the router" +msgstr "роутер" + +#: web/src/admin/events/model.ts +msgid "the router accepted" +msgstr "роутер принят" + +#: web/src/admin/events/model.ts +msgid "the router declined" +msgstr "роутер отклонён" + +#: web/src/admin/events/model.ts +msgid "the router is asked for" +msgstr "запрошен роутер" + +#: web/src/admin/events/model.ts +msgid "the router is asked for again" +msgstr "роутер снова запрошен" + +#: backend/i18n/messages.js msgid "the router itself" msgstr "сам роутер" -#: web/src/admin/pages/person/dialogs.ts -msgid "the server" -msgstr "новый сервер" +#: web/src/admin/pages/settings/check.ts +msgid "the router’s DNS" +msgstr "DNS роутера" -#: web/src/admin/access.ts -msgid "their networks" -msgstr "свои сети" +#: web/src/admin/pages/settings/health.ts +msgid "the server is off" +msgstr "сервер выключен" -#: web/src/admin/access.ts -msgid "their own" -msgstr "свой" +#: web/src/admin/pages/settings/stages.ts +msgid "the tunnel is down" +msgstr "туннель не работает" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -msgid "this month" -msgstr "в этом месяце" +#: web/src/admin/servers/behind.ts +msgid "the tunnel network of %s" +msgstr "туннельная сеть сервера %s" -#: web/src/admin/pages/person/limits.ts -msgctxt "time range" -msgid "to" -msgstr "до" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "the update failed" +msgstr "обновление не удалось" -#: web/src/admin/widgets/tiles.ts +#: web/src/admin/widgets/reach.ts +msgid "their own connection" +msgstr "своё подключение" + +#: web/src/portal/setup.ts +msgid "this device" +msgstr "это устройство" + +#: web/src/admin/pages/settings/stages.ts +msgid "this router" +msgstr "этот роутер" + +#: web/src/admin/servers/behind.ts +msgid "this router’s %s" +msgstr "сеть %s этого роутера" + +#: web/src/admin/widgets/net-values.ts +msgid "this router’s other network" +msgstr "другая сеть этого роутера" + +#: web/src/admin/widgets/reach.ts +msgid "through your router" +msgstr "через ваш роутер" + +#: web/src/admin/widgets/reach.ts +msgid "through your router, as a home device" +msgstr "через ваш роутер, как домашнее устройство" + +#: web/src/admin/pages/overview/now.ts msgid "today" msgstr "сегодня" -#: web/src/admin/pages/people.ts -msgid "today %s" -msgstr "сегодня %s" +#: web/src/admin/events/clock.ts +msgid "today at %s" +msgstr "сегодня в %s" + +#: web/src/admin/widgets/entry.ts +msgid "try a phone on mobile data" +msgstr "проверьте с телефона через мобильную сеть" #: web/src/admin/events/model.ts msgid "tunnel network" @@ -8683,8 +10382,16 @@ msgstr "тип" msgid "type: %s" msgstr "тип: %s" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "under a minute" +msgstr "меньше минуты" + +#: web/src/admin/pages/people/card.ts +msgid "under an hour in 7 days" +msgstr "за 7 дней в сети меньше часа" + +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/term.ts msgid "until %s" msgstr "до %s" @@ -8692,9 +10399,16 @@ msgstr "до %s" msgid "up" msgstr "запуск" -#: web/src/admin/pages/server.ts -msgid "up %s" -msgstr "работает %s" +#: web/src/admin/flows/add-person.ts +msgid "up to %s" +msgstr "до %s" + +#: web/src/admin/system/model.ts +msgid "up to %s device" +msgid_plural "up to %s devices" +msgstr[0] "до %s устройства" +msgstr[1] "до %s устройств" +msgstr[2] "до %s устройств" #: web/src/admin/events/model.ts msgid "up to %s event" @@ -8703,62 +10417,57 @@ msgstr[0] "до %s события" msgstr[1] "до %s событий" msgstr[2] "до %s событий" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "up to date" +msgstr "всё актуально" + +#: backend/i18n/messages.js msgid "update failed" msgstr ": обновление не удалось" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "update to %s failed its check - rolled back to %s" msgstr ": обновление до %s не прошло проверку - откат на %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated automatically · %s" msgstr "обновлены автоматически · %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated automatically · %s → %s" msgstr "обновлён автоматически · %s → %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated · %s" msgstr "обновлены · %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated · %s → %s" msgstr "обновлён · %s → %s" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updates available · %s" msgstr ": есть обновления · %s" -#: web/src/admin/pages/components/awg.ts -msgid "version not checked" -msgstr "версия не проверена" - -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "vpn.example.com or an IP" msgstr "vpn.example.com или IP-адрес" -#: web/src/admin/events/model.ts -msgid "warning before the end" -msgstr "предупреждение до окончания" - #: web/src/admin/events/render.ts msgid "was %s" msgstr "прежнее имя: %s" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "was broken - set up again (%s as %s)" msgstr ": был сломан - настроен заново (%s как %s)" -#: web/src/admin/pages/components/hero.ts -msgid "weekly at %s" -msgstr "еженедельно в %s" +#: web/src/admin/widgets/term.ts +msgid "week of %s" +msgstr "неделя с %s" -#: web/src/admin/events/model.ts -msgid "what happens at the end" -msgstr "действие по окончании" +#: web/src/admin/widgets/term.ts +msgid "weeks" +msgstr "недели" #: web/src/admin/events/model.ts msgid "with %s person" @@ -8767,7 +10476,20 @@ msgstr[0] "с %s человеком" msgstr[1] "с %s людьми" msgstr[2] "с %s людьми" -#: web/src/admin/interfaces.ts +#: web/src/admin/events/clock.ts +msgid "yesterday at %s" +msgstr "вчера в %s" + +#: web/src/admin/pages/settings/networks.ts +msgid "you accept each network" +msgstr "каждую сеть принимаете вы" + +#: web/src/admin/pages/settings/networks.ts +msgid "you accept each router" +msgstr "каждый роутер принимаете вы" + +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-switches.ts msgid "zone %s" msgstr "зона %s" @@ -8775,6 +10497,10 @@ msgstr "зона %s" msgid "“%s” already exists - pick another name." msgstr "«%s» уже есть - выберите другое имя." +#: web/src/shared/nets.ts +msgid "“%s” is not a network like 192.168.2.0/24." +msgstr "«%s» не сеть вида 192.168.2.0/24." + #: web/src/admin/netcheck.ts msgid "“%s” is not a port (1–65535)." msgstr "«%s» - не порт (1–65535)." @@ -8783,10 +10509,10 @@ msgstr "«%s» - не порт (1–65535)." msgid "“%s” is not an IP address. Separate several with commas." msgstr "«%s» - не IP-адрес. Несколько адресов разделяйте запятыми." -#: web/src/admin/pages/components/hero.ts -msgid "← Newer" -msgstr "← Новее" +#: web/src/admin/pages/settings/router/portal.ts +msgid "“Not found”" +msgstr "«Не найдено»" -#: web/src/admin/widgets/readouts.ts -msgid "−%s%% vs average" -msgstr "−%s%% к среднему" +#: web/src/admin/pages/overview/now.ts +msgid "↑ %s from devices" +msgstr "↑ %s от устройств" diff --git a/package/luci-app-dawnline/po/templates/dawnline.pot b/package/luci-app-dawnline/po/templates/dawnline.pot index 1354ebd..59a9c33 100644 --- a/package/luci-app-dawnline/po/templates/dawnline.pot +++ b/package/luci-app-dawnline/po/templates/dawnline.pot @@ -6,114 +6,119 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "\"%s\" already exists." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "\"%s\" is already taken." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "\"%s\" is not a device or an IPv4 address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "\"Devices reach each other\" is off on %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "%d MB free on the overlay" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d MB free on the overlay." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d device is loaded in the tunnel." msgid_plural "%d devices are loaded in the tunnel." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "%d network behind routers is carried by the tunnel." +msgid_plural "%d networks behind routers are carried by the tunnel." +msgstr[0] "" +msgstr[1] "" + +#: backend/i18n/messages.js msgid "%d of %d device missing, %d loaded that should not be." msgid_plural "%d of %d devices missing, %d loaded that should not be." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%d of %d device missing." msgid_plural "%d of %d devices missing." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "%d package update in the feeds: %s" msgid_plural "%d package updates in the feeds: %s" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%d system package" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%d system packages" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s %s automatically" +#: web/src/portal/setup.ts +#: web/src/portal/ui/morph.ts +msgid "%s (Android: %s)" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s %s by you" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s (after %d repair)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s (after %d repairs)" msgstr "" -#: web/src/admin/pages/settings/map.ts -msgid "%s (fallback: %s)" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - %d repairs didn't help" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s - not repaired again (%d repairs didn't help)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s AAAA → %s is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record." msgid_plural "%s AAAA → %s are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router." msgid_plural "%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router." msgstr[0] "" msgstr[1] "" -#: web/src/admin/cores/awg.ts -msgid "%s AmneziaWG device stops connecting until it imports its configuration again (from their personal link or from you)." -msgid_plural "%s AmneziaWG devices stop connecting until they import their configuration again (from their personal link or from you)." -msgstr[0] "" -msgstr[1] "" +#: web/src/admin/flows/add-person.ts +msgid "%s GB" +msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "%s GB a month" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s GB in total" +msgstr "" + +#: backend/i18n/messages.js msgid "%s MB free: settings may stop saving. Remove old backups (Settings → Backups) or shorten the history." msgstr "" @@ -121,150 +126,197 @@ msgstr "" msgid "%s a day lately" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "%s added" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s added by you" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/invite.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s address" msgid_plural "%s addresses" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "%s already exists." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "%s already has %d device. Remove one first to lower the limit to %d." msgid_plural "%s already has %d devices. Remove one first to lower the limit to %d." msgstr[0] "" msgstr[1] "" -#: web/src/admin/device.ts -msgid "%s already has %s of %s device. As admin you can still add one." -msgid_plural "%s already has %s of %s devices. As admin you can still add one." -msgstr[0] "" -msgstr[1] "" - #: web/src/admin/netcheck.ts msgid "%s already uses %s." msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "%s and %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s and %s are not in one circle" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s and %s overlap: each packet type needs values of its own." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "%s applied" +#: web/src/admin/pages/settings/networks.ts +msgid "%s asked for it on their page" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s asked on their page: accept or decline" +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s asks for a network behind it" +msgid_plural "%s asks for networks behind it" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s asks to add this router" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s asks to add this router on their page" +msgstr "" + +#: web/src/admin/events/clock.ts +msgid "%s at %s" +msgstr "" + +#: backend/i18n/messages.js +msgid "%s behind %s is not a network a router may have behind it." +msgstr "" + +#: backend/i18n/messages.js +msgid "%s behind %s is written twice, or is one more than a router may have." +msgstr "" + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with %s behind %s." +msgstr "" + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with %s, which the router has itself." +msgstr "" + +#: backend/i18n/messages.js +msgid "%s behind %s shares addresses with the tunnel network of %s (%s)." msgstr "" #: web/src/admin/events/render.ts msgid "%s blocked %s for 15 min after too many wrong codes" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "%s build" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "%s byte" -msgid_plural "%s bytes" -msgstr[0] "" -msgstr[1] "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -msgid "%s can't be reached: it is outside their allowed hours" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: it is turned off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: their access has ended" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: their server is turned off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they are paused" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they have no server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't be reached: they used up their data" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -msgid "%s can't connect: it is outside their allowed hours" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: their access has ended" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: their server is turned off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they are paused" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they have no server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s can't connect: they used up their data" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s can't use the network interface %s: it exists and isn't Dawnline's." msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s check failed" +#: backend/i18n/messages.js +msgid "%s cannot be changed for several people at once." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "%s city" -msgid_plural "%s cities" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s change" +msgid_plural "%s changes" msgstr[0] "" msgstr[1] "" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/changes.ts +msgid "%s change applied" +msgid_plural "%s changes applied" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s change is not applied: it will be lost." +msgid_plural "%s changes are not applied: they will be lost." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/person/index.ts +msgid "%s change was not applied" +msgid_plural "%s changes were not applied" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/server/overview.ts +#: web/src/admin/pages/settings/health.ts +msgid "%s check passed" +msgid_plural "%s checks passed" +msgstr[0] "" +msgstr[1] "" + +#: web/src/portal/ui/wait-way.ts +msgid "%s connected" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts msgid "%s copied" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s covers %s and is valid for more than 14 days." msgstr "" @@ -273,45 +325,71 @@ msgid "%s d ago" msgstr "" #: web/src/admin/events/model.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/people/card.ts msgid "%s day" msgid_plural "%s days" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/dialogs.ts -msgid "%s day before" -msgid_plural "%s days before" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/term.ts msgid "%s day left" msgid_plural "%s days left" msgstr[0] "" msgstr[1] "" -#: web/src/admin/access.ts +#: web/src/admin/pages/overview/now.ts +msgid "%s days" +msgstr "" + +#: web/src/admin/widgets/week-use.ts +msgid "%s days ago" +msgstr "" + +#: web/src/admin/flows/circle.ts msgid "%s deleted" msgstr "" +#: web/src/admin/flows/invite.ts +#: web/src/admin/flows/restore.ts #: web/src/admin/map.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/overview/head.ts +#: web/src/admin/pages/overview/now.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/settings/pending-dock.ts +#: web/src/admin/people/lines.ts msgid "%s device" msgid_plural "%s devices" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/dialogs.ts -msgid "%s device gets a new address and stops connecting until it imports its configuration again (from the personal link or from you). Circles and home networks of the old server are left behind." -msgid_plural "%s devices get new addresses and stop connecting until they import their configuration again (from the personal link or from you). Circles and home networks of the old server are left behind." +#: web/src/admin/pages/settings/disguise.ts +msgid "%s device fetches its configuration again" +msgid_plural "%s devices fetch their configuration again" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/server.ts -msgid "%s device gets a new address and stops connecting until it imports its configuration again (from their personal link or from you)." -msgid_plural "%s devices get new addresses and stop connecting until they import their configuration again (from their personal link or from you)." +#: web/src/admin/flows/server-change.ts +msgid "%s device fetches its configuration again to drop the extra routes." +msgid_plural "%s devices fetch their configuration again to drop the extra routes." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/person/index.ts +msgid "%s device fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices fetch their configuration again. Until then they work the old way." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device fetches the configuration" +msgid_plural "%s devices fetch the configuration" msgstr[0] "" msgstr[1] "" @@ -327,94 +405,161 @@ msgid_plural "%s devices in an unknown city, %s" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/pickers.ts -msgid "%s device in use" -msgid_plural "%s devices in use" +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "%s device keeps asking the old DNS until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices keep asking the old DNS until they fetch their configuration again. Their connection is not interrupted." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/dialogs.ts -msgid "%s device is disconnected immediately and the personal link stops working." -msgid_plural "All %s devices are disconnected immediately and the personal link stops working." +#: web/src/admin/flows/server-change.ts +msgid "%s device keeps its old keep-alive until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices keep their old keep-alive until they fetch their configuration again. Their connection is not interrupted." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/people.ts -msgid "%s device is disconnected immediately and the personal link stops working. Usage history is kept in backups." -msgid_plural "All %s devices are disconnected immediately and the personal link stops working. Usage history is kept in backups." +#: web/src/admin/pages/people/map-view.ts +msgid "%s device online" +msgid_plural "%s devices online" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/overview.ts -msgid "%s device needs its configuration again (networks or DNS changed)." -msgid_plural "%s devices need their configuration again (networks or DNS changed)." +#: web/src/admin/flows/server-change.ts +msgid "%s device reaches the new home networks once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices reach the new home networks once they fetch their configuration again. Until then they work the old way." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/server-change.ts +msgid "%s device reaches these networks once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices reach these networks once they fetch their configuration again. Until then they work the old way." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device sees the others once it fetches its configuration again. Until then it works the old way." +msgid_plural "%s devices see the others once they fetch their configuration again. Until then they work the old way." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stays on the old MTU until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices stay on the old MTU until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again." +msgid_plural "%s devices stop connecting until they fetch their configuration again." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old address." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old address." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old disguise." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old disguise." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: it has the old port." +msgid_plural "%s devices stop connecting until they fetch their configuration again: theirs has the old port." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device stops connecting until it fetches its configuration again: its address is from the old network." +msgid_plural "%s devices stop connecting until they fetch their configuration again: their addresses are from the old network." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/move-person.ts +msgid "%s device stops connecting until it takes its set-up again: %s has its own address and key." +msgid_plural "%s devices stop connecting until they take their set-up again: %s has its own address and key." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/settings/pending-dock.ts +msgid "%s device will fetch the configuration" +msgid_plural "%s devices will fetch the configuration" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/server-change.ts +msgid "%s device works the old way until it fetches its configuration again. Its connection is not interrupted." +msgid_plural "%s devices work the old way until they fetch their configuration again. Their connection is not interrupted." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/people/card.ts +msgid "%s does not connect" +msgstr "" + +#: backend/i18n/messages.js msgid "%s does not cover %s (it has %s): browsers will warn." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not exist." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not overlap other networks." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "%s does not resolve right now, and V2RayTun on Android connects by IP address only." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s does not resolve." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s doesn't reach %s" msgstr "" #: web/src/admin/events/model.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/log/index.ts msgid "%s entry" msgid_plural "%s entries" msgstr[0] "" msgstr[1] "" #: web/src/admin/events/model.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s event" msgid_plural "%s events" msgstr[0] "" msgstr[1] "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "%s event removed" msgid_plural "%s events removed" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s expires within 14 days." msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s found by a check" -msgstr "" +#: web/src/admin/events/timeline.ts +msgid "%s failure" +msgid_plural "%s failures" +msgstr[0] "" +msgstr[1] "" -#: web/src/admin/pages/components/activity.ts -msgid "%s found by the automatic check" -msgstr "" - -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "%s from the OpenWrt feeds. Dawnline sets the rest up when they arrive." msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "%s from the OpenWrt feeds. Services that use them restart for a moment." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s goes through Cloudflare; in Russia such connections often stall after ~16 KB." msgstr "" @@ -422,177 +567,199 @@ msgstr "" msgid "%s h ago" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home and Internet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only: only DNS and the portal on the router." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Home only: their device's own internet reaches it, not the tunnel." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/behind-ask.ts +msgid "%s has Internet access: all of that place’s internet will go through this tunnel." +msgstr "" + +#: backend/i18n/messages.js msgid "%s has Internet only" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Internet only." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has Internet only: only DNS and the portal on the router." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s has a tag that is not closed with >." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s has an invalid interface name \"%s\"." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has never connected" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "%s has no IPv4 address." msgstr "" -#: web/src/admin/access.ts -msgid "%s has no home access: their devices aren't reachable anyway" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "%s has no room for every device on %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has no server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s has only some home services" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "%s has used 90% of the data limit." -msgstr "" - -#: web/src/admin/ui/badges.ts -msgid "%s home service only" -msgid_plural "%s home services only" +#: web/src/admin/events/timeline.ts +msgid "%s hour" +msgid_plural "%s hours" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/people/card.ts +msgid "%s hour in 7 days" +msgid_plural "%s hours in 7 days" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/overview/now.ts +msgid "%s in 30 days" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgid "%s in memory" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s in memory, %s on flash" msgstr "" -#: web/src/admin/pages/person/limits.ts #: web/src/shared/format.ts msgid "%s in total" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/widgets/net-switches.ts +msgid "%s interface is not offered" +msgid_plural "%s interfaces are not offered" +msgstr[0] "" +msgstr[1] "" + +#: backend/i18n/messages.js msgid "%s is %s, one of %s's home services" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "%s is 0 or 1." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "%s is AmneziaWG 1.0 junk only, which networks learned to spot; it is not offered any more. Switch to %s or %s: devices import their configuration again." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is active" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is at home (%s)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/system/model.ts +msgid "%s is available" +msgstr "" + +#: backend/i18n/messages.js +msgid "%s is behind %s" +msgstr "" + +#: backend/i18n/messages.js +msgid "%s is behind this device" +msgstr "" + +#: backend/i18n/messages.js msgid "%s is connected" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is down." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is down: %s." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "%s is in %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is in %s, which %s doesn't reach" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is in home network %s" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "%s is in no circle" +#: backend/i18n/messages.js +msgid "%s is in the list twice." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise has values AmneziaWG cannot take. %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise needs AmneziaWG %s (installed: %s)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s is kept down: its disguise needs AmneziaWG %s (installed: none)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is missing." msgid_plural "%s are missing." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "%s is not a bridge, so Dawnline cannot join the LAN as a device." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is not a common home subnet: the networks people connect from rarely use the same addresses." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "%s is not a package Dawnline manages" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/shared/nets.ts +msgid "%s is not a private network (10.x, 172.16–31.x, 192.168.x)." +msgstr "" + +#: backend/i18n/messages.js msgid "%s is not an IP address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s is not in a firewall zone, so the server port cannot be opened on it." msgstr "" @@ -600,146 +767,204 @@ msgstr "" msgid "%s is not in any home network of this server: nobody would reach it." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is not one of %s's home services" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s is not one of Dawnline's tunnels." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is on another server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is on the internet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/card.ts +msgid "%s is on two devices at once" +msgstr "" + +#: backend/i18n/messages.js msgid "%s is one of the most common home subnets. On a network with the same addresses, people with home access reach your home instead of their own: their printer or TV there is out of reach while connected, with LAN Bypass too. A rarer subnet for your home network avoids it, for example 10.37.12.0/24." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s is part of %s; choose %s instead." msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/person-acts.ts +msgid "%s is paused" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +msgid "%s is paused again" +msgstr "" + +#: web/src/admin/flows/add-person.ts +#: web/src/admin/flows/invite.ts msgid "%s is ready" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/people/diagnosis.ts +msgid "%s is running" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "%s is running, last connection %s" +msgstr "" + +#: web/src/shared/nets.ts +msgid "%s is taken: it is %s. The two ends need different ranges." +msgstr "" + +#: backend/i18n/messages.js msgid "%s is the WAN." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router on a network %s doesn't reach" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router: DNS is open to everyone" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s is this router: the personal portal is open to everyone" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/shared/nets.ts +msgid "%s is too wide: /16 at the most." +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/people/diagnosis.ts msgid "%s is turned off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/move-person.ts +msgid "%s is turned off: devices do not connect until it is on." +msgstr "" + +#: web/src/admin/flows/device-acts.ts +msgid "%s is turned on" +msgstr "" + +#: backend/i18n/messages.js msgid "%s is up, listening on UDP %d." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s isn't connected right now" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s isn't in %s's home network" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "%s junk" -msgid_plural "%s junk" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "%s left" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s may not contain # or a line break." msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "%s min %s s ago" -msgstr "" - #: web/src/shared/format.ts msgid "%s min ago" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s month" msgid_plural "%s months" msgstr[0] "" msgstr[1] "" -#: web/src/admin/widgets/health.ts -msgid "%s more in Diagnostics" +#: web/src/admin/pages/overview/waiting.ts +msgid "%s more" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/people/card.ts +msgctxt "problems" +msgid "%s more" +msgstr "" + +#: web/src/admin/flows/server-change.ts +msgid "%s more is not set up yet: it gets the new one right away." +msgid_plural "%s more are not set up yet: they get the new one right away." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/awg-build.ts msgid "%s moves to %s with OpenWrt %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 10-100, up to 65535." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 100-200, up to 4294967295." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be a number or a range like 5-15, from 1 to 65535." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js +msgid "%s must be a value, not a list." +msgstr "" + +#: backend/i18n/messages.js msgid "%s must be a whole number from 0 to 65535." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be at least 12 with header protection." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be from %d to %d." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s must be on or off." msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "%s needs a manual switch in Components" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "%s needs its configuration again." -msgstr "" +#: web/src/admin/widgets/reach.ts +msgid "%s network" +msgid_plural "%s networks" +msgstr[0] "" +msgstr[1] "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/shared/nets.ts +msgid "%s network behind one router at the most." +msgid_plural "%s networks behind one router at the most." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/map-view.ts +msgid "%s now" +msgid_plural "%s now" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/ui/filter-bar.ts +#: web/src/admin/widgets/limit-meter.ts msgid "%s of %s" msgstr "" @@ -751,160 +976,171 @@ msgstr "" msgid "%s of %s GB this month" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "%s of %s check passed" -msgid_plural "%s of %s checks passed" +#: web/src/admin/pages/settings/stages.ts +msgid "%s of %s addresses taken" +msgstr "" + +#: web/src/admin/pages/server/overview.ts +msgid "%s of %s fine" +msgstr "" + +#: web/src/admin/pages/overview/health.ts +msgid "%s of %s passed" +msgstr "" + +#: web/src/admin/flows/add-device.ts +msgid "%s of %s slot free" +msgid_plural "%s of %s slots free" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -msgid "%s of %s device" -msgid_plural "%s of %s devices" +#: web/src/admin/flows/server-change.ts +msgid "%s of them belongs to someone without access now: it fetches it when access is back." +msgid_plural "%s of them belong to people without access now: they fetch it when access is back." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/components/index.ts -msgid "%s of %s needs an update" -msgid_plural "%s of %s need an update" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/settings/backups.ts -msgid "%s older backup" -msgid_plural "%s older backups" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "%s on flash" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "%s on this router" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/index.ts msgid "%s online" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/portal/setup.ts +msgid "%s or %s" +msgstr "" + +#: backend/i18n/messages.js msgid "%s overlaps %s." msgstr "" -#: web/src/admin/pages/people.ts -msgid "%s paused" -msgstr "" +#: web/src/admin/pages/settings/router/updates.ts +msgid "%s package update" +msgid_plural "%s package updates" +msgstr[0] "" +msgstr[1] "" -#: web/src/admin/access.ts +#: web/src/admin/flows/restore.ts #: web/src/admin/map.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/pages/settings/check.ts +#: web/src/admin/widgets/visibility.ts msgid "%s person" msgid_plural "%s people" msgstr[0] "" msgstr[1] "" -#: web/src/admin/interfaces.ts -msgid "%s person has Home-only access: their devices need the configuration again to reach the new networks." -msgid_plural "%s people have Home-only access: their devices need the configuration again to reach the new networks." +#: web/src/admin/pages/people/notices.ts +msgid "%s person has not fetched it yet" +msgid_plural "%s people have not fetched it yet" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/activity.ts -msgid "%s place in 30 days" -msgid_plural "%s places in 30 days" +#: web/src/admin/pages/people/notices.ts +msgid "%s person without access" +msgid_plural "%s people without access" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/circle.ts +msgid "%s picked" +msgid_plural "%s picked" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/map-view.ts +msgid "%s place" +msgid_plural "%s places" +msgstr[0] "" +msgstr[1] "" + +#: backend/i18n/messages.js msgid "%s points at %s, not this router (%s)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s points at %s, not this router (WAN %s). Check your DNS / DDNS." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s points at this router (%s)." msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s problem needs attention." -msgid_plural "%s problems need attention." +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/system/model.ts +msgid "%s problem" +msgid_plural "%s problems" msgstr[0] "" msgstr[1] "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "%s random packet of %s–%s bytes before each handshake." msgid_plural "%s random packets of %s–%s bytes before each handshake." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/overview.ts -msgid "%s reached the data limit." -msgstr "" - -#: web/src/admin/pages/person/pickers.ts -msgid "%s reaches %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s reaches %s." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "%s reaches every home network" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "%s reaches no home network." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/widgets/feed.ts +msgid "%s reconnect" +msgid_plural "%s reconnects" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "%s removed" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s repair" -msgid_plural "%s repairs" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s repair today, last %s at %s" -msgid_plural "%s repairs today, last %s at %s" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/people.ts -msgid "%s resumed" -msgstr "" - -#: web/src/admin/device-link.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "%s s" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "%s s ago" -msgstr "" +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/overview/head.ts +msgid "%s server" +msgid_plural "%s servers" +msgstr[0] "" +msgstr[1] "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/widgets/reach.ts +msgid "%s service" +msgid_plural "%s services" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/events/timeline.ts msgid "%s since %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "%s still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations." msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "%s still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations." msgstr "" -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/updater/jobs.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "%s system package" msgid_plural "%s system packages" msgstr[0] "" @@ -914,109 +1150,161 @@ msgstr[1] "" msgid "%s takes over when the tunnel is down." msgstr "" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/header.ts #: web/src/shared/format.ts msgid "%s this month" msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "%s time" -msgid_plural "%s times" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/overview.ts -msgid "%s today" -msgstr "" - -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "%s update" msgid_plural "%s updates" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/components/activity.ts -msgid "%s update failed" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "%s updated" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s updated automatically" +#: web/src/admin/widgets/limit-meter.ts +msgid "%s used of the limit are let go, and a new month begins when they next connect." msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "%s updated by you" -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "%s uses %s now - devices need their configuration again" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "%s warning." -msgid_plural "%s warnings." +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/system/model.ts +msgid "%s warning" +msgid_plural "%s warnings" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/widgets/visibility.ts +msgid "%s with internet only see nobody under any rule." +msgstr "" + +#: web/src/admin/pages/settings/disguise.ts +msgid "%s with the values in use" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgid "%s year" msgid_plural "%s years" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/settings/changes.ts +msgid "%s · %s" +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "%s · %s more above" +msgstr "" + +#: web/src/admin/flows/setup.ts +msgid "%s · %s. Waiting for its first connection with the new configuration." +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +msgid "%s · %s: %s?" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "%s · auto" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +msgid "%s · automatic" +msgstr "" + +#: backend/i18n/messages.js msgid "%s · interface settings" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "%s · restored" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "%s – %s (router time)" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s (Cloudflare). %s reaches the router only if this name is DNS-only there, or use the router's IP." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s (this router)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS." msgid_plural "%s → %s: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, so only devices with IPv6 connect (the router's IPv4 %s has no name)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "%s → %s: IPv6 only, so only devices with IPv6 connect." msgstr "" +#: web/src/admin/flows/move-person.ts +msgid "%s → %s?" +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "%s%% of the data limit" +msgstr "" + #: web/src/admin/places/render.ts msgid "%s%% of the time" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/limit-meter.ts msgid "%s%% used" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "%s, online" +#: web/src/admin/pages/log/clear.ts +msgid "%s+ day" +msgid_plural "%s+ days" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/events/clock.ts +msgid "%s, %s" +msgstr "" + +#: web/src/admin/flows/invite.ts +msgid "%s, %s over HTTP" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s, last 30 days" +msgstr "" + +#: web/src/admin/widgets/week-use.ts +msgid "%s, last 7 days" +msgstr "" + +#: web/src/shared/format.ts +msgid "%s/s" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/limit-meter.ts +#: web/src/admin/widgets/reach.ts +msgid "%s: %s" +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "%s: %s accepted" msgstr "" #: web/src/admin/map.ts @@ -1031,194 +1319,324 @@ msgid_plural "%s: %s devices in an unknown city" msgstr[0] "" msgstr[1] "" -#: web/src/admin/disguise.ts -msgid "%s: %s of 4" +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "%s: +%s GB until the reset" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or ." msgstr "" +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/device/index.ts +msgid "%s: access resumed" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +msgid "%s: access until %s" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +msgid "%s: access with no end date" +msgstr "" + #: web/src/admin/events/model.ts msgid "%s: automatic" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/people/lines.ts +msgid "%s: needs a new configuration" +msgstr "" + +#: web/src/admin/pages/overview/servers.ts +msgid "%s: no server, no access" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "%s: nothing gets through" +msgstr "" + +#: web/src/admin/pages/people/card.ts +msgid "%s: open, link, device, pause" +msgstr "" + +#: web/src/admin/places/render.ts +msgid "%s: replay this period" +msgstr "" + +#: web/src/admin/flows/move-person.ts +msgid "%s: server %s" +msgstr "" + +#: web/src/admin/pages/people/person/devices.ts +msgid "%s: set-up, turn off, new keys, remove" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "%s: the VPN does not connect from the network it is on now. Its attempts reach the router, but the answer does not reach the device. The configuration is right, the network is in the way. Try another one: mobile data instead of Wi‑Fi, or the other way round. If that does not help, write to me." +msgstr "" + +#: web/src/admin/people/card.ts +msgid "%s: the connection keeps dropping" +msgstr "" + +#: backend/i18n/messages.js msgid "%s: the device's own network handles it." msgstr "" +#: backend/i18n/messages.js +msgid "%s: the tunnel carries this network, and the rules see a host there as they see the router." +msgstr "" + +#: web/src/admin/pages/people/card.ts +msgid "%s: traffic in the last 7 days" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "%s: usage reset" +msgstr "" + +#: web/src/admin/pages/people/card.ts +#: web/src/shared/format.ts +msgid "%sd" +msgstr "" + #: web/src/shared/format.ts msgid "%sd %sh" msgstr "" +#: web/src/admin/pages/people/card.ts +#: web/src/shared/format.ts +msgid "%sh" +msgstr "" + #: web/src/shared/format.ts msgid "%sh %sm" msgstr "" +#: web/src/admin/pages/people/card.ts #: web/src/shared/format.ts msgid "%sm" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "%s’s access %s." -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "%s’s access has ended." -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "%s’s end date passed (%s) · access kept." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "(%d more)" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "+%s more in What’s new" -msgid_plural "+%s more in What’s new" +#: web/src/admin/people/lines.ts +msgid "+%s GB" +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "+%s GB until %s" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "+%s GB until the reset" +msgstr "" + +#: web/src/admin/widgets/term.ts +msgid "+%s month" +msgid_plural "+%s months" msgstr[0] "" msgstr[1] "" -#: web/src/admin/widgets/readouts.ts -msgid "+%s%% vs average" +#: web/src/admin/widgets/config-card.ts +msgid "1280–1500, or empty: automatic" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "+1 month" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "+1 week" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "+1 year" -msgstr "" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "+10 GB this month" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "+3 months" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "1 month" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "1 year" -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "15 min" -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "2 min" -msgstr "" - -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "24h" msgstr "" -#: web/src/admin/pages/people.ts -msgid "3 months" -msgstr "" - -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/device/traffic.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/limit-meter.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "30 days" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "4500 is IPsec’s port: most networks let it through." msgstr "" -#: web/src/admin/map.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "7 days" msgstr "" -#: web/src/admin/pages/server.ts -msgid "A DDNS name keeps links working when your IP changes; not through Cloudflare (use a DNS-only name or an IP)" +#: web/src/admin/flows/restore.ts +msgid "A Dawnline backup: people, devices, servers and their keys." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "A DDNS name would follow it by itself." +#: web/src/admin/widgets/link-values.ts +msgid "A device is silent while it has nothing to send: behind NAT it may not be reachable from home until it speaks first." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/widgets/link-values.ts +msgid "A device sends a packet every %s s: it stays reachable from home behind its network’s NAT. A little battery on phones." +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "A device, or 10.0.1.11" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "A device’s own value is set on its page and is not changed here." +msgstr "" + +#: web/src/admin/servers/params.ts msgid "A first packet shaped like a DNS answer." msgstr "" +#: web/src/admin/flows/portal-sheets.ts +msgid "A full path on the router, starting with /." +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "A home service, or 192.168.1.10:445" +msgstr "" + #: web/src/admin/netcheck.ts msgid "A hostname has no spaces." msgstr "" -#: web/src/admin/pages/server.ts -msgid "A hostname or IP address of your router on the internet; not through Cloudflare (use a DNS-only name or an IP). IPv6 works too, and is the way out of CGNAT" +#: web/src/admin/pages/settings/router/portal.ts +msgid "A link nobody was given is sent to this address, so the portal does not show itself to a stranger." +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts +msgid "A link nobody was given opens a bare “Not found” page." +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "A month on from the end date (or from today once it has passed)" +msgstr "" + +#: backend/i18n/messages.js +msgid "A network behind a router has no route" +msgstr "" + +#: backend/i18n/messages.js +msgid "A network behind a router isn’t in effect" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "A new AmneziaWG module restarts every tunnel." +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "A new configuration is needed: %s device" +msgid_plural "A new configuration is needed: %s devices" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/flows/invite.ts +msgid "A new link for %s?" msgstr "" #: web/src/admin/netcheck.ts msgid "A number of GB, up to 100000." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/networks.ts +msgid "A packet crosses the router twice" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "A page where each person adds and manages their devices with their personal link." msgstr "" -#: web/src/admin/pages/server.ts -msgid "A page where each person adds their own devices with their personal link" +#: backend/i18n/messages.js +msgid "A route to a network behind a router couldn't be set: %s." msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "A set time keeps tunnel restarts out of the evening; the run happens within an hour of it." +#: web/src/admin/pages/settings/networks.ts +msgid "A router and every network behind it wait in the card above for your answer. Taking a network away is the person’s to do at once." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/networks.ts +msgid "A router and its networks work as soon as a person adds them, and other people’s devices fetch their configuration again." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "A router brings its own network along: home devices and people with home access reach it through the tunnel, and it reaches what its person reaches." +msgstr "" + +#: backend/i18n/messages.js +msgid "A router has %d networks behind it at the most." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "A router is added at once and connects as one device; the networks behind it wait for your answer." +msgstr "" + +#: backend/i18n/messages.js +msgid "A router reaches its own network without the tunnel." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "A router waits for your answer; once it is taken, its person changes its networks with no answer of yours." +msgstr "" + +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/settings/router/history.ts +msgid "A spreadsheet" +msgstr "" + +#: web/src/admin/flows/versions.ts +msgid "A version by its tag" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "ACME isn’t installed. With it the router gets a certificate and browsers stop warning." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "ACME isn’t installed. With it the router gets a certificate for %s and browsers stop warning." msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts +#: web/src/portal/setup.ts +msgid "APK file on" +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-values.ts +msgid "Accept" +msgstr "" + +#: web/src/admin/widgets/net-values.ts +msgid "Accept %s" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/diagnosis.ts msgid "Access" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Access %s (router time)" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "Access & limits" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "Access and limits" -msgstr "" - -#: web/src/admin/ui/badges.ts -msgid "Access ended" -msgstr "" - -#: web/src/admin/pages/people.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Access ended %s" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Access ends" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "Access ends %s" +#: web/src/admin/people/lines.ts +msgid "Access ended %s: resumed without a new end date, it ends again at once." msgstr "" #: web/src/admin/events/render.ts @@ -1241,7 +1659,7 @@ msgstr "" msgid "Access ends today (%s)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Access must be lan, internet or both." msgstr "" @@ -1261,214 +1679,250 @@ msgstr "" msgid "Access resumed - %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Access rules" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Access rules aren’t loaded" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "Access rules couldn't be updated (%s): the previous rules stay, so this change isn't in effect yet." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "Access rules couldn't load (%s): no device is loaded into the tunnels until they do." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Access rules loaded" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Access saved" -msgstr "" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "Access until %s" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Access: %s" +#: web/src/admin/pages/people/pick.ts +msgid "Actions with the selected" msgstr "" -#: web/src/shared/format.ts -msgid "Active" -msgstr "" - -#: web/src/admin/pages/components/awg.ts -msgctxt "build" -msgid "Active" -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/device.ts -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts +#: backend/i18n/messages.js msgid "Activity" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Activity log" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Activity: %s." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Add" msgstr "" -#: web/src/admin/device.ts -msgid "Add a device for %s" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Add Tunnel" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +msgid "Add a device · %s" +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +msgid "Add a second device" +msgstr "" + +#: web/src/admin/flows/new-server.ts msgid "Add a server" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/pages/settings/router/portal.ts +msgid "Add an address" +msgstr "" + +#: web/src/admin/flows/add-device.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/people/lines.ts msgid "Add device" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Add from devices at home" msgstr "" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/person/head.ts msgid "Add note" msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/person/devices.ts +msgid "Add over the limit" +msgstr "" + +#: web/src/admin/pages/people/cards.ts +#: web/src/admin/pages/people/index.ts msgid "Add person" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/overview/servers.ts msgid "Add server" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Add service" msgstr "" -#: web/src/admin/invite.ts -msgid "Add the device and connect" +#: web/src/admin/pages/people/cards.ts +msgid "Add someone and send them their personal link: they add their devices themselves." msgstr "" -#: web/src/admin/device.ts -msgid "Added" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Add the Russian translation" msgstr "" -#: web/src/admin/device.ts -msgid "Added %s" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Add the Russian translation?" msgstr "" -#: web/src/admin/pages/person/header.ts -msgctxt "date" -msgid "Added %s" +#: backend/i18n/messages.js +msgid "Add the router as a new device: a device cannot be made one here." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/flows/invite.ts +msgid "Added on the portal through the old link: they keep working until they are removed." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "Adding a router" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "Adding a router on people’s pages" +msgstr "" + +#: web/src/admin/flows/server-change.ts +msgid "Adding a router on people’s pages: %s?" +msgstr "" + +#: backend/i18n/messages.js msgid "Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link." msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Adding the Russian translation" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/entry.ts msgid "Address" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/entry.ts msgid "Address copied" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/widgets/entry.ts +msgid "Address for devices" +msgstr "" + +#: web/src/admin/flows/server-change.ts +msgid "Address for devices: %s?" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +msgid "Address in the tunnel" +msgstr "" + +#: backend/i18n/messages.js msgid "Address must be an IPv4 address." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Address range" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Address removed: %s" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/entry.ts +msgid "Address · the portal’s" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "Address: %s" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/config-card.ts msgid "Addresses" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Addresses devices get inside the tunnel" -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Adds the LAN this router uses." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/device/index.ts +msgid "Advice copied: send it to them" +msgstr "" + +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Advice · %s" +msgstr "" + +#: backend/i18n/messages.js msgid "Agent" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Alert at 90%" -msgstr "" - -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/widgets/reach.ts msgid "All" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "All %s check passed" -msgid_plural "All %s checks passed" -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/device.ts -msgid "All activity" +#: web/src/admin/flows/places-closeup.ts +msgid "All devices" msgstr "" -#: web/src/admin/logs.ts -msgid "All categories" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "All checks passed." -msgstr "" - -#: web/src/admin/updater/operation.ts -msgid "All components" -msgstr "" - -#: web/src/admin/events/render.ts -msgid "All devices removed, end date reached" -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "All good. Nothing needs you right now." -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "All in Log" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "All in Log →" +#: web/src/admin/widgets/rollout.ts +msgid "All in People" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc -#: web/src/admin/access.ts +#: web/src/admin/flows/add-person.ts +msgid "All of it can be changed later on their page. Their invite comes next, in this sheet." +msgstr "" + +#: web/src/admin/widgets/reach.ts +msgid "All of them includes networks added to the server later; a choice keeps them out." +msgstr "" + +#: web/src/admin/pages/people/map-view.ts +msgid "All places" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/flows/home-service.ts msgid "All ports" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "All ports, or e.g. 445, 5000" msgstr "" @@ -1476,31 +1930,22 @@ msgstr "" msgid "All ports." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Allow fewer devices" +#: web/src/admin/pages/server/index.ts +msgid "All servers" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Allow more devices" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Allowed" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Allowed %s–%s" -msgstr "" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "Allowed hours" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Allowed: %s" msgstr "" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Almost as fast" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Already has %s device: remove %s first, or allow more." msgid_plural "Already has %s devices: remove %s first, or allow more." @@ -1513,140 +1958,118 @@ msgid_plural "Already has %s devices: remove one first, or allow more." msgstr[0] "" msgstr[1] "" -#: web/src/admin/invite.ts -msgid "Also" +#: web/src/admin/flows/setup.ts +msgid "AmneziaVPN key" msgstr "" -#: web/src/admin/disguise.ts -msgid "AmneziaVPN 4.8.12 or newer, AmneziaWG 2.0+ apps" -msgstr "" - -#: web/src/admin/cores/awg.ts -msgid "AmneziaVPN → %s. Keep it private." -msgstr "" - -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "AmneziaWG %s is installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG %s: no source publishes this build for this firmware any more" msgstr "" #: web/src/admin/disguise.ts -msgid "AmneziaWG 2.0+ apps" +msgid "AmneziaWG 2.0+, AmneziaVPN 4.8.12+" msgstr "" #: web/src/admin/disguise.ts -msgid "AmneziaWG 2.0: junk packets, padded packets and a first packet that looks like DNS. For networks that learned to spot 1.0-style junk." +msgid "AmneziaWG 3.1+, not V2RayTun" msgstr "" -#: web/src/admin/disguise.ts -msgid "AmneziaWG 3.1 apps" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "AmneziaWG 3.1: encrypted headers, random tails and extra padding on data packets." msgstr "" -#: web/src/admin/disguise.ts -msgid "AmneziaWG 3.1: encrypted packet headers, random tails and sizes, jittered timing, and a first packet that looks like DNS." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG answers may not reach devices" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG answers reach devices" +#: web/src/admin/flows/awg-build.ts +msgid "AmneziaWG build" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG devices loaded" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG firewall" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG firewall rules are missing" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG is down" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "AmneziaWG is installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is installed, but its kernel module doesn't load on this firmware" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is missing from the router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed (%s): install it in Dawnline → Components." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "AmneziaWG is not installed: install it in Dawnline → Components." msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "AmneziaWG is off by default: a new kernel module restarts every tunnel." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is running again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is running again · accepting connections on port %d" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG is up to date (%s)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG isn't accepting connections on port %d" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG isn't running" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/disguise.ts msgid "AmneziaWG isn’t installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG needs a build for the new firmware" msgstr "" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates.ts +#: web/src/admin/system/model.ts msgid "AmneziaWG not installed" msgstr "" @@ -1654,255 +2077,340 @@ msgstr "" msgid "AmneziaWG port" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG port is free" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG port is taken" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG running" -msgstr "" - -#: web/src/admin/cores/awg.ts -msgid "AmneziaWG saved" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "AmneziaWG subnet is unique" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "AmneziaWG subnet overlaps another network" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "AmneziaWG update is available: %s → %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "AmneziaWG's kernel module doesn't load on this firmware: reinstall a build for this kernel in Components." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "AmneziaWG: more" +msgstr "" + +#: backend/i18n/messages.js msgid "AmneziaWG’s kernel module doesn’t load" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "AmneziaWG’s kernel module doesn’t load on this firmware" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc +#: web/src/admin/pages/settings/first.ts +msgid "An AmneziaWG server on this router and personal links for people. It takes a couple of minutes: the address, the disguise, the portal." +msgstr "" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "An IPv4 address; empty: none" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "An address and port, like 192.168.1.10:445" +msgstr "" + +#: web/src/admin/pages/settings/router/remove.ts +msgid "An admin with write access can remove it." +msgstr "" + +#: web/src/admin/pages/settings/first.ts +msgid "An admin with write access sets the server up." +msgstr "" + +#: backend/i18n/messages.js msgid "An update is running: wait for it to finish, then remove Dawnline." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc -#: web/src/admin/pages/components/index.ts +#: web/src/admin/widgets/rollout.ts +msgid "And %s more device" +msgid_plural "And %s more devices" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/settings/router/portal.ts +msgid "Another address" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/index.ts msgid "Another component action is already running" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/card.ts +msgid "Answer" +msgstr "" + +#: web/src/admin/pages/people/person/devices.ts +msgid "Answer the request" +msgstr "" + +#: backend/i18n/messages.js msgid "Answers from %s are swallowed by a proxy on the router (%s): clients get no reply." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Answers from %s go straight out." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Answers from %s go straight out. A proxy on the router diverts its own traffic (%s); these answers skip it." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Answers reach visitors" +#: backend/i18n/messages.js +msgid "Answers reach devices" msgstr "" #: web/src/admin/disguise.ts +#: web/src/admin/widgets/disguise-levels.ts msgid "Any WireGuard app" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Any time" +#: web/src/admin/flows/setup.ts +msgid "App" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Appearance" +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Apply" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Applies at once: every AmneziaWG device imports its configuration again." +#: web/src/admin/flows/server-change.ts +msgid "Apply %s change?" +msgid_plural "Apply %s changes?" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/people/person/index.ts +msgid "Apply the changes for %s?" msgstr "" -#: web/src/admin/disguise.ts -msgid "Apps with AmneziaWG 3.1 (current AmneziaVPN)" +#: web/src/admin/flows/restore.ts +msgid "Apply the settings" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Apps" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "As soon as a check finds it." +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "As soon as found" msgstr "" -#: web/src/admin/device-link.ts -msgid "As the server: %s" +#: web/src/admin/widgets/config-card.ts +msgid "As the server" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/shared/format.ts +msgid "Ask me first" +msgstr "" + +#: web/src/admin/events/timeline.ts +msgid "Asked for on its owner’s page. It can connect once you accept it." +msgstr "" + +#: web/src/admin/flows/new-server.ts +msgid "Asking the router what it has…" +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "Asking the router where it points…" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Asks for the network %s behind %s" +msgid_plural "Asks for the networks %s behind %s" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/people/card.ts +msgid "Asks for the router %s" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "At a set time" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/reach.ts +msgid "At least one home network must stay." +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts +msgid "At most" +msgstr "" + +#: backend/i18n/messages.js +msgid "At most %d people at once." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "At once" +msgstr "" + +#: web/src/admin/widgets/link-values.ts +#: web/src/admin/widgets/net-switches.ts msgid "Auto" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Auto-detect LAN" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Auto-detect WAN" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "Auto-update" +#: web/src/admin/widgets/config-card.ts +msgid "Automatic" msgstr "" #: web/src/admin/netcheck.ts msgid "Automatic by device type and disguise: %s for computers and routers, %s for phones and tablets." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Automatic certificate" -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "Automatic update: %s" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: AmneziaWG" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Automatic updates" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: Dawnline" +#: web/src/admin/widgets/link-values.ts +msgid "Automatic: %s, phones %s" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: components" +#: web/src/admin/pages/settings/router/updates.ts +msgid "Available: %s" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Automatic update: system packages" -msgstr "" - -#: web/src/admin/device-link.ts -msgid "Automatic: %s" -msgstr "" - -#: web/src/admin/cores/awg.ts #: web/src/shared/format.ts msgid "B" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/portal/ui/sheet.ts msgid "Back" msgstr "" -#: web/src/admin/pages/person/index.ts -msgid "Back to Servers" -msgstr "" - #: web/src/admin/places/render.ts msgid "Back to now" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/ui/subpage.ts +msgid "Back to the list" +msgstr "" + +#: web/src/admin/ui/subpage.ts +msgid "Back to the list · Esc" +msgstr "" + +#: web/src/admin/pages/settings/router/backups.ts msgid "Back up now" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/restore.ts +msgid "Back up the current state" +msgstr "" + +#: backend/i18n/messages.js msgid "Background agent isn’t running" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Background agent running" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Backing up configuration" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "Backup" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Backup created" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Backup deleted" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup does not contain /etc/config/dawnline." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup failed: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup failed: the archive could not be written (is the flash full?)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup is too large." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Backup not found." msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/index.ts msgid "Backups" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Backups contain private keys: keep downloads safe. JSON moves everything except usage history to another router." +#: web/src/admin/pages/settings/router/backups.ts +msgid "Backups contain private keys: keep downloads safe." +msgstr "" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Balance" msgstr "" -#: web/src/admin/cores/awg.ts #: web/src/admin/disguise.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Balanced" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Balanced needs AmneziaWG 2.0 or newer on the router: install a current build in Dawnline → Components." msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before import" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts +msgid "Before removing Dawnline" +msgstr "" + +#: web/src/admin/system/model.ts msgid "Before removing a server" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before restore" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Before update" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Behind Cloudflare · often stalls in Russia" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Blocked" msgstr "" @@ -1910,330 +2418,371 @@ msgstr "" msgid "Blocked portal sign-ins and devices that can’t connect properly (tunnels and services are in the service log)" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +msgctxt "access" msgid "Both" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Both are %s's devices" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Both are in %s" msgstr "" -#: web/src/admin/pages/person/index.ts -msgid "Breadcrumb" +#: web/src/admin/widgets/net-values.ts +msgid "Bring %s back" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Browse the internet through your router. No access to devices at home, and home cannot reach theirs." +#: web/src/admin/widgets/net-values.ts +msgid "Bring it back" msgstr "" -#: web/src/admin/widgets/access-picker.ts -msgid "Browse the internet through your router. No access to devices at home." -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings." msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "Build and translation" -msgstr "" - #: web/src/admin/logs.ts msgid "By" msgstr "" -#: web/src/admin/pages/diagnostics/log.ts -msgid "CSV (spreadsheet)" +#: web/src/admin/pages/people/filters.ts +msgid "By attention, in groups" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Can reach" +#: web/src/admin/pages/settings/router/history.ts +msgid "By day" msgstr "" -#: web/src/admin/pages/server.ts -#: web/src/admin/ui/modal.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "By hand" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "By month" +msgstr "" + +#: web/src/admin/flows/ask.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/flows/uninstall.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Cancel" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/settings/pending-dock.ts +msgctxt "changes" +msgid "Cancel" +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "Cancel selection" +msgstr "" + +#: backend/i18n/messages.js msgid "Cannot detect the firmware target" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Cannot reach github.com/%s" msgstr "" -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/servers/state.ts msgid "Can’t start" msgstr "" +#: web/src/admin/flows/invite.ts +msgid "Card" +msgstr "" + +#: web/src/admin/pages/people/index.ts +msgid "Cards" +msgstr "" + #: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Category" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Certificate" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Certificate file" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Certificate saved" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Certificate: %s" msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Certificates (ACME)" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/server-change.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/defaults.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/ui/edit-rows.ts +#: web/src/admin/ui/measure.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/entry.ts +#: web/src/admin/widgets/net-values.ts +#: web/src/admin/widgets/visibility.ts msgid "Change" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Change limit" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Change files" msgstr "" -#: web/src/admin/device-link.ts -msgid "Change the MTU" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Change the build" msgstr "" -#: web/src/admin/device-link.ts -msgid "Change the keep-alive" +#: web/src/admin/flows/server-change.ts +msgid "Change the home networks?" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Change the tunnel network" +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "Change the limit" msgstr "" -#: web/src/admin/device.ts -msgid "Changed network" +#: web/src/admin/flows/server-change.ts +msgid "Change the networks behind routers?" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Changed: %s." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Changing it marks devices “Update config” until they import again" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Changes that wait to be applied" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Changing these marks devices “Update config” until they import again" +#: web/src/admin/pages/settings/networks.ts +msgid "Changing a router’s networks on people’s pages" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/server-change.ts +msgid "Changing a router’s networks on people’s pages: %s?" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "Changing its networks" +msgstr "" + +#: web/src/portal/setup.ts +msgid "Channel on" +msgstr "" + +#: web/src/admin/pages/settings/check.ts msgid "Check" msgstr "" -#: web/src/admin/access.ts -msgid "Check access" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Check AmneziaWG" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Check all" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Check Dawnline" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Check automatically" +#: web/src/admin/pages/settings/check.ts +msgid "Check a path" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/pages/overview/health.ts +msgid "Check again" +msgstr "" + +#: backend/i18n/messages.js msgid "Check every 6h, 12h, 1d or 7d." msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Check failed" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Check for new versions" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Check for updates" -msgstr "" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Check for updates to see the builds for this router." msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates.ts +msgid "Check now" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Check system packages" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/restore.ts +msgid "Check the backup" +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "Check the file" +msgstr "" + +#: web/src/admin/flows/operation.ts +msgid "Checked" +msgstr "" + +#: web/src/admin/pages/settings/router/updates.ts +msgid "Checked %s" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Checked once it is fixed" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking AmneziaWG" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking Dawnline" msgstr "" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates.ts +#: web/src/admin/updater/jobs.ts msgid "Checking all components" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Checking components" -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/components/packages.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Checking system packages" msgstr "" +#: web/src/admin/pages/server/overview.ts +msgid "Checking the server…" +msgstr "" + +#: web/src/admin/flows/portal-sheets.ts #: web/src/admin/netcheck.ts -#: web/src/admin/pages/settings/portal.ts msgid "Checking where it points…" msgstr "" -#: web/src/admin/pages/components/index.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Checking…" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Checks" -msgstr "" - -#: web/src/admin/interfaces.ts -msgid "Choose %s to include it." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Choose a device on at least one side." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -msgid "Choose a disguise on the Server page: it replaces the values set by hand." +#: backend/i18n/messages.js +msgid "Choose a disguise in Settings → Disguise: it replaces the values set by hand." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/restore.ts +msgid "Choose a file" +msgstr "" + +#: backend/i18n/messages.js msgid "Choose a free port between 1 and 65535 (not 22, 53, 80 or 443)." msgstr "" -#: web/src/admin/pages/people.ts -msgid "Choose a server on their page" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/people/lines.ts +msgid "Choose a server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Choose a system log level: errors, warnings, normal or verbose." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Choose another interface name in the server settings." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Choose the interface that leads to the internet." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/widgets/reach.ts +msgid "Circle" +msgstr "" + +#: backend/i18n/messages.js msgid "Circle %s: server %s does not exist." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Circles" +#: web/src/admin/flows/move-person.ts +msgid "Circles and home networks of the old server stay behind." msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "City-level, from the client IP" +#: web/src/admin/pages/settings/router/history.ts +msgid "City and operator by IP, through %s. Map tiles load in your browser from CARTO." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "City-level, from the client IP · locations cached on the router" -msgstr "" - -#: web/src/admin/device.ts -#: web/src/admin/logs.ts -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Clear" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/activity.ts -msgid "Clear %s's activity" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts -msgid "Clear activity" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts -msgid "Clear one person or device from their own page." -msgstr "" - -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/clear.ts +#: web/src/admin/pages/log/index.ts msgid "Clear the log" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Clears %s's daily and monthly traffic history. Their person's totals and data limit are not changed." msgstr "" -#: web/src/admin/logs.ts -msgid "Clears %s's traffic history and that of their devices. Their data limit starts again from zero." -msgstr "" - -#: web/src/admin/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Clears traffic history for everyone. Data limits start again from zero." msgstr "" -#: web/src/admin/device.ts -msgid "Client IP" +#: web/src/admin/pages/people/device/index.ts +msgid "Client IP: where its last connection came from · %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Clock is set" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Clock isn’t set" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/ui/drawer.ts -#: web/src/admin/ui/toast.ts -#: web/src/admin/updater/notes.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/flows/restore.ts +#: web/src/portal/ui/sheet.ts msgid "Close" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Collecting… 1 point a second" +#: web/src/portal/ui/wait-way.ts +msgid "Close this and open it again to keep checking." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts msgid "Colour" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts msgid "Colour %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/settings/updates.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Components" msgstr "" @@ -2241,46 +2790,46 @@ msgstr "" msgid "Computers and routers get %s, phones and tablets %s." msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "Config" -msgstr "" - -#: web/src/admin/cores/awg.ts -msgid "Configuration" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/setup.ts msgid "Configuration copied" msgstr "" -#: web/src/admin/ui/modal.ts -msgid "Confirm" +#: web/src/admin/pages/server/settings.ts +msgid "Configuration of devices" msgstr "" -#: web/src/admin/device.ts -msgctxt "section" -msgid "Connect" +#: web/src/portal/setup.ts +msgid "Confirm the import and connect" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts -msgid "Connected" +#: web/src/admin/people/diagnosis.ts +msgid "Connected, handshake %s" msgstr "" -#: web/src/admin/device.ts -msgid "Connected from %s" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/people/diagnosis.ts msgid "Connection" msgstr "" +#: web/src/admin/pages/people/device/index.ts +msgctxt "section" +msgid "Connection" +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "Connection in the %s" +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "Connection in the %s: ← → by stretch" +msgstr "" + #: web/src/admin/events/model.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Connection keeps dropping" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js #: web/src/admin/events/model.ts msgid "Connections" msgstr "" @@ -2289,140 +2838,152 @@ msgstr "" msgid "Connects, disconnects and IP changes" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "AmneziaVPN app" msgid "Continue" msgstr "" +#: web/src/portal/ui/feedback.ts +msgid "Copied" +msgstr "" + #: web/src/admin/ui/files.ts msgid "Copied to clipboard" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/setup.ts +#: web/src/admin/flows/whats-new.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Copy" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Copy AmneziaVPN config" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/widgets/entry.ts msgid "Copy address" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Copy as config" +#: web/src/admin/pages/settings/disguise.ts +msgid "Copy as configuration" msgstr "" -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/flows/invite.ts msgid "Copy link" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Copy log" msgstr "" -#: web/src/admin/invite.ts -msgid "Copy this link" +#: web/src/admin/pages/people/device/link.ts +msgid "Copy the advice" +msgstr "" + +#: web/src/admin/widgets/rollout.ts +msgid "Copy the portal link: %s" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/config-card.ts +msgid "Copy: %s" msgstr "" #: web/src/admin/ui/files.ts +#: web/src/portal/ui/feedback.ts msgid "Copying is blocked here. Select the text and copy it by hand." msgstr "" -#: web/src/admin/invite.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +msgid "Core" +msgstr "" + +#: web/src/admin/flows/invite-card.ts msgid "Could not draw the card" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Could not find a free id, try again." msgstr "" +#: web/src/admin/shell/qr.ts +msgid "Could not load the QR code. Reload the page to try again." +msgstr "" + #: web/src/admin/map.ts msgid "Could not load the map library (no internet access from this browser?)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: web/src/admin/shell/maps.ts +msgid "Could not load the map. Reload the page to try again." +msgstr "" + +#: web/src/admin/shell/style.ts +msgid "Could not load the page’s styles. Reload the page to try again." +msgstr "" + +#: backend/i18n/messages.js msgid "Couldn't load devices into %s: %s." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Couldn't read the devices at home." msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Couldn't read the live speed: %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc +#: backend/i18n/messages.js msgid "Couldn't save /etc/config/dawnline: %s. Is the flash full?" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc +#: backend/i18n/messages.js msgid "Couldn't save /etc/config/dawnline: the write failed. Is the flash full?" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Couldn't show people: %s" +#: backend/i18n/messages.js +msgid "Couldn't set the routes to the networks behind routers (%s): they aren't reachable yet." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Couldn't write %s. Is the flash full?" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/limit-meter.ts +msgid "Count" +msgstr "" + +#: backend/i18n/messages.js msgid "Counts traffic and enforces end dates and quotas." msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/add-person.ts msgid "Create" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Create a new link?" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Create from QR code" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Create and copy link" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Create from file or archive" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Create new link" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Create server" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Created. Turn on the personal portal in Settings to get a link, or add devices for them here." -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Creating the server restarts the network for a few seconds: AmneziaWG was installed after the network started." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Cross-site request refused." msgstr "" -#: web/src/admin/disguise.ts -msgid "Current" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Current parameters" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Custom" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/disguise.ts msgctxt "disguise" msgid "Custom" msgstr "" @@ -2431,114 +2992,165 @@ msgstr "" msgid "DNS" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "DNS for Home-only devices" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "DNS for Home-only devices isn’t working" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/stages.ts msgid "DNS for devices" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "DNS-like first packets" +#: web/src/admin/flows/server-change.ts +msgid "DNS for devices: %s?" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/overview/health.ts +msgid "DNS, ports, certificates: it takes a moment." +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "DNS: %s" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "DNS: this router" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Daily" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Daily traffic" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Daily traffic history must be 7-1830 days." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Danger zone" +#: web/src/admin/events/render.ts +msgid "Data is back after the limit" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Data" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/ui/badges.ts -msgid "Data limit" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "Data limit %s GB" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "Data limit (GB)" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Data limit must be a positive number of GB." msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Data limit period" -msgstr "" - -#: web/src/admin/pages/people.ts -#: web/src/shared/format.ts +#: web/src/admin/events/render.ts +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Data limit reached" msgstr "" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/events/timeline.ts +msgid "Data limit reached %s" +msgstr "" + +#: web/src/admin/widgets/term.ts msgid "Date" msgstr "" #: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json +#: web/src/admin/shell/nav.ts msgid "Dawnline" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Dawnline %s is installed." +#: web/src/admin/flows/operation.ts +msgid "Dawnline %s is installed" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: web/src/admin/pages/settings/router/notice.ts +msgid "Dawnline %s is out" +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "Dawnline backup" +msgstr "" + +#: backend/i18n/messages.js msgid "Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed." msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/pages/people/map-view.ts +msgid "Dawnline does not look up the city and network of an address, so there is no map. It is turned on in System, under History and storage." +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "Dawnline export" +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "Dawnline has %s, %s and %s now." +msgstr "" + +#: web/src/admin/updater/install.ts msgid "Dawnline installs the AmneziaWG build made for this firmware and loads it. If the network service has to restart to learn it, connections drop for a few seconds." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/admin/flows/operation.ts +msgid "Dawnline is installed" +msgstr "" + +#: web/src/admin/failure.ts +msgid "Dawnline is not answering on the router right now: it may be restarting. Try again in a moment." +msgstr "" + +#: web/src/admin/shell/waiting.ts +msgid "Dawnline is starting" +msgstr "" + +#: web/src/admin/api.ts +msgid "Dawnline is starting on the router: this page fills in when it answers." +msgstr "" + +#: backend/i18n/messages.js msgid "Dawnline is up to date (%s)" msgstr "" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/settings/router/backups.ts +msgid "Dawnline makes one itself before an update and before a restore. You can make one now too." +msgstr "" + +#: web/src/admin/flows/uninstall.ts msgid "Dawnline removed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Dawnline update is available: %s → %s" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Dawnline updated to %s" -msgstr "" - #: web/src/admin/state/live.ts msgid "Dawnline was updated to %s: reload the page." msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Days this device was used" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Dawnline: more" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/behind-ask.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-values.ts +msgid "Decline" +msgstr "" + +#: web/src/admin/widgets/net-values.ts +msgid "Decline %s" +msgstr "" + +#: web/src/shared/format.ts +msgid "Declined" +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "Declined: %s reads so on their page" +msgstr "" + +#: backend/i18n/messages.js msgid "Default device limit must be 1-32." msgstr "" @@ -2546,47 +3158,37 @@ msgstr "" msgid "Default: a packet every 25 s keeps NAT open and “Connected” accurate." msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Delete" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Delete %s?" -msgstr "" - -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Delete this backup?" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Deleted" +#: web/src/admin/pages/settings/router/remove.ts +msgid "Deletes the tunnel, firewall rules, access table and hostnames Dawnline created, and stops the service. People and keys are kept in a backup." msgstr "" -#: web/src/admin/pages/settings/danger.ts -msgid "Deletes the tunnel, firewall rules, access table and hostnames Dawnline created, and stops the service. People and keys are kept in a backup." +#: web/src/admin/pages/settings/router/history.ts +msgid "Depth" msgstr "" #: web/src/admin/logs.ts msgid "Detail" msgstr "" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/settings/portal.ts -msgid "Details" -msgstr "" - -#: web/src/admin/device.ts -msgctxt "section" -msgid "Details" +#: web/src/admin/pages/settings/networks.ts +msgid "Detect automatically" msgstr "" +#: web/src/admin/flows/places-closeup.ts #: web/src/admin/logs.ts #: web/src/admin/map.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/people/diagnosis.ts #: web/src/shared/format.ts msgid "Device" msgstr "" @@ -2627,47 +3229,47 @@ msgstr "" msgid "Device %s has a connection problem" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: MTU %d is not between 1280 and 1500." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is also used by device %s of %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is not a plain IPv4 address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is outside %s's tunnel %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address %s is the router's own address on %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: address (none) is not a plain IPv4 address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: keep-alive %d is not between 0 and 600 seconds." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the preshared key is not a key." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the private key is not a key." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the public key is not a key." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s of %s: the public key is the server's own." msgstr "" @@ -2699,91 +3301,87 @@ msgstr "" msgid "Device %s went offline" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device %s: person %s does not exist." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Device DNS - devices need their configuration again" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Device addresses" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Device addresses come from it." +#: web/src/admin/pages/settings/stages.ts +msgid "Device addresses come from it. Change it when it clashes with a network a device connects from." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Device addresses: %s" -msgstr "" - -#: web/src/admin/device.ts -msgid "Device disabled" -msgstr "" - -#: web/src/admin/device.ts -msgid "Device enabled" -msgstr "" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Device hostnames" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/pages/people/person/index.ts +msgid "Device limit" +msgstr "" + +#: backend/i18n/messages.js msgid "Device limit must be between 1 and 32." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Device limit reached (%d)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Device not found." msgstr "" -#: web/src/admin/device.ts -msgid "Device removed" +#: web/src/admin/pages/log/filters.ts +msgid "Device: %s" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/stages.ts msgid "Devices" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Devices added through the old link keep working until they are removed. Remove them too:" +#: web/src/admin/pages/settings/stages.ts +msgid "Devices are given %s, the router is %s now. A DDNS name would follow it by itself." msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts -msgid "Devices are marked “Update config” until they import again." -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "Devices can’t connect" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "Devices can’t connect until you resume" -msgstr "" - -#: web/src/admin/pages/overview.ts -msgid "Devices connect once it is on" -msgstr "" - -#: web/src/admin/pages/server.ts -msgid "Devices connect to" +#: web/src/admin/flows/add-device.ts +msgid "Devices at home reach them through it." msgstr "" #: web/src/admin/netcheck.ts msgid "Devices connect to %s." msgstr "" +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices do not connect until the end date is moved." +msgstr "" + +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices do not connect while access is paused." +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "Devices do not connect while the server is turned off." +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "Devices do not see each other on this server: only home devices will reach it." +msgstr "" + +#: web/src/admin/widgets/rollout.ts +msgid "Devices fetch it by their own portal link" +msgstr "" + +#: web/src/admin/ui/edit-rows.ts +msgid "Devices fetch their configuration again after this change" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Devices get %s – %s, the router %s." msgstr "" @@ -2792,59 +3390,69 @@ msgstr "" msgid "Devices get names like %s." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Devices have %s addresses now. A new range when it clashes with a network you connect to; every device then needs its configuration again." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices in one circle reach each other." msgstr "" -#: web/src/admin/pages/components/awg.ts +#: backend/i18n/messages.js +msgid "Devices loaded" +msgstr "" + +#: web/src/admin/flows/awg-build.ts msgid "Devices need AmneziaVPN 3.1 or newer." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Devices of different people never reach each other; a person's own devices don't either." +#: web/src/admin/widgets/visibility.ts +msgid "Devices never reach each other: neither other people’s, nor a person’s own." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices of different servers never reach each other." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/widgets/visibility.ts +msgid "Devices of everyone with home access reach each other, as devices at home do." +msgstr "" + +#: web/src/admin/flows/circle.ts msgid "Devices of people in one circle reach each other. A person is in one circle at a time." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Devices of people with home access reach each other, like home devices do. Internet-only people never." -msgstr "" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Devices per person" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Devices reach each other" +#: web/src/admin/widgets/visibility.ts +msgid "Devices reach each other inside a circle. Everyone reaches their own devices." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Devices reach each other on this server" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Devices reach each other: %s" +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts +msgid "Devices see each other" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Devices see each other" +#: web/src/admin/pages/settings/networks.ts +msgid "Devices see each other: %s" +msgstr "" + +#: web/src/admin/flows/server-change.ts +msgid "Devices see each other: %s?" msgstr "" #: web/src/admin/netcheck.ts msgid "Devices send a packet every %s s to keep NAT open (a little battery on phones)." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +msgid "Devices stay connected, but only the portal and the router’s DNS open." +msgstr "" + +#: web/src/admin/flows/home-service.ts msgid "Devices that got an address from this router. Pick the ports to open, or all ports." msgstr "" @@ -2852,162 +3460,163 @@ msgstr "" msgid "Devices use %s - home names and your LAN’s DNS filters no longer apply to them." msgstr "" -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "Device’s own DNS" msgstr "" -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/diagnostics/index.ts -msgid "Diagnostics" +#: web/src/admin/pages/settings/networks.ts +msgid "Direct" msgstr "" -#: web/src/admin/device.ts -msgid "Disable" -msgstr "" - -#: web/src/admin/ui/badges.ts +#: web/src/admin/people/diagnosis.ts msgid "Disabled" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +msgid "Disabled by you" +msgstr "" + +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/disguise-levels.ts msgid "Disguise" msgstr "" -#: web/src/admin/disguise.ts -msgid "Disguise method" +#: web/src/admin/pages/settings/disguise.ts +msgid "Disguise: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/server-change.ts +msgid "Disguise: %s?" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "Does a home service not open? Check the path to it." +msgstr "" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Does not look like a VPN" +msgstr "" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Domain" +msgstr "" + +#: backend/i18n/messages.js msgid "Domain may use lowercase letters, digits, dashes and dots." msgstr "" -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/people/pick.ts msgid "Done" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/events/render.ts -msgid "Done by you in LuCI" -msgstr "" - -#: web/src/admin/pages/person/dialogs.ts -msgid "Don’t warn" -msgstr "" - -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Download" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgctxt "speed" -msgid "Download" +#: web/src/admin/flows/setup.ts +msgid "Download .conf" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Download AmneziaWG config" -msgstr "" - -#: web/src/admin/invite.ts -msgid "Download card" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Download failed: %s" msgstr "" -#: web/src/admin/pages/settings/logs.ts -msgid "Download the log as %s" +#: web/src/portal/setup.ts +msgid "Download for Linux" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/portal/setup.ts +msgid "Download for Mac" +msgstr "" + +#: web/src/portal/setup.ts +msgid "Download for Windows" +msgstr "" + +#: web/src/portal/setup.ts +msgid "Download from" +msgstr "" + +#: web/src/portal/setup.ts +msgid "Download on the" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts +msgid "Download the log" +msgstr "" + +#: web/src/admin/pages/log/index.ts +msgid "Download what is shown now" +msgstr "" + +#: web/src/portal/ui/bars.ts +msgid "Downloaded" +msgstr "" + +#: backend/i18n/messages.js msgid "Downloading %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Downloading %s from %s" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Downloads and installs new versions of the components below." +#: backend/i18n/messages.js +msgid "Each change needs the id of a person." msgstr "" -#: web/src/admin/access.ts -msgid "Each other" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Easy to block" msgstr "" -#: web/src/admin/access.ts -msgid "Edit" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgid "Edit %s" msgstr "" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/person/head.ts msgid "Edit note" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Empty" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Empty = the portal’s address (%s)." -msgstr "" - -#: web/src/admin/pages/server.ts -msgid "Empty = the portal’s address." -msgstr "" - #: web/src/admin/netcheck.ts msgid "Empty: automatic. Lower it when big pages hang on this device." msgstr "" -#: web/src/admin/device.ts -msgid "Enable" +#: web/src/admin/people/diagnosis.ts +msgid "Enabled, its configuration is current" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Enable portal" +#: web/src/admin/flows/person-acts.ts +msgid "End date as it was" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Encrypted headers" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "End date" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "End date must be YYYY-MM-DD." msgstr "" -#: web/src/admin/events/render.ts -msgid "End date passed (%s) · access kept" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "End dates and quotas use the router clock." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Endpoint must be a hostname or IP address." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "English only" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Enter a circle name: up to 32 characters, without < > \" or \\." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Enter a device name: up to %d letters, digits, spaces and - _ ." msgstr "" @@ -3019,219 +3628,264 @@ msgstr "" msgid "Enter a name." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc +#: backend/i18n/messages.js msgid "Enter a name: up to 48 characters, without < > \" or \\." msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Enter a release tag like 0.3.1" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Enter a time as HH:MM, 00:00 to 23:59." msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Enter both times, like 07:00 and 23:00." +#: web/src/admin/ui/edit-rows.ts +#: web/src/portal/ui/inline-edit.ts +msgid "Enter: save, Esc: cancel" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/log/days.ts +msgid "Entries appear when someone connects." +msgstr "" + +#: backend/i18n/messages.js msgid "Error: %s" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Errors only" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts +msgctxt "measure" +msgid "Events" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgid "Every 10 min" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Every 12 h" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Every 6 h" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Every device has a key and an address of its own inside its server." msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts msgid "Every interface restarts. Connections drop for a few seconds." msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Every minute it checks the tunnels and services and repairs what it can on its own." -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Every step lets it through" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts msgid "Everyone" msgstr "" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/people/card.ts +msgid "Everyone else" +msgstr "" + +#: web/src/admin/flows/uninstall.ts msgid "Everyone is disconnected and the tunnel, firewall rules and portal are removed. A backup is made first. Type “%s” to confirm." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Everyone online" +#: web/src/admin/pages/settings/networks.ts +msgid "Everyone with home access reaches these, unless their page leaves one out." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Everyone with home access reaches these, unless their page leaves one out; their devices can be reached from here too. Click one to add or remove it." +#: web/src/admin/pages/people/map-view.ts +msgid "Everyone’s places, not only %s" msgstr "" -#: web/src/admin/logs.ts -msgid "Everything" +#: web/src/admin/pages/overview/waiting.ts +msgid "Everyone’s terms, limits and connections are in order." msgstr "" -#: web/src/admin/pages/diagnostics/index.ts -msgid "Everything Dawnline depends on, checked live. The watchdog repairs what it can on its own." -msgstr "" - -#: web/src/admin/pages/components/index.ts #: web/src/admin/updater/jobs.ts msgid "Everything is up to date" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Everything returns to %s. The current state is backed up first." +#: web/src/admin/overview/model.ts +msgid "Everything works" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Example code; each person gets their own three words." +#: web/src/portal/flows/device-form.ts +msgid "Except %s: those addresses lead to the home network." msgstr "" -#: web/src/shared/format.ts -msgid "Expired" -msgstr "" - -#: web/src/admin/device.ts -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/index.ts msgid "Export" msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "Export CSV" -msgstr "" - -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Export JSON" msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "Export or clear" +#: web/src/admin/pages/log/index.ts +msgid "Export the log" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Extend 1 month" +#: web/src/admin/pages/people/pick.ts +msgid "Extend" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Extended by 1 month" +#: web/src/admin/people/lines.ts +msgid "Extend and resume" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Extend to %s" +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "Extended: %s" +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "Extension undone" +msgstr "" + +#: backend/i18n/messages.js msgid "Extra data must be a positive number of GB." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Extra packets sent before the handshake." msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Failed" -msgstr "" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Failed to load versions: %s" msgstr "" -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Fallback DNS" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Fallback DNS must be an IPv4 address (or empty for none)." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Fallback DNS: %s?" +msgstr "" + +#: web/src/admin/flows/circle.ts msgid "Family" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/widgets/rollout.ts +msgid "Fetched: %s of %s" +msgstr "" + +#: web/src/admin/ui/stepper.ts +msgid "Fewer: %s" +msgstr "" + +#: web/src/admin/flows/restore.ts msgid "File" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "File %s does not exist." msgstr "" -#: web/src/admin/pages/people.ts -msgid "Find a person or device" +#: web/src/admin/flows/circle.ts +msgid "Find a person" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Find…" +#: web/src/admin/pages/people/index.ts +msgid "Find a person, a device or an address" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/settings/networks.ts +msgid "Find at home" +msgstr "" + +#: web/src/admin/pages/log/filters.ts +msgid "Find in the log" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Fine" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/flows/operation.ts msgid "Finished" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "Firewall" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "Firewall rules" +msgstr "" + +#: backend/i18n/messages.js msgid "Firewall zone or WAN rule is missing." msgstr "" -#: web/src/admin/pages/server.ts -msgid "First three numbers of the device addresses" -msgstr "" - -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Fix" msgstr "" -#: web/src/admin/pages/settings/defaults.ts -msgid "For Home-only devices using home names: %s" +#: web/src/admin/pages/overview/health.ts +msgid "Fix in Settings" msgstr "" -#: web/src/admin/pages/server.ts -msgid "For every device" +#: web/src/admin/people/diagnosis.ts +msgid "Flowing" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/log/index.ts +msgid "For a script" +msgstr "" + +#: web/src/admin/disguise.ts +msgid "For networks that block everything. Slower." +msgstr "" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "For networks that block hard" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "For the whole term" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "For the whole term: it does not reset" +msgstr "" + +#: web/src/admin/flows/setup.ts +msgid "Form" +msgstr "" + +#: web/src/admin/flows/new-server.ts msgid "Forward the UDP port on the upstream router to this one and use a DDNS name or that router’s public address here." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Found automatically" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Free certificate from Let’s Encrypt" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Free slot" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Free space on the router" msgstr "" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts msgid "From" msgstr "" @@ -3240,71 +3894,73 @@ msgid "From 0 to 600 seconds." msgstr "" #: web/src/admin/netcheck.ts +#: web/src/admin/widgets/link-values.ts msgid "From 1280 to 1500." msgstr "" -#: web/src/admin/access.ts -msgid "From the rules on this server" +#: web/src/admin/flows/packages.ts +msgid "From the OpenWrt feeds, for what Dawnline uses on this router." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "From your DDNS name." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "From your Let’s Encrypt certificate." msgstr "" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Full speed" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts #: web/src/shared/format.ts msgid "GB" msgstr "" -#: web/src/shared/format.ts -msgid "Gbit/s" +#: web/src/admin/widgets/limit-meter.ts +msgid "GB, or empty: no limit" msgstr "" -#: web/src/admin/device.ts -msgid "Generate" +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +msgid "General" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Generate and apply" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/server-change.ts msgid "Generate new disguise values?" msgstr "" -#: web/src/admin/device.ts -msgid "Generate new keys?" +#: web/src/portal/setup.ts +msgid "Get it on" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Generate new values" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub API rate limit reached: try again in an hour." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub did not answer, trying mirrors" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "GitHub mirrors" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: backend/i18n/messages.js msgid "GitHub: %s" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "H1–H4 random" +#: web/src/admin/pages/server/device-dialog.ts +msgid "Give the device a name." msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/invite.ts +msgid "HTTP: not encrypted" +msgstr "" + +#: web/src/admin/flows/packages.ts msgid "HTTPS for the portal" msgstr "" @@ -3312,11 +3968,11 @@ msgstr "" msgid "HTTPS here, plain HTTP for links on IP addresses on %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "HTTPS isn't available on this router: install %s." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "HTTPS isn’t available on this router" msgstr "" @@ -3324,83 +3980,66 @@ msgstr "" msgid "HTTPS on this port, opened on WAN." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Handshake and key timers vary within these ranges instead of WireGuard’s fixed values." msgstr "" #: web/src/admin/events/model.ts +#: web/src/portal/ui/wait-way.ts msgid "Handshake complete, but no data" msgstr "" -#: web/src/admin/pages/diagnostics/index.ts -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/server/overview.ts msgid "Health" msgstr "" -#: web/src/admin/invite.ts +#: web/src/admin/flows/invite-card.ts msgid "Hi, %s" msgstr "" -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/portal.ts -msgid "Hide" +#: web/src/admin/widgets/disguise-levels.ts +msgid "Hidden" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Hide key" +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/pages/settings/router/index.ts +msgid "History and storage" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc -#: web/src/admin/access.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts #: web/src/admin/map.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts msgid "Home" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/add-person.ts +msgctxt "access" +msgid "Home" +msgstr "" + +#: backend/i18n/messages.js msgid "Home access includes the router." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Home access reaches %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home access reaches every home network." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home and Internet" msgstr "" -#: web/src/admin/widgets/access-picker.ts -msgid "Home devices and the internet, all through your router." -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "Home devices and the internet, all through your router. Home reaches their devices too." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home devices reach only people with home access." msgstr "" -#: web/src/admin/access.ts -msgid "Home devices reach the devices of people with home access, on the networks those people reach. Paused, ended and over-the-limit people reach nothing." -msgstr "" - -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "Home names" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Home names on - devices need their configuration again" -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/reach.ts #: web/src/shared/format.ts msgid "Home network" msgstr "" @@ -3409,19 +4048,16 @@ msgstr "" msgid "Home network + Internet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Home network addresses" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Home networks %s reaches. Networks added to the server later stay out." +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/reach.ts +msgid "Home networks" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Home networks %s reaches: all of them. Untick one to keep %s out of it." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Home only" msgstr "" @@ -3429,381 +4065,456 @@ msgstr "" msgid "Home router" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/widgets/reach.ts msgid "Home services" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Home services updated" +#: web/src/admin/pages/settings/networks.ts +msgid "Home services · shared by all servers" msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Home-like link" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Home-only devices that use home names ask it while the tunnel is down." +msgstr "" + +#: web/src/admin/flows/home-service.ts msgid "Home-only people can be limited to these instead of whole networks (chosen on their page). Shared by all servers." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Hourly" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Hours must look like 07:00-23:00." +#: web/src/admin/pages/settings/networks.ts +msgid "How devices’ internet traffic leaves" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "How Dawnline keeps its components current. Every Dawnline update makes a backup of the settings first." -msgstr "" - -#: web/src/admin/pages/server.ts -msgid "How devices reach the internet" -msgstr "" - -#: web/src/admin/pages/settings/updates.ts -msgid "How often" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "How the portal listens (80 and 443 stay free)" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "I1-I5 together must be at most 2000 characters, not %d." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Idle right now" +#: web/src/admin/pages/settings/stages.ts +msgid "IP addresses, separated by commas; empty: this router" msgstr "" -#: web/src/admin/interfaces.ts -msgid "If the router’s DNS hands out proxy addresses, those sites won’t open without it." +#: web/src/admin/widgets/entry.ts +msgid "IPsec’s port" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Import" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Import JSON" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import Tunnel(s) from File…" +msgstr "" + +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import config from Clipboard" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import config from QRcode" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Import from clipboard" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Import?" +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import from file or archive" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/setup.ts +msgid "Import the file in AmneziaWG on the device" +msgstr "" + +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Import tunnel(s) from file…" +msgstr "" + +#: web/src/admin/flows/restore.ts msgid "Imported" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "In every device configuration" +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/visibility.ts +msgid "In circles" msgstr "" -#: web/src/admin/pages/people.ts -msgid "In total" +#: web/src/admin/widgets/visibility.ts +msgid "In no circle: %s. They reach only their own devices." msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Includes +%s GB extra this month" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "In the background; the components above say what it found." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "In use: %s" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Includes +%s GB extra until the reset." +msgstr "" + +#: web/src/portal/setup.ts msgctxt "AmneziaVPN app" msgid "Insert" msgstr "" -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/packages.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pkgs.ts -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/awg-build.ts +#: web/src/admin/flows/install.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/flows/versions.ts +#: web/src/admin/pages/settings/disguise.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/servers/fixes.ts msgid "Install" msgstr "" -#: web/src/admin/invite.ts -msgid "Install %s on the device" +#: web/src/admin/flows/versions.ts +msgid "Install %s" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Install ACME" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install ACME certificates?" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Install AmneziaWG %s?" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Install AmneziaWG first" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install AmneziaWG?" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Install Dawnline %s?" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install HTTPS for the portal?" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Install automatically" +#: web/src/portal/setup.ts +msgid "Install from" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc +#: backend/i18n/messages.js msgid "Install it in Dawnline → Components." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -msgid "Install that AmneziaWG build in Dawnline → Components, or switch the disguise on the Server page." +#: backend/i18n/messages.js +msgid "Install that AmneziaWG build in Settings → Updates, or switch the disguise in Settings → Disguise." msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Install the home-like link?" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Install updates immediately or scheduled." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Install what it finds" +msgstr "" + +#: backend/i18n/messages.js msgid "Installation failed" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installed Dawnline %s is newer than the release %s" msgstr "" -#: web/src/admin/updater/jobs.ts -msgid "Installed version is newer than the release (%s)" +#: web/src/admin/flows/versions.ts +msgid "Installed: %s. Another version can be installed once the job under way is over." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/versions.ts +msgid "Installed: %s. Every release on GitHub, newest first." +msgstr "" + +#: backend/i18n/messages.js msgid "Installing %s" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing ACME certificates" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pkgs.ts +#: web/src/admin/flows/awg-build.ts +#: web/src/admin/updater/install.ts msgid "Installing AmneziaWG" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Installing Dawnline %s" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing HTTPS for the portal" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installing package" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Installing the %s build" msgstr "" -#: web/src/admin/pkgs.ts +#: web/src/admin/updater/install.ts msgid "Installing the home-like link" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Installing the translation" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Interface" +#: web/src/admin/pages/settings/stages.ts +msgid "Interface and key" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Interface %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Interface name: 1-12 lowercase letters, digits or _." msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/reach.ts #: web/src/shared/format.ts msgid "Internet" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Internet interface" -msgstr "" - -#: web/src/admin/pages/person/pickers.ts -msgid "Internet keeps working exactly as without the VPN. Reach home devices by IP address." -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts msgid "Internet like a home device" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet like a home device isn’t working" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet like a home device not bypassed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Internet only" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Internet straight to %s" +#: web/src/admin/flows/circle.ts +msgid "Internet only · %s" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Internet through the LAN is off: %s" -msgstr "" - -#: web/src/admin/interfaces.ts -msgid "Internet traffic enters %s as %s, so whatever handles home traffic (proxies, filters, DNS) handles it too." -msgstr "" - -#: web/src/admin/interfaces.ts -msgid "Internet traffic enters the router from your LAN, so whatever handles home traffic (proxies, filters, DNS) handles it too." -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Internet traffic goes straight to the WAN for now." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Internet traffic leaves through WAN directly." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Internet traffic will enter the router from your LAN, so it is handled like any home device. Save to turn on." +#: web/src/admin/pages/settings/networks.ts +msgid "Internet traffic: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/flows/server-change.ts +msgid "Internet traffic: %s?" +msgstr "" + +#: backend/i18n/messages.js msgid "Invalid JSON." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid backup name." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid option %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Invalid port %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Invalid public key." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Invalid section %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Invalid service id." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Invalid value for %s." msgstr "" -#: web/src/admin/invite.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Invite" +msgstr "" + +#: web/src/admin/flows/invite.ts msgid "Invite %s" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -msgid "Invite card" +#: web/src/admin/flows/invite.ts +msgid "Invite · %s" msgstr "" -#: web/src/admin/invite.ts -msgid "Invite card for %s" +#: web/src/admin/flows/new-keys.ts +msgid "Issue new keys" msgstr "" #: web/src/admin/events/model.ts msgid "It connects, but the connection breaks every few minutes: the network may be cutting it." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/people/diagnosis.ts +msgid "It has never connected" +msgstr "" + +#: web/src/admin/events/timeline.ts +msgid "It has not connected yet" +msgstr "" + +#: web/src/admin/pages/settings/router/notice.ts +msgid "It installs on its own at %s." +msgstr "" + +#: web/src/admin/pages/settings/router/notice.ts +msgid "It installs on its own soon." +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "It is asked for again" +msgstr "" + +#: backend/i18n/messages.js msgid "It is in the tunnel network %s." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "It is older than %s. A backup of the settings is made first; restore it from Settings if something looks wrong." +#: web/src/admin/flows/versions.ts +msgid "It is older than %s. A backup of the settings is made first; restore it from Backups if something looks wrong." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves like a home device would." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves through %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "It leaves through the WAN." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/shared/format.ts +msgid "It shares addresses with a network here" +msgstr "" + +#: web/src/admin/pages/people/index.ts +msgid "It was removed, or the link is out of date. Its events stay in the log for as long as the log keeps them." +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Its attempts reach the router since %s, no answer reaches the device" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Its configuration changed after it was set up: the device has the old one." +msgstr "" + +#: backend/i18n/messages.js msgid "Its configuration doesn't send it to the router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/people/diagnosis.ts +msgid "Its configuration is current, so the network it connects from is in the way. Let it try another: mobile data instead of Wi‑Fi, or the other way round." +msgstr "" + +#: backend/i18n/messages.js msgid "Its configuration sends it to the router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Its configuration stops working at once. It can be added again here or on the portal." +msgstr "" + +#: web/src/admin/flows/new-keys.ts +msgid "Its configuration stops working at once. Set the device up again: the new one opens next." +msgstr "" + +#: web/src/admin/events/timeline.ts +msgid "Its configuration was given out, but the device has never connected." +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Its owner added this router on their page: it connects once you accept it." +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "Its server’s settings changed" +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "Its settings changed" +msgstr "" + +#: web/src/admin/pages/settings/router/backups.ts +msgid "JSON moves everything except usage history to another router." +msgstr "" + +#: backend/i18n/messages.js msgid "Jmin must not be larger than Jmax." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Junk packets" msgstr "" @@ -3819,89 +4530,85 @@ msgstr "" msgid "KB" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Keep access" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts -msgid "Keep activity" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Keep activity for 0 (no age limit) to 9999 days." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Keep at least one network, or choose Internet only." +#: web/src/admin/flows/server-change.ts +msgid "Keep devices apart?" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/history.ts +msgid "Keep the log" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Keep the previous version" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts +#: web/src/admin/pages/settings/disguise.ts +msgid "Keep the values in use" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "Keep-alive" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Keep-alive must be 0-600 seconds." msgstr "" -#: web/src/admin/device-link.ts -msgid "Keep-alive of %s" +#: web/src/admin/widgets/link-values.ts +msgid "Keep-alive: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/flows/server-change.ts +msgid "Keep-alive: %s?" +msgstr "" + +#: backend/i18n/messages.js msgid "Keeping AmneziaWG %s for rollback" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Keeping Dawnline %s for rollback" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Kept after the next update" -msgstr "" - #: web/src/admin/events/model.ts msgid "Kept for %s, %s, %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Kernel module, awg tool and the netifd protocol are present." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/setup.ts msgid "Key" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts +#: web/src/admin/flows/setup.ts msgid "Key copied" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Key file" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Key generation failed (is amneziawg-tools installed?)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Key generation failed (no random data)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Key generation failed." msgstr "" -#: web/src/admin/device-link.ts -#: web/src/admin/device.ts #: web/src/admin/events/model.ts +#: web/src/portal/flows/device-form.ts msgid "LAN Bypass" msgstr "" @@ -3913,59 +4620,116 @@ msgstr "" msgid "LAN Bypass on" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Last 30 days" +#: web/src/admin/pages/overview/now.ts +msgid "Last 24 hours" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/widgets/spark.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/widgets/week-use.ts msgid "Last 7 days" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Last check" +#: web/src/admin/pages/people/device/link.ts +msgid "Last handshake %s" msgstr "" -#: web/src/admin/pages/people.ts -msgctxt "sort" -msgid "Last seen" +#: web/src/admin/people/diagnosis.ts +msgid "Last one %s" msgstr "" -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts +#: web/src/admin/pages/people/filters.ts +msgid "Last online" +msgstr "" + +#: web/src/admin/events/timeline.ts +msgid "Last online %s" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/rollout.ts msgid "Last seen %s" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Last: %s, %s" +#: web/src/admin/people/card.ts +msgid "Last seen in %s" +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +msgid "Last time %s" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "Latest" msgstr "" #: web/src/admin/updater/jobs.ts msgid "Latest version is installed" msgstr "" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Latest version · checked %s" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Leave" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Leave out https:// - just the name." msgstr "" +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/pending-dock.ts +msgid "Leave without applying?" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Letters, digits, spaces and - _ . only." msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Let’s Encrypt certificate for the portal" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Limit hours" +#: web/src/admin/pages/settings/networks.ts +msgid "Like a home device" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/invite.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "Limit" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +msgid "Limit as it was" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Limit nearly reached" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Limit reached" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Limit: %s. Change" +msgstr "" + +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/people/card.ts +msgid "Link" +msgstr "" + +#: web/src/admin/flows/invite.ts msgid "Link copied" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Links on %s use plain HTTP: the link and the VPN keys in configurations travel unencrypted." msgstr "" @@ -3977,7 +4741,7 @@ msgstr "" msgid "Links on IP addresses also need the next port: choose a lower one." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Links on IP addresses use plain HTTP on the next port (%d), which the portal cannot take. Choose another portal port." msgstr "" @@ -3985,128 +4749,90 @@ msgstr "" msgid "Links use %s." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Links will open for the people you send them to." +#: web/src/admin/flows/portal-sheets.ts +msgid "Links work on every picked address; the first is the main one." msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts -msgid "Listening" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Listening on TCP %d." msgstr "" -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/new-server.ts msgid "Listening port" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Live tunnel" -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/changes.ts +#: web/src/admin/pages/settings/networks.ts msgid "Loading interfaces…" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Loading people…" -msgstr "" - -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "Loading release notes…" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Loading the kernel module" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Loading versions…" msgstr "" -#: web/src/admin/device.ts -msgid "Loading…" -msgstr "" - -#: web/src/admin/device.ts -msgid "Local address" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Location cache" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Location cache cleared" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/settings/map.ts -msgid "Locations" -msgstr "" - -#: web/src/admin/pages/person/activity.ts -msgid "Locations are off" -msgstr "" - -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -msgid "Locations are off. %s." -msgstr "" - -#: web/src/admin/pages/diagnostics/index.ts +#: web/src/admin/pages/log/index.ts +#: web/src/admin/shell/nav.ts +#: web/src/admin/widgets/feed.ts msgid "Log" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Log copied" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Log size must be 100-20000 events." msgstr "" -#: web/src/admin/pages/settings/logs.ts -msgid "Logs & history" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Looked %s" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Looking for devices at home…" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Looking for the %s build for OpenWrt %s" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Looks for new versions in the background; Components shows what it found and the service log names it." +#: web/src/admin/pages/overview/health.ts +msgid "Looks every minute and repairs the tunnels and services it can. It never reboots the router." msgstr "" #: web/src/admin/netcheck.ts msgid "Lowercase letters, digits, dashes and dots." msgstr "" +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Lowercase letters, digits, dashes and dots; empty: lan" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Lowercase only." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "LuCI link" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "LuCI pages for AmneziaWG" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "LuCI pages for Dawnline" msgstr "" @@ -4114,12 +4840,11 @@ msgstr "" msgid "MB" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "MTU is now automatic" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "MTU must be 1280-1500." msgstr "" @@ -4127,60 +4852,69 @@ msgstr "" msgid "MTU must be 1280–1500, or empty for automatic." msgstr "" -#: web/src/admin/device-link.ts -msgid "MTU of %s" +#: web/src/admin/widgets/link-values.ts +msgid "MTU: %s" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/server-change.ts +msgid "MTU: %s?" +msgstr "" + +#: web/src/admin/system/model.ts +msgid "Made by hand" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Made by the router: browsers warn until a certificate covers the address." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Main" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts +msgid "Main address: %s" +msgstr "" + +#: web/src/admin/flows/invite.ts +msgid "Make a new link" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Make main" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Manual" +#: web/src/admin/pages/people/index.ts +msgid "Map" msgstr "" -#: web/src/admin/pages/settings/map.ts -msgid "Map & locations" +#: web/src/admin/widgets/place-rows.ts +msgid "Map and replay" +msgstr "" + +#: web/src/admin/widgets/disguise-levels.ts +msgctxt "disguise" +msgid "Max" msgstr "" -#: web/src/admin/cores/awg.ts #: web/src/admin/disguise.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Maximum" msgstr "" -#: web/src/admin/pages/settings/logs.ts -msgid "Maximum events" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Maximum needs AmneziaWG 3.1 on the router (kmod-amneziawg, amneziawg-tools 3.1): install a 3.1 build in Dawnline → Components." msgstr "" -#: web/src/admin/pages/settings/logs.ts -msgid "Maximum size" -msgstr "" - -#: web/src/shared/format.ts -msgid "Mbit/s" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Memory only" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Method not allowed." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "Missing: %s." msgstr "" @@ -4188,102 +4922,95 @@ msgstr "" msgid "Mobile" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Monthly" +#: web/src/admin/widgets/limit-meter.ts +msgctxt "limit" +msgid "Month" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Monthly data (GB)" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Monthly data must be a positive number of GB." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Monthly traffic" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Monthly traffic history must be 1-120 months." msgstr "" -#: web/src/admin/pages/components/index.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/pages/settings/backups.ts -msgid "More" +#: web/src/admin/ui/stepper.ts +msgid "More: %s" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Most: %s" +#: web/src/admin/pages/overview/now.ts +msgid "Most in 30 days:" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/flows/move-person.ts msgid "Move" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Move %s to another server" +#: web/src/admin/pages/people/person/head.ts +msgid "Move to another server" msgstr "" -#: web/src/admin/pages/person/header.ts -msgid "Move to server…" +#: web/src/admin/flows/move-person.ts +msgid "Move · %s" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Moved to %s" +#: web/src/admin/pages/people/person/head.ts +msgid "Move, rename, note, pause, remove" +msgstr "" + +#: web/src/admin/pages/settings/router/backups.ts +msgid "Moving to another router" msgstr "" #: web/src/admin/netcheck.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Must start with http:// or https://." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "NAS" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts msgid "Name" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts msgctxt "circle or service" msgid "Name" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -msgctxt "person" -msgid "Name" +#: web/src/admin/widgets/config-card.ts +msgid "Name copied" msgstr "" -#: web/src/admin/pages/people.ts -msgctxt "sort" -msgid "Name" +#: web/src/admin/widgets/config-card.ts +msgid "Name in the network" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Name: %s" +#: web/src/admin/pages/people/index.ts +msgid "Name, device, IP" msgstr "" -#: web/src/admin/device.ts -msgid "Named after its type: %s." +#: web/src/admin/widgets/reach.ts +msgid "Names" msgstr "" #: web/src/admin/netcheck.ts msgid "Names can’t contain < > \" or \\." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Names like %s work. Internet names are resolved at home, so they depend on the tunnel (%s takes over when it is down)." -msgstr "" - -#: web/src/admin/pages/person/pickers.ts -msgid "Names like %s work. Internet names are resolved at home, so they depend on the tunnel - with no fallback set, they stop when it is down." -msgstr "" - #: web/src/admin/map.ts msgid "Near %s" msgstr "" @@ -4292,15 +5019,11 @@ msgstr "" msgid "Near the server" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Need a little more this month?" -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Needs %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Needs %s. Internet traffic leaves through WAN directly until then." msgstr "" @@ -4320,208 +5043,304 @@ msgstr "" msgid "Needs AmneziaWG on the router." msgstr "" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +msgid "Needs a decision" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Needs a new configuration" +msgstr "" + +#: web/src/admin/pages/settings/health.ts +#: web/src/admin/ui/rail.ts msgid "Needs attention" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/server/overview.ts +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/net-values.ts +msgid "Network" +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is not private (10.x, 172.16-31.x, 192.168.x)." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is not written like 192.168.2.0/24." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is taken on this server. Ask the admin which addresses are free." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is behind %s (%s). Two sites need different addresses." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is behind your %s. Two sites need different addresses." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is taken: %s is the tunnel network of %s. The two ends of a tunnel need different addresses." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is taken: the router has %s itself. The two ends of a tunnel need different addresses." +msgstr "" + +#: backend/i18n/messages.js +msgid "Network %s is too wide: /%d at the most." +msgstr "" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/net-values.ts +msgid "Network behind it" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +msgid "Network copied" +msgstr "" + +#: backend/i18n/messages.js msgid "Network interface %s already exists." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/reach.ts msgid "Networks" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js +msgid "Networks %s and %s share addresses." +msgstr "" + +#: backend/i18n/messages.js msgid "Networks a person does not reach cannot reach them either." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Never" +#: web/src/admin/pages/settings/networks.ts +msgid "Networks behind %s" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Never connected" +#: web/src/admin/flows/add-device.ts +#: web/src/admin/widgets/config-card.ts +msgid "Networks behind it" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Never reached from the internet yet - test with a phone on mobile data." +#: web/src/admin/pages/settings/networks.ts +msgid "Networks behind people’s routers" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/pages/person/pickers.ts +#: backend/i18n/messages.js +msgid "Networks behind routers" +msgstr "" + +#: web/src/admin/flows/circle.ts +#: web/src/admin/widgets/visibility.ts msgid "New circle" msgstr "" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/widgets/rollout.ts +msgid "New configuration" +msgstr "" + +#: web/src/admin/pages/people/notices.ts +msgid "New configuration for %s" +msgid_plural "New configuration for %s" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/widgets/rollout.ts +msgid "New configuration: %s of %s" +msgstr "" + +#: web/src/admin/pages/settings/disguise.ts +msgid "New disguise values" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/timeline.ts msgid "New keys" msgstr "" -#: web/src/admin/device.ts -msgid "New keys %s" -msgstr "" - -#: web/src/admin/device.ts -msgid "New keys generated" -msgstr "" - #: web/src/admin/events/render.ts msgid "New keys issued for device %s on the portal" msgstr "" -#: web/src/admin/pages/person/header.ts +#: web/src/admin/flows/new-keys.ts +msgid "New keys · %s" +msgstr "" + +#: web/src/admin/flows/invite.ts msgid "New link" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "New link copied" +#: web/src/admin/flows/invite.ts +msgid "New link made" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "New link created" -msgstr "" - -#: web/src/admin/pages/person/dialogs.ts -msgid "New link created, %s device removed" -msgid_plural "New link created, %s devices removed" +#: web/src/admin/flows/invite.ts +msgid "New link made, %s device removed" +msgid_plural "New link made, %s devices removed" msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts +#: web/src/admin/pages/settings/router/index.ts msgid "New people" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "New values applied" +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "New person" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Newer than release" +#: web/src/admin/pages/settings/disguise.ts +msgid "New values" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts +msgid "Newer than the release (%s)" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgid "Newest events are kept when the log is full." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Next" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/system/model.ts msgid "Nightly" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Nightly when something changed, and before every restore, import or update. The last 10 are kept." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/settings/networks.ts +msgctxt "devices see each other" +msgid "No" +msgstr "" + +#: backend/i18n/messages.js msgid "No %s build for OpenWrt %s in %s, or it could not be verified" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "No AmneziaWG build for OpenWrt %s (%s) yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "No AmneziaWG build for OpenWrt %s yet" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-switches.ts msgid "No IPv4 network" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No LAN detected." msgstr "" -#: web/src/admin/interfaces.ts -msgid "No WAN found" -msgstr "" - -#: web/src/admin/device.ts -msgid "No activity yet." -msgstr "" - -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "No answer" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "No backups yet." +#: web/src/admin/pages/settings/router/backups.ts +msgid "No backups yet" msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "No build" -msgstr "" - -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/widgets/reach.ts msgid "No circle" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "No data limit" +#: web/src/portal/ui/wait-way.ts +msgid "No connection yet" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "No device has connected yet" +#: web/src/admin/pages/people/map-view.ts +msgid "No connections from a known place in this period." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/events/timeline.ts +msgid "No connections in the %s" +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "No connections in this period" +msgstr "" + +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/rollout.ts +msgid "No connections yet" +msgstr "" + +#: backend/i18n/messages.js msgid "No device uses %s" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "No devices found in the home network right now." msgstr "" -#: web/src/admin/pages/server.ts -msgid "No devices on this server yet: nothing else changes." +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "No devices yet" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "No end" -msgstr "" - -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/widgets/term.ts msgid "No end date" msgstr "" -#: web/src/admin/pages/diagnostics/log.ts -msgid "No events match." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "No free address left on %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free address on %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "No free addresses left in the server subnet." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free link-local range for the internal link." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "No free routing table." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/net-switches.ts msgid "No home network: Home access reaches nothing but this router." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "No junk packets." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "No limit" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgctxt "retention" msgid "No limit" msgstr "" @@ -4531,120 +5350,168 @@ msgid "No locations in this period." msgstr "" #: web/src/admin/map.ts -#: web/src/admin/pages/person/activity.ts msgid "No locations yet" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "No more versions." +#: web/src/admin/pages/log/days.ts +msgid "No log entry fits these filters." msgstr "" -#: web/src/admin/interfaces.ts -msgid "No netifd interface" +#: web/src/admin/pages/people/map-view.ts +msgid "No map of places" msgstr "" -#: web/src/admin/pages/people.ts -msgid "No one here right now." +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/net-values.ts +msgid "No network behind it" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "No other policy routing ahead of the tunnel rules." msgstr "" -#: web/src/admin/pages/people.ts -msgid "No people yet. Add someone and send them their personal link." +#: web/src/admin/pages/people/cards.ts +msgid "No people yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/admin/pages/people/map-view.ts +msgid "No places in this period" +msgstr "" + +#: backend/i18n/messages.js msgid "No previous AmneziaWG build is kept on the router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "No previous Dawnline version is kept on the router" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "No problems in the last 7 days." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "No public address: devices will not know where to connect." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "No release %s in %s." msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/ui/badges.ts -#: web/src/shared/format.ts +#: web/src/admin/pages/settings/networks.ts +msgid "No routers yet: a router is a person’s device of the kind «Router»." +msgstr "" + +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "No server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/people/diagnosis.ts +msgid "No server chosen" +msgstr "" + +#: web/src/admin/pages/overview/index.ts +msgid "No server is running" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/pages/people/index.ts msgid "No server yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "No server yet." msgstr "" -#: web/src/admin/pages/people.ts -msgid "No server yet. %s before adding people." +#: web/src/admin/flows/move-person.ts +msgid "No server yet: their devices have nowhere to connect." msgstr "" -#: web/src/admin/access.ts -msgid "No services yet: pick ports of a device below." +#: web/src/admin/pages/settings/networks.ts +msgid "No services yet." msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "No traffic yet." +#: web/src/admin/pages/people/index.ts +msgid "No such device" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "No values yet" +#: web/src/admin/pages/log/days.ts +msgid "No such entries" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/people/index.ts +msgid "No such person" +msgstr "" + +#: web/src/admin/flows/versions.ts msgid "No versions found." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Nobody can connect. Turn it on to bring the tunnel back." +#: web/src/admin/widgets/visibility.ts +msgid "Nobody" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Nobody else in %s yet" +#: web/src/admin/flows/circle.ts +msgid "Nobody by that name." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Nobody is connected" +#: web/src/admin/widgets/entry.ts +msgid "Nobody has reached it from the internet yet" msgstr "" -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/ui/controls.ts +#: web/src/admin/pages/people/map-view.ts +msgid "Nobody is online now" +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody is online now." +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody is paused." +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody matches “%s”." +msgstr "" + +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/people/cards.ts +msgid "Nobody on this server yet." +msgstr "" + +#: web/src/admin/pages/overview/waiting.ts +msgid "Nobody waits for a decision" +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody waits for a decision." +msgstr "" + +#: web/src/admin/pages/people/cards.ts +msgid "Nobody waits for a new configuration." +msgstr "" + +#: web/src/admin/pages/settings/router/defaults.ts msgid "None" msgstr "" -#: web/src/admin/pages/people.ts -msgctxt "end date" -msgid "None" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "None in use" msgstr "" #: web/src/admin/netcheck.ts msgid "None: without the tunnel those devices have no DNS." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Normal" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Not a Dawnline export." msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Not a JSON file." msgstr "" @@ -4652,141 +5519,225 @@ msgstr "" msgid "Not a usable address (no spaces or quotes)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Not a valid backup archive." msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Not checked" +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/entry.ts +#: web/src/admin/widgets/link-values.ts +#: web/src/admin/widgets/visibility.ts +msgid "Not applied yet. Now: %s" msgstr "" -#: web/src/admin/ui/badges.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Not checked yet" +msgstr "" + +#: web/src/admin/pages/settings/router/updates.ts +msgid "Not checked yet." +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/people/diagnosis.ts +msgid "Not connected" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Not connected for %s" +msgstr "" + +#: web/src/admin/people/card.ts msgid "Not connected yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "Not enough free space on the router: %d MB free, about %d MB needed. Remove old backups or packages first" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Not every device is loaded into AmneziaWG" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/updater/jobs.ts +msgid "Not everything was checked" +msgstr "" + +#: web/src/admin/widgets/rollout.ts +msgid "Not fetched yet" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts msgid "Not found now: using %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc -#: web/src/admin/interfaces.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/networks.ts msgid "Not found." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Not in a firewall zone: the firewall rejects this traffic." +#: web/src/admin/flows/restore.ts +msgid "Not imported" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/operation.ts +#: web/src/admin/updater/jobs.ts msgid "Not installed" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Not on this router" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts msgid "Not present right now" msgstr "" -#: web/src/admin/pages/diagnostics/log.ts -msgid "Not recorded: %s." +#: web/src/admin/flows/restore.ts +msgid "Not restored" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/servers/state.ts msgid "Not running" msgstr "" -#: web/src/admin/pages/person/pickers.ts -#: web/src/admin/ui/badges.ts +#: web/src/admin/people/diagnosis.ts msgid "Not set up yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Not set up." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Not set: the certificate is picked automatically." +#: web/src/admin/flows/operation.ts +msgid "Not started" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "Not used" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/ui/rail.ts msgid "Not working" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Not working: %s" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note removed" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Note saved" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/people/person/head.ts +msgid "Note: %s. Edit" +msgstr "" + +#: web/src/admin/widgets/feed.ts +msgid "Nothing about them in the log yet." +msgstr "" + +#: web/src/admin/widgets/feed.ts +msgid "Nothing about this device in the log yet." +msgstr "" + +#: web/src/admin/flows/operation.ts msgid "Nothing else was changed." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/people/cards.ts +msgid "Nothing found" +msgstr "" + +#: backend/i18n/messages.js msgid "Nothing listens on TCP %d." msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/clear.ts msgid "Nothing matched" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: web/src/admin/pages/log/days.ts +msgid "Nothing matches “%s”." +msgstr "" + +#: backend/i18n/messages.js +msgid "Nothing to change for %s." +msgstr "" + +#: backend/i18n/messages.js +msgid "Nothing to change." +msgstr "" + +#: backend/i18n/messages.js msgid "Nothing to install" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/settings.uc +#: backend/i18n/messages.js msgid "Nothing to save." msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "Nothing yet." +#: web/src/admin/flows/restore.ts +msgid "Nothing was changed." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Nothing yet. Connections, new devices and pauses appear here." +#: web/src/admin/pages/people/map-view.ts +msgctxt "period" +msgid "Now" msgstr "" -#: web/src/admin/access.ts -msgid "Now in %s" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/traffic.ts +msgctxt "speed" +msgid "Now" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Now %s. Updating restarts the service for a few seconds; tunnels stay up." +msgstr "" + +#: web/src/admin/flows/move-person.ts +msgid "Now on %s. Access, end date and limits stay." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts msgid "Now: %s, was %s." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Now: %s." msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "OK" +#: web/src/admin/pages/people/card.ts +msgid "Of the limit" msgstr "" -#: web/src/admin/device-link.ts #: web/src/admin/disguise.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/edit-rows.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "Off" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts +msgctxt "keep-alive" +msgid "Off" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts +msgctxt "portal" +msgid "Off" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgctxt "updates" msgid "Off" msgstr "" @@ -4794,88 +5745,128 @@ msgstr "" msgid "Off: NAT may close the tunnel when idle, and “Connected” lags." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Off: internet traffic goes straight to the WAN, the fastest way. DNS still goes through this router. Proxies and filters here handle the tunnel only if you %s." -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Off: only you add devices, from LuCI. On: people manage their devices within the limits you set." msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Off: problems are only written to the log. Nothing is repaired on its own." +#: web/src/admin/pages/settings/router/portal.ts +msgid "Off: personal links do not open." msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/portal/setup.ts +msgid "Official release on GitHub" +msgstr "" + +#: web/src/admin/widgets/timeline.ts msgid "Offline" msgstr "" -#: web/src/admin/pages/settings/logs.ts -msgid "Older events are removed automatically." +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/people/card.ts +msgid "Offline for %s" msgstr "" -#: web/src/admin/logs.ts -msgid "Older than %s day" -msgid_plural "Older than %s days" -msgstr[0] "" -msgstr[1] "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Older than must be a number of days." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Older →" -msgstr "" - -#: web/src/admin/device-link.ts -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/edit-rows.ts msgid "On" msgstr "" -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts +#: web/src/portal/setup.ts msgid "On GitHub" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "On one of the networks %s reaches." msgstr "" +#: web/src/admin/pages/settings/networks.ts +msgid "On request" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +msgid "On the map" +msgstr "" + #: web/src/admin/events/model.ts msgid "On two devices at once" msgstr "" -#: web/src/admin/device-link.ts -msgid "On, except %s (home)" +#: web/src/admin/people/diagnosis.ts +msgid "One configuration is on two devices, and they push each other out." msgstr "" -#: web/src/admin/pages/server.ts -msgid "One more server: another port or disguise for networks where the first does not get through, or its own home access rules. People are moved between servers from their page." +#: web/src/admin/flows/new-server.ts +msgid "One more server: another port or disguise for networks the first does not get through, or its own home access rules." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "One of the networks %s reaches." msgstr "" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/widgets/reach.ts +msgid "One of the two must stay: otherwise their devices reach nothing." +msgstr "" + +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/overview/now.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts +#: web/src/admin/widgets/timeline.ts msgid "Online" msgstr "" -#: web/src/admin/map.ts -msgid "Online now" +#: web/src/admin/pages/people/card.ts +msgid "Online for %s" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Only %s's own devices" +#: web/src/admin/widgets/rollout.ts +msgid "Online now, on the old configuration" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/overview/now.ts +msgid "Online now: %s" +msgstr "" + +#: web/src/admin/events/timeline.ts +#: web/src/admin/pages/people/card.ts +msgid "Online since %s" +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "Online · %s" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Online · data limit reached" +msgstr "" + +#: web/src/admin/events/timeline.ts +msgid "Online, but only the portal and the router’s DNS open." +msgstr "" + +#: web/src/admin/pages/people/person/head.ts +msgid "Only a backup brings them back." +msgstr "" + +#: backend/i18n/messages.js +msgid "Only a router has networks behind it." +msgstr "" + +#: backend/i18n/messages.js msgid "Only devices of people with home access can be reached." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Only home devices reach people's devices." msgstr "" @@ -4883,53 +5874,57 @@ msgstr "" msgid "Only letters, digits, - _ ." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Only people with home access reach other devices." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "Only the admin can change how a device connects." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js msgid "Only the admin can turn devices off." msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Only the selected services at home." +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/timeline.ts +msgid "Only the portal and the router’s DNS" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/pages/people/person/head.ts msgid "Only you see this" msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/devices.ts msgid "Open" msgstr "" #: web/src/admin/map.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/settings/networks.ts msgid "Open %s" msgstr "" -#: web/src/admin/pages/server.ts -#: web/src/admin/widgets/health.ts -msgid "Open Components" +#: web/src/portal/setup.ts +msgctxt "step" +msgid "Open %s" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Open Diagnostics" +#: backend/i18n/messages.js +msgid "Open Overview → Health." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc -msgid "Open Diagnostics → Health." +#: web/src/admin/flows/new-server.ts +#: web/src/admin/servers/fixes.ts +msgid "Open Updates" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Open Settings" +#: web/src/portal/setup.ts +msgid "Open a terminal in the folder with the file" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Open on GitHub" msgstr "" @@ -4937,43 +5932,78 @@ msgstr "" msgid "Open person" msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Open the OpenWrt package list" msgstr "" -#: web/src/admin/invite.ts -msgid "Open the link or scan the code" +#: web/src/admin/flows/places-closeup.ts +msgid "Open the device" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/pages/people/card.ts +msgid "Open the device %s" +msgstr "" + +#: web/src/admin/pages/people/index.ts +msgid "Open the log" +msgstr "" + +#: web/src/admin/widgets/place-rows.ts +msgid "Open the map and the replay" +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +msgid "Open the server" +msgstr "" + +#: web/src/admin/pages/people/map-view.ts +msgid "Open the setting" +msgstr "" + +#: web/src/admin/flows/add-person.ts +msgid "Open their page" +msgstr "" + +#: backend/i18n/messages.js msgid "Open this link over HTTPS to get the connection settings." msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/people/diagnosis.ts +msgid "Open until %s" +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "Open with no end date" +msgstr "" + +#: web/src/admin/flows/packages.ts msgid "OpenSSL for uhttpd" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/portal/setup.ts +msgid "OpenWrt packages" +msgstr "" + +#: web/src/portal/setup.ts +msgid "OpenWrt packages + kmod" +msgstr "" + +#: web/src/admin/flows/new-server.ts msgid "Opened on the WAN firewall automatically." msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Operation completed" +#: web/src/admin/shell/waiting.ts +msgid "Opening the page" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "Operation failed" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/job-stage.ts msgid "Operation log" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Operation started. Waiting for log output…" -msgstr "" - #: web/src/admin/netcheck.ts msgid "Optional. No data limit." msgstr "" @@ -4982,82 +6012,104 @@ msgstr "" msgid "Optional. No end date." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/flows/portal-sheets.ts +msgid "Or another one:" +msgstr "" + +#: web/src/portal/setup.ts +msgid "Or, with wireguard-tools," +msgstr "" + +#: web/src/admin/pages/people/filters.ts +msgid "Order" +msgstr "" + +#: web/src/admin/pages/people/filters.ts +msgid "Order: %s" +msgstr "" + #: web/src/shared/format.ts msgid "Other" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Other address" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/flows/invite.ts +msgid "Other addresses" +msgstr "" + +#: backend/i18n/messages.js msgid "Other addresses must be hostnames or IP addresses." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Other interfaces" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Other policy routing bypasses the home-device path" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/shared/format.ts -msgid "Outside allowed hours" +#: web/src/admin/flows/versions.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Other versions" msgstr "" -#: web/src/admin/ui/badges.ts -msgid "Outside hours" -msgstr "" - -#: web/src/admin/pages/person/devices.ts -msgid "Over the limit" -msgstr "" - -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/person/devices.ts msgid "Over the limit: admins can still add" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-device.ts +msgid "Over the limit: on the portal they have %s, you can add more" +msgstr "" + +#: web/src/admin/pages/server/index.ts +#: web/src/admin/shell/nav.ts msgid "Overview" msgstr "" +#: web/src/admin/widgets/link-values.ts +msgid "Own" +msgstr "" + +#: web/src/admin/widgets/link-values.ts +msgid "Own: %s" +msgstr "" + #: web/src/shared/format.ts msgid "PC" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Package installation failed" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/flows/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Packages and versions" +msgstr "" + +#: web/src/admin/servers/params.ts msgid "Packet types" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Padding" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Page %s" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Parameters copied" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "Parameters copied. The header protection key is in each device’s file." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Paths on the router. Leave both empty to pick a certificate automatically." msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/people/pick.ts msgid "Pause" msgstr "" @@ -5066,14 +6118,15 @@ msgctxt "replay" msgid "Pause" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Pause access" +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/people/pick.ts +msgid "Pause lifted" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts -#: web/src/admin/ui/badges.ts -#: web/src/shared/format.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/people/lines.ts msgid "Paused" msgstr "" @@ -5085,28 +6138,46 @@ msgstr "" msgid "Paused after %s GB this month, resumed on the 1st." msgstr "" -#: web/src/admin/pages/people.ts -msgid "Paused until it resets on %s" +#: web/src/admin/pages/people/pick.ts +msgid "Paused again" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Paused until the limit is raised" +#: backend/i18n/messages.js +msgid "Paused must be true or false." msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/access.ts +#: web/src/admin/people/card.ts +msgid "Paused since %s" +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "Paused · access ended" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "Paused, ended and over-the-limit people reach nothing." +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "Paused: %s" +msgstr "" + +#: backend/i18n/messages.js #: web/src/admin/events/model.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/index.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/index.ts msgid "People" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "People and devices are inconsistent" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "People and devices consistent" msgstr "" @@ -5114,32 +6185,41 @@ msgstr "" msgid "People and their devices added, changed, paused, removed" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "People limited to this service lose access to it." msgstr "" -#: web/src/admin/interfaces.ts -msgid "People with Home or Both" +#: web/src/admin/flows/restore.ts +msgid "People, devices and servers from a Dawnline export (usage history is not in it)." msgstr "" -#: web/src/admin/interfaces.ts -msgid "People with Internet or Both" +#: web/src/admin/pages/settings/router/portal.ts +msgid "People’s links work on every address; the first is the main one and goes into invitations." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/networks.ts +msgid "People’s pages offer no «Router» among the kinds: only you add one, on a person’s page." +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts msgid "Per-day history behind the charts." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Per-month totals; data limits use the current month." msgstr "" -#: web/src/admin/logs.ts -msgid "Person" +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts +msgid "Period" msgstr "" -#: web/src/admin/events/render.ts -msgid "Person %s - all devices removed, end date reached" +#: web/src/admin/logs.ts +#: web/src/admin/pages/log/filters.ts +msgid "Person" msgstr "" #: web/src/admin/events/render.ts @@ -5154,6 +6234,10 @@ msgstr "" msgid "Person %s changed device %s on their portal" msgstr "" +#: web/src/admin/events/render.ts +msgid "Person %s has data again after the limit" +msgstr "" + #: web/src/admin/events/render.ts msgid "Person %s issued new keys for device %s on their portal" msgstr "" @@ -5166,6 +6250,10 @@ msgstr "" msgid "Person %s paused - %s" msgstr "" +#: web/src/admin/events/render.ts +msgid "Person %s reached the data limit" +msgstr "" + #: web/src/admin/events/render.ts msgid "Person %s removed device %s" msgstr "" @@ -5186,19 +6274,19 @@ msgstr "" msgid "Person %s resumed - %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: circle %s does not exist." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: has the same personal link as %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: home service %s does not exist." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Person %s: server %s does not exist." msgstr "" @@ -5212,37 +6300,28 @@ msgstr[1] "" msgid "Person %s’s access ends in a few days" msgstr "" -#: web/src/admin/events/render.ts -msgid "Person %s’s end date passed (%s) · access kept" +#: web/src/admin/pages/log/filters.ts +msgid "Person: %s" msgstr "" -#: web/src/admin/pages/person/index.ts -msgid "Person not found" -msgstr "" - -#: web/src/admin/pages/people.ts -msgid "Person removed" -msgstr "" - -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts +#: web/src/admin/flows/invite.ts msgid "Personal link copied" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "Personal links" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js #: web/src/admin/events/render.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Personal portal" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Personal portal isn’t working" msgstr "" @@ -5250,63 +6329,70 @@ msgstr "" msgid "Phone" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Pick one or more; the first is the main link" +#: web/src/admin/pages/people/map-view.ts +msgid "Pick a period to see where they connected from before." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Plain HTTP" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Pick automatically" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/portal/setup.ts +msgid "Pick the file and connect" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/map-view.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/server/index.ts +msgid "Places" +msgstr "" + +#: backend/i18n/messages.js msgid "Plain HTTP links" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Plain HTTP: the link and VPN keys travel unencrypted" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Plain WireGuard" -msgstr "" - #: web/src/admin/disguise.ts -msgid "Plain WireGuard-compatible traffic. Fastest, but easy to recognise and block." +msgid "Plain WireGuard. Fast, but easy to recognise and block." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Plain resolver on port %d." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Plain resolver running next to the LAN (%s)." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at %s, not this router" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at this router · Let’s Encrypt certificate" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Points at this router · no certificate yet" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Points here" +#: web/src/admin/widgets/entry.ts +msgid "Points to this router" msgstr "" -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/flows/packages.ts msgid "Policy routing and the veth pair" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Policy routing on the router (%s) sends marked traffic straight out, past the home-device path: tunnel traffic it matches skips your LAN's proxies and filters." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Port" msgstr "" @@ -5316,110 +6402,111 @@ msgid_plural "Ports %s." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js +msgid "Port is free" +msgstr "" + +#: backend/i18n/messages.js msgid "Port must be 1-65535." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Port of %s" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Port, MTU and keep-alive apply at once." +#: web/src/admin/pages/settings/router/portal.ts +msgid "Port: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js #: web/src/admin/events/model.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/first.ts msgid "Portal" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address doesn’t point here" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address isn’t set" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal address points here" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Portal addresses" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal answers may not reach visitors" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal answers reach visitors" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal certificate" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Portal certificate needs attention" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Portal is off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/rollout.ts +msgid "Portal link · %s" +msgstr "" + +#: web/src/admin/widgets/rollout.ts +msgid "Portal link · %s copied" +msgstr "" + +#: backend/i18n/messages.js msgid "Portal links use plain HTTP" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Portal port must be 1-65535." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Portal port: %s" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "Portal running" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Ports" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Ports %s" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Ports they announce over Bonjour. Pick what to open, or all ports." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Ports: %s" -msgstr "" - -#: web/src/admin/pages/settings/defaults.ts +#: web/src/admin/pages/settings/router/defaults.ts msgid "Pre-filled when you add someone." msgstr "" -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/versions.ts +#: web/src/admin/flows/whats-new.ts msgid "Pre-release" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/overview/now.ts +msgid "Previous %s" +msgstr "" + +#: web/src/admin/flows/home-service.ts msgid "Printer" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "Private addresses outside the home network are blocked." msgstr "" @@ -5427,920 +6514,911 @@ msgstr "" msgid "Problems" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Protection" msgstr "" -#: web/src/admin/pages/settings/map.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Provider" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/networks.ts +msgid "Proxies and filters" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/flows/new-server.ts msgid "Public address" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Public address changed: %s still gives devices %s, the router is %s now." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Public address must be a hostname or IP address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Public address needs attention" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Public address: %s" -msgstr "" - -#: web/src/admin/device.ts -msgid "Public key" -msgstr "" - -#: web/src/admin/cores/awg.ts -msgid "Public key copied" -msgstr "" - -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts #: web/src/shared/qr.ts msgid "QR code" msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "QR, file, key, rename, new keys, remove" +#: web/src/portal/setup.ts +msgctxt "AmneziaVPN app" +msgid "QR code" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Random bytes in front of handshake, cookie and data packets, so their sizes do not match WireGuard." msgstr "" -#: web/src/admin/widgets/access-picker.ts -msgid "Reach devices at home (NAS, printer, cameras). Internet stays on their own connection." +#: web/src/admin/widgets/entry.ts +msgid "Reached from the internet" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Reach devices at home, and home reaches theirs. Internet stays on their own connection." +#: web/src/admin/pages/settings/networks.ts +msgid "Read again" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Reached from the internet %s." +#: web/src/admin/shell/waiting.ts +msgid "Reading the router" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Read the interfaces again" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "Ready" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "Ready to share" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Recent problems" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "Recommended" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Record" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Redirect must be a full http:// or https:// address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "Refreshing package lists" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Reinstall" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstall %s" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Reinstall AmneziaWG?" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstall this build" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstalling AmneziaWG" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Reinstalling Dawnline" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "RejectAfterTime must be at most 180 seconds." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s has no %s: it stays as it is" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s has no translation into %s: install a release that has one" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Release %s publishes no checksum for %s: not installing an unverified package" msgstr "" -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "Release notes copied" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Release tag" msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Reload devices" msgstr "" -#: web/src/admin/updater/operation.ts +#: web/src/admin/flows/operation.ts msgid "Reload now" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Reloading the kernel module (%d tunnel restarts)" msgid_plural "Reloading the kernel module (%d tunnels restart)" msgstr[0] "" msgstr[1] "" -#: web/src/admin/updater/operation.ts -msgid "Reloading the page…" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Remote desktop" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/server/settings.ts +msgid "Removal" +msgstr "" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/flows/uninstall.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/server-bar.ts +#: web/src/admin/widgets/net-values.ts msgid "Remove" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/widgets/net-values.ts msgid "Remove %s" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Remove %s?" msgstr "" -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/remove.ts msgid "Remove Dawnline" msgstr "" -#: web/src/admin/pages/settings/danger.ts -msgid "Remove Dawnline from this router" -msgstr "" - -#: web/src/admin/pages/settings/danger.ts +#: web/src/admin/flows/uninstall.ts msgid "Remove Dawnline?" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Remove a device first to lower the limit" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Remove the Russian translation" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Remove server" +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Remove the Russian translation?" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Remove their devices" +#: web/src/admin/ui/filter-bar.ts +msgid "Remove the filter" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device.ts -msgid "Removed" +#: web/src/admin/ui/filter-bar.ts +msgid "Remove the filter: %s" msgstr "" -#: web/src/admin/device.ts -msgid "Removed %s" +#: web/src/admin/pages/server/settings.ts +msgid "Remove the server" msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "Removes events about %s and their devices." +#: web/src/admin/flows/invite.ts +msgid "Remove with it" msgstr "" -#: web/src/admin/device.ts -msgid "Removes events about %s." +#: web/src/admin/pages/log/filters.ts +msgid "Removed device" msgstr "" -#: web/src/admin/pages/diagnostics/log.ts -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/log/filters.ts +msgid "Removed person" +msgstr "" + +#: web/src/admin/pages/log/clear.ts msgid "Removes events from the log on the router." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first." -msgid_plural "Removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first." -msgstr[0] "" -msgstr[1] "" - -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Removing the Russian translation" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Removing the translation" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Rename" msgstr "" -#: web/src/admin/device.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Rename %s" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/dialogs.ts -msgid "Renamed" +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/server/settings.ts +msgid "Renamed: %s" msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Repair" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Repaired by the watchdog at %s" +#: web/src/admin/flows/restore.ts +msgid "Replace people, devices and servers" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Replace the current Dawnline configuration with %s? The current state is backed up first." +#: web/src/admin/flows/restore.ts +msgid "Replaces everything Dawnline has now. The current state is backed up first." msgstr "" #: web/src/admin/places/render.ts msgid "Replay this period" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: web/src/admin/people/diagnosis.ts +msgid "Request declined" +msgstr "" + +#: backend/i18n/messages.js msgid "Request too large." msgstr "" -#: web/src/admin/interfaces.ts -msgid "Rescan" -msgstr "" - -#: web/src/admin/device.ts -#: web/src/admin/logs.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/router/history.ts +#: web/src/admin/ui/filter-bar.ts msgid "Reset" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Reset all traffic history?" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/log/days.ts +#: web/src/admin/pages/people/cards.ts +msgid "Reset the filters" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Reset traffic" +msgstr "" + +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Reset traffic history for %s?" msgstr "" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/widgets/limit-meter.ts msgid "Reset usage" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/widgets/limit-meter.ts +msgid "Reset usage for %s?" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Resets in %s" +msgstr "" + +#: backend/i18n/messages.js msgid "Resolver" msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts +#: web/src/admin/servers/fixes.ts msgid "Restart network" msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/servers/fixes.ts msgid "Restart service" msgstr "" -#: web/src/admin/widgets/health.ts +#: web/src/admin/flows/health-fix.ts msgid "Restart the network?" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Restarting the network so it knows AmneziaWG (connections drop for a few seconds)" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Restarting the network so it knows AmneziaWG: back in a few seconds" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Restarting with the new settings." msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "Restore" msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts +msgid "Restore a backup" +msgstr "" + +#: web/src/admin/pages/settings/first.ts +msgid "Restore from a backup" +msgstr "" + +#: web/src/admin/pages/settings/router/backups.ts msgid "Restore from file" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Restore from file?" +#: web/src/admin/flows/restore.ts +msgid "Restore the files" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Restore this backup?" -msgstr "" - -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/flows/restore.ts msgid "Restored" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/header.ts +#: web/src/admin/pages/people/card.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/people/pick.ts +#: web/src/admin/people/lines.ts msgid "Resume" msgstr "" -#: web/src/admin/pages/person/header.ts -msgid "Resumed" +#: web/src/admin/pages/people/device/link.ts +msgid "Resume access" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Right now" +#: web/src/admin/pages/people/pick.ts +msgid "Resumed: %s" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/ui/rename-title.ts +msgid "Return to save, Esc to cancel" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back AmneziaWG to %s?" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Roll back to %s" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Roll back to Dawnline %s?" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "Rollback" -msgstr "" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Rolling back AmneziaWG" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Rolling back Dawnline" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Rolling back to %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/health.ts +#: web/src/admin/pages/settings/networks.ts #: web/src/shared/format.ts msgid "Router" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Run a check or an update by hand in Components." +#: web/src/admin/flows/behind-ask.ts +msgid "Router %s accepted" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Run again" +#: web/src/admin/pages/settings/networks.ts +msgid "Routers on people’s pages" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Run the setup wizard" +#: backend/i18n/messages.js +msgid "Routes" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -msgid "Run the setup wizard on the Server tab." +#: web/src/portal/setup.ts +msgid "Run" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/servers/state.ts msgid "Running" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/overview/health.ts msgid "Running checks…" msgstr "" +#: web/src/admin/servers/state.ts +msgid "Running for %s" +msgstr "" + #: web/src/admin/netcheck.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Runs within an hour after %s (router time)." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Russian" -msgstr "" - -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Russian translation" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "S2 must not be S1 + 56: the handshake initiation and response would have the same size." msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/cores/awg.ts -#: web/src/admin/device-link.ts -#: web/src/admin/device.ts -#: web/src/admin/interfaces.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/person/limits.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/map.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/flows/circle.ts +#: web/src/admin/flows/home-service.ts +#: web/src/admin/flows/portal-sheets.ts +#: web/src/admin/flows/text-sheet.ts msgid "Save" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Save the log every 10min, hourly or off." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Save to flash" msgstr "" -#: web/src/admin/access.ts -#: web/src/admin/device-link.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/defaults.ts -#: web/src/admin/pages/settings/logs.ts -#: web/src/admin/pages/settings/map.ts -#: web/src/admin/pages/settings/portal.ts -#: web/src/admin/pages/settings/updates.ts -msgid "Saved" -msgstr "" - -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Saves the replaced Dawnline or AmneziaWG package on flash, so Roll back works without internet. Under 1 MB." msgstr "" -#: web/src/admin/invite.ts +#: web/src/portal/setup.ts +msgctxt "WireGuard app" +msgid "Scan from QR code" +msgstr "" + +#: web/src/admin/flows/setup.ts +msgid "Scan it with the app on the device" +msgstr "" + +#: web/src/admin/flows/invite-card.ts msgid "Scan to connect to %s" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -msgid "Scan with AmneziaVPN or AmneziaWG on the device." -msgstr "" - -#: web/src/admin/cores/awg.ts -#: web/src/admin/device.ts -msgid "Scan with AmneziaVPN or any WireGuard app on the device." -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Screen sharing" msgstr "" +#: web/src/admin/widgets/link-values.ts +msgid "Seconds" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +msgid "Seconds, or empty: as the server" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Seconds. Empty: as the server. Longer saves battery; behind some NATs it then drops." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Seen recently" +#: web/src/admin/ui/rail.ts +msgid "Sections" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/visibility.ts +msgid "See each other" +msgstr "" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "Seen at home as %s" +msgstr "" + +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/pick.ts +msgid "Select" +msgstr "" + +#: web/src/admin/pages/people/cards.ts +#: web/src/admin/pages/people/pick.ts +msgid "Select all" +msgstr "" + +#: web/src/admin/pages/people/index.ts +msgid "Select several: extend, pause, resume. Or hold a card." +msgstr "" + +#: web/src/admin/pages/people/pick.ts +msgid "Selected: %s" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Self-signed" msgstr "" -#: web/src/admin/invite.ts -#: web/src/admin/pages/people.ts -msgid "Send %s the card or the link. They open it, add their devices and connect - no account needed." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js #: web/src/admin/events/render.ts -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/pages/settings/first.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/feed.ts msgid "Server" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Server %d" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/people/card.ts +msgid "Server %s is turned off" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/overview/servers.ts +msgid "Server %s turned off again" +msgstr "" + +#: web/src/admin/flows/person-acts.ts +#: web/src/admin/pages/overview/servers.ts +msgid "Server %s turned on" +msgstr "" + +#: backend/i18n/messages.js msgid "Server %s: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: %s is one of the router's own network interfaces." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: UDP %s is also used by %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Server %s: interface %s is also used by %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Server ID may use lowercase letters, digits and underscores." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Server configured" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Server created" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Server is disabled." msgstr "" -#: web/src/shared/format.ts -msgid "Server is turned off" -msgstr "" - -#: web/src/admin/ui/badges.ts -msgid "Server off" -msgstr "" - -#: web/src/admin/cores/awg.ts -msgid "Server public key" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Server removed" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts msgid "Server turned off" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Server turned on" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/move-person.ts +msgid "Server · %s" +msgstr "" + +#: backend/i18n/messages.js msgid "Server → Access → Home network." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +msgid "Server: %s" +msgstr "" + +#: backend/i18n/messages.js msgid "Server: Enter a name: up to 48 characters, without < > \" or \\." msgstr "" -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc -#: web/src/admin/pages/person/index.ts -#: web/src/admin/pages/server.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/servers.ts msgid "Servers" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: web/src/admin/pages/settings/networks.ts +msgid "Service" +msgstr "" + +#: backend/i18n/messages.js msgid "Service: Enter a name: up to 48 characters, without < > \" or \\." msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Services are back. Reloading…" +#: web/src/admin/widgets/reach.ts +msgid "Services" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Services restarted. Reload the page to use the new version." +#: backend/i18n/messages.js +msgid "Set a server up in Settings." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Set by hand" +#: web/src/admin/widgets/config-card.ts +msgid "Set in Network" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "Set the hours, then press Enter" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Set the public hostname in Settings so links can be generated." msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "Set up %s" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts +#: web/src/admin/pages/settings/first.ts msgid "Set up Dawnline" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Set up a server first." msgstr "" -#: web/src/admin/pages/people.ts +#: web/src/admin/pages/people/index.ts +msgid "Set up the server" +msgstr "" + +#: web/src/admin/pages/people/index.ts msgid "Set up the server first, then add people." msgstr "" -#: web/src/admin/pages/people.ts -msgid "Set up the server first." +#: web/src/admin/widgets/config-card.ts +msgid "Set-up" msgstr "" -#: package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json -#: web/src/admin/pages/components/index.ts +#: web/src/admin/flows/setup.ts +#: web/src/admin/people/card.ts +#: web/src/admin/people/lines.ts +msgid "Set-up · %s" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +msgid "Set-up, rename, turn off, reset traffic, new keys, remove" +msgstr "" + +#: web/src/admin/pages/server/index.ts #: web/src/admin/pages/settings/index.ts +#: web/src/admin/shell/nav.ts msgid "Settings" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: web/src/admin/pages/server/overview.ts +msgid "Settings › %s" +msgstr "" + +#: web/src/admin/pages/settings/index.ts +msgid "Settings’ sections" +msgstr "" + +#: backend/i18n/messages.js msgid "Setup failed: %s" msgstr "" -#: web/src/admin/invite.ts -msgid "Share card" +#: web/src/admin/flows/invite.ts +msgid "Share" msgstr "" -#: web/src/admin/invite.ts -msgid "Share link" -msgstr "" - -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/days.ts msgid "Show %s more of %s" msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "Show QR" +#: web/src/admin/flows/versions.ts +msgid "Show older" msgstr "" -#: web/src/admin/device.ts -msgid "Show QR code" +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/device/link.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Show set-up" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Show key" -msgstr "" - -#: web/src/admin/pages/person/activity.ts -msgid "Show map" -msgstr "" - -#: web/src/admin/pages/components/index.ts -msgid "Show progress" -msgstr "" - -#: web/src/admin/device.ts -msgid "Show the new configuration" -msgstr "" - -#: web/src/admin/pages/settings/map.ts -msgid "Show where people connect from on the Overview and person pages, at city level." -msgstr "" - -#: web/src/admin/pages/settings/portal.ts -msgid "Show “Not found”" -msgstr "" - -#: web/src/admin/pages/person/activity.ts -msgid "Shown after a device connects" -msgstr "" - -#: web/src/admin/device.ts -msgid "Shown in the portal and in the app." -msgstr "" - -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/dialogs.ts -msgid "Shown in their portal and apps." -msgstr "" - -#: web/src/admin/pages/person/dialogs.ts -msgid "Shown in their portal and on the Overview." +#: web/src/admin/pages/people/card.ts +msgid "Show set-up · %s" msgstr "" #: web/src/admin/netcheck.ts msgid "Shown on the person cards." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Shown to people in their portal and apps." msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Shown to people who may reach it." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Signature packets" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Signatures" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Slower: every packet crosses the router twice. On a dual-core router expect up to a third less speed, and lost packets at full load." +#: web/src/admin/pages/settings/router/backups.ts +msgid "Size" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts -msgid "So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard" +#: web/src/admin/pages/people/map-view.ts +msgid "Skip to the list of places" +msgstr "" + +#: web/src/admin/widgets/disguise-levels.ts +msgid "Slower" msgstr "" #: web/src/admin/map.ts msgid "Someone" msgstr "" -#: web/src/admin/pages/people.ts -msgid "Sort" +#: backend/i18n/messages.js +#: web/src/admin/failure.ts +msgid "Something went wrong on the router. Try again; if it goes on, look at the Log." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Source" +#: web/src/admin/failure.ts +msgid "Something went wrong on this page. Try again; if it goes on, reload the page." msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/cores/awg.ts -#: web/src/admin/disguise.ts +#: backend/i18n/messages.js +#: web/src/admin/widgets/disguise-levels.ts msgid "Speed" msgstr "" -#: web/src/admin/widgets/tiles.ts +#: web/src/admin/pages/overview/now.ts msgid "Speed now" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Speed over the last 2 minutes" -msgstr "" - #: web/src/admin/disguise.ts msgid "Standard (old)" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Starts within a minute" +#: web/src/admin/pages/settings/first.ts +msgid "Start" msgstr "" -#: web/src/admin/device.ts -msgid "Status" +#: web/src/admin/flows/job-stage.ts +msgid "Starting…" msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/disguise.ts -msgid "Stealth" +#: web/src/admin/flows/new-server.ts +msgid "Step %s of %s" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/check.ts msgid "Stops at step %s of %s" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Stops the tunnel and disconnects everyone on it. Settings and people are kept." -msgstr "" - -#: web/src/admin/pages/settings/logs.ts -msgid "Stored data" +#: web/src/admin/pages/settings/networks.ts +msgid "Straight to the WAN, past this router’s proxies and filters." msgstr "" #: web/src/admin/disguise.ts msgid "Strong (old)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js +msgid "Subnet is unique" +msgstr "" + +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/stages.ts msgid "Subnet must look like 10.77.0.0/24." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Subnet overlaps %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js +msgid "Such a network is not in effect: change it in the server's Network settings." +msgstr "" + +#: backend/i18n/messages.js msgid "Such devices are left out of the tunnels: fix or remove them." msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switch" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Switch and apply" +#: web/src/admin/disguise.ts +msgid "Switch the disguise to Balanced?" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Switch to %s" +#: web/src/admin/disguise.ts +msgid "Switch the disguise to Maximum?" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Switch to %s?" -msgstr "" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switch to AmneziaWG %s?" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Switch to Balanced or Maximum" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Switched-off categories are not logged from now on." msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "Switching restarts %s for a few seconds." -msgstr "" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching restarts %s tunnel for a few seconds: %s. Devices keep their configurations." msgid_plural "Switching restarts %s tunnels for a few seconds: %s. Devices keep their configurations." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching restarts the tunnel for a few seconds: %s. Devices keep their configurations." msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "Switching takes a few seconds." -msgstr "" - -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching takes a few seconds. Devices keep their configurations." msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "Switching to AmneziaWG %s" msgstr "" -#: web/src/admin/logs.ts -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/filters.ts msgid "System" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "System log" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/activity.ts -#: web/src/admin/pages/settings/updates.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-policy.ts +#: web/src/admin/pages/settings/router/updates-rows.ts #: web/src/admin/updater/jobs.ts msgid "System packages" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: backend/i18n/messages.js msgid "System packages are up to date" msgstr "" +#: web/src/admin/flows/operation.ts +msgid "System packages are updated" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "System packages: more" +msgstr "" + #: web/src/shared/format.ts msgid "TB" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Choose another port in Settings." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Choose another portal port." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is already used by %s. Links on IP addresses use plain HTTP on the port after the portal's. Choose another portal port." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "TCP %d is sent on by port forward “%s”. Choose another portal port." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Table inet dawnline enforces who may reach LAN and the internet." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Table inet dawnline is missing: no device is loaded into the tunnels until it is back." msgstr "" @@ -6348,96 +7426,131 @@ msgstr "" msgid "Tablet" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/versions.ts msgid "Tag, e.g. 0.3.1" msgstr "" +#: web/src/admin/flows/restore.ts +msgid "Takes up to a minute. Keep this open." +msgstr "" + +#: web/src/portal/setup.ts +msgid "Tap “%s” and connect" +msgstr "" + +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +msgid "Term" +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Term limit reached" +msgstr "" + +#: web/src/admin/flows/setup.ts +msgid "Text" +msgstr "" + +#: web/src/admin/pages/log/filters.ts +msgid "Text, person, IP" +msgstr "" + #: web/src/admin/netcheck.ts msgid "That date has passed: access would end at once." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "That id is taken." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "That is the same device" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "The %s build" +msgstr "" + +#: web/src/admin/flows/awg-build.ts msgid "The %s build, %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: web/src/portal/setup.ts +msgid "The APK is for phones without Google Play, or where the store hides the app." +msgstr "" + +#: backend/i18n/messages.js msgid "The AmneziaWG update is installed and starts after a reboot." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The AmneziaWG update waits for a reboot" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "The ISP shares one address: devices can only connect if the ISP gives you a public address or IPv6. Ask them, or use a DDNS name that points at an IPv6 address." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/widgets/net-switches.ts +msgid "The LAN this router uses, found by itself. Turn «Auto-detect LAN» off to choose it yourself." +msgstr "" + +#: backend/i18n/messages.js msgid "The WAN address %s is CGNAT (shared by the ISP): %s cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The WAN address %s is private: this router is behind another one. Forward %s on it, or devices cannot connect." msgstr "" -#: web/src/admin/interfaces.ts -msgid "The WAN, this server, ports and Wi-Fi of a bridge (they come with it) and interfaces without an IPv4 network." +#: web/src/admin/pages/settings/stages.ts +msgid "The address and UDP port devices connect to" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +#: backend/i18n/messages.js +msgid "The admin adds routers on this server. Ask them for one." +msgstr "" + +#: backend/i18n/messages.js msgid "The admin has turned this device off." msgstr "" -#: web/src/admin/pages/diagnostics/health.ts +#: web/src/admin/pages/overview/health.ts msgid "The agent has not checked in for %s min; cron restarts it after 5." msgstr "" -#: web/src/admin/pages/settings/backups.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "The backup from %s is removed from the router." msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "The build kept on the router is installed again. Every AmneziaWG tunnel restarts for a few seconds." +#: web/src/admin/flows/operation.ts +#: web/src/admin/updater/jobs.ts +msgid "The check failed" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "The busiest of the %s days" +#: web/src/admin/overview/model.ts +#: web/src/admin/pages/overview/health.ts +msgid "The checks did not run" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "The configuration in this file cannot be read." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "The copy kept on the router replaces %s. A backup of the settings is made first." +#: web/src/admin/widgets/timeline.ts +msgid "The connection failed" msgstr "" -#: web/src/admin/device.ts -msgid "The current configuration on this device stops working until it is imported again." -msgstr "" - -#: web/src/admin/pages/settings/defaults.ts -msgid "The default, 3. Pre-filled when you add someone." +#: web/src/admin/pages/server/settings.ts +msgid "The core decides how devices connect: its protocol, its disguise and its apps. Everything below is this core’s own." msgstr "" #: web/src/admin/netcheck.ts msgid "The default, lan: devices get names like %s." msgstr "" -#: web/src/admin/device.ts -msgid "The device is disconnected immediately and its configuration stops working." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The devices in AmneziaWG could not be checked" msgstr "" @@ -6445,11 +7558,11 @@ msgstr "" msgid "The device’s address at home." msgstr "" -#: web/src/admin/device.ts -msgid "The device’s local network stays reachable while connected, except %s: your home network." +#: web/src/admin/pages/people/device/index.ts +msgid "The device’s configuration changes. Until the new one is fetched on it, it works the old way. The new one opens next." msgstr "" -#: web/src/admin/device.ts +#: web/src/admin/flows/device-form.ts msgid "The device’s local network stays reachable while connected." msgstr "" @@ -6457,59 +7570,75 @@ msgstr "" msgid "The device’s network may be blocking the connection." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/settings/networks.ts +msgid "The fastest way" +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "The file could not be read." +msgstr "" + +#: backend/i18n/messages.js msgid "The firewall lets it through" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The firmware changed (kernel %s → %s): the AmneziaWG build installed for it is gone. Install the build for this firmware." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "The header protection key is not a key." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/pages/settings/disguise.ts +msgid "The header protection key is not shown here: each device’s file has it." +msgstr "" + +#: backend/i18n/messages.js msgid "The id may use lowercase letters, digits and underscores." msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "The interface with the default route: the server port opens there and Internet access leaves through it." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The kept AmneziaWG build was made for another firmware: it would not load on this one" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/awg-build.ts +msgid "The kernel module and its tools, made for this firmware." +msgstr "" + +#: backend/i18n/messages.js msgid "The kernel module doesn't load. Reinstall a build for this kernel in Components." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The kernel module doesn't load: %s Reinstall a build for this kernel in Components." msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "The latest release is %s" +#: web/src/admin/pages/overview/now.ts +msgid "The last 24 hours by the hour" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "The link has the server’s IP address, not its name: if the address changes, set the device up again." +#: web/src/admin/people/lines.ts +msgid "The limit is for the whole term: raise it to give access back." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The link is up but not attached to %s." msgstr "" -#: web/src/admin/pages/diagnostics/log.ts +#: web/src/admin/pages/log/days.ts msgid "The log is empty." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "The log lives in memory and is copied to flash. Memory only saves flash writes but is lost on reboot." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The main address is an IP: its links use plain HTTP." msgstr "" @@ -6517,55 +7646,67 @@ msgstr "" msgid "The map library from the CDN is not the expected file: not loading it." msgstr "" -#: web/src/admin/pages/server.ts -msgid "The name people see, where devices find the router, and DNS. The port is on AmneziaWG." +#: web/src/admin/widgets/limit-meter.ts +msgid "The month begins when they next connect" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The network doesn’t know AmneziaWG yet" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The new AmneziaWG kernel module doesn't load on this firmware: the tunnels stay down until it does (see the log above)" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "The old kernel module stays loaded (another AmneziaWG interface may use it): the AmneziaWG update is installed and starts after a reboot." msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "The old link stops working right away." +#: web/src/admin/flows/invite.ts +msgid "The old link stops working right away. Send them the new one." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: web/src/admin/failure.ts +msgid "The page and the router do not agree on this request. Reload the page; if it goes on, update Dawnline." +msgstr "" + +#: web/src/admin/flows/operation.ts +msgid "The page reloads by itself in a few seconds." +msgstr "" + +#: backend/i18n/messages.js msgid "The person has no server." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "The personal portal is off." -msgstr "" - -#: web/src/admin/invite.ts +#: web/src/admin/flows/invite.ts msgid "The personal portal is off. Turn it on in Settings." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/widgets/timeline.ts +msgid "The person’s access changed" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "The portal needs %s. It can’t start without them." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts +msgid "The portal’s address" +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "The portal’s address is used." +msgstr "" + +#: web/src/admin/flows/new-server.ts msgid "The portal’s address." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "The portal’s checks from Health" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The resolver is not running; Home-only devices cannot resolve names." msgstr "" @@ -6573,174 +7714,270 @@ msgstr "" msgid "The router answers again." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "The router clock looks wrong; end dates will misbehave. Check NTP." msgstr "" +#: web/src/admin/failure.ts +msgid "The router could not be reached. Check the connection and try again." +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "The router did not answer where it points." +msgstr "" + +#: web/src/admin/pages/overview/health.ts +msgid "The router did not answer. Check again in a moment." +msgstr "" + +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/widgets/limit-meter.ts +msgid "The router did not take it." +msgstr "" + +#: web/src/portal/ui/wait-way.ts +msgid "The router drops its traffic: the address does not match." +msgstr "" + +#: web/src/admin/people/diagnosis.ts +msgid "The router drops what it sends" +msgstr "" + +#: web/src/admin/flows/operation.ts +msgid "The router has not answered with the new version yet. Reload the page to use it." +msgstr "" + +#: web/src/admin/shell/waiting.ts +msgid "The router is not answering yet" +msgstr "" + #: web/src/admin/state/poller.ts msgid "The router is not answering: what you see may be out of date." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/operation.ts +msgid "The router is restarting its services. The page reloads by itself." +msgstr "" + +#: backend/i18n/messages.js msgid "The router is running out of flash" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "The router reaches it only while its VPN is on." msgstr "" -#: web/src/admin/pages/settings/map.ts -msgid "The router sends each new client IP to the provider once and caches the city. Map tiles load in your browser from CARTO; people never see the map." +#: web/src/admin/pages/settings/router/history.ts +msgid "The router sends each new client IP to the provider once and caches the city; the other one is the fallback." msgstr "" -#: web/src/admin/updater/operation.ts -msgid "The router stopped answering. The job may still finish: reopen Components in a minute." +#: web/src/admin/flows/operation.ts +msgid "The router stopped answering. The job may still finish: open Settings in a minute." +msgstr "" + +#: web/src/admin/flows/server-change.ts +msgid "The router stops letting devices reach each other at once." +msgstr "" + +#: web/src/admin/failure.ts +msgid "The router took too long to answer. Try again." +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "The router’s networks home access leads to" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "The router’s public address changed" +msgstr "" + +#: web/src/admin/failure.ts +msgid "The router’s web server could not answer. Try again in a moment." msgstr "" #: web/src/admin/events/model.ts msgid "The same configuration connects from two places in turn. Give the other device its own." msgstr "" -#: web/src/admin/pages/overview.ts -msgid "The server is turned off" +#: web/src/admin/pages/server/overview.ts +msgid "The server is not running" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/server/index.ts +msgid "The server’s sections" +msgstr "" + +#: web/src/admin/pages/log/clear.ts msgid "The service log was not cleared: %s" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "The start and the end must differ." +#: web/src/admin/widgets/link-values.ts +msgid "The size of a packet in the tunnel. Lower it when pages hang or the link drops on a mobile network." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "The translation could not be removed" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "The translation is installed." +#: web/src/admin/flows/operation.ts +msgid "The translation is installed" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "The translation is removed." +#: web/src/admin/flows/operation.ts +msgid "The translation is removed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/server/settings.ts +msgid "The tunnel core of this server · interface %s" +msgstr "" + +#: backend/i18n/messages.js msgid "The tunnel could not be read, so its devices could not be checked." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/server/settings.ts +msgid "The tunnel is stopped: nobody on this server connects." +msgstr "" + +#: web/src/admin/flows/new-server.ts msgid "The tunnel needs %s. Install the build made for this firmware, then create the server." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "The tunnel stops and %s person is disconnected until you turn it back on. Nothing is deleted." msgid_plural "The tunnel stops and %s people are disconnected until you turn it back on. Nothing is deleted." msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/updates.uc +#: web/src/admin/pages/server/overview.ts +msgid "The tunnel, the way in, the firewall and the home networks of this server." +msgstr "" + +#: backend/i18n/messages.js msgid "The update stopped unexpectedly." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "The values that replace WireGuard’s recognisable message types." msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Then" +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog is off." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog is on: nothing needed a repair today." +msgstr "" + +#: web/src/admin/pages/overview/health.ts +msgid "The watchdog repaired %s %s." +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +msgid "Their devices have not connected from a known place yet." +msgstr "" + +#: web/src/admin/people/lines.ts +msgid "Their devices have nowhere to connect until a server is chosen." +msgstr "" + +#: web/src/admin/pages/people/person/head.ts +msgid "Their link and %s stop working at once: %s." +msgstr "" + +#: web/src/admin/pages/people/person/head.ts +msgid "Their link stops working at once." +msgstr "" + +#: web/src/admin/people/card.ts +msgid "Their set-up was given out, but no device has connected yet." +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts +msgid "Their traffic history is not changed." +msgstr "" + +#: web/src/admin/updater/jobs.ts +msgid "There is an update" +msgid_plural "There are updates" +msgstr[0] "" +msgstr[1] "" + +#: backend/i18n/messages.js msgid "There is no session the router could reach." msgstr "" +#: web/src/admin/flows/server-change.ts +msgid "They belong to %s person." +msgid_plural "They belong to %s people." +msgstr[0] "" +msgstr[1] "" + #: web/src/admin/netcheck.ts msgid "They can add %s device themselves." msgid_plural "They can add %s devices themselves." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/person/pickers.ts -msgid "They can add a device here" -msgstr "" - -#: web/src/admin/pages/person/dialogs.ts -msgid "They have no devices yet: nothing else changes." -msgstr "" - -#: web/src/admin/pages/person/index.ts -msgid "They may have been removed." -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "They need an app with AmneziaWG 2.0 or newer." msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "They need an app with AmneziaWG 3.1." msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/pages/people/index.ts +msgid "They were removed, or the link is out of date. Their devices’ events stay in the log for as long as the log keeps them." +msgstr "" + +#: web/src/admin/pages/log/clear.ts msgid "This cannot be undone; export first if you want a copy." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "This configuration can't be used: %s" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "This device generated its own keys in the browser, so its full configuration only exists on that device." -msgstr "" - -#: web/src/admin/device.ts -msgid "This device has an older configuration: networks or DNS changed since it was set up. Import it again with the QR code, key or file below." +#: backend/i18n/messages.js +msgid "This device asks for nothing." msgstr "" #: web/src/admin/events/model.ts msgid "This device is using an outdated configuration." msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "This device made its own keys in the browser; its configuration only exists there." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "This is a SNAPSHOT firmware: the AmneziaWG projects publish builds for releases only" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "This key is already in use." msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/people.ts -msgid "This month" +#: web/src/admin/failure.ts +msgid "This login may not do that." msgstr "" -#: web/src/admin/pages/people.ts -msgid "This month by device" +#: web/src/shared/format.ts +msgid "This network is not needed here" msgstr "" -#: web/src/admin/pages/people.ts -msgid "This person was just removed." +#: web/src/admin/flows/add-device.ts +msgid "This person already has a device with this name." msgstr "" -#: web/src/admin/updater/notes.ts +#: web/src/admin/flows/whats-new.ts msgid "This release has no notes." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "This removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first." msgid_plural "This removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first." msgstr[0] "" msgstr[1] "" -#: web/src/admin/pages/settings/backups.ts -msgid "This replaces the whole Dawnline configuration on this router. The current state is backed up first." -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/stages.ts msgid "This router" msgstr "" @@ -6748,246 +7985,308 @@ msgstr "" msgid "This router (%s): queries go where your home network sends them, and home names work." msgstr "" -#: web/src/admin/pages/server.ts -msgid "This router (recommended)" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "This router runs an older AmneziaWG. %s becomes available with kmod-amneziawg and amneziawg-tools 3.1." msgstr "" -#: web/src/admin/interfaces.ts -msgid "This server" +#: backend/i18n/messages.js +msgid "This router waits for an answer to its request: it has no configuration yet." msgstr "" -#: web/src/admin/pages/server.ts -msgid "This server is off" +#: web/src/admin/pages/settings/networks.ts +msgid "This server" msgstr "" #: web/src/admin/netcheck.ts msgid "Three numbers, like 10.77.0." msgstr "" -#: web/src/admin/pages/server.ts -msgid "Through the home network" +#: web/src/admin/pages/settings/networks.ts +msgid "Through this router’s proxies and filters, as from a device at home." +msgstr "" + +#: web/src/admin/flows/new-server.ts +msgid "Through this router’s proxies and filters. Slower: up to a third on two cores." msgstr "" #: web/src/admin/logs.ts -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Time" msgstr "" -#: web/src/admin/pages/settings/updates.ts -msgid "Time: %s" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgid "Timing" msgstr "" -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts msgid "To" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/disguise.ts msgid "To keep the old disguise for some people, add a second server and move them there." msgstr "" -#: web/src/admin/events/render.ts +#: web/src/admin/pages/people/person/index.ts +msgid "To lower the limit, remove a device first" +msgstr "" + +#: web/src/admin/pages/people/index.ts +msgid "To people" +msgstr "" + +#: web/src/admin/events/clock.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/card.ts #: web/src/admin/places/model.ts -#: web/src/admin/widgets/readouts.ts +#: web/src/admin/widgets/week-use.ts msgid "Today" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Today %s" -msgstr "" - -#: web/src/admin/pages/settings/backups.ts -msgid "Today, %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Too many changes in a short time. Try again in a few minutes." msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/people/device/traffic.ts msgid "Total" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js +#: web/src/admin/flows/add-person.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/people/diagnosis.ts +#: web/src/admin/widgets/limit-meter.ts msgid "Traffic" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/overview/now.ts +msgid "Traffic by day: the arrows pick a day" +msgstr "" + +#: web/src/admin/disguise.ts +msgid "Traffic does not look like a VPN. About the same speed." +msgstr "" + +#: backend/i18n/messages.js msgid "Traffic enters %s as %s, so it is handled like any device on your LAN." msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Traffic history" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/flows/device-acts.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Traffic history reset" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "Traffic, last 30 days" -msgstr "" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Translation" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "Translation removed by you" -msgstr "" - #: web/src/admin/netcheck.ts msgid "Try %s." msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/flows/whats-new.ts msgid "Try again" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Try another build in Components, or update OpenWrt. The server can’t start until it loads." +#: web/src/admin/flows/new-server.ts +msgid "Try another build in System, under Updates, or update OpenWrt. The server can’t start until it loads." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: web/src/admin/shell/waiting.ts +msgid "Trying again in a moment" +msgstr "" + +#: backend/i18n/messages.js msgid "Trying mirror %s" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/admin/pages/settings/stages.ts msgid "Tunnel" msgstr "" -#: web/src/admin/cores/awg.ts +#: web/src/portal/setup.ts msgctxt "V2RayTun app" msgid "Tunnel" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "Tunnel %s is down." -msgstr "" - -#: web/src/admin/device.ts -msgid "Tunnel address" -msgstr "" - -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/stages.ts msgid "Tunnel network" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Tunnel network changed" +#: web/src/admin/pages/server/settings.ts +msgid "Tunnel network and DNS" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Tunnel subnet" +#: web/src/admin/pages/settings/stages.ts +msgid "Tunnel network: %s" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/server-change.ts +msgid "Tunnel network: %s?" +msgstr "" + +#: backend/i18n/messages.js +msgid "Tunnel running" +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +msgid "Turn it on" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Turn off" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/settings/server-bar.ts msgid "Turn off %s?" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Turn off this server" -msgstr "" - -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/notices.ts +#: web/src/admin/pages/people/person/devices.ts +#: web/src/admin/pages/server/device-dialog.ts msgid "Turn on" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/flows/add-person.ts +msgid "Turn on the personal portal in System to get their link, or add their devices yourself on their page." +msgstr "" + +#: backend/i18n/messages.js msgid "Turn the device on again on its page." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/disguise.ts +msgid "Turn the disguise off?" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts msgid "Turn the portal on to see its certificate." msgstr "" -#: web/src/admin/pages/overview.ts -#: web/src/admin/pages/person/activity.ts -msgid "Turn them on in Settings" +#: web/src/admin/people/lines.ts +msgid "Turn the server on" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/move-person.ts +#: web/src/admin/pages/log/filters.ts +#: web/src/admin/pages/people/filters.ts +#: web/src/admin/pages/server/settings.ts +#: web/src/admin/servers/state.ts msgid "Turned off" msgstr "" -#: web/src/admin/device.ts +#: web/src/admin/pages/server/settings.ts +msgid "Turned on" +msgstr "" + +#: web/src/admin/pages/server/settings.ts +msgid "Turning it off disconnects everyone on it; nothing is deleted." +msgstr "" + #: web/src/admin/logs.ts msgid "Type" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc +#: backend/i18n/messages.js msgid "Type \"remove\" to confirm." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/flows/uninstall.ts +msgid "Type the word to confirm" +msgstr "" + +#: backend/i18n/messages.js msgid "UDP %d is also used by %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "UDP %d is used by %s. Choose another port." msgstr "" -#: web/src/admin/cores/awg.ts -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts +msgid "UDP %s" +msgstr "" + +#: web/src/admin/flows/new-server.ts +#: web/src/admin/widgets/entry.ts msgid "UDP port" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js +#: web/src/admin/widgets/entry.ts msgid "UDP port must be 1-65535." msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/widgets/entry.ts msgid "UDP port: %s" msgstr "" +#: web/src/admin/flows/server-change.ts +msgid "UDP port: %s?" +msgstr "" + #: web/src/admin/events/model.ts +#: web/src/portal/ui/wait-way.ts msgid "Unable to complete the handshake" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: web/src/admin/shell/toast.ts +msgid "Undo" +msgstr "" + +#: web/src/admin/shell/toast.ts +msgid "Undone" +msgstr "" + +#: backend/i18n/messages.js msgid "Unexpected entry in backup: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Unexpected file in backup: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Unknown AmneziaWG build %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown DNS choice." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Unknown action." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js +msgid "Unknown answer." +msgstr "" + +#: backend/i18n/messages.js msgid "Unknown category." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Unknown choice for devices reaching each other." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js +msgid "Unknown choice for routers on people's pages." +msgstr "" + +#: backend/i18n/messages.js msgid "Unknown circle." msgstr "" @@ -6995,38 +8294,35 @@ msgstr "" msgid "Unknown city" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "Unknown component %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown device type." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown device." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: backend/i18n/messages.js msgid "Unknown disguise method." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Unknown end action." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Unknown fix." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Unknown links" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: web/src/admin/pages/settings/router/portal.ts +msgid "Unknown links: “Not found”" +msgstr "" + +#: backend/i18n/messages.js msgid "Unknown location service." msgstr "" @@ -7034,52 +8330,43 @@ msgstr "" msgid "Unknown network" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown page." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown person." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown release." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +#: backend/i18n/messages.js msgid "Unknown scope." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Unknown server." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +#: backend/i18n/messages.js msgid "Unknown service %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +#: backend/i18n/messages.js msgid "Unknown service." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +#: backend/i18n/messages.js msgid "Unknown setting %s." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +#: backend/i18n/messages.js msgid "Unknown update target." msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts -msgid "Unlimited" -msgstr "" - -#: web/src/admin/interfaces.ts +#: web/src/admin/pages/settings/networks.ts msgid "Until they are installed, internet traffic goes straight to the WAN." msgstr "" @@ -7093,109 +8380,90 @@ msgstr[1] "" msgid "Up to %s characters." msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "Up to date" -msgstr "" - -#: web/src/admin/pages/components/packages.ts -msgid "Update" -msgstr "" - -#: web/src/admin/updater/operation.ts -msgctxt "noun" -msgid "Update" -msgstr "" - -#: web/src/admin/pages/components/packages.ts -msgid "Update %s?" -msgstr "" - -#: web/src/admin/pages/components/index.ts -msgid "Update available" +#: web/src/admin/pages/settings/networks.ts +msgid "Up to a third slower on two cores" msgstr "" #: web/src/admin/updater/jobs.ts -msgid "Update available: %s" +msgid "Up to date" msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "Update config" +#: web/src/admin/flows/operation.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Update" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Update AmneziaWG to %s?" +msgstr "" + +#: backend/i18n/messages.js msgid "Update failed" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/notice.ts msgid "Update now" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/updater/operation.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "Update the system packages?" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "Update to %s" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Updated %s" -msgstr "" - -#: web/src/admin/updater/operation.ts -msgid "Updated system packages" -msgstr "" - -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/index.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Updates" msgstr "" -#: web/src/admin/pages/components/activity.ts -msgid "Updates, and checks that found something, show up here." -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc -#: web/src/admin/pages/components/packages.ts +#: backend/i18n/messages.js msgid "Updating %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating AmneziaWG" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating Dawnline" msgstr "" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/updater/jobs.ts msgid "Updating components" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater -#: web/src/admin/pages/components/index.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/updater/jobs.ts msgid "Updating system packages" msgstr "" -#: web/src/admin/pages/components/index.ts +#: web/src/admin/pages/settings/router/updates-rows.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "Updating…" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgctxt "speed" -msgid "Upload" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +#: backend/i18n/messages.js msgid "Upload is empty or too large." msgstr "" -#: web/src/admin/pages/people.ts -msgctxt "sort" +#: web/src/portal/ui/bars.ts +msgid "Uploaded" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts msgid "Usage" msgstr "" #: web/src/admin/netcheck.ts +#: web/src/admin/widgets/link-values.ts msgid "Use 0–600 seconds." msgstr "" @@ -7203,6 +8471,10 @@ msgstr "" msgid "Use 1–32." msgstr "" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Use 1–65535." +msgstr "" + #: web/src/admin/netcheck.ts msgid "Use HH:MM, 00:00–23:59." msgstr "" @@ -7223,7 +8495,7 @@ msgstr "" msgid "Use a private range: 10.x.x, 172.16–31.x or 192.168.x." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x." msgstr "" @@ -7235,228 +8507,259 @@ msgstr "" msgid "Use an IPv4 address, or leave it empty." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Use files" -msgstr "" - -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/settings/stages.ts msgid "Use the new address" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Use your own certificate" msgstr "" +#: web/src/admin/pages/settings/router/portal.ts +msgid "Use your own files" +msgstr "" + #: web/src/admin/netcheck.ts msgid "Used by %s. Choose another port." msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Used for HTTPS links" -msgstr "" - -#: web/src/admin/widgets/readouts.ts -msgid "Used on %s of %s day" -msgid_plural "Used on %s of %s days" -msgstr[0] "" -msgstr[1] "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Using a self-signed certificate: browsers will show a warning." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: backend/i18n/messages.js msgid "Using a self-signed certificate: browsers will show a warning. ACME can get a free Let’s Encrypt one." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "V2RayTun on Android: %s, or copy the link and %s." +#: web/src/admin/people/diagnosis.ts +msgid "Usually it is the device’s network: worth trying another." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "V2RayTun on Windows: %s, then set its mode to %s and connect. That mode needs administrator rights: the app offers to restart with them." +#: web/src/portal/setup.ts +msgid "V2RayTun’s own channel: news and updates of the app." msgstr "" -#: web/src/admin/interfaces.ts -msgid "VPN & tunnels" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Verbose (debug)" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "Versions" +#: web/src/admin/pages/people/index.ts +msgid "View" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "View all" +#: web/src/admin/pages/log/index.ts +#: web/src/admin/pages/overview/head.ts +#: web/src/admin/pages/people/device/index.ts +#: web/src/admin/pages/people/index.ts +#: web/src/admin/pages/people/person/head.ts +#: web/src/admin/pages/server/index.ts +#: web/src/admin/pages/settings/index.ts +msgid "View only" msgstr "" -#: web/src/admin/device.ts -#: web/src/admin/ui/badges.ts -msgid "Waiting for the first connection" +#: web/src/admin/pages/settings/networks.ts +msgid "WAN interface" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Waiting for the router to restart its services (%s of 30)…" +#: web/src/admin/pages/settings/networks.ts +msgid "WAN: %s" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Waiting for the router to restart its services…" +#: web/src/admin/flows/server-change.ts +msgid "WAN: %s?" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "Warn" +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/overview/waiting.ts +msgid "Waiting for a decision" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc -msgid "Warning must be 0-60 days." +#: web/src/admin/pages/people/filters.ts +msgid "Waiting for a new configuration" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +#: web/src/admin/flows/job-stage.ts +msgid "Waiting for log output…" +msgstr "" + +#: web/src/admin/shell/waiting.ts +msgid "Waiting for the backend" +msgstr "" + +#: web/src/portal/ui/wait-way.ts +msgid "Waiting for the connection" +msgstr "" + +#: web/src/admin/shell/waiting.ts +msgid "Waiting for the router" +msgstr "" + +#: web/src/admin/pages/overview/servers.ts +msgid "Waiting:" +msgstr "" + +#: web/src/admin/events/timeline.ts +#: web/src/admin/people/diagnosis.ts +msgid "Waits for your answer" +msgstr "" + +#: backend/i18n/messages.js msgid "Warning: %s sent a file that does not match GitHub's sha256, discarded" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: backend/i18n/messages.js msgid "Warning: could not keep %s: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +#: backend/i18n/messages.js msgid "Warning: the installed build is no longer published, nothing to keep for rollback" msgstr "" -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Warnings and errors" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: web/src/admin/pages/diagnostics/health.ts +#: backend/i18n/messages.js +#: web/src/admin/pages/overview/health.ts msgid "Watchdog" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog off" +#: web/src/admin/pages/settings/stages.ts +msgid "Way in" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog on" -msgstr "" - -#: web/src/admin/pages/diagnostics/health.ts -msgid "Watchdog repairs" -msgstr "" - -#: web/src/admin/access.ts +#: web/src/admin/flows/home-service.ts msgid "Web" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "Weekly" msgstr "" -#: web/src/admin/device.ts -msgid "Went offline" -msgstr "" - -#: web/src/admin/pages/settings/logs.ts +#: web/src/admin/pages/settings/router/history.ts msgid "What Dawnline writes to the router’s system log (logread -e dawnline). Verbose adds each step of a start and of applying settings." msgstr "" -#: web/src/admin/pages/server.ts -#: web/src/admin/pages/settings/portal.ts -msgid "What people see" +#: web/src/admin/pages/settings/stages.ts +msgid "What identifies the server to its devices" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Whatever handles home traffic on this router (proxies, filters, DNS) handles theirs too. Change it later under Servers → Access." +#: web/src/portal/flows/device-form.ts +msgid "What is it?" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "What it installs" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/widgets/reach.ts +msgid "What they reach" +msgstr "" + +#: web/src/admin/flows/restore.ts +msgid "What was there before is kept in the backup “%s”." +msgstr "" + +#: web/src/admin/pages/settings/router/notice.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new" msgstr "" -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/notice.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new in Dawnline %s" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "What’s new in the %s build" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/backups.ts msgid "When" msgstr "" -#: web/src/admin/pages/settings/updates.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "When GitHub is unreachable, download through mirrors. Checksums are still verified." msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "When access ends" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "When it ends: %s" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "When it ends: %s, warn %s day before" -msgid_plural "When it ends: %s, warn %s days before" -msgstr[0] "" -msgstr[1] "" - #: web/src/admin/logs.ts msgid "Where" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Where devices connect to. A hostname that always points at your router (DDNS) keeps links working when your IP changes." +#: web/src/admin/widgets/place-rows.ts +msgid "Where %s has been" msgstr "" -#: web/src/admin/pages/server.ts -msgid "Where devices reach AmneziaWG from the internet" +#: web/src/admin/flows/new-server.ts +msgid "Where devices connect to. A name that always points at your router (DDNS) keeps links working when your IP changes." msgstr "" -#: web/src/admin/cores/awg.ts -msgid "Where devices reach this core from the internet" +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "Where it has been · %s" msgstr "" -#: web/src/admin/pages/overview.ts +#: web/src/admin/pages/settings/router/history.ts msgid "Where people connect from" msgstr "" -#: web/src/admin/logs.ts +#: web/src/admin/flows/places-closeup.ts +msgid "Where they have been · %s" +msgstr "" + +#: web/src/admin/pages/log/filters.ts +msgid "Which entries" +msgstr "" + +#: web/src/admin/pages/log/clear.ts msgid "Which events" msgstr "" -#: web/src/admin/access.ts -msgid "Who reaches what" +#: web/src/admin/pages/settings/networks.ts +msgid "Who reaches which service is picked on the person: People › a person › «What they reach»." msgstr "" -#: web/src/admin/pages/person/pickers.ts +#: web/src/admin/pages/people/notices.ts +msgid "Who waits" +msgstr "" + +#: web/src/admin/widgets/reach.ts msgid "Whole home network" msgstr "" -#: web/src/admin/pages/person/pickers.ts -msgid "Whole home network. Pick services to narrow it down." +#: web/src/admin/widgets/limit-meter.ts +msgid "Whole term" msgstr "" -#: web/src/admin/access.ts -msgid "Why something does or does not connect" +#: web/src/admin/pages/settings/router/backups.ts +msgid "Why" msgstr "" -#: web/src/admin/interfaces.ts -msgid "Within a circle: family sees family, guests see guests. Everyone reaches their own devices. Internet-only people never." +#: web/src/admin/pages/server/settings.ts +msgid "With its %s person and all their devices. A backup is made first." +msgid_plural "With its %s people and all their devices. A backup is made first." +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/people/card.ts +msgid "With the networks behind it: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: web/src/admin/flows/invite.ts +msgid "With this link %s adds their devices and takes their set-up. No account needed." +msgstr "" + +#: web/src/admin/flows/behind-ask.ts +msgid "Without a reason" +msgstr "" + +#: backend/i18n/messages.js msgid "Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline." msgstr "" -#: web/src/admin/updater/operation.ts -msgid "Working…" +#: web/src/admin/pages/settings/networks.ts +msgid "Works: traffic enters %s as %s." msgstr "" #: web/src/admin/netcheck.ts @@ -7467,16 +8770,12 @@ msgstr "" msgid "Wrong links get a bare “Not found”." msgstr "" -#: web/src/admin/events/render.ts +#: web/src/admin/events/clock.ts +#: web/src/admin/pages/log/filters.ts #: web/src/admin/places/model.ts -#: web/src/admin/widgets/readouts.ts msgid "Yesterday" msgstr "" -#: web/src/admin/pages/settings/backups.ts -msgid "Yesterday, %s" -msgstr "" - #: web/src/admin/events/render.ts msgid "You" msgstr "" @@ -7501,6 +8800,10 @@ msgstr "" msgid "You added this person" msgstr "" +#: web/src/admin/flows/operation.ts +msgid "You can close this: the job carries on on the router." +msgstr "" + #: web/src/admin/events/model.ts msgid "You changed circle %s" msgstr "" @@ -7549,6 +8852,10 @@ msgstr "" msgid "You imported settings from a file" msgstr "" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "You install from the rows above." +msgstr "" + #: web/src/admin/events/render.ts msgid "You issued a new link for person %s" msgstr "" @@ -7669,51 +8976,68 @@ msgstr "" msgid "You turned on the watchdog" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your WAN address now - it may change; a DDNS name is better." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Your access has ended." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +#: backend/i18n/messages.js msgid "Your access is paused." msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "Your address" msgstr "" -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/portal.ts msgid "Your files" msgstr "" -#: web/src/admin/pages/settings/portal.ts -msgid "Your own files" +#: web/src/portal/flows/device-form.ts +msgid "Your local network stays reachable while connected." msgstr "" -#: web/src/admin/invite.ts +#: web/src/portal/ui/wait-way.ts +msgid "Your network may be blocking the connection." +msgstr "" + +#: web/src/admin/flows/invite.ts msgid "Your personal VPN link" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your router has no public address (CGNAT)" msgstr "" -#: web/src/admin/pages/server.ts +#: web/src/admin/flows/new-server.ts msgid "Your router is behind another router (WAN %s)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/failure.ts +msgid "Your session has ended. Reload the page to sign in again." +msgstr "" + +#: backend/i18n/messages.js msgid "Zone %s and the WAN rule for UDP %d exist." msgstr "" +#: web/src/admin/system/model.ts +msgid "a check is running" +msgstr "" + +#: web/src/admin/widgets/feed.ts +msgid "a connection problem" +msgstr "" + #: web/src/admin/events/render.ts +#: web/src/admin/widgets/feed.ts msgid "a device" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "a new build needs a manual switch in Components" msgstr "" @@ -7721,63 +9045,89 @@ msgstr "" msgid "about %s by the reset on %s" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "about average" +#: web/src/admin/events/model.ts +msgid "accepted: %s" msgstr "" #: web/src/admin/events/model.ts msgid "access" msgstr "" -#: web/src/admin/interfaces.ts -msgid "add its interface %s to their source interfaces yourself" +#: web/src/admin/pages/overview/now.ts +msgid "across %s person" +msgid_plural "across %s people" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "added by you" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +msgid "added by you %s" +msgstr "" + +#: web/src/admin/pages/people/device/index.ts +msgid "added on the portal %s" msgstr "" #: web/src/admin/events/model.ts msgid "address %s" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "ahead of the latest release" +#: web/src/admin/pages/people/card.ts +msgid "address in the tunnel" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "addresses taken" msgstr "" #: web/src/admin/events/render.ts msgid "all Cloudflare visitors" msgstr "" -#: web/src/admin/access.ts -msgid "all networks" +#: web/src/admin/pages/settings/check.ts +msgid "all home networks" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/pages/settings/networks.ts msgid "all ports" msgstr "" -#: web/src/admin/events/model.ts -msgid "allowed hours" -msgstr "" - #: web/src/admin/map.ts msgid "an unknown city" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/system/model.ts +msgid "an update is running" +msgstr "" + +#: web/src/admin/pages/overview/servers.ts +msgid "and %s more" +msgstr "" + +#: web/src/admin/widgets/reach.ts +msgid "and new ones" +msgstr "" + +#: backend/i18n/messages.js msgid "another program on this router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "answers again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk did not install %s %s (installed: %s)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk did not reinstall the version that is already installed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +#: backend/i18n/messages.js msgid "apk doesn't reinstall an installed version. Install a different release, or run install.sh on the router" msgstr "" @@ -7789,92 +9139,102 @@ msgstr "" msgid "approximate location" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "are loaded again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "are missing" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "as soon as found" +#: web/src/admin/pages/settings/networks.ts +msgid "as any other device" msgstr "" -#: web/src/admin/device-link.ts +#: web/src/admin/widgets/config-card.ts msgid "as the server" msgstr "" -#: web/src/admin/device-link.ts +#: web/src/admin/events/model.ts +msgid "asked for again: %s" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "asked for: %s" +msgstr "" + +#: web/src/admin/pages/settings/router/defaults.ts +msgid "at home their device is seen as %s" +msgstr "" + +#: web/src/admin/widgets/link-values.ts +msgid "auto" +msgstr "" + +#: web/src/admin/widgets/config-card.ts +#: web/src/admin/widgets/link-values.ts msgid "automatic" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "automatic update failed" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "automatically" +msgstr "" + +#: backend/i18n/messages.js msgid "background check failed: %s" msgstr "" -#: web/src/shared/format.ts -msgid "bit/s" +#: web/src/admin/places/render.ts +msgid "before this period" msgstr "" -#: web/src/admin/device.ts +#: web/src/admin/pages/settings/router/updates-policy.ts msgid "by you" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/widgets/link-values.ts +msgid "bytes, every device" +msgstr "" + +#: backend/i18n/messages.js msgid "can't reach Dawnline (luci.dawnline is missing in rpcd)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "can't use the network interface %s: it exists and isn't Dawnline's" msgstr "" +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/system/model.ts +msgid "can’t start" +msgstr "" + #: web/src/admin/events/model.ts msgid "certificate" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate expires %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate expires within 7 days" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "certificate renewed · valid until %s" msgstr "" -#: web/src/admin/pages/components/index.ts -msgid "checked %s" +#: web/src/admin/system/model.ts +msgid "certificate: %s d" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "checks daily" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "checks every 12 h" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "checks every 6 h" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "checks off" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "checks weekly" -msgstr "" - -#: web/src/admin/access.ts -msgid "circle" +#: web/src/admin/pages/server/overview.ts +msgid "checking…" msgstr "" #: web/src/admin/events/model.ts @@ -7886,42 +9246,51 @@ msgstr "" msgid "click to zoom in" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/people/card.ts +msgid "client IP" +msgstr "" + +#: web/src/portal/setup.ts +msgid "computer" +msgstr "" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "computer" +msgstr "" + +#: web/src/admin/widgets/link-values.ts +msgid "computers and routers" +msgstr "" + +#: backend/i18n/messages.js msgid "couldn't be repaired: %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "couldn't be updated - the previous rules stay, and changes to access wait until they load" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +#: backend/i18n/messages.js msgid "couldn't load - no device is loaded into the tunnels until they do" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "couldn't load devices into the tunnel" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js +msgid "couldn't set a route to a network behind a router" +msgstr "" + +#: backend/i18n/messages.js msgid "couldn't start" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "couldn't start · %d failed attempts in %d min" msgstr "" -#: web/src/admin/pages/person/devices.ts -msgid "created %s by you." -msgstr "" - -#: web/src/admin/pages/person/devices.ts -msgid "created %s in the portal." -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "daily at %s" -msgstr "" - #: web/src/admin/events/model.ts msgid "data limit" msgstr "" @@ -7934,14 +9303,54 @@ msgstr "" msgid "data limit reached" msgstr "" +#: web/src/admin/pages/settings/router/cert.ts +msgid "day" +msgid_plural "days" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/widgets/term.ts +msgid "day left" +msgid_plural "days left" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/widgets/term.ts +msgid "day since it ended" +msgid_plural "days since it ended" +msgstr[0] "" +msgstr[1] "" + +#: web/src/admin/events/model.ts +msgid "declined: %s" +msgstr "" + #: web/src/admin/map.ts +#: web/src/admin/pages/people/card.ts +#: web/src/portal/setup.ts msgid "device" msgstr "" +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "device" +msgstr "" + +#: web/src/admin/flows/add-device.ts +#: web/src/admin/flows/behind-ask.ts +msgid "device fetches its configuration again" +msgid_plural "devices fetch their configuration again" +msgstr[0] "" +msgstr[1] "" + #: web/src/admin/events/model.ts msgid "device limit" msgstr "" +#: web/src/admin/pages/settings/router/defaults.ts +msgid "device names in the home network are off" +msgstr "" + #: web/src/admin/events/model.ts msgid "devices kept apart" msgstr "" @@ -7954,10 +9363,6 @@ msgstr "" msgid "devices reach each other in circles" msgstr "" -#: web/src/admin/access.ts -msgid "direct" -msgstr "" - #: web/src/admin/events/model.ts msgid "disguise: %s" msgstr "" @@ -7966,8 +9371,12 @@ msgstr "" msgid "down" msgstr "" -#: web/src/admin/pages/people.ts -msgid "e.g. Myata" +#: web/src/admin/pages/settings/check.ts +msgid "each other" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "each other in circles" msgstr "" #: web/src/admin/events/model.ts @@ -7978,11 +9387,7 @@ msgstr "" msgid "end date reached" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "ended" -msgstr "" - -#: web/src/admin/pages/people.ts +#: web/src/admin/widgets/term.ts msgid "ended %s" msgstr "" @@ -8004,7 +9409,7 @@ msgstr "" msgid "error" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/flows/awg-build.ts msgid "every app" msgstr "" @@ -8012,20 +9417,20 @@ msgstr "" msgid "extra data" msgstr "" -#: web/src/admin/updater/operation.ts -msgid "failed" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "failed - internet goes out directly for now" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "failed: %s" msgstr "" -#: web/src/admin/device.ts -msgid "from the portal" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "found by a check" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "found by the automatic check" msgstr "" #: web/src/shared/pace.ts @@ -8034,11 +9439,19 @@ msgid_plural "full in about %s days, %s" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/widgets/config-card.ts +msgid "given out %s" +msgstr "" + +#: web/src/admin/pages/people/device/link.ts +msgid "handshake %s" +msgstr "" + +#: backend/i18n/messages.js msgid "has an invalid interface name \"%s\"" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: backend/i18n/messages.js msgid "home" msgstr "" @@ -8054,95 +9467,115 @@ msgstr "" msgid "home services" msgstr "" -#: web/src/admin/pages/people.ts -msgid "in total" +#: web/src/admin/pages/settings/check.ts +msgid "home services only" msgstr "" -#: web/src/admin/pages/people.ts -msgid "includes +%s GB extra" +#: web/src/admin/flows/circle.ts +msgid "in a circle they still reach nobody, until they get home access" msgstr "" #: web/src/admin/events/render.ts msgid "info" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "install any release" +#: web/src/admin/pages/server/settings.ts +msgid "installed" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/settings/first.ts +msgid "installed if needed, and the disguise picked" +msgstr "" + +#: backend/i18n/messages.js msgid "installed the %s build" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "installed the %s build · %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: web/src/admin/pages/settings/stages.ts +msgid "interface" +msgstr "" + +#: backend/i18n/messages.js msgid "interface %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "interface %s has Dawnline's settings again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "interface %s was changed outside Dawnline" msgstr "" -#: web/src/admin/access.ts -msgid "internet" +#: web/src/admin/pages/settings/check.ts +msgid "internet directly" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/pages/settings/check.ts +msgid "internet like a home device" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "internet on their own connection" +msgstr "" + +#: web/src/admin/flows/circle.ts +msgid "internet only: reaches nobody yet" +msgstr "" + +#: backend/i18n/messages.js msgid "is kept down" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise has values AmneziaWG cannot take" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise needs AmneziaWG %s (installed: %s)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is kept down: its disguise needs AmneziaWG %s (installed: none)" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "is off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "is on · traffic enters %s as %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "is ready again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't answering on port %d" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "isn't installed: no tunnel can run - install it in Dawnline → Components" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc +#: backend/i18n/messages.js msgid "isn't installed: tunnels were left as they are" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "isn't known to the network service - restart the network or reboot" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't running" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "isn't running on this router (fw4): tunnels and the portal are closed" msgstr "" @@ -8150,18 +9583,14 @@ msgstr "" msgid "it needs its new configuration" msgstr "" +#: web/src/admin/pages/settings/networks.ts +msgid "it works as soon as it is added" +msgstr "" + #: web/src/shared/format.ts msgid "just now" msgstr "" -#: web/src/shared/format.ts -msgid "kbit/s" -msgstr "" - -#: web/src/admin/pages/person/limits.ts -msgid "keep access" -msgstr "" - #: web/src/admin/events/model.ts msgid "keep-alive" msgstr "" @@ -8170,100 +9599,155 @@ msgstr "" msgid "keep-alive %s s" msgstr "" +#: web/src/admin/pages/log/index.ts +msgid "kept %s" +msgstr "" + #: web/src/admin/events/model.ts msgid "kept in memory only (lost on reboot)" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "kept on flash" +#: web/src/admin/pages/log/index.ts +msgid "kept with no age limit" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "kernel module isn't installed: no tunnel can run - install it in Dawnline → Components" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "kernel module isn't loaded" msgstr "" -#: web/src/admin/widgets/tiles.ts -msgid "last 2 min" +#: web/src/admin/pages/settings/stages.ts +msgid "key" msgstr "" -#: web/src/admin/pages/person/header.ts -msgid "last seen %s" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 24 hours" msgstr "" -#: web/src/admin/pages/person/activity.ts -msgid "latest 10 of %s" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 30 days" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "latest release" +#: web/src/admin/events/timeline.ts +#: web/src/admin/flows/places-closeup.ts +#: web/src/admin/pages/server/device-dialog.ts +msgid "last 7 days" msgstr "" -#: web/src/admin/interfaces.ts -msgid "leaves through %s" +#: web/src/admin/people/card.ts +msgid "last day" msgstr "" -#: web/src/admin/access.ts -msgid "like home" +#: web/src/admin/pages/settings/router/backups.ts +msgid "latest %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: web/src/admin/pages/settings/router/history.ts +msgctxt "measure" +msgid "limit" +msgstr "" + +#: web/src/admin/pages/people/card.ts +msgid "limit for the month" +msgstr "" + +#: web/src/admin/pages/people/card.ts +msgid "limit for the whole term" +msgstr "" + +#: backend/i18n/messages.js msgid "loading it" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "loading them again" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/system/model.ts +msgid "log: %s d" +msgstr "" + +#: web/src/admin/system/model.ts +msgid "log: no limit" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "missing %s" msgstr "" +#: web/src/admin/widgets/link-values.ts +msgid "mobile networks" +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "most networks let it through" +msgstr "" + #: web/src/admin/events/model.ts msgid "moved to %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +#: backend/i18n/messages.js msgid "moved to word codes" msgstr "" +#: web/src/admin/flows/circle.ts +msgid "moves from %s" +msgstr "" + #: web/src/admin/events/model.ts msgid "name" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +#: web/src/admin/pages/people/card.ts +msgid "name in the network" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "needs attention" +msgstr "" + +#: backend/i18n/messages.js msgid "netifd doesn't know the amneziawg protocol (AmneziaWG missing, or the network wasn't restarted after installing it)." msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +#: backend/i18n/messages.js msgid "netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed." msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "network changed - Dawnline set itself up again" msgstr "" +#: web/src/admin/events/model.ts +msgid "networks behind it: %s" +msgstr "" + #: web/src/shared/format.ts msgid "never" msgstr "" -#: web/src/admin/pages/person/header.ts -msgid "never connected" -msgstr "" - -#: web/src/admin/pages/components/hero.ts +#: web/src/admin/pages/settings/router/updates.ts msgid "next in %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "nightly backup failed: %s" msgstr "" -#: web/src/admin/pages/person/dialogs.ts +#: web/src/admin/widgets/reach.ts +msgid "no access" +msgstr "" + +#: web/src/admin/flows/move-person.ts +#: web/src/admin/pages/overview/servers.ts msgid "no address" msgstr "" @@ -8271,127 +9755,231 @@ msgstr "" msgid "no age limit" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +#: web/src/admin/pages/settings/router/index.ts +msgid "no backups" +msgstr "" + +#: backend/i18n/messages.js msgid "no circle" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "no end date" +#: web/src/admin/pages/settings/pending-dock.ts +msgid "no device has to fetch anything" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/events/timeline.ts +msgid "no failures" +msgstr "" + +#: web/src/admin/widgets/net-switches.ts msgid "no firewall zone" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/check.ts +msgid "no home" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "no home network" +msgstr "" + +#: web/src/admin/widgets/limit-meter.ts msgid "no limit" msgstr "" -#: web/src/admin/pages/diagnostics/health.ts -msgid "no repairs today" +#: web/src/admin/events/model.ts +msgid "no longer asked for: %s" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "no networks behind it" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "no reason given" msgstr "" #: web/src/admin/events/model.ts msgid "no server" msgstr "" -#: web/src/admin/access.ts +#: web/src/admin/widgets/visibility.ts +msgid "nobody has home access yet" +msgstr "" + +#: web/src/admin/pages/overview/now.ts +msgid "nobody is connected" +msgstr "" + +#: web/src/admin/flows/circle.ts +#: web/src/admin/widgets/visibility.ts msgid "nobody yet" msgstr "" -#: web/src/admin/pages/components/awg.ts +#: web/src/admin/pages/overview/servers.ts +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/pages/settings/router/defaults.ts +msgid "none" +msgstr "" + +#: web/src/admin/widgets/reach.ts +msgid "none picked: the whole home network" +msgstr "" + +#: web/src/admin/flows/awg-build.ts msgid "none yet" msgstr "" -#: web/src/admin/pages/components/hero.ts -#: web/src/admin/pages/components/index.ts +#: web/src/admin/widgets/disguise-levels.ts +msgid "not V2RayTun" +msgstr "" + +#: web/src/admin/pages/people/person/index.ts +#: web/src/admin/pages/settings/index.ts +#: web/src/admin/widgets/net-switches.ts +msgid "not applied" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "not checked yet" msgstr "" -#: web/src/admin/pages/components/awg.ts -#: web/src/admin/pages/components/packages.ts +#: web/src/admin/pages/settings/check.ts +msgid "not each other" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "not found" +msgstr "" + +#: web/src/admin/flows/packages.ts +#: web/src/admin/pages/settings/router/updates-rows.ts msgid "not installed" msgstr "" -#: web/src/admin/pages/people.ts -msgid "not set up" +#: web/src/admin/pages/people/card.ts +msgid "not online in 7 days" msgstr "" +#: web/src/admin/widgets/net-switches.ts +msgid "not present right now" +msgstr "" + +#: web/src/admin/pages/log/index.ts +msgid "not recorded: %s" +msgstr "" + +#: web/src/admin/flows/awg-build.ts #: web/src/admin/map.ts #: web/src/admin/places/render.ts -#: web/src/admin/widgets/readouts.ts +#: web/src/admin/widgets/place-rows.ts +#: web/src/admin/widgets/timeline.ts msgid "now" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/limits.ts +#: web/src/admin/pages/settings/networks.ts +msgid "now %s" +msgstr "" + +#: web/src/admin/ui/measure.ts +msgctxt "measure" +msgid "of" +msgstr "" + +#: web/src/admin/pages/people/card.ts msgid "of %s" msgstr "" +#: web/src/admin/system/model.ts +msgctxt "portal" +msgid "off" +msgstr "" + +#: web/src/admin/pages/overview/health.ts +msgctxt "server" +msgid "off" +msgstr "" + +#: web/src/admin/pages/settings/router/history.ts +msgid "older ones are removed on their own" +msgstr "" + #: web/src/admin/events/model.ts msgid "older than %s day" msgid_plural "older than %s days" msgstr[0] "" msgstr[1] "" -#: web/src/admin/device.ts -msgid "on the portal" +#: web/src/admin/system/model.ts +msgctxt "portal" +msgid "on" msgstr "" -#: web/src/admin/pages/overview.ts +#: web/src/admin/widgets/timeline.ts msgid "online" msgstr "" -#: web/src/admin/pages/overview.ts -msgid "online for %s" +#: web/src/admin/events/timeline.ts +msgid "online %s in the %s" msgstr "" -#: web/src/admin/pages/people.ts -msgid "online from %s" -msgstr "" - -#: web/src/admin/pages/person/header.ts +#: web/src/admin/widgets/feed.ts msgid "online now" msgstr "" +#: web/src/admin/widgets/feed.ts +msgid "online until %s" +msgstr "" + +#: web/src/admin/widgets/timeline.ts +msgid "only the portal and DNS: the limit" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "only you add one" +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "opened on the WAN firewall by itself" +msgstr "" + #: web/src/admin/events/model.ts msgid "other addresses" msgstr "" -#: web/src/admin/events/model.ts -msgid "outside allowed hours" -msgstr "" - -#: web/src/admin/pages/person/pickers.ts -msgid "over the limit" -msgstr "" - #: web/src/admin/events/model.ts msgid "pause" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "pause access" -msgstr "" - #: web/src/admin/events/model.ts msgid "paused by admin" msgstr "" +#: web/src/admin/pages/settings/first.ts +msgid "personal links people add their own devices with" +msgstr "" + +#: web/src/portal/setup.ts +msgid "phone" +msgstr "" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "phone" +msgstr "" + +#: web/src/admin/widgets/link-values.ts +msgid "phones" +msgstr "" + #: web/src/admin/events/model.ts msgid "port %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "port forward “%s”" msgstr "" -#: web/src/admin/access.ts -msgid "ports %s" -msgstr "" - #: web/src/admin/events/model.ts msgid "problems are only logged, nothing is repaired" msgstr "" @@ -8400,80 +9988,81 @@ msgstr "" msgid "public address" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "public address changed · %s → %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "reaches Dawnline again" msgstr "" +#: web/src/admin/events/model.ts +msgid "reason: %s" +msgstr "" + #: web/src/admin/events/model.ts msgid "redirect" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "release %s" -msgstr "" - -#: web/src/admin/pages/components/hero.ts -msgid "released %s" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "reloading rpcd" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "remove their devices" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "removed by you" msgstr "" #: web/src/admin/events/render.ts msgid "repair" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgid "resets on the 1st" -msgstr "" - -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "restarted · version %s" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "restarting for the AmneziaWG update" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "restarting it" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "restoring them" msgstr "" -#: web/src/admin/cores/awg.ts -msgid "router %s" +#: web/src/portal/setup.ts +msgid "router" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: web/src/admin/pages/settings/stages.ts +msgctxt "in the tunnel" +msgid "router" +msgstr "" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "router" +msgstr "" + +#: backend/i18n/messages.js msgid "rules for Dawnline are in place again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "rules for Dawnline aren't loaded" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "rules for Dawnline were changed or removed" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "runs again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "runs without its fast path" msgstr "" @@ -8485,8 +10074,8 @@ msgstr "" msgid "saved to flash hourly" msgstr "" -#: web/src/admin/pages/people.ts -msgid "seen %s" +#: web/src/admin/widgets/link-values.ts +msgid "seconds, up to 600" msgstr "" #: web/src/admin/events/model.ts @@ -8497,104 +10086,183 @@ msgstr "" msgid "server turned off" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +#: backend/i18n/messages.js msgid "server “%s”" msgstr "" -#: web/src/admin/access.ts -msgid "services" -msgstr "" - -#: web/src/admin/cores/awg.ts +#: web/src/admin/servers/params.ts msgctxt "key" msgid "set" msgstr "" -#: web/src/admin/device-link.ts -msgid "set when it was added" -msgstr "" - -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +#: backend/i18n/messages.js msgid "setting it up again" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +#: web/src/admin/widgets/timeline.ts +msgid "settings changed" +msgstr "" + +#: backend/i18n/messages.js msgid "sha256 matches the release (%s…)" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "so far" +#: web/src/admin/pages/settings/router/history.ts +msgid "since %s" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "started" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "started with the router · version %s" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "started · accepting connections on port %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "started · version %s" msgstr "" -#: package/luci-app-dawnline/root/usr/bin/dawnline +#: backend/i18n/messages.js msgid "stopped unexpectedly" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "stopped unexpectedly - started again" msgstr "" +#: web/src/portal/setup.ts +msgid "tablet" +msgstr "" + +#: web/src/portal/setup.ts +msgctxt "on the" +msgid "tablet" +msgstr "" + +#: web/src/admin/pages/settings/first.ts +msgid "the address and port: we check the router can be reached from the internet" +msgstr "" + +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "the check failed" +msgstr "" + #: web/src/admin/events/model.ts msgid "the file holds private keys" msgstr "" -#: web/src/admin/interfaces.ts +#: web/src/admin/widgets/reach.ts +msgid "the home network" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "the home networks their pages pick" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts msgid "the link is down" msgstr "" +#: web/src/admin/servers/behind.ts +msgid "the network behind %s" +msgstr "" + #: web/src/admin/events/render.ts msgid "the old link stopped working" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +#: web/src/admin/pages/settings/stages.ts +#: web/src/admin/widgets/entry.ts +msgid "the portal’s address" +msgstr "" + +#: web/src/admin/pages/settings/check.ts +msgid "the router" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "the router accepted" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "the router declined" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "the router is asked for" +msgstr "" + +#: web/src/admin/events/model.ts +msgid "the router is asked for again" +msgstr "" + +#: backend/i18n/messages.js msgid "the router itself" msgstr "" -#: web/src/admin/pages/person/dialogs.ts -msgid "the server" +#: web/src/admin/pages/settings/check.ts +msgid "the router’s DNS" msgstr "" -#: web/src/admin/access.ts -msgid "their networks" +#: web/src/admin/pages/settings/health.ts +msgid "the server is off" msgstr "" -#: web/src/admin/access.ts -msgid "their own" +#: web/src/admin/pages/settings/stages.ts +msgid "the tunnel is down" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/person/devices.ts -msgid "this month" +#: web/src/admin/servers/behind.ts +msgid "the tunnel network of %s" msgstr "" -#: web/src/admin/pages/person/limits.ts -msgctxt "time range" -msgid "to" +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "the update failed" msgstr "" -#: web/src/admin/widgets/tiles.ts +#: web/src/admin/widgets/reach.ts +msgid "their own connection" +msgstr "" + +#: web/src/portal/setup.ts +msgid "this device" +msgstr "" + +#: web/src/admin/pages/settings/stages.ts +msgid "this router" +msgstr "" + +#: web/src/admin/servers/behind.ts +msgid "this router’s %s" +msgstr "" + +#: web/src/admin/widgets/net-values.ts +msgid "this router’s other network" +msgstr "" + +#: web/src/admin/widgets/reach.ts +msgid "through your router" +msgstr "" + +#: web/src/admin/widgets/reach.ts +msgid "through your router, as a home device" +msgstr "" + +#: web/src/admin/pages/overview/now.ts msgid "today" msgstr "" -#: web/src/admin/pages/people.ts -msgid "today %s" +#: web/src/admin/events/clock.ts +msgid "today at %s" +msgstr "" + +#: web/src/admin/widgets/entry.ts +msgid "try a phone on mobile data" msgstr "" #: web/src/admin/events/model.ts @@ -8609,8 +10277,16 @@ msgstr "" msgid "type: %s" msgstr "" -#: web/src/admin/pages/people.ts -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/pages/settings/router/updates-policy.ts +msgid "under a minute" +msgstr "" + +#: web/src/admin/pages/people/card.ts +msgid "under an hour in 7 days" +msgstr "" + +#: web/src/admin/pages/settings/router/portal.ts +#: web/src/admin/widgets/term.ts msgid "until %s" msgstr "" @@ -8618,71 +10294,72 @@ msgstr "" msgid "up" msgstr "" -#: web/src/admin/pages/server.ts -msgid "up %s" +#: web/src/admin/flows/add-person.ts +msgid "up to %s" msgstr "" +#: web/src/admin/system/model.ts +msgid "up to %s device" +msgid_plural "up to %s devices" +msgstr[0] "" +msgstr[1] "" + #: web/src/admin/events/model.ts msgid "up to %s event" msgid_plural "up to %s events" msgstr[0] "" msgstr[1] "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: web/src/admin/pages/settings/router/updates-rows.ts +msgid "up to date" +msgstr "" + +#: backend/i18n/messages.js msgid "update failed" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent +#: backend/i18n/messages.js msgid "update to %s failed its check - rolled back to %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated automatically · %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated automatically · %s → %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated · %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/agent -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updated · %s → %s" msgstr "" -#: package/luci-app-dawnline/root/usr/libexec/dawnline/updater +#: backend/i18n/messages.js msgid "updates available · %s" msgstr "" -#: web/src/admin/pages/components/awg.ts -msgid "version not checked" -msgstr "" - -#: web/src/admin/pages/settings/portal.ts +#: web/src/admin/flows/portal-sheets.ts msgid "vpn.example.com or an IP" msgstr "" -#: web/src/admin/events/model.ts -msgid "warning before the end" -msgstr "" - #: web/src/admin/events/render.ts msgid "was %s" msgstr "" -#: package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +#: backend/i18n/messages.js msgid "was broken - set up again (%s as %s)" msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "weekly at %s" +#: web/src/admin/widgets/term.ts +msgid "week of %s" msgstr "" -#: web/src/admin/events/model.ts -msgid "what happens at the end" +#: web/src/admin/widgets/term.ts +msgid "weeks" msgstr "" #: web/src/admin/events/model.ts @@ -8691,7 +10368,20 @@ msgid_plural "with %s people" msgstr[0] "" msgstr[1] "" -#: web/src/admin/interfaces.ts +#: web/src/admin/events/clock.ts +msgid "yesterday at %s" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "you accept each network" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +msgid "you accept each router" +msgstr "" + +#: web/src/admin/pages/settings/networks.ts +#: web/src/admin/widgets/net-switches.ts msgid "zone %s" msgstr "" @@ -8699,6 +10389,10 @@ msgstr "" msgid "“%s” already exists - pick another name." msgstr "" +#: web/src/shared/nets.ts +msgid "“%s” is not a network like 192.168.2.0/24." +msgstr "" + #: web/src/admin/netcheck.ts msgid "“%s” is not a port (1–65535)." msgstr "" @@ -8707,10 +10401,10 @@ msgstr "" msgid "“%s” is not an IP address. Separate several with commas." msgstr "" -#: web/src/admin/pages/components/hero.ts -msgid "← Newer" +#: web/src/admin/pages/settings/router/portal.ts +msgid "“Not found”" msgstr "" -#: web/src/admin/widgets/readouts.ts -msgid "−%s%% vs average" +#: web/src/admin/pages/overview/now.ts +msgid "↑ %s from devices" msgstr "" diff --git a/package/luci-app-dawnline/root/etc/hotplug.d/iface/95-dawnline b/package/luci-app-dawnline/root/etc/hotplug.d/iface/95-dawnline index d22dcc6..6a7c3d2 100755 --- a/package/luci-app-dawnline/root/etc/hotplug.d/iface/95-dawnline +++ b/package/luci-app-dawnline/root/etc/hotplug.d/iface/95-dawnline @@ -6,6 +6,6 @@ case "$ACTION" in ifup|ifdown|ifup-failed) ;; *) exit 0 ;; esac # In order (a quick down/up must not log up first). /usr/bin/dawnline iface-event "$ACTION" "$INTERFACE" >/dev/null 2>&1 # A disabled Dawnline leaves the tunnels empty: nothing would enforce end -# dates, limits or hours once the devices were loaded. +# dates or limits once the devices were loaded. [ "$ACTION" = ifup ] && /etc/init.d/dawnline enabled && /usr/bin/dawnline sync >/dev/null 2>&1 & exit 0 diff --git a/package/luci-app-dawnline/root/etc/init.d/dawnline b/package/luci-app-dawnline/root/etc/init.d/dawnline index 25891e0..7458cfa 100755 --- a/package/luci-app-dawnline/root/etc/init.d/dawnline +++ b/package/luci-app-dawnline/root/etc/init.d/dawnline @@ -1,14 +1,13 @@ #!/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. +# Dawnline: AmneziaWG access server — its backend (which also serves the personal portal) and the +# resolver for Home-only devices. START=95 STOP=10 USE_PROCD=1 -PORTAL_ROOT=/usr/share/dawnline/portal/www - -# A line in syslog as dawnline.util syslog() writes them: "dawnline: [info] [service] …" at the +# A line in syslog as the backend writes them: "dawnline: [info] [service] …" at the # matching priority, when the admin's level (settings.log_level: error|warn|info|debug) takes it. log() { local lvl="$1" want rank prio @@ -20,39 +19,34 @@ log() { logger -t dawnline -p "daemon.$prio" "[$lvl] [service] $*" } -start_portal() { - local enabled port certs cert key hport http +# What the portal runs with, worked out once for whoever serves it: P_PORT (empty: no portal, said in the +# log), P_CERT, P_KEY, P_HPORT (plain HTTP for links with an IP address, or empty), P_PROCS. +portal_plan() { + local enabled certs mem + P_PORT='' P_CERT='' P_KEY='' P_HPORT='' config_get_bool enabled settings portal_enabled 0 if [ "$enabled" != 1 ]; then log info "personal portal is off" return 0 fi - config_get port settings portal_port 8443 certs="$(/usr/bin/dawnline portal-cert 2>/dev/null)" - cert="${certs% *}" - key="${certs#* }" - if ! [ -f "$cert" ] || ! [ -f "$key" ]; then - log warn "personal portal not started: no certificate (${cert:-none}): choose one in Settings, or save the portal settings again" + P_CERT="${certs% *}" + P_KEY="${certs#* }" + if ! [ -f "$P_CERT" ] || ! [ -f "$P_KEY" ]; then + log warn "personal portal not started: no certificate (${P_CERT:-none}): choose one in Settings, or save the portal settings again" return 0 fi + config_get P_PORT settings portal_port 8443 # 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" + P_HPORT="$(/usr/bin/dawnline portal-http-port 2>/dev/null)" + return 0 +} - # Portal processes at once: each loads the whole model (a burst of 16 could - # empty a 128 MB router), so four, and two on a router with little memory; - # the rest of 64 connections wait their turn. - local procs=4 mem - mem="$(awk '/^MemTotal:/ { print int($2 / 1024) }' /proc/meminfo 2>/dev/null)" - [ -n "$mem" ] && [ "$mem" -le 160 ] && procs=2 - procd_open_instance portal - procd_set_param command /usr/sbin/uhttpd -f -h "$PORTAL_ROOT" -x /cgi-bin -E /cgi-bin/portal \ - -D -n "$procs" -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 - log info "personal portal on port $port (HTTPS${hport:+, plain HTTP on $hport for links with an IP address}) · certificate $cert$(openssl x509 -enddate -noout -in "$cert" 2>/dev/null | sed 's/^notAfter=/ until /') · $procs processes" +start_portal() { + [ -n "$P_PORT" ] || return 0 + local until + until="$(openssl x509 -enddate -noout -in "$P_CERT" 2>/dev/null | sed 's/^notAfter=/ until /')" + log info "personal portal on port $P_PORT (HTTPS${P_HPORT:+, plain HTTP on $P_HPORT for links with an IP address}) · certificate $P_CERT$until · served by the backend" } # Plain DNS for Home-only tunnel devices (config written by `dawnline apply`). @@ -64,12 +58,42 @@ start_resolver() { procd_open_instance dns procd_set_param command /usr/libexec/dawnline/resolver procd_set_param file /var/etc/dawnline-dns.conf - # A new config kills it (dawnline.resolver): back within a second, not five. + # A new config kills it (the backend's apply): back within a second, not five. procd_set_param respawn 3600 1 0 procd_close_instance log info "DNS for Home-only devices started (/var/etc/dawnline-dns.conf)" } +# The backend (dawnlined, docs/backend.md): it looks at the tunnels, keeps the router to the settings, +# answers the pages and their stream, and serves the personal portal. +start_backend() { + local bin=/usr/libexec/dawnline/dawnlined stream=poll built portal='' + # No binary here (a fresh install with no network, a download that failed): fetched in the background, + # once a boot, and the service started again with it. + if [ ! -x "$bin" ] && [ ! -e /var/run/dawnline/backend.asked ]; then + : > /var/run/dawnline/backend.asked + ( /usr/libexec/dawnline/fetch-backend && [ -x "$bin" ] && /etc/init.d/dawnline restart ) /dev/null 2>&1 & + fi + if ! [ -x "$bin" ] || ! "$bin" -version >/dev/null 2>&1; then + log error "the backend is not on this router ($bin): Dawnline does not run until it is · /usr/libexec/dawnline/fetch-backend puts it in place" + return 0 + fi + # uhttpd holds an event stream without losing its connection only since 2026-08-03 (an older one stops + # serving after a hundred of them): before that the pages follow by a held call. + built="$({ apk list -I uhttpd-mod-ubus 2>/dev/null || opkg list-installed uhttpd-mod-ubus 2>/dev/null; } | + sed -n 's/.*uhttpd-mod-ubus[- ]*\([0-9]\{4\}\)[.-]\([0-9]\{2\}\)[.-]\([0-9]\{2\}\).*/\1\2\3/p' | head -n 1)" + [ -n "$built" ] && [ "$built" -ge 20260803 ] && stream=sse + # The portal: its certificate is read again when it is renewed, so no restart follows a renewal. + [ -n "$P_PORT" ] && portal="-portal-port $P_PORT -portal-cert $P_CERT -portal-key $P_KEY${P_HPORT:+ -portal-http $P_HPORT}" + procd_open_instance backend + # shellcheck disable=SC2086 # the portal's options are words on purpose + procd_set_param command "$bin" -stream "$stream" $portal + procd_set_param respawn 3600 5 0 + procd_set_param stderr 1 + procd_close_instance + log info "backend started · the pages follow by $stream" +} + start_service() { config_load dawnline mkdir -p /var/run/dawnline @@ -77,23 +101,19 @@ start_service() { # The apply writes its own lines: what it came to and how long it took (each step at debug). /usr/bin/dawnline apply >/dev/null 2>&1 || log error "applying the configuration failed: run \"dawnline apply\" to see why" - 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 - + portal_plan + start_backend start_portal start_resolver log info "started" } -# Noted for the service log: the next agent start is a restart, not a crash or a boot. +# Noted for the service log: the backend's next start is a restart, not a crash or a boot. stop_service() { log info "stopping" mkdir -p /var/run/dawnline date +%s > /var/run/dawnline/agent.stopped - # Copies procd doesn't know about (started by hand, or left by an older version) go too. + # An agent left by a version from before the backend did its work goes too. pgrep -f '^/usr/bin/ucode /usr/libexec/dawnline/agent' | xargs -r kill 2>/dev/null } @@ -105,8 +125,8 @@ reload_service() { service_triggers() { procd_add_reload_trigger dawnline - # The portal's uhttpd reads its certificate once: an issued or renewed one needs a - # reload (procd restarts the portal alone, its cert file having changed). + # A certificate issued for the first time changes what the portal is served with: the service is + # planned again (a renewed one the backend reads by itself). procd_add_raw_trigger acme.issue 5000 /etc/init.d/dawnline reload procd_add_raw_trigger acme.renew 5000 /etc/init.d/dawnline reload } diff --git a/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline b/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline index 4073e49..c7b5af1 100755 --- a/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline +++ b/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline @@ -46,17 +46,20 @@ fi rm -f /tmp/luci-indexcache* /tmp/luci-modulecache/* 2>/dev/null touch /usr/lib/opkg/status 2>/dev/null -# Cron restarts the agent when it stops ticking (Health → Watchdog). -mkdir -p /etc/crontabs -grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root || { - echo '*/5 * * * * /usr/libexec/dawnline/heartbeat' >> /etc/crontabs/root +# The agent's heartbeat check went with the agent: procd restarts the backend. +grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root && { + sed -i '\#/usr/libexec/dawnline/heartbeat#d' /etc/crontabs/root /etc/init.d/cron restart 2>/dev/null } +# What the ucode backend was made of, left by a version that had it (the package manager removes what a +# package no longer ships; a tarball laid over it does not). +rm -rf /usr/share/ucode/dawnline /usr/share/rpcd/ucode/luci.dawnline /usr/libexec/dawnline/agent /usr/libexec/dawnline/cli \ + /usr/libexec/dawnline/updater.uc /usr/libexec/dawnline/heartbeat /usr/share/dawnline/portal/cgi.uc /usr/share/dawnline/portal/www +rm -f /etc/dawnline/backend-off /etc/dawnline/backend-watch /etc/dawnline/backend-portal /etc/dawnline/backend-sync /etc/dawnline/backend-apply /etc/dawnline/backend-shadow +# rpcd reads the access lists once (the backend's object is in them), and forgets the plugin that is gone. /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; } +sleep 1 # A fresh install starts the service; an upgrade restarts it only where the # admin had it on (a disabled Dawnline stays that way). if [ "$PKG_UPGRADE" = 1 ]; then diff --git a/package/luci-app-dawnline/root/usr/bin/dawnline b/package/luci-app-dawnline/root/usr/bin/dawnline index b4e8198..1dbc411 100755 --- a/package/luci-app-dawnline/root/usr/bin/dawnline +++ b/package/luci-app-dawnline/root/usr/bin/dawnline @@ -1,344 +1,8 @@ -#!/usr/bin/ucode -// Dawnline command line: `dawnline help`. -'use strict'; - -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as view from 'dawnline.view'; -import * as health from 'dawnline.health'; -import * as backup from 'dawnline.backup'; -import * as pc from 'dawnline.portalcert'; -import * as watchdog from 'dawnline.watchdog'; -import * as awg from 'dawnline.awg'; -import * as store from 'dawnline.store'; -import * as devices from 'dawnline.devices'; -import { L_ } from 'dawnline.i18n'; -import { - VERSION, slog, syslog, slog_read, sh_out, q, take_iface_intent, read_json, write_json, ensure_dir, with_lock, RUN_DIR -} from 'dawnline.util'; - -/** Options that take no value. */ -const FLAGS = [ 'json', 'yes', 'conf' ]; - -// Options (--name value, or a bare --flag) can go anywhere; what is left are the words. -const opts = {}; -const args = []; -for (let i = 0; i < length(ARGV); i++) { - let a = ARGV[i]; - if (a == '-n') - a = '--n'; - if (substr(a, 0, 2) == '--') { - let name = substr(a, 2); - if (index(FLAGS, name) >= 0) - opts[name] = true; - else - opts[name] = ARGV[++i] ?? ''; - } - else - push(args, a); -} -const cmd = args[0] ?? 'help'; - -function out(v) { - print(type(v) == 'string' ? v + '\n' : sprintf('%.J\n', v)); -} - -function opt(name, dflt) { - return opts[name] ?? dflt; -} - -/** Fixed-width columns: a header, then one line per row. */ -function table(cols, rows) { - let w = map(cols, (c) => length(c)); - for (let r in rows) - for (let i, v in r) - w[i] = max(w[i], length(`${v}`)); - let line = (r) => rtrim(join(' ', map(r, (v, i) => sprintf(`%-${w[i]}s`, `${v}`)))); - out(line(cols)); - for (let r in rows) - out(line(r)); -} - -/** `--since 30m|2h|3d|YYYY-MM-DD` as a time, or null. */ -function since_time(s) { - if (!s) - return null; - let m = match(s, /^([0-9]+)([mhd])$/); - if (m) - return time() - +m[1] * { m: 60, h: 3600, d: 86400 }[m[2]]; - m = match(s, /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/); - if (m) - return timelocal({ year: +m[1], mon: +m[2], mday: +m[3], hour: 0, min: 0, sec: 0 }); - die('--since takes 30m, 2h, 3d or a date like 2026-10-18.'); -} - -/** "5m", "3h", "2d": how long ago, for the lists. */ -function ago(secs) { - return secs < 3600 ? `${int(secs / 60)}m` : secs < 86400 ? `${int(secs / 3600)}h` : `${int(secs / 86400)}d`; -} - -function the_person(m, slug) { - return m.people[slug ?? ''] ?? die(slug ? `Unknown person: ${slug}.` : 'Which person? Give their id (dawnline person ls).'); -} - -function help() { - out(`Dawnline ${VERSION} - -Usage: dawnline - - apply Reconcile router configuration and runtime state - sync Push devices and access rules to the tunnels - status People and devices with live state (JSON) - health Run health checks (JSON) - person ls [--json] Everyone: id, name, access, state, devices, last seen - person add [--slug s] [--access lan|internet|both] [--devices n] - [--expires YYYY-MM-DD] [--quota GB] [--server id] - person link Print the personal portal link - person rm [--yes] Remove a person and their devices (--yes when they have any) - device ls [person] [--json] - device add [--kind phone|computer|tablet|router] [--conf] - device conf Print a device configuration (.conf) - device rm Remove a device - backup Create a backup in /etc/dawnline/backups - portal-cert Print the certificate and key the portal uses - portal-http-port Print the plain-HTTP port when an IP is among the portal addresses - log [-n N] [--since 2h|3d|date] [--level error|down|repair|up|info] [--src awg|dawnline|portal] [--json] - Service log: tunnel and service starts, stops, repairs (newest first) - teardown Remove everything Dawnline created on the router - version - -Exit codes: 0 done, 1 refused or failed, 2 unknown command. health exits 1 when a check fails.`); -} - -/* - * netifd retries a tunnel that fails to start every few seconds (a kernel - * module that won't load, AmneziaWG removed): one line per interface every - * 10 minutes, with how many attempts failed meanwhile. A start clears it. - */ -const FAILS = `${RUN_DIR}/ifup-failed.json`; -const FAIL_EVERY = 600; - -function ifup_failed(ifname, who) { - let now = time(); - // Attempts since the last line (a quiet spell starts a new count), and over how long. - let r = with_lock('ifup-failed', () => { - let all = read_json(FAILS, {}); - let f = all[ifname]; - if (!f || now - f.last > FAIL_EVERY) - f = all[ifname] = { logged: 0, count: 0, since: now }; - f.count++; - f.last = now; - let out = null; - if (now - f.logged >= FAIL_EVERY) { - out = { n: f.count, mins: int((now - f.since) / 60) }; - f.logged = f.since = now; - f.count = 0; - } - ensure_dir(RUN_DIR); - write_json(FAILS, all, 0o600); - return out; - }); - if (r) - slog('awg', 'error', r.n > 1 ? sprintf(L_("couldn't start · %d failed attempts in %d min"), r.n, r.mins) : L_("couldn't start"), - watchdog.iface_errors(ifname), who); -} - -function ifup_ok(ifname) { - with_lock('ifup-failed', () => { - let all = read_json(FAILS, {}); - if (all[ifname]) { - delete all[ifname]; - write_json(FAILS, all, 0o600); - } - }); -} - -try { - if (cmd == 'apply') - out(apply.apply()); - else if (cmd == 'sync') - out(apply.sync()); - else if (cmd == 'status') { - let m = core.load(), u = core.load_usage(), d = live.dump(m), st = view.states(m, u); - out(map(values(m.people), (p) => view.person_view(m, p, u, d, st, { admin: true }))); - } - else if (cmd == 'health') { - let checks = health.health(); - out(checks); - if (length(filter(checks, (c) => c.status == 'error'))) - exit(1); - } - else if (cmd == 'person' && args[1] == 'ls') { - let m = core.load(), u = core.load_usage(), d = live.dump(m), st = view.states(m, u); - let people = sort(map(values(m.people), (p) => view.person_view(m, p, u, d, st, { admin: true })), (a, b) => a.name < b.name ? -1 : 1); - if (opts.json) - out(people); - else - table([ 'ID', 'NAME', 'SERVER', 'ACCESS', 'STATE', 'DEVICES', 'LAST SEEN' ], map(people, (p) => [ - p.id, p.name, p.server, p.access, p.state, `${length(p.devices)}${p.online ? ` (${p.online} online)` : ''}`, - p.online ? 'now' : p.last_seen ? ago(time() - p.last_seen) + ' ago' : 'never', - ])); - } - else if (cmd == 'person' && args[1] == 'add') { - let id = store.transact((c, m) => core.create_person(c, m, { - name: args[2], slug: opt('slug'), access: opt('access', 'internet'), server: opt('server'), - device_limit: opt('devices'), expires: opt('expires'), quota_gb: opt('quota'), - })); - let m2 = core.load(); - live.add_event({ type: 'person_added', person: id, detail: m2.people[id].name, by: 'admin' }); - out(`Added ${m2.people[id].name} (${id})`); - out(core.portal_url(m2, m2.people[id]) ?? 'No personal link: the portal is off.'); - } - else if (cmd == 'person' && args[1] == 'link') { - let m = core.load(); - let p = the_person(m, args[2]); - out(core.portal_url(m, p) ?? 'No personal link: the portal is off.'); - } - else if (cmd == 'person' && args[1] == 'rm') { - let m = core.load(); - let p = the_person(m, args[2]); - let n = length(p.devices); - if (n && !opts.yes) - die(`${p.name} has ${n} device${n == 1 ? '' : 's'}: add --yes to remove them too.`); - store.transact((c, m) => core.delete_person(c, m, p.id)); - live.add_event({ type: 'person_removed', person: p.id, detail: p.name, pname: p.name, by: 'admin' }); - let s = apply.sync(); - out(`Removed ${p.name}${n ? ` and ${n} device${n == 1 ? '' : 's'}` : ''}.`); - if (s.warning) - warn(`dawnline: ${s.warning}\n`); - } - else if (cmd == 'device' && args[1] == 'ls') { - let m = core.load(), d = live.dump(m); - let who = args[2] ? the_person(m, args[2]) : null; - let rows = []; - for (let id, dev in m.devices) { - let p = m.people[dev.person]; - if (!p || (who && p.id != who.id)) - continue; - let peer = d.peers[dev.public_key]; - let online = live.online(d, id, peer); - push(rows, { id, person: p.id, name: dev.name, kind: dev.kind, address: dev.address, disabled: dev.disabled, - online, handshake: +(peer?.handshake ?? 0) }); - } - rows = sort(rows, (a, b) => (a.person < b.person ? -1 : a.person > b.person ? 1 : 0) || (a.name < b.name ? -1 : 1)); - if (opts.json) - out(rows); - else - table([ 'ID', 'PERSON', 'NAME', 'KIND', 'ADDRESS', 'STATE' ], map(rows, (r) => [ - r.id, r.person, r.name, r.kind, r.address, - r.disabled ? 'off' : r.online ? 'online' : r.handshake ? `seen ${ago(time() - r.handshake)} ago` : 'never connected', - ])); - } - else if (cmd == 'device' && args[1] == 'add') { - // Through the same door as LuCI and the portal: event, "issued" marker, capability check. - let m = core.load(); - let p = the_person(m, args[2]); - if (!args[3]) - die('Which name? dawnline device add .'); - let r = devices.add(p.id, args[3], opt('kind', 'phone'), { by: 'admin' }); - if (opts.conf) - print(r.config.conf); - else - out(`${r.id} (dawnline device conf ${r.id} prints its configuration)`); - if (r.warning) - warn(`dawnline: ${r.warning}\n`); - } - else if (cmd == 'device' && args[1] == 'conf') { - let m = core.load(); - let d = m.devices[args[2] ?? ''] ?? die('Unknown device.'); - awg.mark_issued(m, d.id); - print(awg.client_config(m, d).conf); - } - else if (cmd == 'device' && args[1] == 'rm') { - let m = core.load(); - let d = m.devices[args[2] ?? ''] ?? die('Unknown device.'); - let r = devices.remove(d.id, { by: 'admin' }); - out(`Removed ${d.name} (${m.people[d.person]?.name ?? d.person}).`); - if (r.warning) - warn(`dawnline: ${r.warning}\n`); - } - else if (cmd == 'backup') - out(backup.backup_create(opt('reason'))); - else if (cmd == 'portal-cert') { - let c = pc.portal_cert(core.load().settings); - out(`${c.cert} ${c.key}`); - } - else if (cmd == 'portal-http-port') { - let m = core.load(); - if (core.portal_http(m)) - out(`${core.portal_http_port(m)}`); - } - else if (cmd == 'log') { - let n = +opt('n', 0) || 0; - let since = since_time(opt('since')); - let level = opt('level'), src = opt('src'); - if (level && index([ 'info', 'up', 'down', 'repair', 'error' ], level) < 0) - die('--level takes error, down, repair, up or info.'); - if (src && index([ 'awg', 'dawnline', 'portal' ], src) < 0) - die('--src takes awg, dawnline or portal.'); - let log = filter(slog_read(n && !since && !level && !src ? n : null), - (e) => (!since || e.ts >= since) && (!level || e.level == level) && (!src || e.src == src)); - if (n && length(log) > n) - log = slice(log, 0, n); - if (opts.json) { - out(log); - exit(0); - } - for (let e in log) { - let t = localtime(e.ts); - let text = e.by == 'admin' - ? join(' ', filter([ 'You', e.msg, e.kind, e.who, e.note ? '· ' + e.note : null ], (x) => x)) - : (e.who ? e.who + ' ' : '') + e.msg; - out(sprintf('%02d-%02d %02d:%02d %-8s %-6s %s', t.mon, t.mday, t.hour, t.min, e.src, e.level, text)); - if (e.detail) - out(' ' + replace(e.detail, '\n', '\n ')); - } - } - else if (cmd == 'iface-event') { - // From the iface hotplug script: a tunnel started, stopped or failed to start. - let ifname = args[2] ?? ''; - if (!match(ifname, /^[a-z][a-z0-9_]{0,15}$/)) - die('Bad interface.'); - // Dawnline leaves a note before it takes a tunnel down itself; anything else is unexpected. - let it = args[1] == 'ifdown' ? take_iface_intent(ifname) : null; - let who = it?.name ?? ifname; - for (let id, srv in core.load().servers) - if (srv.ifname == ifname) - who = srv.name; - if (args[1] == 'ifup') { - ifup_ok(ifname); - let port = sh_out(`awg show ${q(ifname)} listen-port 2>/dev/null`); - slog('awg', 'up', port ? sprintf(L_('started · accepting connections on port %s'), port) : L_('started'), null, who); - } - else if (args[1] == 'ifdown') { - // Stops Dawnline made itself are explained by the admin's own line - // (changed, turned off, removed); only an AmneziaWG update gets one here. - if (it?.reason == 'update') - slog('awg', 'info', L_('restarting for the AmneziaWG update'), null, who); - else if (!it) - slog('awg', 'down', L_('stopped unexpectedly'), join('\n', filter([ - L_("Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed."), - watchdog.iface_errors(ifname), - ], (x) => x)), who); - } - else if (args[1] == 'ifup-failed') - ifup_failed(ifname, who); - } - else if (cmd == 'teardown') - apply.teardown(); - else if (cmd == 'version') - out(VERSION); - else if (cmd == 'help' || cmd == '--help' || cmd == '-h') - help(); - else { - warn(`dawnline: unknown command "${join(' ', slice(args, 0, 2))}" (dawnline help)\n`); - exit(2); - } -} -catch (e) { - warn(`dawnline: ${e.message}\n`); - // Run from the init script or cron, stderr goes nowhere: syslog keeps why. - syslog('error', 'cli', `dawnline ${cmd} failed: ${e.message}`); - exit(1); -} +#!/bin/sh +# Dawnline's command line: `dawnline help`. It is the backend's own (dawnlined cli, backend/cli). +b=/usr/libexec/dawnline/dawnlined +if [ -x "$b" ] && "$b" -version >/dev/null 2>&1; then + exec "$b" cli "$@" +fi +echo "dawnline: the backend is not on this router yet (/usr/libexec/dawnline/fetch-backend puts it in place; logread -e dawnline says why it is missing)" >&2 +exit 1 diff --git a/package/luci-app-dawnline/root/usr/libexec/dawnline/agent b/package/luci-app-dawnline/root/usr/libexec/dawnline/agent deleted file mode 100755 index 71e06a3..0000000 --- a/package/luci-app-dawnline/root/usr/libexec/dawnline/agent +++ /dev/null @@ -1,919 +0,0 @@ -#!/usr/bin/ucode -// Dawnline agent (procd instance). Every second its watcher reads the tunnels -// and, the moment a device connects, its session expires or it roams, logs -// it, folds the counters, locates the new address and moves the revision the -// admin UI polls (presence.json, see dawnline.live). The same read tells when -// a device's link fails in a named way (link.json, dawnline.link), what it does -// right now for the portal's set-up sheet (setup.json) and the live meter's -// last two minutes, written out while someone looks (meter.json, dawnline.meter). -// Every minute it: -// * folds the tunnels' counters into usage (tmpfs; flushed to flash hourly) -// * saves the activity log to flash as often as Settings says (or never) -// * keeps the "like a home device" path and the Home-only resolver up -// * enforces end dates, quotas, schedules and pauses (peers + nft sets) -// * watches the tunnel interfaces and repairs what it can (dawnline.watchdog) -'use strict'; - -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, 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'; -import * as apply from 'dawnline.apply'; -import * as backup from 'dawnline.backup'; -import * as pc from 'dawnline.portalcert'; -import * as geo from 'dawnline.geo'; -import * as watchdog from 'dawnline.watchdog'; -import * as net from 'dawnline.net'; -import * as store from 'dawnline.store'; -import * as upd from 'dawnline.updates'; -import * as awg from 'dawnline.awg'; -import * as builds from 'dawnline.awg_builds'; -import * as link from 'dawnline.link'; -import * as meter from 'dawnline.meter'; -import { L_ } from 'dawnline.i18n'; - -const TICK = 60 * 1000; -const WATCH = 1000; -const FLUSH_EVERY = 3600; -const LOG_FLUSH = { '10min': 600, hourly: 3600 }; -const RESYNC_EVERY = 600; -const CONFIG_FILE = '/etc/config/dawnline'; - -// One agent, procd's. A second copy would run forever beside it with the code -// it started with: its own events (pauses and resumes from stale states), its -// own counters and syncs. It takes no arguments: the commands are `dawnline`'s. -if (length(ARGV)) { - warn(`The agent takes no arguments (procd runs it). For commands use: dawnline ${join(' ', ARGV)}\n`); - exit(2); -} -ensure_dir(RUN_DIR); -// Held as long as the process lives; close-on-exec, so children don't keep it. -let instance = open(`${RUN_DIR}/agent.lock`, 'we'); -if (!instance?.lock('xn')) { - warn(`The agent is already running (${RUN_DIR}/agent.lock is held). Use /etc/init.d/dawnline restart.\n`); - exit(1); -} - -let usage = live.load_usage(); -let last_states = null; -// Who was online, kept in tmpfs so an agent restart (update, reload) does not -// swallow connects that happened in between. -let presence = read_json(live.PRESENCE, {}); -// What a link showed comes from the watcher's memory, which starts empty: a -// state shows again once it held (link.HOLD), a set-up state with the next -// read that tells it. The meter's points start again too, written at the next look. -write_json(live.LINK, {}, 0o600); -write_json(live.SETUP, {}, 0o600); -meter.stop(); -let last_online = presence.online ?? {}; -let last_endpoint = presence.endpoint ?? {}; -let rev = +(presence.rev ?? 0); -let person_rev = presence.people ?? {}; -let last_flush = time(); -let last_log_flush = time(); -// The network as apply() last saw it (apply.NET_SIG; this when it never ran), -// and a different one seen on the previous tick. -let base_net = null; -let pending_net = null; -let rate_prev = null; - -/** - * Throughput per server for the Overview's "Speed now": bytes per second - * over the last minute, newest 30 points, kept in tmpfs only. - */ -function record_rate(m) { - let ts = time(); - let now = {}; - for (let pid, p in m.people) { - let t = usage.people?.[pid]?.total; - if (!t) - continue; - now[p.server] ??= [ 0, 0 ]; - now[p.server][0] += t[0]; - now[p.server][1] += t[1]; - } - let hist = read_json(`${RUN_DIR}/rate.json`, {}); - // Per person: the last 15 points (People list, person page). - let people = read_json(`${RUN_DIR}/rate_people.json`, {}); - if (type(people) != 'object') - people = {}; - if (rate_prev) { - let dt = ts - rate_prev.ts; - if (dt > 0 && dt < 600) { - for (let s, v in now) { - let p = rate_prev.v[s] ?? v; - push(hist[s] ??= [], [ ts, int(max(0, v[0] - p[0]) / dt), int(max(0, v[1] - p[1]) / dt) ]); - while (length(hist[s]) > 30) - shift(hist[s]); - } - for (let pid in keys(m.people)) { - let t = usage.people?.[pid]?.total, p = rate_prev.p?.[pid]; - if (!t || !p) - continue; - if (type(people[pid]?.[0]) != 'array') - people[pid] = []; - push(people[pid], [ ts, int(max(0, t[0] - p[0]) / dt), int(max(0, t[1] - p[1]) / dt) ]); - while (length(people[pid]) > 15) - shift(people[pid]); - } - } - } - for (let s in keys(hist)) - if (!m.servers[s]) - delete hist[s]; - for (let pid in keys(people)) - if (!m.people[pid]) - delete people[pid]; - let totals = {}; - for (let pid in keys(m.people)) - if (usage.people?.[pid]?.total) - totals[pid] = [ ...usage.people[pid].total ]; - rate_prev = { ts, v: now, p: totals }; - write_json(`${RUN_DIR}/rate.json`, hist, 0o644); - write_json(`${RUN_DIR}/rate_people.json`, people, 0o644); -} -let last_sync = 0; -// Per server, how the agent's last sync of its devices went (dawnline.awg.sync_peers). -let last_peers = {}; -let conf_mtime = null; -let cert_mtime = null; - -const REASON = { - paused: 'paused by admin', expired: 'end date reached', - quota: 'data limit reached', hours: 'outside allowed hours', no_server: 'no server', server_off: 'server turned off', - active: 'active', -}; - -function check_people(m, states, events) { - let ts = time(); - for (let id, p in m.people) { - let st = states[id], prev = last_states?.[id]; - // The admin's own pauses (and turning a server off or on) are logged by - // rpcd when they happen; here only what changes on its own (end date, - // data limit, allowed hours). - let by_admin = (x) => x == 'paused' || x == 'server_off'; - if (prev != null && prev != st && !by_admin(prev) && !by_admin(st)) - push(events, { type: st == 'active' ? 'resumed' : 'paused', person: id, detail: REASON[st] ?? st }); - // "Remove their devices" when the end date passes: irreversible, so never - // on a clock that has not been set yet (a router before NTP is in 1970). - if (core.person_expired(p, ts) && p.expire_action == 'remove' && length(p.devices) && localtime(ts).year >= 2025) { - store.transact((c, mm) => { - for (let d in mm.people[id]?.devices ?? []) - core.delete_device(c, mm, d); - }); - push(events, { type: 'devices_removed', person: id, detail: 'end date reached' }); - last_sync = 0; - } - } -} - -/** Connections from home: the DHCP name of the address, as it is now. */ -function named(e) { - let h = net.event_hosts(e, net.lan_names()); - if (h) - e.hosts = h; - return e; -} - -/* ---------- the watcher ---------- */ - -// Per device: its latest real handshake, kept when apply re-adds the peer -// (its counters and handshake restart from zero, or it is briefly missing), -// and the public key it was seen with: new keys (Reconnect, New keys) end -// the old session, whatever its handshake said. -let last_hs = {}, last_key = {}; -// The model, read again only when the config file changes (the watcher runs -// every second), the tunnels it reads (live.tunnel_ifnames: a regex per -// server, compiled each time it runs, so not every second), each device's -// online window (live.online_windows: its keep-alive's, from the model) and -// the largest keepalive its server's disguise makes (link.keepalive_sizes). -let wm = null, wm_sig = null, wm_ifnames = [], wm_windows = {}, wm_ka = {}; -// netifd deletes and adds a tunnel's link each time it sets it up (a new -// ifindex): the devices come back only with the sync its hotplug starts, and -// then with no handshake until each one makes a new one. For this long after -// the link changed, a device missing from it keeps what was known of it, -// rather than a burst of disconnects and connects for everyone online. -const RESTART_GRACE = 45; -// Per tunnel: the link last seen (null while it is down), and until when its grace lasts. -let links = {}, grace = {}; - -/** A file's mtime and inode ('-' when it is missing): what the cached model depends on. */ -function file_sig(path) { - let st = stat(path); - return st ? `${st.mtime}/${st.inode}` : '-'; -} - -function watch_model() { - // uci commits replace the file: a new inode even within the same second. - // Which servers are kept down (core.BLOCKED, written by apply) is in the - // model too: their interface names may be someone else's tunnels. - let sig = `${file_sig(CONFIG_FILE)} ${file_sig(core.BLOCKED)}`; - if (wm == null || sig != wm_sig) { - wm = core.load(); - wm_sig = sig; - wm_ifnames = live.tunnel_ifnames(wm); - wm_windows = live.online_windows(wm); - wm_ka = link.keepalive_sizes(wm); - } - return wm; -} - -// Per device: how its link behaves (dawnline.link: a few recent events and -// what is shown), and whether what is shown (link.json) or the set-up states -// (setup.json) changed since they were written. -let link_hist = {}, link_dirty = false, setup_dirty = false; - -/** - * A device's read into its link history: its set-up state follows at once - * (link.setup, a few compares unless something happened); it is classified - * again when something happened or link.CHECK_EVERY passed (its spans age). - * Returns the change in what is shown (link.settle: { from, to }), or null. - */ -function watch_link(id, dev, peer, now, on) { - let h = link_hist[id] ??= link.fresh(now); - let moved = false; - if (peer) - moved = link.observe(h, peer, now, wm_ka[id] ?? link.KEEPALIVE); - else - link.gone(h); - if (link.setup(h, now, on, moved)) - setup_dirty = true; - if (!moved && now - h.checked < link.CHECK_EVERY) - return null; - h.checked = now; - link.prune(h, now); - h.raw = link.classify(h, now, on); - let change = link.settle(h, h.raw, now, on); - if (change) - link_dirty = true; - return change; -} - -// The live meter: the last sample and the last two minutes of points -// ([ ts, JSON ], newest last, meter.keep), kept whether anyone looks or not so -// that a look gets them at once; whether meter.json is out for a look now. -let meter_prev = null, meter_ring = [], meter_out = false; - -/** - * A meter point a second from this read, kept; meter.json written while - * someone looks (meter.wanted): all the points the first second of a look, - * then with each new one. Once nobody does, the file goes; the points stay. - */ -function watch_meter(m, d, now) { - let s = meter.sample(m, d, now); - let p = meter_prev ? meter.point(meter_prev, s) : null; - meter_prev = s; - if (p) - meter.keep(meter_ring, p); - if (!meter.wanted(now)) { - if (meter_out) - meter.stop(); - meter_out = false; - return; - } - if (p || !meter_out) - meter.save(meter_ring); - meter_out = true; -} - -/** Move the revisions (all, and these people's) and save who is online. */ -function save_presence(people) { - rev++; - for (let pid in people) - person_rev[pid] = rev; - ensure_dir(RUN_DIR); - write_json(live.PRESENCE, { online: last_online, endpoint: last_endpoint, rev, people: person_rev }, 0o600); -} - -/* ---------- locations ---------- */ - -// A lookup run: this many addresses at most, within this many seconds; a run -// still going after GEO_KILL seconds (past every timeout) is given up. -const GEO_PER_RUN = 3; -const GEO_BUDGET = 12; -const GEO_KILL = 60; - -let last_home = 0; -// Addresses the watcher saw connect or roam that wait for a run. -let geo_pending = {}; -// The run in a child process (uloop.task) and when it started; null when none. -let geo_task = null, geo_since = 0; - -/** Every client address still shown on the map (the cache never pushes these out). */ -function geo_shown() { - let ips = []; - for (let id, rec in usage.devices) - for (let ip in keys(rec.ips ?? {})) - push(ips, ip); - return uniq(ips); -} - -/* - * A run's results: into the cache (the agent is its only writer), onto the - * connections in the activity log that were logged before their place was - * known, and to open pages at once: the revision moves for the people seen - * from those addresses. - */ -function geo_done(found) { - let cache = geo.load(); - if (type(found) != 'object' || !geo.merge(cache, found, geo_shown())) - return; - geo.save(cache); - let where = {}; - for (let ip, r in found) - if (r) - where[ip] = geo.label(r); - if (!length(keys(where))) - return; - let m = watch_model(), people = {}; - for (let id, rec in usage.devices) - for (let ip in keys(where)) - if (rec.ips?.[ip] && m.devices[id]) - people[m.devices[id].person] = true; - live.set_places(where, time() - 3600); - save_presence(keys(people)); -} - -/* - * Locate client addresses for the admin map in a child process: a lookup - * waits on the network for seconds, and neither the 1-second watcher nor the - * tick may wait with it. Addresses that just connected go first, at once - * (the watcher calls this on a connect); the tick adds anything still shown - * that is missing or stale (`more`). One run at a time, a few addresses each; - * what just connected and did not fit waits for the next run. - */ -function geo_lookup(m, more) { - if (!m.settings.geo_enabled) { - geo_pending = {}; - return; - } - if (geo_task && !geo_task.finished()) { - if (time() - geo_since < GEO_KILL) - return; - geo_task.kill(); - } - geo_task = null; - let todo = geo.stale(geo.load(), [ ...keys(geo_pending), ...(more ?? []) ]); - let want = slice(todo, 0, GEO_PER_RUN); - let rest = {}; - for (let ip in slice(todo, GEO_PER_RUN)) - if (geo_pending[ip]) - rest[ip] = true; - geo_pending = rest; - if (!length(want)) - return; - let provider = m.settings.geo_provider; - let t = null; - t = uloop.task(() => { - // The child shares the instance lock: it must not keep it past the agent (a restart would find it taken). - instance.close(); - return geo.lookup_all(provider, want, GEO_PER_RUN, GEO_BUDGET); - }, (found) => { - if (geo_task == t) - geo_task = null; - geo_done(found); - if (length(keys(geo_pending))) - geo_lookup(watch_model()); - }); - geo_task = t; - geo_since = time(); -} - -/** The tick: shown addresses missing or stale get a run; the router's own place about hourly. */ -function check_geo(m) { - geo_lookup(m, geo_shown()); - if (!m.settings.geo_enabled || time() - last_home <= 3600) - return; - last_home = time(); - let cache = geo.load(); - let wan = live.iface_status('wan')?.['ipv4-address']?.[0]?.address; - if (geo.resolve_home(m.settings, cache, wan)) - geo.save(cache); -} - -function place_of(ip) { - return geo.label(geo.place(geo.load(), ip)); -} - -/* - * One look at the tunnels. Connects (a new handshake from a device that was - * away), disconnects (its session expired: no handshake within its online - * window, live.online_window; a phone asleep looks the same as one switched - * off, so silence alone is not enough) and roaming (a new address) are acted - * on at once: the log, the counters and the map, then the revision the UI polls. - * Only Dawnline's own tunnels are read, each on its own (one process with a - * single server): a tunnel that could not be read says nothing about its - * devices, which stay as they were. - */ -function watch() { - let m = watch_model(); - let d = awg.dump(wm_ifnames); - let now = time(); - for (let ifn, r in d.reads) { - if (r == 'error') - continue; - let ix = d.ifaces[ifn]?.ifindex; - if (ifn in links && links[ifn] != ix) - grace[ifn] = now + RESTART_GRACE; - links[ifn] = ix; - } - for (let ifn in keys(links)) - if (!(ifn in d.reads)) { - delete links[ifn]; - delete grace[ifn]; - } - let events = [], people = {}, ips = [], failing = []; - for (let id, dev in m.devices) { - let ifn = m.servers[m.people[dev.person]?.server]?.ifname; - if (d.reads[ifn] == 'error') - continue; - let peer = d.peers[dev.public_key]; - let ep = ''; - // New keys: offline until they shake hands, and a new link history. The - // old one's set-up session (its no data, or its data flowing) and its - // answers would otherwise be taken for the new configuration's. - if (last_key[id] != dev.public_key) { - if (last_key[id] != null) { - last_hs[id] = 0; - let h = link_hist[id]; - if (h?.state != null) { - link_dirty = true; - people[dev.person] = true; - } - if (h?.setup != null) - setup_dirty = true; - delete link_hist[id]; - } - last_key[id] = dev.public_key; - } - if (peer) { - last_hs[id] = max(last_hs[id] ?? 0, peer.handshake); - ep = live.endpoint_ip(peer.endpoint); - } - // Not in the tunnel (turned off, paused, out of time or data): offline now, and online - // again only with a new handshake, not the one remembered from before. Unless its - // tunnel was just set up again and the sync has not brought it back yet. - else if (!(grace[ifn] > now)) - last_hs[id] = 0; - let on = last_hs[id] > 0 && now - last_hs[id] < (wm_windows[id] ?? live.ONLINE_WINDOW); - let was = last_online[id]; - // What is shown changed: the person's pages read it again (link.json), also - // when it cleared without an event (the device stopped trying, or was paused). - let change = watch_link(id, dev, peer, now, on); - if (change) { - people[dev.person] = true; - let le = link.event_for(change, dev, on); - if (le) - push(failing, le); - } - // One configuration on two devices: its address goes back and forth all - // the time, which is no roaming (nor a reason to move the revision). - let flapping = link_hist[id].raw == 'shared' || link_hist[id].state == 'shared'; - if (on && !was) { - push(events, { type: 'connect', person: dev.person, device: id, detail: ep }); - push(ips, ep); - } - else if (!on && was) - push(events, { type: 'disconnect', person: dev.person, device: id }); - else if (on && ep && last_endpoint[id] && ep != last_endpoint[id] && !flapping) { - push(events, { type: 'roam', person: dev.person, device: id, detail: `${last_endpoint[id]} → ${ep}` }); - push(ips, ep); - } - if (on != !!was || (ep && ep != last_endpoint[id] && !flapping)) - people[dev.person] = true; - last_online[id] = on; - if (ep) - last_endpoint[id] = ep; - } - for (let id in keys(last_online)) - if (!m.devices[id]) { - delete last_online[id]; - delete last_endpoint[id]; - delete last_hs[id]; - delete last_key[id]; - } - for (let id in keys(link_hist)) - if (!m.devices[id]) { - if (link_hist[id].state != null) - link_dirty = true; - if (link_hist[id].setup != null) - setup_dirty = true; - delete link_hist[id]; - } - if (link_dirty) { - write_json(live.LINK, link.shown(link_hist), 0o600); - link_dirty = false; - } - // The portal's set-up sheet polls for it: no revision moves with it. - if (setup_dirty) { - write_json(live.SETUP, link.setups(link_hist), 0o600); - setup_dirty = false; - } - // Merged per device for an hour: a link that keeps failing and coming back is one line. - for (let e in failing) - live.add_event_merged(e, 3600); - watch_meter(m, d, now); - if (!length(keys(people))) - return; - save_presence(keys(people)); - if (!length(events)) - return; - live.collect(m, usage, d); - live.save_usage(usage, false); - // The event carries the place when the cache already knows it. A new - // address is looked up at once, in a child process (geo_lookup): its place - // goes onto this event and the revision moves again when it is known. - for (let e in events) - if (e.type == 'connect') - e.where = place_of(e.detail); - live.add_events(map(events, (e) => e.type == 'disconnect' ? e : named(e)), live.policy(m.settings.retention)); - save_presence(keys(people)); - if (m.settings.geo_enabled && length(ips)) { - for (let ip in ips) - geo_pending[ip] = true; - geo_lookup(m); - } -} - -// What the service log was already told. On flash: the public address often -// changes with a reboot (PPPoE), and that is when it matters. Written rarely. -const NOTES = `${DATA_DIR}/notes.json`; -let notes = read_json(NOTES, {}); -let last_cert_check = 0; - -function note(k, v) { - notes[k] = v; - ensure_dir(DATA_DIR, 0o700); - write_json(NOTES, notes, 0o600); -} - -/* - * End dates in the activity log: a heads-up once per end date when its - * warning window opens, and "keep access" passing it (which changes no - * state, so nothing else would say it). Not on a clock that is not set. - */ -function check_expiry(m, events) { - let ts = time(); - if (localtime(ts).year < 2025) - return; - for (let id, p in m.people) { - if (!p.expires) - continue; - let end = date_end(p.expires); - if (end == null) - continue; - let left = end > ts ? int((end - ts) / 86400) + 1 : 0; - if (left > 0 && p.expire_warn > 0 && left <= p.expire_warn && notes[`warned:${id}`] != p.expires) { - note(`warned:${id}`, p.expires); - push(events, { type: 'expiring', person: id, detail: `${left} day${left == 1 ? '' : 's'}` }); - } - if (left == 0 && p.expire_action == 'notify' && notes[`kept:${id}`] != p.expires) { - note(`kept:${id}`, p.expires); - push(events, { type: 'expired_kept', person: id, detail: p.expires }); - } - } -} - -/** "Jan 1 2027" from the certificate, or null. */ -function cert_end(path) { - let m = match(sh_out(`openssl x509 -enddate -noout -in ${q(path)} 2>/dev/null`) ?? '', /notAfter=([A-Za-z]+) +([0-9]+) [0-9:]+ ([0-9]+)/); - return m ? `${m[1]} ${m[2]} ${m[3]}` : null; -} - -function check_cert(m) { - if (!m.settings.portal_enabled) - return; - let c = pc.portal_cert(m.settings); - let mt = stat(c.cert)?.mtime; - if (cert_mtime != null && mt != null && mt != cert_mtime) { - slog('portal', 'up', sprintf(L_('certificate renewed · valid until %s'), cert_end(c.cert) ?? '?'), null, L_('Personal portal')); - system('/etc/init.d/dawnline reload >/dev/null 2>&1 &'); - } - cert_mtime = mt; - // Running out soon (ACME did not renew it): once per certificate, checked hourly. - if (mt == null || c.self_signed || time() - last_cert_check < 3600) - return; - last_cert_check = time(); - if (notes.cert_warned != mt && system(`openssl x509 -checkend 604800 -noout -in ${q(c.cert)} >/dev/null 2>&1`) != 0) { - let end = cert_end(c.cert); - slog('portal', 'error', end ? sprintf(L_('certificate expires %s'), end) : L_('certificate expires within 7 days'), - L_('Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings.'), L_('Personal portal')); - note('cert_warned', mt); - } -} - -/** - * The router's public IPv4 changed. Devices whose configuration holds the - * address itself (a server's public address is an IP) cannot connect until - * they get a new one; with a hostname only the DNS record must follow. - */ -function check_wan(m) { - let srv = filter(values(m.servers), (x) => x.enabled && x.private_key)[0]; - let ip = srv ? net.wan_address(srv) : null; - if (!ip || ip == notes.wan) - return; - let was = notes.wan; - note('wan', ip); - if (!was) - return; - let stuck = map(filter(values(m.servers), (x) => core.endpoint_host(m, x) == was), (x) => x.name); - if (length(stuck)) - slog('dawnline', 'error', sprintf(L_('public address changed · %s → %s'), was, ip), - sprintf(length(stuck) == 1 - ? L_('%s still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.') - : L_('%s still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.'), - join(', ', stuck)), L_('Router')); - else - slog('dawnline', 'info', sprintf(L_('public address changed · %s → %s'), was, ip), null, L_('Router')); -} - -let last_backup_day = null; - -function nightly_backup() { - let t = localtime(); - if (t.hour != 3 || last_backup_day == t.mday) - return; - last_backup_day = t.mday; - let sum = sh_out('md5sum /etc/config/dawnline | cut -d" " -f1'); - let st = read_json(`${DATA_DIR}/backup-state.json`, {}); - if (sum && sum != st.auto) { - try { - 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). - slog('dawnline', 'error', sprintf(L_('nightly backup failed: %s'), e.message), null, L_('Backup')); - } - } -} - -/** - * Settings → Updates: an automatic check or update when one is due. The - * updater does the work in its own process; this only decides when. - */ -function check_updates(m) { - if (upd.due(m.settings.updates, upd.auto_state()) && !upd.busy()) - system('start-stop-daemon -S -b -x /usr/libexec/dawnline/updater -- auto'); -} - -/** - * Traffic history resets requested from LuCI (rpcd cannot touch the - * counters this process holds in memory). Applied, then saved to flash. - */ -function check_usage_reset(m) { - let path = `${RUN_DIR}/usage.reset`; - let req = read_json(path, null); - if (req == null) - return false; - unlink(path); - for (let r in (type(req) == 'array' ? req : [ req ])) { - live.reset_usage(usage, m, r.scope, r.id); - } - return true; -} - -/* - * Push devices and access rules when people's states changed, the config - * file was written (by anyone: rpcd, the portal, the CLI, a restore), the - * access table is gone (a flushed ruleset: the firewall alone would let every - * device reach everything, so the sync unloads them until it is back), a - * running tunnel holds other devices than it should (check_peers), or every - * RESYNC_EVERY seconds anyway. apply.sync reads the model again itself. - */ -function sync_runtime(t) { - // uci commits replace the file: a new inode even within the same second. - let st = stat(CONFIG_FILE); - let mt = st ? `${st.mtime}/${st.inode}` : null; - let changed = last_states == null || sprintf('%J', t.states) != sprintf('%J', last_states) || - (conf_mtime != null && mt != conf_mtime); - if (changed || time() - last_sync > RESYNC_EVERY || (length(t.m.servers) && !apply.table_present())) { - last_peers = apply.sync(t.m, usage).peers ?? {}; - last_sync = time(); - } - conf_mtime = mt; - last_states = t.states; -} - -/* - * A running tunnel without all of its devices, or with ones it should not - * have (set up again before its hotplug sync ran, an `awg set` by hand): the - * sync runs on this tick, not up to RESYNC_EVERY later. By the same choice - * of devices the sync makes (and Health compares); only where the agent's - * last sync took: a server that refuses its devices has said so in the - * service log and keeps the slower pace. - */ -function check_peers(t) { - for (let id, srv in t.m.servers) { - let last = last_peers[id] ?? 'ok'; - if (t.dmp?.reads?.[srv.ifname] != 'read' || (last != 'ok' && last != 'down')) - continue; - let diff = awg.peer_diff(awg.tunnel_devices(t.m, id, t.states), t.dmp, srv.ifname); - if (diff.missing || diff.extra) - last_sync = 0; - } -} - -/* - * The router's network changed under us: re-derive everything. Only a change - * seen on two ticks in a row (a bridge recreated or an interface restarting - * passes), compared with what the last apply() used. - */ -function check_network(t) { - let sig = apply.net_signature(t.m); - let applied = readfile(apply.NET_SIG) ?? base_net; - if (applied == null || sig == applied) { - base_net ??= sig; - pending_net = null; - return; - } - if (pending_net != sig) { - pending_net = sig; - return; - } - pending_net = null; - slog('dawnline', 'info', L_('network changed - Dawnline set itself up again'), null, L_('Router')); - apply.apply(); - base_net = readfile(apply.NET_SIG) ?? apply.net_signature(core.load()); -} - -/* - * One tick is a list of steps, each on its own: a failing step is logged - * (each new message once in the service log, every time in syslog) and the - * others still run. Steps that need the model wait for it; the counters and - * the logs are saved at the end whatever happened. - */ -const STEPS = [ - { who: 'Dawnline', run: (t) => { - t.m = core.load(); - t.pol = live.policy(t.m.settings.retention); - } }, - { who: L_('Traffic'), run: (t) => { - t.reset = check_usage_reset(t.m); - t.dmp = live.dump(t.m); - live.collect(t.m, usage, t.dmp); - } }, - { who: L_('Speed'), quiet: true, run: (t) => record_rate(t.m) }, - { who: L_('People'), run: (t) => { - t.states = apply.states_for(t.m, usage); - check_people(t.m, t.states, t.events); - check_expiry(t.m, t.events); - } }, - { who: L_('Access rules'), run: (t) => { - if (!t.states) - return; - check_peers(t); - sync_runtime(t); - } }, - // Tunnels going down and up are in the service log (hotplug, watchdog), with names and reasons. - { who: L_('Activity'), run: (t) => { - live.add_events(t.events, t.pol); - // Pauses and resumes on their own: the UI shows them without waiting for its next poll. - if (length(t.events)) - save_presence(uniq(map(filter(t.events, (e) => e.person), (e) => e.person))); - } }, - { who: L_('Internet like a home device'), run: (t) => apply.sync_loop(t.m, usage) }, - { who: L_('Router'), run: check_network }, - { who: L_('Watchdog'), run: (t) => watchdog.run(core.load()) }, - { who: L_('Personal portal'), run: (t) => check_cert(t.m) }, - { who: L_('Router'), quiet: true, run: (t) => check_wan(t.m) }, - { who: L_('Backup'), run: (t) => nightly_backup() }, - { who: 'updates', quiet: true, run: (t) => check_updates(t.m) }, - { who: 'geo', quiet: true, run: (t) => check_geo(t.m) }, -]; - -// Step → the last error it logged (cleared when it works again). -let step_err = {}; - -function step(i, s, fn) { - try { - fn(); - delete step_err[i]; - } - catch (e) { - // 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; - } -} - -function tick() { - ensure_dir(RUN_DIR); - writefile(watchdog.BEAT, `${time()}`); - // A restore or import put other counters on flash (dawnline.backup leaves - // a marker): start over from them, whatever the watcher wrote since. - if (stat(live.USAGE_RELOAD)) { - unlink(live.USAGE_RELOAD); - usage = live.load_usage(true); - } - else if (!stat(`${RUN_DIR}/usage.json`) && usage.updated) - usage = live.load_usage(); - let t = { m: null, pol: null, reset: false, events: [], dmp: null }; - for (let i, s in STEPS) - if (i == 0 || t.m) - step(i, s, () => s.run(t)); - - let persist = t.reset || time() - last_flush >= FLUSH_EVERY; - step('save', { who: L_('Traffic') }, () => { - live.save_usage(usage, persist); - if (persist) { - last_flush = time(); - geo.flush(); - } - }); - step('slog', { who: 'Dawnline', quiet: true }, () => slog_trim(persist)); - step('events', { who: L_('Activity') }, () => { - let pol = t.pol ?? live.policy(); - if (pol.persist == 'off' || time() - last_log_flush >= LOG_FLUSH[pol.persist]) { - live.persist_events(pol); - last_log_flush = time(); - } - }); -} - -// 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(); - slog_trim(true); - // The live meter's file goes with it: a stopped agent's points are no speed now. - meter.stop(); - // A clean stop: the next start is not a crash. - unlink(watchdog.BEAT); -} - -// Why this start: the heartbeat file outlives an agent that died (crash, out -// of memory, kill -9); the init script notes a stop; the version on flash -// changes with an update; a fresh uptime means the router just booted. -let crashed = stat(watchdog.BEAT) != null; -let stopped = +(readfile(`${RUN_DIR}/agent.stopped`) ?? 0); -unlink(`${RUN_DIR}/agent.stopped`); -let was = trim(readfile(`${DATA_DIR}/version`) ?? ''); -if (was != VERSION) { - ensure_dir(DATA_DIR, 0o700); - writefile(`${DATA_DIR}/version`, VERSION); -} -slog_restore(); -// postupdate put this (kept) version back because the new one did not come up. -let rolled = trim(readfile(`${RUN_DIR}/update-rolled-back`) ?? ''); -unlink(`${RUN_DIR}/update-rolled-back`); -if (rolled) - slog('dawnline', 'error', sprintf(L_('update to %s failed its check - rolled back to %s'), rolled, VERSION), - L_('The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why.'), 'Dawnline'); -else if (was && was != VERSION) - slog('dawnline', 'up', sprintf(L_('updated · %s → %s'), was, VERSION), null, 'Dawnline'); -else if (crashed) - slog('dawnline', 'repair', L_('stopped unexpectedly - started again'), - // Why, when syslog knows: procd, the kernel (out of memory, segfault), ucode errors. - sh_out('logread -l 400 2>/dev/null | grep -iE "kernel:.*(out of memory|killed process|oom-kill|segfault)|procd:.*dawnline|dawnline/agent" | tail -n 6'), 'Dawnline'); -else if (stopped && time() - stopped < 300) - slog('dawnline', 'info', sprintf(L_('restarted · version %s'), VERSION), null, 'Dawnline'); -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(); - -uloop.init(); - -let timer; -timer = uloop.timer(1000, function() { - try { - tick(); - } - catch (e) { - slog('dawnline', 'error', sprintf(L_('background check failed: %s'), e.message), e.stacktrace?.[0]?.context, 'Dawnline'); - } - timer.set(TICK); -}); - -let watcher; -watcher = uloop.timer(WATCH, function() { - step('watch', { who: L_('Connections') }, watch); - watcher.set(WATCH); -}); - -if (type(uloop.signal) == 'function') { - uloop.signal('TERM', () => { shutdown(); uloop.end(); }); - uloop.signal('INT', () => { shutdown(); uloop.end(); }); -} - -uloop.run(); -shutdown(); diff --git a/package/luci-app-dawnline/root/usr/libexec/dawnline/fetch-backend b/package/luci-app-dawnline/root/usr/libexec/dawnline/fetch-backend new file mode 100755 index 0000000..2b374c6 --- /dev/null +++ b/package/luci-app-dawnline/root/usr/libexec/dawnline/fetch-backend @@ -0,0 +1,86 @@ +#!/bin/sh +# Dawnline — put the Go backend's binary (dawnlined) for this router in place. The package is the same for +# every architecture, so the binary is a release file of its own (dawnlined--), fetched +# from the release of the installed version and kept only when it matches the sha256 GitHub's API gives. +# +# fetch-backend [version] version: the package's own when not given +# +# Exit 0: the binary of that version is in place, or this architecture has none (the router then runs on +# the ucode backend, and a binary of another version is removed). Exit 1: it could not be fetched; a binary +# of another version is removed all the same, so two versions never run side by side. +# Plain shell on purpose, like postupdate: it runs when no backend does. +REPO="${DAWNLINE_REPO:-tickcount/luci-app-dawnline}" +API="${DAWNLINE_API:-https://api.github.com}" +BIN=/usr/libexec/dawnline/dawnlined +ver="${1:-$(cat /usr/share/dawnline/version 2>/dev/null)}" +ver="$(printf '%s' "$ver" | tr -cd 'A-Za-z0-9.-')" + +say() { logger -t dawnline -p "daemon.$1" "[$2] [backend] $3"; } + +[ -n "$ver" ] || { say err error "the installed version is not known: no binary fetched"; exit 1; } +[ -x "$BIN" ] && [ "$("$BIN" -version 2>/dev/null)" = "$ver" ] && exit 0 + +# A binary of another version (or one that does not run here) must not serve this version's pages. +drop() { [ -e "$BIN" ] && rm -f "$BIN" && say notice info "the backend's binary of another version was removed"; } + +arch="$(sed -n "s/^DISTRIB_ARCH='\(.*\)'/\1/p" /etc/openwrt_release 2>/dev/null)" +case "$arch" in +aarch64_*) goarch=arm64 ;; +x86_64) goarch=amd64 ;; +mipsel_*) goarch=mipsle ;; +mips_*) goarch=mips ;; +arm_cortex-a*) goarch=arm ;; +*) goarch= ;; +esac +if [ -z "$goarch" ]; then + drop + say notice info "no backend is built for $arch: Dawnline runs without it" + exit 0 +fi + +fail() { + drop + say err error "the backend $ver could not be put in place: $1 · Dawnline runs without it until it can (tried again at the next start)" + rm -rf "$tmp" + exit 1 +} + +tmp="$(mktemp -d /tmp/dawnline-backend.XXXXXX)" || exit 1 +get() { # get URL FILE [ACCEPT] + if command -v curl >/dev/null 2>&1; then + curl -fsSL --connect-timeout 15 --max-time 300 ${3:+-H "Accept: $3"} -o "$2" "$1" 2>/dev/null + else + uclient-fetch -q -T 30 ${3:+--header="Accept: $3"} -O "$2" "$1" 2>/dev/null + fi +} + +asset="dawnlined-$ver-$goarch" +# The release as the API gives it: the file's id (downloaded through the API, whose answer is short: the +# redirect github.com gives for a release file can outgrow uclient-fetch's header buffer) and its sha256. +found= +for tag in "v$ver" "$ver"; do + get "$API/repos/$REPO/releases/tags/$tag" "$tmp/release.json" && found=1 && break +done +[ -n "$found" ] || fail "GitHub does not answer, or has no release $ver" +id="$(jsonfilter -i "$tmp/release.json" -e "@.assets[@.name='$asset'].id" 2>/dev/null)" +want="$(jsonfilter -i "$tmp/release.json" -e "@.assets[@.name='$asset'].digest" 2>/dev/null | sed -n 's/^sha256:\([0-9a-f]\{64\}\)$/\1/p')" +[ -n "$id" ] || { drop; say notice info "release $ver has no backend for $arch: Dawnline runs without it"; rm -rf "$tmp"; exit 0; } +[ -n "$want" ] || fail "the release publishes no sha256 for $asset" + +# Room for it twice over: the download in memory, the file on flash. +free="$(df -Pk /usr/libexec/dawnline 2>/dev/null | awk 'NR==2 { print $4 }')" +size="$(jsonfilter -i "$tmp/release.json" -e "@.assets[@.name='$asset'].size" 2>/dev/null)" +if [ -n "$free" ] && [ -n "$size" ] && [ "$free" -lt $((size / 1024 + 1024)) ]; then + fail "not enough free space ($((free / 1024)) MB free, $((size / 1048576 + 1)) MB needed)" +fi + +get "$API/repos/$REPO/releases/assets/$id" "$tmp/dawnlined" application/octet-stream || fail "the download failed" +got="$(sha256sum "$tmp/dawnlined" 2>/dev/null | cut -d' ' -f1)" +[ "$got" = "$want" ] || fail "the file does not match the release's sha256" +chmod 755 "$tmp/dawnlined" +[ "$("$tmp/dawnlined" -version 2>/dev/null)" = "$ver" ] || fail "the binary does not run on this router, or is another version" +# Beside its place first, then renamed: a binary is never half there. +cp "$tmp/dawnlined" "$BIN.new" && chmod 755 "$BIN.new" && mv -f "$BIN.new" "$BIN" || { rm -f "$BIN.new"; fail "it could not be written"; } +rm -rf "$tmp" +say notice info "the backend $ver ($goarch) is in place · sha256 matches the release" +exit 0 diff --git a/package/luci-app-dawnline/root/usr/libexec/dawnline/heartbeat b/package/luci-app-dawnline/root/usr/libexec/dawnline/heartbeat deleted file mode 100755 index 22b61d2..0000000 --- a/package/luci-app-dawnline/root/usr/libexec/dawnline/heartbeat +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Cron, every 5 minutes: the watchdog lives in the agent, so this looks after -# the agent itself: ends any copy that isn't procd's, and kills procd's when it -# runs but has stopped ticking (procd starts it again; that part is off with -# the watchdog, Health → Watchdog). -pid="$(ubus call service list '{"name":"dawnline"}' 2>/dev/null | jsonfilter -q -e '@.dawnline.instances.agent.pid')" - -# Only procd's agent: any other copy (started by hand, or left by an older version that let -# it start) runs stale code beside it, with its own events and syncs. Always ended. -for p in $(pgrep -f '^/usr/bin/ucode /usr/libexec/dawnline/agent'); do - [ "$p" = "$pid" ] || kill -9 "$p" 2>/dev/null -done - -[ "$(uci -q get dawnline.settings.watchdog)" = 0 ] && exit 0 -[ -n "$pid" ] && [ -r "/proc/$pid/stat" ] || exit 0 - -now="$(date +%s)" -last="$(cat /var/run/dawnline/agent.beat 2>/dev/null)" -# Seconds the agent has been running: uptime minus its start time (field 22, in 1/100 s). -age="$(awk -v up="$(cut -d. -f1 /proc/uptime)" '{ print up - int($22 / 100) }' "/proc/$pid/stat")" -[ "${age:-0}" -gt 300 ] || exit 0 -[ $((now - ${last:-0})) -gt 300 ] || exit 0 - -kill -9 "$pid" -# Logged here; the restarted agent should not report a crash as well. -rm -f /var/run/dawnline/agent.beat -if [ -n "$last" ]; then detail="No check for $((now - last)) s." -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 -p daemon.warning "[warn] [agent] Dawnline $msg - $detail" diff --git a/package/luci-app-dawnline/root/usr/libexec/dawnline/postupdate b/package/luci-app-dawnline/root/usr/libexec/dawnline/postupdate index f7619d1..c4caaf2 100755 --- a/package/luci-app-dawnline/root/usr/libexec/dawnline/postupdate +++ b/package/luci-app-dawnline/root/usr/libexec/dawnline/postupdate @@ -1,10 +1,10 @@ #!/bin/sh # Dawnline — after its own package was replaced: restart, check that the new -# version answers (the LuCI link and the agent), and put the kept previous -# version back when it does not. Started detached by the updater +# version answers (its backend, on the bus and as a process), and put the kept +# previous version back when it does not. Started detached by the updater # (usr/libexec/dawnline/updater) with the version being installed. # postupdate -# Plain shell on purpose: a release whose ucode does not compile cannot check +# Plain shell on purpose: a release whose backend does not start cannot check # or repair itself, and the admin cannot click Roll back in a page that this # same backend serves. RUN=/var/run/dawnline @@ -12,6 +12,9 @@ KEEP=/etc/dawnline/keep/app to="${1:-?}" sleep 2 +# The backend's binary of the new version, before anything of it starts: a binary of another version is +# removed even when the new one cannot be fetched (the service then runs on the ucode backend). +/usr/libexec/dawnline/fetch-backend "$to" /dev/null 2>&1 # LuCI reads a language's catalogs once per web server: a replaced translation # needs a fresh one, before the new version answers and the page reloads. ls /usr/lib/lua/luci/i18n/dawnline.*.lmo >/dev/null 2>&1 && /etc/init.d/uhttpd restart >/dev/null 2>&1 @@ -19,9 +22,9 @@ ls /usr/lib/lua/luci/i18n/dawnline.*.lmo >/dev/null 2>&1 && /etc/init.d/uhttpd r /etc/init.d/dawnline restart >/dev/null 2>&1 up() { - ubus list luci.dawnline >/dev/null 2>&1 || return 1 - ubus -t 10 call luci.dawnline rev >/dev/null 2>&1 || return 1 - pgrep -f '^/usr/bin/ucode /usr/libexec/dawnline/agent' >/dev/null 2>&1 + ubus list dawnline >/dev/null 2>&1 || return 1 + [ "$(ubus -t 10 call dawnline hello 2>/dev/null | jsonfilter -q -e '@.version')" = "$to" ] || return 1 + pgrep -f '^/usr/libexec/dawnline/dawnlined ' >/dev/null 2>&1 } i=0 @@ -31,7 +34,7 @@ while [ "$i" -lt 12 ]; do up && exit 0 done -logger -t dawnline -p daemon.err "[error] [update] 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: the backend is not up, or is not that version" set -- for f in "$KEEP"/*.ipk "$KEEP"/*.apk; do [ -f "$f" ] && set -- "$@" "$f" @@ -45,10 +48,12 @@ if command -v apk >/dev/null 2>&1; then else opkg install --force-reinstall --force-downgrade "$@" >/dev/null 2>&1 fi +# and the backend that goes with the version put back (its own, by the package's files) +/usr/libexec/dawnline/fetch-backend /dev/null 2>&1 /etc/init.d/rpcd restart >/dev/null 2>&1 /etc/init.d/dawnline restart >/dev/null 2>&1 mkdir -p "$RUN" -# The restored agent reports it in the service log on its start. +# The restored backend reports it in the service log on its start. echo "$to" > "$RUN/update-rolled-back" logger -t dawnline -p daemon.warning "[warn] [update] rolled back from $to to the kept version" exit 0 diff --git a/package/luci-app-dawnline/root/usr/libexec/dawnline/updater b/package/luci-app-dawnline/root/usr/libexec/dawnline/updater index b762a3a..f8a82b0 100755 --- a/package/luci-app-dawnline/root/usr/libexec/dawnline/updater +++ b/package/luci-app-dawnline/root/usr/libexec/dawnline/updater @@ -1,375 +1,9 @@ -#!/usr/bin/ucode -// Dawnline background update worker, started detached by luci.dawnline and -// by the agent (automatic runs). -// -// updater check [app|amneziawg|packages] -// updater install app | app@ | app:reinstall | app:rollback -// updater install amneziawg[:auto|slava|grey[:ru]] | amneziawg:rollback -// updater install pkgs: -// updater auto (Settings → Updates: check, then install) -// -// One job at a time: the job holds the update lock (dawnline.updates) until -// it exits. Progress: /var/run/dawnline/update-job.json; check results: -// /var/run/dawnline/update-check.json. The Components tab polls both. The -// components themselves are dawnline.upd_app, upd_awg and upd_pkgs. -'use strict'; - -import * as fs from 'fs'; -import { slog, read_json, write_json, ensure_dir, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as upd from 'dawnline.updates'; -import * as app from 'dawnline.upd_app'; -import * as awg from 'dawnline.upd_awg'; -import * as pkgs from 'dawnline.upd_pkgs'; -import * as i18n from 'dawnline.i18n'; -import { _, L_ } from 'dawnline.i18n'; - -const USAGE = `Usage: - updater check [app|amneziawg|packages] - updater install app | app@ | app:reinstall | app:rollback - updater install amneziawg[:auto|slava|grey[:ru]] | amneziawg:rollback - updater install pkgs: - updater auto -`; - -// No command, one it doesn't know, or an install of nothing: the usage and exit, before anything is read or -// written (no job for Components, no history, nothing in the service log). Asked for help: the same, on stdout. -if (index([ '-h', '--help', 'help' ], ARGV[0]) >= 0) { - print(USAGE); - exit(0); -} -if (index([ 'check', 'install', 'auto' ], ARGV[0]) < 0 || (ARGV[0] == 'install' && !length(ARGV[1] ?? ''))) { - warn(USAGE); - exit(2); -} - -// The phases and errors of a job LuCI started are in the admin's language (rpc/updates.uc hands it over). -i18n.use(getenv('DAWNLINE_LANG')); - -const PID = +split(fs.readfile('/proc/self/stat') ?? '0', ' ')[0]; -const POL = core.load().settings.updates; -const CHECKS = { app: app.check, amneziawg: awg.check, packages: pkgs.check }; -const INSTALLS = { app: app.install, amneziawg: awg.install, pkgs: pkgs.install }; -// Names in the service log (English there, like the rest of it); the phases are checking() and updating(). -const WHO = { app: 'Dawnline', amneziawg: 'AmneziaWG', pkgs: L_('System packages'), packages: L_('System packages') }; - -let job = { - id: `${time()}-${PID}`, action: ARGV[0], component: ARGV[1] ?? null, state: 'running', started: time(), finished: null, - pid: PID, auto: false, phase: '', from: null, to: null, log: [], error: null, result: null, -}; -// An automatic run only shows up as a job once it installs something. -let quiet = ARGV[0] == 'auto'; -// What to restart once the job is over (never in the middle of it). -let after = {}; - -function save() { - if (!quiet) - write_json(upd.JOB_FILE, job, 0o644); -} - -function log(msg) { - let t = localtime(); - push(job.log, sprintf('%02d:%02d:%02d %s', t.hour, t.min, t.sec, msg)); - if (length(job.log) > 400) - splice(job.log, 0, length(job.log) - 400); - save(); -} - -function phase(p) { - job.phase = p; - log(p); -} - -/** A command, its output in the log: { code, out }. */ -function run(cmd) { - let p = fs.popen(cmd + ' 2>&1', 'r'); - if (!p) - return { code: 127, out: '' }; - let out = p.read('all') ?? ''; - let r = { code: p.close(), out }; - for (let line in split(trim(out), '\n')) - if (length(trim(line))) - log(` ${line}`); - return r; -} - -const ctx = { - pol: POL, - work: `/tmp/dawnline-update.${PID}`, - log, phase, run, save, - // An automatic run (nobody is watching: the previous version is always kept). - auto: () => job.auto, - versions: (from, to) => { - job.from = from; - job.to = to; - save(); - }, - after: (what) => after[what] = true, -}; - -/** The phase of a component's check (app, amneziawg, packages). */ -function checking(name) { - if (name == 'app') - return _('Checking Dawnline'); - if (name == 'amneziawg') - return _('Checking AmneziaWG'); - return _('Checking system packages'); -} - -/** The phase of a component's update (app, amneziawg, pkgs). */ -function updating(name) { - if (name == 'app') - return _('Updating Dawnline'); - if (name == 'amneziawg') - return _('Updating AmneziaWG'); - return _('Updating system packages'); -} - -/* ---------- check results ---------- */ - -function checks_file() { - return read_json(upd.CHECK_FILE, null)?.components ?? {}; -} - -/** Components' results into the check file (the others stay as they were). */ -function save_check(res) { - let c = read_json(upd.CHECK_FILE, null) ?? {}; - c.components ??= {}; - for (let k, v in res) - c.components[k] = { ...v, time: time() }; - c.time = time(); - write_json(upd.CHECK_FILE, c, 0o644); -} - -/** - * What a check found, as short names ("Dawnline 0.3.3", "2 system packages"): - * kept in the history and shown later, so English whatever the job's language. - */ -function found_in(res) { - let found = []; - if (res.app?.update) - push(found, `Dawnline ${res.app.latest}`); - if (res.amneziawg?.update && res.amneziawg.installed) - push(found, `AmneziaWG ${res.amneziawg.latest}`); - if (res.packages?.updates) - push(found, sprintf(res.packages.updates == 1 ? L_('%d system package') : L_('%d system packages'), res.packages.updates)); - return found; -} - -function run_checks(which) { - let res = {}; - for (let name in which) { - phase(checking(name)); - try { - res[name] = CHECKS[name](ctx); - } - catch (e) { - log(sprintf(_('Error: %s'), e.message)); - res[name] = { error: e.message, status: '' }; - } - } - save_check(res); - return res; -} - -/** One line in Activity per new finding (the same finding is not repeated). */ -function note_found(res, st, auto) { - let found = found_in(res); - let sig = join(', ', found); - if (length(found) && sig != st.announced) { - if (auto) - slog('dawnline', 'info', sprintf(L_('updates available · %s'), sig), null, L_('Components')); - upd.history_add({ kind: 'found', items: found, auto }); - } - st.announced = sig; -} - -/* ---------- installs ---------- */ - -/** A line in the service log for each finished update (Dawnline's own is logged by the new agent). */ -function log_update(name, r) { - if (name == 'amneziawg') { - let b = r?.before?.['kmod-amneziawg'], a = r?.after?.['kmod-amneziawg']; - slog('awg', 'up', b && a && b != a ? sprintf(job.auto ? L_('updated automatically · %s → %s') : L_('updated · %s → %s'), b, a) - : a ? sprintf(L_('installed the %s build · %s'), r?.build ?? '', a) : sprintf(L_('installed the %s build'), r?.build ?? ''), null, 'AmneziaWG'); - } - else if (name == 'pkgs' && length([ ...(r?.updated ?? []), ...(r?.installed ?? []) ])) - slog('dawnline', 'up', sprintf(job.auto ? L_('updated automatically · %s') : L_('updated · %s'), - join(', ', [ ...(r.updated ?? []), ...(r.installed ?? []) ])), null, L_('System packages')); -} - -function split_target(w) { - let i = index(w, ':'), at = index(w, '@'); - let cut = i < 0 ? at : at < 0 || i < at ? i : at; - if (cut < 0) - return [ w, null ]; - return [ substr(w, 0, cut), substr(w, cut + (substr(w, cut, 1) == ':' ? 1 : 0)) ]; -} - -function app_status(installed, latest) { - if (!latest) - return 'latest'; - let c = upd.version_cmp(installed, latest); - return c < 0 ? 'outdated' : c > 0 ? 'dev' : 'latest'; -} - -function install(what) { - job.result ??= {}; - for (let w in what) { - let t = split_target(w), name = t[0], arg = t[1]; - if (!INSTALLS[name]) - die(sprintf(_('Unknown component %s'), name)); - job.current = name; - phase(updating(name)); - let r = INSTALLS[name](ctx, arg); - job.result[name] = r; - log_update(name, r); - // Installed components are current now: no stale "Update available". - let c = checks_file(); - if (name == 'pkgs' && r.check) - save_check({ packages: r.check }); - else if (name == 'app' && r.to && c.app) { - let s = app_status(r.to, c.app.latest); - save_check({ app: { ...c.app, installed: r.to, update: s == 'outdated', status: s } }); - } - else if (name == 'amneziawg' && r.after) - save_check({ amneziawg: { ...(c.amneziawg ?? {}), installed: r.after['amneziawg-tools'], packages: r.after, - current: r.build ?? c.amneziawg?.current, update: false, status: 'latest' } }); - upd.history_add({ kind: 'install', component: w, from: r.from, to: r.to, state: 'done', auto: job.auto, - took: time() - job.started }); - delete job.current; - } -} - -/** Settings → Updates: check when due, install what is allowed (scheduled or right away). */ -function auto() { - let st = upd.auto_state(); - let what = upd.due(POL, st); - if (!what) - return; - let now = time(); - let res; - if (what == 'check' || now - (st.check ?? 0) >= 3600) { - res = run_checks(upd.TARGETS); - st.check = now; - note_found(res, st, true); - } - else - res = checks_file(); - if (what == 'install') - upd.mark_day(POL, st, now); - upd.auto_save(st); - if (!POL.auto || (what != 'install' && POL.mode != 'immediate')) - return; - let todo = []; - // Packages first, Dawnline last: it restarts rpcd and itself. - if (index(POL.targets, 'packages') >= 0 && res.packages?.updates) { - let names = filter(keys(res.packages.pkgs ?? {}), (p) => res.packages.pkgs[p].latest || length(res.packages.pkgs[p].with ?? [])); - if (length(names)) - push(todo, `pkgs:${join(',', names)}`); - } - let a = res.amneziawg; - if (index(POL.targets, 'amneziawg') >= 0 && a?.update && a.installed) { - // Only the same build, same generation: anything else needs a person to decide. - if (a.current && !a.gen_change) - push(todo, `amneziawg:${a.current}${a.ru ? ':ru' : ''}`); - else - slog('awg', 'info', a.latest ? sprintf(L_('%s needs a manual switch in Components'), a.latest) : L_('a new build needs a manual switch in Components'), null, 'AmneziaWG'); - } - if (index(POL.targets, 'app') >= 0 && res.app?.update) - push(todo, 'app'); - if (!length(todo)) - return; - quiet = false; - job.action = 'install'; - job.component = join(' ', todo); - job.auto = true; - job.log = []; - log(sprintf(_('Automatic update: %s'), join(', ', todo))); - install(todo); -} - -/** - * The restarts the job asked for, in one go, after its final state is saved. - * Dawnline's own package is restarted by postupdate, a shell that also checks - * the new version and rolls back to the kept one when it does not come up. - */ -function restarts() { - if (after.app) { - let to = replace(`${job.to ?? ''}`, /[^A-Za-z0-9.-]/g, ''); - system(`/usr/libexec/dawnline/postupdate '${to}' /dev/null 2>&1 &`); - return; - } - let cmds = []; - if (after.apply) - push(cmds, '/usr/bin/dawnline apply'); - // LuCI's own web server reads a language's catalogs once: a new translation needs a fresh one. - if (after.uhttpd || after.luci) - push(cmds, '/etc/init.d/uhttpd restart'); - if (after.apply || after.uhttpd) - push(cmds, '/etc/init.d/dawnline restart'); - if (length(cmds)) - system(`( sleep 2; ${join('; ', cmds)} ) /dev/null 2>&1 &`); -} - -/** The job the command line asks for, to its final state: done, or failed with the error in the log and the history. */ -function main() { - try { - if (job.action == 'check') { - let which = job.component ? [ job.component ] : upd.TARGETS; - for (let w in which) - if (!CHECKS[w]) - die(sprintf(_('Unknown component %s'), w)); - job.result = run_checks(which); - let st = upd.auto_state(); - note_found(job.result, st, false); - if (length(which) == length(upd.TARGETS)) - st.check = time(); - upd.auto_save(st); - } - else if (job.action == 'install') - install([ job.component ]); - else if (job.action == 'auto') - auto(); - else - die(USAGE); - job.state = 'done'; - phase(_('Finished')); - } - catch (e) { - quiet = false; - job.state = 'failed'; - job.error = e.message; - log(sprintf(_('Error: %s'), e.message)); - let name = job.current ?? split_target(split(job.component ?? '', ' ')[0])[0]; - if (job.action != 'check') { - slog(name == 'amneziawg' ? 'awg' : 'dawnline', 'error', job.auto ? L_('automatic update failed') : L_('update failed'), e.message, WHO[name] ?? 'Dawnline'); - upd.history_add({ kind: 'install', component: name, from: job.from, to: job.to, state: 'failed', auto: job.auto, error: e.message, - took: time() - job.started }); - } - else - upd.history_add({ kind: 'error', component: job.component ?? 'all', state: 'failed', error: e.message }); - } -} - -/* ---------- main ---------- */ - -ensure_dir(RUN_DIR); -// One job at a time (LuCI refuses a second one; an automatic run just skips its turn). -let LOCK = null; -for (let i = 0; i < 10 && !LOCK; i++) { - LOCK = upd.try_lock(); - if (!LOCK) - sleep(100); -} -if (!LOCK) - exit(0); -fs.mkdir(ctx.work, 0o700); -save(); -main(); - -system(`rm -rf '${ctx.work}'`); -job.finished = time(); -delete job.current; -save(); -restarts(); +#!/bin/sh +# Dawnline's background update worker (updater check|install|auto, see `updater help`): the backend's own +# (dawnlined updater, backend/updater). +b=/usr/libexec/dawnline/dawnlined +if [ -x "$b" ] && "$b" -version >/dev/null 2>&1; then + exec "$b" updater "$@" +fi +logger -t dawnline -p daemon.err "[error] [update] the backend is not on this router: nothing to update with" +exit 1 diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/cgi.uc b/package/luci-app-dawnline/root/usr/share/dawnline/portal/cgi.uc deleted file mode 100755 index 50792e5..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/cgi.uc +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/ucode -// Dawnline personal portal as a CGI script: the request handling itself is -// dawnline.portal. www/cgi-bin/portal (a shell) runs it for requests shaped -// like a personal link and answers the rest itself. -'use strict'; - -import { stdin } from 'fs'; -import { serve } from 'dawnline.portal'; - -let env = {}; -for (let k in [ 'REQUEST_METHOD', 'REQUEST_URI', 'REMOTE_ADDR', 'HTTPS', 'CONTENT_LENGTH', 'CONTENT_TYPE', - 'HTTP_HOST', 'HTTP_ORIGIN', 'HTTP_USER_AGENT', 'HTTP_ACCEPT', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_ACCEPT_ENCODING', - // The visitor behind Cloudflare (believed only when REMOTE_ADDR is Cloudflare's). - 'HTTP_CF_CONNECTING_IP' ]) - env[k] = getenv(k); - -serve({ - env, - headers: {}, - read: (n) => stdin.read(n), - write: (s) => print(s), -}); diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/www/cgi-bin/portal b/package/luci-app-dawnline/root/usr/share/dawnline/portal/www/cgi-bin/portal deleted file mode 100755 index 7f091b6..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/www/cgi-bin/portal +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# Dawnline personal portal, the door: uhttpd runs this for every request. -# Anything that is not shaped like a personal link (/[/…]) gets -# the portal's bare answer from here, in a shell that costs nothing, so a -# scanner or a flood on the root never starts ucode (compiling the portal's -# module graph is ~140 ms of CPU). Links go on to the portal itself -# (/usr/share/dawnline/portal/cgi.uc), which judges the code. -# -# The answer here is byte for byte the portal's own not_found(): keep both -# in step (dawnline.portal headers(), SECURITY_HEADERS, not_found()). - -path="${REQUEST_URI%%\?*}" -w='[a-z][a-z][a-z][a-z][a-z][a-z]' -# The expansion is meant as a pattern (a word of six letters), not literally. -# shellcheck disable=SC2254 -case "$path" in - /$w-$w-$w|/$w-$w-$w/*) exec /usr/bin/ucode /usr/share/dawnline/portal/cgi.uc ;; -esac - -# HSTS pins the whole name: only when the visitor is on the standard port. -hsts= -if [ "$HTTPS" = on ]; then - port="${HTTP_HOST##*:}" - case "$HTTP_HOST" in *:*) ;; *) port=443 ;; esac - case "$HTTP_HOST" in *\]) port=443 ;; esac - [ "$port" = 443 ] && hsts=1 -fi - -# Files always get the 404: a missing asset must not turn into someone's website. -file= -case "$path" in - /luci-static|/luci-static/*|/cgi-bin|/cgi-bin/*|/ubus|/ubus/*) file=1 ;; - *) case "${path##*/}" in *.*) file=1 ;; esac ;; -esac -redirect= -[ -n "$file" ] || redirect="$(uci -q get dawnline.settings.portal_redirect)" - -if [ -n "$redirect" ]; then - printf 'Status: 302 Found\r\n' - printf 'X-Content-Type-Options: nosniff\r\nReferrer-Policy: no-referrer\r\nX-Frame-Options: DENY\r\nCache-Control: no-store\r\n' - printf 'Location: %s\r\nContent-Type: text/plain\r\n' "$redirect" - [ -n "$hsts" ] && printf 'Strict-Transport-Security: max-age=31536000\r\n' - printf '\r\nMoved\n' -else - printf 'Status: 404 Not Found\r\n' - printf 'X-Content-Type-Options: nosniff\r\nReferrer-Policy: no-referrer\r\nX-Frame-Options: DENY\r\nCache-Control: no-store\r\n' - printf 'Content-Type: text/plain\r\n' - [ -n "$hsts" ] && printf 'Strict-Transport-Security: max-age=31536000\r\n' - printf '\r\nNot found\n' -fi -exit 0 diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/version b/package/luci-app-dawnline/root/usr/share/dawnline/version new file mode 100644 index 0000000..5a03fb7 --- /dev/null +++ b/package/luci-app-dawnline/root/usr/share/dawnline/version @@ -0,0 +1 @@ +0.20.0 diff --git a/package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json b/package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json index 15b46af..a3ddb0b 100644 --- a/package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json +++ b/package/luci-app-dawnline/root/usr/share/luci/menu.d/luci-app-dawnline.json @@ -4,7 +4,7 @@ "order": 65, "action": { "type": "alias", - "path": "admin/services/dawnline/server" + "path": "admin/services/dawnline/overview" }, "depends": { "acl": [ @@ -18,7 +18,7 @@ "admin/services/dawnline/overview": { "action": { "type": "view", - "path": "dawnline/server" + "path": "dawnline/overview" } }, "admin/services/dawnline/people": { @@ -27,29 +27,49 @@ "path": "dawnline/people" } }, + "admin/services/dawnline/places": { + "action": { + "type": "view", + "path": "dawnline/places" + } + }, "admin/services/dawnline/activity": { "action": { "type": "view", "path": "dawnline/activity" } }, + "admin/services/dawnline/log": { + "action": { + "type": "view", + "path": "dawnline/log" + } + }, "admin/services/dawnline/person": { "action": { "type": "view", "path": "dawnline/person" } }, + "admin/services/dawnline/device": { + "action": { + "type": "view", + "path": "dawnline/device" + } + }, "admin/services/dawnline/server": { - "title": "Servers", - "order": 10, "action": { "type": "view", "path": "dawnline/server" } }, + "admin/services/dawnline/system": { + "action": { + "type": "view", + "path": "dawnline/system" + } + }, "admin/services/dawnline/diagnostics": { - "title": "Diagnostics", - "order": 40, "action": { "type": "view", "path": "dawnline/diagnostics" @@ -62,16 +82,12 @@ } }, "admin/services/dawnline/settings": { - "title": "Settings", - "order": 60, "action": { "type": "view", "path": "dawnline/settings" } }, "admin/services/dawnline/updates": { - "title": "Components", - "order": 70, "action": { "type": "view", "path": "dawnline/updates" diff --git a/package/luci-app-dawnline/root/usr/share/rpcd/acl.d/luci-app-dawnline.json b/package/luci-app-dawnline/root/usr/share/rpcd/acl.d/luci-app-dawnline.json index 4b2b1f0..034df31 100644 --- a/package/luci-app-dawnline/root/usr/share/rpcd/acl.d/luci-app-dawnline.json +++ b/package/luci-app-dawnline/root/usr/share/rpcd/acl.d/luci-app-dawnline.json @@ -3,32 +3,75 @@ "description": "Grant access to Dawnline", "read": { "ubus": { - "luci.dawnline": [ - "rev", - "status", - "meter", - "setup_defaults", - "health", + "dawnline": [ + "hello", + "sync", + "wait", + "watch", + "refresh", + "events", + "person_usage", "service_log", "backup_list", + "settings_get", + "server_ports", + "interfaces", "updates_status", + "setup_defaults", "updates_releases", "updates_notes", "updates_changes", - "person_usage", - "settings_get", - "portal_info", - "interfaces", - "server_ports", "endpoint_probe", - "events" + "health", + "portal_info", + ":subscribe" ] } }, "write": { "ubus": { - "luci.dawnline": [ - "*" + "dawnline": [ + "person_links", + "device_config", + "backup_read", + "home_hosts", + "export", + "access_check", + "logs_clear", + "service_log_clear", + "usage_clear", + "geo_clear", + "backup_delete", + "service_set", + "service_delete", + "circle_set", + "circle_delete", + "person_pause", + "person_delete", + "person_update", + "people_update", + "person_create", + "person_regen", + "device_update", + "device_delete", + "device_create", + "device_rotate", + "device_networks", + "device_answer", + "settings_update", + "server_update", + "server_interfaces", + "server_delete", + "backup_create", + "server_obfuscation", + "server_create", + "health_fix", + "updates_run", + "apply", + "backup_restore", + "backup_upload", + "import", + "uninstall" ] } } diff --git a/package/luci-app-dawnline/root/usr/share/rpcd/ucode/luci.dawnline b/package/luci-app-dawnline/root/usr/share/rpcd/ucode/luci.dawnline deleted file mode 100644 index b4340bb..0000000 --- a/package/luci-app-dawnline/root/usr/share/rpcd/ucode/luci.dawnline +++ /dev/null @@ -1,50 +0,0 @@ -// Dawnline — rpcd backend for the LuCI admin UI (ubus object luci.dawnline). -// -// The methods live in dawnline.rpc.* by page: status (Overview, activity), -// servers, people (and their devices), settings, home (services, circles), -// maint (Diagnostics, backups, removal) and updates (Components). Each module -// exports `methods` as { name: { args, call } }; read-only users get the -// methods listed under "read" in acl.d/luci-app-dawnline.json. Every method -// also takes `lang`, the admin page's language, and answers in it (its -// errors and the texts the backend writes, through dawnline.i18n). -'use strict'; - -import * as status from 'dawnline.rpc.status'; -import * as servers from 'dawnline.rpc.servers'; -import * as people from 'dawnline.rpc.people'; -import * as settings from 'dawnline.rpc.settings'; -import * as home from 'dawnline.rpc.home'; -import * as maint from 'dawnline.rpc.maint'; -import * as updates from 'dawnline.rpc.updates'; -import * as i18n from 'dawnline.i18n'; - -/** The methods with `lang` added: the language is set for the call, the method never sees it. */ -function in_lang(methods) { - let out = {}; - for (let name, m in methods) { - let call = m.call; - out[name] = { - ...m, - args: { ...(m.args ?? {}), lang: '' }, - call: function(req) { - i18n.use(req.args?.lang); - if (req.args) - delete req.args.lang; - return call(req); - }, - }; - } - return out; -} - -return { - 'luci.dawnline': in_lang({ - ...status.methods, - ...servers.methods, - ...people.methods, - ...settings.methods, - ...home.methods, - ...maint.methods, - ...updates.methods, - }), -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc deleted file mode 100644 index f44ac46..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/access.uc +++ /dev/null @@ -1,333 +0,0 @@ -// Dawnline: "Check access" — walks the same rules the nft table and the -// client configuration apply, and says in words where a connection stops -// (in the admin's language: each step is a whole sentence). - -'use strict'; - -import { ip2int, in_nets } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as net from 'dawnline.net'; -import * as live from 'dawnline.live'; -import * as view from 'dawnline.view'; -import * as awg from 'dawnline.awg'; -import { _ } from 'dawnline.i18n'; - -/** "Bob can't connect: they are paused", by the person's state (core.person_state). */ -function cant_connect(name, st) { - if (st == 'no_server') - return sprintf(_("%s can't connect: they have no server"), name); - if (st == 'server_off') - return sprintf(_("%s can't connect: their server is turned off"), name); - if (st == 'paused') - return sprintf(_("%s can't connect: they are paused"), name); - if (st == 'expired') - return sprintf(_("%s can't connect: their access has ended"), name); - if (st == 'quota') - return sprintf(_("%s can't connect: they used up their data"), name); - if (st == 'hours') - return sprintf(_("%s can't connect: it is outside their allowed hours"), name); - return sprintf(_("%s can't connect: %s"), name, st); -} - -/** "Bob · Phone can't be reached: it is turned off", by the device and its person's state. */ -function cant_reach(who, disabled, st) { - if (disabled) - return sprintf(_("%s can't be reached: it is turned off"), who); - if (st == 'no_server') - return sprintf(_("%s can't be reached: they have no server"), who); - if (st == 'server_off') - return sprintf(_("%s can't be reached: their server is turned off"), who); - if (st == 'paused') - return sprintf(_("%s can't be reached: they are paused"), who); - if (st == 'expired') - return sprintf(_("%s can't be reached: their access has ended"), who); - if (st == 'quota') - return sprintf(_("%s can't be reached: they used up their data"), who); - if (st == 'hours') - return sprintf(_("%s can't be reached: it is outside their allowed hours"), who); - return sprintf(_("%s can't be reached: %s"), who, st); -} - -/** A person's access as the admin page names it. */ -function access_text(a) { - if (a == 'lan') - return _('Home only'); - if (a == 'internet') - return _('Internet only'); - if (a == 'both') - return _('Home and Internet'); - return a; -} - -/** "Bob has Internet only": the step where access stops a connection. */ -function has_access(name, a) { - if (a == 'lan') - return sprintf(_('%s has Home only'), name); - if (a == 'internet') - return sprintf(_('%s has Internet only'), name); - return sprintf(_('%s has Home and Internet'), name); -} - -/** "Bob reaches lan, guest." (the person's home networks), or that there is none. */ -function reaches(name, devs) { - return length(devs) ? sprintf(_('%s reaches %s.'), name, join(', ', devs)) : sprintf(_('%s reaches no home network.'), name); -} - -function step(ok, title, detail) { - return { ok: !!ok, title, detail: detail ?? '' }; -} - -/** Add the step where it stops and end the walk. */ -function stop(steps, s) { - push(steps, s); - return steps; -} - -/** The tunnel subnet (of any server) that holds `ip`: never home, whatever routes cover it. */ -function in_tunnels(m, ip) { - let nets = []; - for (let id, s in m.servers) - for (let t in core.tunnels(s)) - push(nets, t.subnet); - return in_nets(ip, nets); -} - -/** "10.0.1.20:445" → [ip, port]; a device id → its address. */ -function parse_target(m, s) { - s = trim(`${s ?? ''}`); - if (m.devices[s]) - return { dev: m.devices[s], ip: m.devices[s].address, port: null }; - let mm = match(s, /^([0-9.]+)(:([0-9]{1,5}))?$/); - if (!mm || ip2int(mm[1]) == null) - return null; - let ip = mm[1]; - for (let id, d in m.devices) - if (d.address == ip) - return { dev: d, ip, port: mm[3] ? +mm[3] : null }; - return { ip, port: mm[3] ? +mm[3] : null }; -} - -function home_access(p) { - return p.access == 'both' || (p.access == 'lan' && !length(p.services)); -} - -function peer_of(dmp, d) { - return dmp.peers[d.public_key]; -} - -/** What the device sends to the router: its configuration's AllowedIPs (its own, with lan_bypass). */ -function routed(m, srv, p, d) { - return awg.allowed_ips(m, srv, p, d); -} - -/** The home network (interface) of a server that holds an address. */ -function home_dev_of(srv, ip, snap) { - for (let h in net.server_net(srv, snap).home) - if (in_nets(ip, h.nets)) - return h.dev; - return null; -} - -function router_addrs(snap) { - let out = []; - for (let dev, d in snap.devices) - for (let a in d.addrs ?? []) - push(out, split(a, '/')[0]); - return out; -} - -function person_ok(m, p, d, states) { - let st = states[p.id] ?? 'active'; - if (d.disabled) - return step(false, sprintf(_('%s is turned off'), d.name), _('Turn the device on again on its page.')); - if (st != 'active') - return step(false, cant_connect(p.name, st), ''); - return step(true, sprintf(_('%s is active'), p.name), access_text(p.access)); -} - -function connected(dmp, d, who) { - let peer = peer_of(dmp, d); - if (!peer || !(peer.handshake > 0)) - return step(false, sprintf(_('%s has never connected'), who), _('There is no session the router could reach.')); - if (!live.online(dmp, d.id, peer)) - return step(false, sprintf(_("%s isn't connected right now"), who), _('The router reaches it only while its VPN is on.')); - return step(true, sprintf(_('%s is connected'), who), ''); -} - -/** A device → somewhere: the router, home, another device or the internet. */ -function from_device(m, d, t, states, dmp, snap) { - let p = m.people[d.person]; - let srv = p ? m.servers[p.server] : null; - if (!p || !srv) - return [ step(false, sprintf(_('%s has no server'), d.name), '') ]; - let steps = [ person_ok(m, p, d, states) ]; - if (!steps[0].ok) - return steps; - let allowed = routed(m, srv, p, d); - let via = (ip) => { - let hit = in_nets(ip, allowed); - // The configuration's own words: the option and its value. - let what = `AllowedIPs ${join(', ', filter(allowed, (x) => index(x, ':') < 0))}`; - return hit - ? step(true, _('Its configuration sends it to the router'), what) - : step(false, _("Its configuration doesn't send it to the router"), sprintf(_("%s: the device's own network handles it."), what)); - }; - - // Another device. - if (t.dev) { - let q = m.people[t.dev.person]; - let who = `${q?.name ?? '?'} · ${t.dev.name}`; - if (t.dev.id == d.id) - return [ step(false, _('That is the same device'), '') ]; - if (!q || q.server != p.server) - return stop(steps, step(false, sprintf(_('%s is on another server'), who), _('Devices of different servers never reach each other.'))); - if (!home_access(p)) - return stop(steps, step(false, has_access(p.name, p.access), _('Only people with home access reach other devices.'))); - if (!home_access(q)) - return stop(steps, step(false, has_access(q.name, q.access), _('Only devices of people with home access can be reached.'))); - if (srv.mesh == 'off') - return stop(steps, step(false, sprintf(_('"Devices reach each other" is off on %s'), srv.name), _('Server → Access → Home network.'))); - if (srv.mesh == 'circles' && q.id != p.id) { - let a = core.person_circle(m, p), b = core.person_circle(m, q); - if (!a || !b || a.id != b.id) - return stop(steps, step(false, sprintf(_('%s and %s are not in one circle'), p.name, q.name), - `${p.name}: ${a?.name ?? _('no circle')} · ${q.name}: ${b?.name ?? _('no circle')}`)); - push(steps, step(true, sprintf(_('Both are in %s'), a.name), _('Devices in one circle reach each other.'))); - } - else - push(steps, step(true, q.id == p.id ? sprintf(_("Both are %s's devices"), p.name) : _('Devices reach each other on this server'), '')); - let st = states[q.id] ?? 'active'; - if (st != 'active' || t.dev.disabled) - return stop(steps, step(false, cant_reach(who, t.dev.disabled, st), '')); - push(steps, via(t.ip)); - push(steps, connected(dmp, t.dev, who)); - return steps; - } - - // A device that keeps its own local network out of the tunnel (lan_bypass; - // Home only is the same either way) sends a private address there, router - // or home address alike: it never reaches this router's rules. - if (d.lan_bypass && p.access != 'lan' && !in_nets(t.ip, allowed)) - return stop(steps, via(t.ip)); - - // The router itself. - if (index(router_addrs(snap), t.ip) >= 0) { - let portal = m.settings.portal_enabled && (t.port == m.settings.portal_port || (core.portal_http(m) && t.port == core.portal_http_port(m))); - if (t.port == 53) - push(steps, step(true, sprintf(_('%s is this router: DNS is open to everyone'), t.ip), '')); - else if (portal) - push(steps, step(true, sprintf(_('%s is this router: the personal portal is open to everyone'), t.ip), '')); - else if (!home_access(p)) - return stop(steps, step(false, sprintf(_('%s is this router'), t.ip), sprintf(p.access == 'lan' - ? _('%s has Home only: only DNS and the portal on the router.') - : _('%s has Internet only: only DNS and the portal on the router.'), p.name))); - else { - // Like any home address: only on the networks the person reaches. - let h = core.person_home(srv, p, snap); - if (!h.all && !in_nets(t.ip, h.nets)) - return stop(steps, step(false, sprintf(_("%s is this router on a network %s doesn't reach"), t.ip, p.name), reaches(p.name, h.devs))); - push(steps, step(true, sprintf(_('%s is this router'), t.ip), - h.all ? _('Home access includes the router.') : sprintf(_('On one of the networks %s reaches.'), p.name))); - } - push(steps, via(t.ip)); - return steps; - } - - // A tunnel address no device has. - let tn = in_tunnels(m, t.ip); - if (tn) - return stop(steps, step(false, sprintf(_('No device uses %s'), t.ip), sprintf(_('It is in the tunnel network %s.'), tn))); - - // Home. - let sn = net.server_net(srv, snap); - let hdev = home_dev_of(srv, t.ip, snap); - if (hdev) { - if (p.access == 'internet') - return stop(steps, step(false, sprintf(_('%s is at home (%s)'), t.ip, hdev), sprintf(_('%s has Internet only.'), p.name))); - if (p.access == 'lan' && length(p.services)) { - let hit = null; - for (let sid in p.services) { - let s = m.services[sid]; - if (s?.address == t.ip && (!length(s.ports) || t.port == null || index(s.ports, `${t.port}`) >= 0)) - hit = s; - } - let names = join(', ', map(filter(map(p.services, (x) => m.services[x]), (x) => x), (x) => x.name)); - if (!hit) - return stop(steps, step(false, sprintf(_("%s is not one of %s's home services"), t.port ? `${t.ip}:${t.port}` : t.ip, p.name), - sprintf(_('Allowed: %s'), names))); - push(steps, step(true, sprintf(_("%s is %s, one of %s's home services"), t.ip, hit.name, p.name), - length(hit.ports) ? sprintf(_('Ports %s'), join(', ', hit.ports)) : _('All ports'))); - } - else { - let h = core.person_home(srv, p, snap); - if (!in_nets(t.ip, h.nets)) - return stop(steps, step(false, sprintf(_("%s is in %s, which %s doesn't reach"), t.ip, hdev, p.name), reaches(p.name, h.devs))); - push(steps, step(true, sprintf(_('%s is in home network %s'), t.ip, hdev), - h.all ? _('Home access reaches every home network.') : sprintf(_('One of the networks %s reaches.'), p.name))); - } - push(steps, via(t.ip)); - push(steps, step(true, _('The firewall lets it through'), `${srv.ifname} → ${join(', ', sn.zones) || _('home')}`)); - return steps; - } - - // Another private address, or the internet. - if (in_nets(t.ip, [ '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', '100.64.0.0/10', '169.254.0.0/16' ])) - return stop(steps, step(false, sprintf(_("%s isn't in %s's home network"), t.ip, srv.name), _('Private addresses outside the home network are blocked.'))); - if (p.access == 'lan') - return stop(steps, step(true, sprintf(_('%s is on the internet'), t.ip), - sprintf(_("%s has Home only: their device's own internet reaches it, not the tunnel."), p.name))); - push(steps, via(t.ip)); - push(steps, step(true, sprintf(_('%s is on the internet'), t.ip), srv.lan_like ? _('It leaves like a home device would.') - : sn.wan.dev != null ? sprintf(_('It leaves through %s.'), sn.wan.dev) : _('It leaves through the WAN.'))); - return steps; -} - -/** A home address → a device. */ -function to_device(m, ip, d, states, dmp, snap) { - let p = m.people[d.person]; - let srv = p ? m.servers[p.server] : null; - if (!p || !srv) - return [ step(false, sprintf(_('%s has no server'), d.name), '') ]; - let who = `${p.name} · ${d.name}`; - let hdev = in_tunnels(m, ip) ? null : home_dev_of(srv, ip, snap); - if (!hdev) - return [ step(false, sprintf(_("%s isn't in %s's home network"), ip, srv.name), _("Only home devices reach people's devices.")) ]; - let steps = [ step(true, sprintf(_('%s is at home (%s)'), ip, hdev), '') ]; - if (!home_access(p)) - return stop(steps, step(false, p.access == 'lan' ? sprintf(_('%s has only some home services'), p.name) : has_access(p.name, p.access), - _('Home devices reach only people with home access.'))); - let h = core.person_home(srv, p, snap); - if (!in_nets(ip, h.nets)) - return stop(steps, step(false, sprintf(_("%s doesn't reach %s"), p.name, hdev), _('Networks a person does not reach cannot reach them either.'))); - push(steps, person_ok(m, p, d, states)); - if (!steps[length(steps) - 1].ok) - return steps; - push(steps, step(true, _('The firewall lets it through'), `${join(', ', net.server_net(srv, snap).zones) || _('home')} → ${srv.ifname}`)); - push(steps, connected(dmp, d, who)); - return steps; -} - -/** - * `from` and `to`: a device id, or an IPv4 address (optionally :port). - * `ctx` = { states, dmp, snap } (a test's own); read from the router when not - * given. Returns { ok, steps: [{ ok, title, detail }] }. - */ -export function check(m, from, to, ctx) { - let a = parse_target(m, from), b = parse_target(m, to); - if (!a) - die(sprintf(_('"%s" is not a device or an IPv4 address.'), from)); - if (!b) - die(sprintf(_('"%s" is not a device or an IPv4 address.'), to)); - let states = ctx?.states ?? view.states(m, core.load_usage()); - let dmp = ctx?.dmp ?? live.dump(m); - let snap = ctx?.snap ?? net.snapshot(true); - let steps; - if (a.dev) - steps = from_device(m, a.dev, b, states, dmp, snap); - else if (b.dev) - steps = to_device(m, a.ip, b.dev, states, dmp, snap); - else - die(_('Choose a device on at least one side.')); - let ok = length(filter(steps, (s) => !s.ok)) == 0; - return { ok, steps }; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc deleted file mode 100644 index 48286d3..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/apply.uc +++ /dev/null @@ -1,324 +0,0 @@ -// Dawnline — reconciliation. Turns /etc/config/dawnline into router state: -// * network interfaces (dawnline.netifd) and the devices loaded live into -// them (dawnline.awg) -// * firewall zones, forwardings, WAN rules and reply routes (dawnline.fw) -// * the nft table `inet dawnline` enforcing each person's access (dawnline.nft) -// * hostnames in /tmp/hosts/dawnline -// * the "like a home device" path and the Home-only resolver (dawnline.loop) -// Only objects created by Dawnline are ever modified. -// -// apply(), sync() and sync_loop() run under one lock ('apply') and read the -// model inside it, so a rebuild and a runtime update never interleave and the -// last one to run always works from the newest configuration. The config lock -// (dawnline.store) is never taken while 'apply' is held. - -import { readfile, writefile, stat, unlink } from 'fs'; -import { ensure_dir, write_file, write_json, with_lock, ip2int, slog, syslog, log_on, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as net from 'dawnline.net'; -import * as loop from 'dawnline.loop'; -import * as awg from 'dawnline.awg'; -import * as nft from 'dawnline.nft'; -import * as fw from 'dawnline.fw'; -import * as netifd from 'dawnline.netifd'; -import * as migrate from 'dawnline.migrate'; -import { _, L_ } from 'dawnline.i18n'; - -const HOSTS_FILE = '/tmp/hosts/dawnline'; -/** The network signature the last apply() worked from (the agent compares against it). */ -export const NET_SIG = `${RUN_DIR}/net.sig`; -// The last access-table error that was logged (each distinct failure once). -const NFT_ERR = `${RUN_DIR}/nft.err`; - -function log(who, msg, level, detail) { - slog('dawnline', level ?? 'info', msg, detail, who); -} - -/* ---------- hostnames ---------- */ - -export function sync_hosts(m) { - let lines = []; - if (m.settings.hostnames) - for (let pid, p in m.people) { - // One label per device, unique within the person (the UI shows the same). - let labels = core.device_labels(m, p); - for (let id in p.devices) { - let d = m.devices[id]; - if (ip2int(d.address) != null) - push(lines, `${d.address} ${labels[id]}.${p.id}.${m.settings.domain}`); - } - } - let ls = loop.status(); - if (ls.active) - push(lines, `${ls.address} dawnline.${m.settings.domain}`); - let body = length(lines) ? join('\n', lines) + '\n' : ''; - // dnsmasq runs as its own user; rpcd's umask would leave the file 0600. - let readable = ((stat(HOSTS_FILE)?.perm?.other_read) ?? false); - if ((readfile(HOSTS_FILE) ?? '') == body && (body == '' || readable)) { - syslog('debug', 'dns', `${HOSTS_FILE}: unchanged · ${length(lines)} names`); - return false; - } - ensure_dir('/tmp/hosts'); - if (body == '') - unlink(HOSTS_FILE); - else { - writefile(HOSTS_FILE, body); - system(`chmod 644 ${HOSTS_FILE}`); - } - syslog('info', 'dns', body == '' ? `${HOSTS_FILE}: removed (no device names)` : `${HOSTS_FILE}: ${length(lines)} names written (*.${m.settings.domain}) · killall -HUP dnsmasq`); - system('killall -HUP dnsmasq 2>/dev/null'); - return true; -}; - -/* ---------- access table ---------- */ - -export function states_for(m, usage) { - let st = {}; - for (let id, p in m.people) - st[id] = core.person_state(m, p, usage); - return st; -}; - -/** Per-person runtime membership (dawnline.nft). */ -export function access_sets(m, usage, states) { - return nft.access_sets(m, usage, states); -}; - -/** - * Log an access-table failure once per distinct error (with what it means - * for the devices: none loaded while the table is missing, the previous rules - * kept when an older one survived the failed rebuild); the error, or null. - */ -function nft_result(err, present) { - let was = readfile(NFT_ERR); - if (err == null) { - if (was != null) - unlink(NFT_ERR); - return null; - } - if (was != err) { - log(L_('Access rules'), present - ? L_("couldn't be updated - the previous rules stay, and changes to access wait until they load") - : L_("couldn't load - no device is loaded into the tunnels until they do"), 'error', err); - ensure_dir(RUN_DIR); - writefile(NFT_ERR, err); - } - return err; -} - -/** - * The table in place: rebuilt with `full`, otherwise members only, rebuilt - * when that fails (no table yet at boot, or an older shape). Null, or the - * error when the rebuild fails too. - */ -function load_table(m, sets, full) { - let err = full ? nft.rebuild(m, sets) : nft.update(sets); - if (err != null && !full) - err = nft.rebuild(m, sets); - return nft_result(err, err != null && nft.present()); -} - -/** Full table rebuild (structure changes: servers, LAN subnets); true when it loaded. */ -export function rebuild_nft(m, sets) { - let err = nft.rebuild(m, sets); - return nft_result(err, err != null && nft.present()) == null; -}; - -/** Atomically replace set contents only. */ -export function update_sets(sets) { - return nft.update(sets) == null; -}; - -export function remove_nft() { - nft.remove(); -}; - -/** For the watchdog (dawnline.fw). */ -export function firewall_drift(m) { - return fw.drift(m); -}; - -/* ---------- runtime sync ---------- */ - -/** - * What an admin should hear when a sync did not fully take: the access table - * failed, or a server did not accept its devices (sentences in the caller's - * language, with what nft or awg said). Null when all went in. - */ -function sync_warning(m, table, peers) { - let out = []; - if (table != null) - push(out, nft.present() - ? sprintf(_("Access rules couldn't be updated (%s): the previous rules stay, so this change isn't in effect yet."), table) - : sprintf(_("Access rules couldn't load (%s): no device is loaded into the tunnels until they do."), table)); - for (let id, r in peers) - if (r != 'ok' && r != 'down') - push(out, sprintf(_("Couldn't load devices into %s: %s."), m.servers[id]?.name ?? id, r)); - return length(out) ? join(' ', [ ...out, _('Open Diagnostics → Health.') ]) : null; -} - -/** - * The same as sync_warning for syslog: in English whatever the admin's - * language (a log is read by anyone, searched and sent on), with what nft or - * awg said. Null when all went in. - */ -function sync_facts(m, table, peers) { - let out = []; - if (table != null) - push(out, `access rules ${nft.present() ? 'not updated, the previous ones stay' : 'not loaded, no device loaded'}: ${table}`); - for (let id, r in peers) - if (r != 'ok' && r != 'down') - push(out, `${m.servers[id]?.name ?? id}: devices not loaded: ${r}`); - return length(out) ? join(' · ', out) : null; -} - -/* - * With the lock held: access sets first, then devices into the tunnels. - * Fail closed: without the table the firewall would let every loaded device - * reach everything, so while it is missing no device is loaded at all. An - * older table that survived a failed rebuild keeps limiting them with the - * sets it has, and the devices still follow people's states (a revoked one - * leaves). - */ -function locked_sync(m, usage, full) { - let states = states_for(m, usage); - let sets = nft.access_sets(m, usage, states); - let table = load_table(m, sets, full); - let peers = awg.sync_peers(m, table == null || nft.present() ? states : {}); - sync_hosts(m); - ensure_dir(RUN_DIR); - write_json(`${RUN_DIR}/states.json`, states, 0o644); - return { peers, states, table, warning: sync_warning(m, table, peers) }; -} - -/** - * Runtime sync: devices into the tunnels (AmneziaWG peers), access sets, - * hostnames. Cheap; safe to call often. The model is always read again under - * the lock (`m` is accepted for older callers and not used); `usage` is the - * caller's (the agent holds the live counters). The result carries `warning` - * (a sentence for the admin) when the sync did not fully take. - */ -export function sync(m, usage) { - return with_lock('apply', () => locked_sync(core.load(), usage ?? core.load_usage())); -}; - -/** Is the access table loaded (the agent's tick re-syncs when it is not). */ -export function table_present() { - return nft.present(); -}; - -/** - * Everything on the router that Dawnline's state is derived from: WAN and - * LAN, the home networks and zones of each server, the netns address and the - * LAN's DNS. The agent re-applies when it changes (LAN renumbered, interface - * added, bridge recreated, DHCP DNS changed, ...). - */ -export function net_signature(m) { - let snap = net.snapshot(true); - let srvs = {}; - for (let id, srv in m.servers) - srvs[id] = net.server_net(srv, snap); - let lan = snap.devices[snap.lan]; - return sprintf('%J', { wan: snap.wan, lan: snap.lan, addrs: lan?.addrs, servers: srvs, dns: loop.lan_dns(), loop: loop.client_dns() }); -}; - -/** - * Keep the "like a home device" path and the resolver in step (agent tick). - * Cheap when nothing changed; rebuilds the access table when the netns - * address appears, moves or goes away (the guard allows DNS to it). - */ -export function sync_loop(m, usage, force) { - let p = with_lock('apply', () => { - let mm = core.load(); - let before = `${loop.client_dns()} ${loop.resolver_target().mode}`; - let lp = loop.ensure(mm, force); - loop.sync_resolver(mm); - fw.sync_reply_routes(mm); - if (`${loop.client_dns()} ${loop.resolver_target().mode}` != before) - locked_sync(mm, usage ?? core.load_usage(), true); - return lp; - }); - loop.remember(p); - return p; -}; - -/* ---------- entry points ---------- */ - -/** Milliseconds on the monotonic clock, for how long an apply's steps take. */ -function ms() { - let c = clock(true); - return c[0] * 1000 + c[1] / 1000000; -} - -/** - * Full reconcile: router configuration + runtime state. In syslog: what it - * came to, with how long it took (info; warn when it did not fully take), and - * each step with its result at the debug level. - */ -export function apply(opts) { - opts ??= {}; - let t0 = ms(); - let debug = log_on('debug'); - // One step, timed; `show` picks what of its result goes in the line (never the model: it holds keys). - let step = (name, fn, show) => { - let t = ms(); - let out = fn(); - let what = show ? show(out) : out; - if (debug) - syslog('debug', 'apply', sprintf('%s done in %d ms%s', name, ms() - t, - what == null ? '' : ` · ${type(what) == 'string' ? what : sprintf('%J', what)}`)); - return out; - }; - if (debug) - syslog('debug', 'apply', 'applying the configuration'); - migrate.run(); - let r = with_lock('apply', () => { - let m = core.load(); - let usage = core.load_usage(); - let changed = (x) => x ? 'changed' : 'unchanged'; - let network = step('network (netifd)', () => netifd.sync(m), changed); - let firewall = step('firewall (fw4)', () => fw.sync(m), changed); - let lp = step('internet like a home device', () => loop.ensure(m, true)); - step('resolver for Home-only devices', () => { loop.sync_resolver(m); }); - step('reply routes', () => { fw.sync_reply_routes(m); }); - let s = step('access rules and devices', () => locked_sync(m, usage, true), (x) => ({ table: x.table, peers: x.peers })); - ensure_dir(RUN_DIR); - write_file(NET_SIG, net_signature(m), 0o644); - return { network, firewall, lp, peers: s.peers, warning: s.warning, facts: sync_facts(m, s.table, s.peers), - counts: [ length(keys(m.servers)), length(keys(m.people)), length(keys(m.devices)) ] }; - }); - loop.remember(r.lp); - let n = (k, one, many) => `${k} ${k == 1 ? one : many}`; - let took = sprintf('configuration applied in %d ms · %s, %s, %s', ms() - t0, - n(r.counts[0], 'server', 'servers'), n(r.counts[1], 'person', 'people'), n(r.counts[2], 'device', 'devices')); - // Syslog in English (sync_facts, loop.error_note); the admin's answer carries the words in their language. - if (r.facts) - syslog('warn', 'apply', `${took} · ${r.facts}`); - else - syslog('info', 'apply', took); - if (r.lp.error) - syslog('warn', 'apply', `internet like a home device: ${type(r.lp.error) == 'object' ? loop.error_note(r.lp.error) : r.lp.error}`); - return { network: r.network, firewall: r.firewall, like_home: r.lp.error ? { error: loop.error_text(r.lp.error) } : !r.lp.off, peers: r.peers, warning: r.warning }; -}; - -/** Remove everything Dawnline created (used by the uninstaller). */ -export function teardown() { - with_lock('apply', () => { - let m = core.load(); - loop.remove(); - unlink(loop.RESOLVER.conf); - m.servers = {}; - m.settings.portal_enabled = false; - netifd.sync(m); - fw.sync(m); - fw.sync_reply_routes(m); - nft.remove(); - unlink(HOSTS_FILE); - unlink(NET_SIG); - system('killall -HUP dnsmasq 2>/dev/null'); - }); - migrate.uhttpd(); - // The agent's heartbeat check. - if (system('grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root') == 0) - system("sed -i '\\#/usr/libexec/dawnline/heartbeat#d' /etc/crontabs/root; /etc/init.d/cron restart >/dev/null 2>&1"); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc deleted file mode 100644 index 5ab73e4..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg.uc +++ /dev/null @@ -1,1121 +0,0 @@ -// Dawnline — the AmneziaWG core: keys, disguise (obfuscation) and the values -// AmneziaWG refuses, client configurations (.conf, AmneziaVPN key), the -// netifd options of a server's tunnel, its peers (`awg syncconf`, no -// restart), live counters, the words for why a tunnel is kept down -// (blocked_text) and what the watchdog and Health check about it. Plain -// WireGuard is AmneziaWG with the disguise off. - -import { readfile, stat, unlink } from 'fs'; -import { - q, sh, sh_out, rand_int, rand_bytes, valid_key, ip2int, tunnel_name, ensure_dir, write_file, read_json, write_json, lock, unlock, - slog, syslog, some_of, iface_status, DATA_DIR, RUN_DIR -} from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as net from 'dawnline.net'; -import { ipv6_groups } from 'dawnline.schema'; -import * as pkg from 'dawnline.pkg'; -import * as builds from 'dawnline.awg_builds'; -import { _, L_ } from 'dawnline.i18n'; - -/** Names in .conf files (and AmneziaVPN keys); netifd uses `awg_`. */ -export const OBF_CONF = { - jc: 'Jc', jmin: 'Jmin', jmax: 'Jmax', s1: 'S1', s2: 'S2', s3: 'S3', s4: 'S4', - h1: 'H1', h2: 'H2', h3: 'H3', h4: 'H4', i1: 'I1', i2: 'I2', i3: 'I3', i4: 'I4', i5: 'I5', - header_protection_key: 'HeaderProtectionKey', content_padding_addition: 'ContentPaddingAddition', - rekey_after_time: 'RekeyAfterTime', rekey_timeout: 'RekeyTimeout', reject_after_time: 'RejectAfterTime', - keepalive_timeout: 'KeepaliveTimeout', max_handshake_attempts: 'MaxHandshakeAttempts', - random_trailers: 'RandomTrailers', disable_cookies: 'DisableCookies', -}; - -const TOOL = '/usr/bin/awg', PROTO = '/lib/netifd/proto/amneziawg.sh'; -/** The packages AmneziaWG comes in (the Components tab installs them). */ -const PACKAGES = [ 'kmod-amneziawg', 'amneziawg-tools' ]; -// A module constant, compiled once (a literal is compiled each time it runs): -// dump() checks it on every line of each tunnel's `awg show dump`, every second. -const DIGITS = /^[0-9]+$/; - -/** netifd knows the amneziawg protocol (it reads the proto scripts when it starts). */ -function proto_handler() { - try { - return 'amneziawg' in (json(sh_out('ubus call network get_proto_handlers 2>/dev/null') || '{}') ?? {}); - } - catch (e) { - return false; - } -} - -/** - * What of AmneziaWG is on the router: - * tools the awg tool and the netifd protocol script (amneziawg-tools) - * kmod the kernel module, loaded or on disk for the running kernel - * loaded the module is loaded - * handler netifd lists the amneziawg protocol - * missing packages that are not installed; ok: everything is in place - */ -export function state() { - let tools = stat(TOOL) != null && stat(PROTO) != null; - let loaded = stat('/sys/module/amneziawg') != null; - let rel = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - let kmod = loaded || (rel != '' && stat(`/lib/modules/${rel}/amneziawg.ko`) != null); - let handler = tools && proto_handler(); - let missing = filter(PACKAGES, (p) => p == 'kmod-amneziawg' ? !kmod : !tools); - return { tools, kmod, loaded, handler, missing, ok: !length(missing) && loaded && handler }; -}; - -/** - * state(), after loading an installed module that isn't loaded yet: nothing loads - * it before the first tunnel comes up, so "not loaded" alone is no fault. - */ -export function load() { - let s = state(); - if (!s.kmod || s.loaded) - return s; - system('modprobe amneziawg >/dev/null 2>&1'); - return state(); -}; - -/** The kernel module and the awg tool are on the router. */ -export function installed() { - let s = state(); - return s.tools && s.kmod; -}; - -/* ---------- keys ---------- */ - -export function genkey() { - return sh_out('awg genkey'); -}; - -export function pubkey(priv) { - if (!valid_key(priv)) - return null; - return sh_out(`printf %s ${q(priv)} | awg pubkey`); -}; - -/** A preshared key is 32 random bytes: no tool needed (`awg genpsk` does the same). */ -export function genpsk() { - return b64enc(rand_bytes(32)); -}; - -/** - * Keys for a new device. With `public_key` (made in the browser) the private - * key never reaches the router. Never without a preshared key. - */ -export function new_keys(public_key) { - let psk = genpsk(); - if (!valid_key(psk)) - die(_('Key generation failed (no random data).')); - if (public_key) { - if (!valid_key(public_key)) - die(_('Invalid public key.')); - return { public_key, preshared_key: psk }; - } - let priv = genkey(), pub = pubkey(priv); - if (!pub) - die(_('Key generation failed (is amneziawg-tools installed?).')); - return { private_key: priv, public_key: pub, preshared_key: psk }; -}; - -/** A server's own key pair (set up once, on the server). */ -export function server_keys() { - let priv = genkey(), pub = pubkey(priv); - if (!pub) - die(_('Key generation failed (is amneziawg-tools installed?).')); - return { private_key: priv, public_key: pub }; -}; - -/* ---------- obfuscation ---------- */ - -// Junk packets may be tiny (the 3.1 preset sends 10-50 bytes, as AmneziaVPN -// does); the ceiling keeps them under the path MTU. -const OBF_SPEC = { jc: [ 0, 10 ], jmin: [ 0, 1024 ], jmax: [ 0, 1024 ], s1: [ 0, 64 ], s2: [ 0, 64 ], s3: [ 0, 64 ], s4: [ 0, 32 ] }; - -function rand_h(used) { - for (let i = 0; i < 50; i++) { - let v = rand_int(5, 2147483647); - if (!used[v]) { - used[v] = true; - return `${v}`; - } - } -} - -// caps() answers from here while the tool, the protocol script, the module -// file, the install record and the loaded module are the same (tmpfs: a -// reboot starts over). -const CAPS = `${RUN_DIR}/awg-caps.json`; - -/** - * What the installed AmneziaWG can do: the netifd protocol script (the - * options it passes on) and the `awg` tool (the keys it accepts) say what the - * tools know, the kernel module's package version what the kernel runs, and - * a feature counts only when both have it (tools 3.1 over a 2.0 module would - * configure header protection that the kernel silently lacks). While an - * update waits for a reboot (its old module stayed loaded) the kernel runs - * the generation from before it, as the install recorded it: - * v2 — S3/S4, I1-I5, header ranges (AWG 1.5/2.0) - * v3 — header protection, trailers, padding, timing (AWG 3.1) - * tools / kmod — their generations ('1.0', '2.0', '3.1'; null unknown) - * mismatch — the two differ - * pending — an installed module waits for a reboot (dawnline.awg_builds) - */ -export function caps() { - let rel = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - let core = builds.module_core(); - let key = `${stat(`/lib/modules/${rel}/amneziawg.ko`)?.mtime ?? 0}/${stat(TOOL)?.mtime ?? 0}/${stat(PROTO)?.mtime ?? 0}` + - `/${stat(builds.RECORD)?.mtime ?? 0}/${core ?? 0}`; - let cached = read_json(CAPS, null); - if (cached?.key == key && cached.caps) - return cached.caps; - let script = readfile(PROTO) ?? ''; - let tool = sh_out("grep -a -o -m1 'HeaderProtectionKey' /usr/bin/awg 2>/dev/null") ?? ''; - let t2 = index(script, 'awg_s3') >= 0 && index(script, 'awg_i1') >= 0; - let t3 = t2 && index(script, 'awg_header_protection_key') >= 0 && tool != ''; - let tools = !stat(TOOL) ? null : t3 ? '3.1' : t2 ? '2.0' : '1.0'; - // A module installed by hand has no package, so no generation (also when - // a pending update replaces it): then the tools are believed. - let rec = read_json(builds.RECORD, null), boot = builds.boot_id(); - let kmod = builds.running_gen(rec, boot, core, pkg.version('kmod-amneziawg')); - let out = { - v2: t2 && (kmod == null || kmod != '1.0'), - v3: t3 && (kmod == null || kmod == '3.1'), - tools, kmod, mismatch: tools != null && kmod != null && tools != kmod, - pending: builds.pending(rec, boot, core), - }; - ensure_dir(RUN_DIR); - write_json(CAPS, { key, caps: out }, 0o644); - return out; -}; - -/** - * Why this AmneziaWG cannot run a server's disguise values, as a reason to - * keep the server down (blocked_text): { code: 'disguise', need, installed } - * (installed null: none), or null when it can. A 3.1 preset after a rollback - * to a 2.0 build would come up without the header protection every device - * expects, so such a server is kept down instead (dawnline.netifd). - */ -export function obf_unsupported(o) { - let c = caps(); - let has = (keys) => length(filter(keys, (k) => o?.[k] != null && o[k] != '')) > 0; - let v3 = [ 'header_protection_key', 'content_padding_addition', 'rekey_after_time', 'rekey_timeout', 'reject_after_time', - 'keepalive_timeout', 'max_handshake_attempts', 'random_trailers', 'disable_cookies' ]; - let v2 = [ 's3', 's4', 'i1', 'i2', 'i3', 'i4', 'i5' ]; - let ranged = length(filter([ 'h1', 'h2', 'h3', 'h4' ], (k) => match(`${o?.[k] ?? ''}`, /-/))) > 0; - if (has(v3) && !c.v3) - return { code: 'disguise', need: '3.1', installed: c.kmod ?? c.tools }; - if ((has(v2) || ranged) && !c.v2) - return { code: 'disguise', need: '2.0', installed: c.kmod ?? c.tools }; - return null; -}; - -/** - * Signature packets shaped like DNS, made fresh for each server: the same - * fixed bytes on every router (AmneziaVPN's own 3.1 default is one constant - * answer about icloud.com) would be one rule for a DPI to match. A query and - * an answer about a name of this server's own, with its own TTL and address. - * random bytes, random letters, fixed bytes - */ -function dns_name_hex() { - let hex = (s) => { - let out = ''; - for (let i = 0; i < length(s); i++) - out += sprintf('%02x', ord(s, i)); - return out; - }; - let tld = [ 'com', 'net', 'org', 'io' ][rand_int(0, 3)]; - let n = rand_int(5, 9); - return { labels: ``, len: n + length(tld) + 2 }; -} - -function dns_query() { - let name = dns_name_hex(); - // id, flags (standard query, recursion desired), 1 question, name, type A, class IN - return `${name.labels}`; -} - -function dns_answer() { - let name = dns_name_hex(); - let ttl = sprintf('%08x', rand_int(300, 86400)); - // id, flags (answer, authoritative, recursion), 1 question, 1 answer, name, A IN, pointer, A IN, ttl, 4 bytes - return `${name.labels}`; -} - -/** - * Generate obfuscation parameters for a method: - * off plain WireGuard-compatible packets - * balanced AmneziaWG 2.0: junk packets, random headers, padded cookie and - * data packets, DNS-shaped signature packets - * max AmneziaWG 3.1: protected headers, random trailers, padding, - * jittered timers and a DNS-like first packet — the values - * AmneziaVPN itself uses for 3.1 servers - * Servers made before 0.8 may still carry the old "standard" or "strong" - * values (1.0-style junk only): they keep running as they are, the picker - * offers Balanced or Maximum instead. - */ -export function obf_preset(name) { - if (name == 'max') { - // 32 random bytes, as `awg genkey` makes them (no process). Without - // one the server would come up with weak or no header protection. - let hpk = genpsk(); - if (!valid_key(hpk)) - die(_('Key generation failed (no random data).')); - return { - jc: `${rand_int(4, 6)}`, jmin: '10', jmax: '50', - s1: '12', s2: '12', s3: '12', s4: '12', - h1: '1', h2: '2', h3: '3', h4: '4', - i1: dns_query(), i2: dns_answer(), - header_protection_key: hpk, - content_padding_addition: '10-100', - rekey_after_time: '100-120', rekey_timeout: '3-7', reject_after_time: '150-180', - keepalive_timeout: '5-15', max_handshake_attempts: '15-20', - random_trailers: 'on', disable_cookies: 'on', - }; - } - if (name == 'off') - return { jc: '0', jmin: '0', jmax: '0', s1: '0', s2: '0', h1: '1', h2: '2', h3: '3', h4: '4' }; - let o = {}; - o.jc = `${rand_int(4, 8)}`; - let jmin = rand_int(64, 128); - o.jmin = `${jmin}`; - o.jmax = `${jmin + rand_int(150, 400)}`; - let s1 = rand_int(15, 64), s2 = rand_int(15, 64); - while (s1 + 56 == s2) - s2 = rand_int(15, 64); - o.s1 = `${s1}`; - o.s2 = `${s2}`; - let used = {}; - for (let k in [ 'h1', 'h2', 'h3', 'h4' ]) - o[k] = rand_h(used); - // AmneziaWG 2.0: padded cookie and data packets (S4 costs MTU, kept - // small: core.tunnel_mtu) and DNS-shaped signature packets before each - // handshake — what 1.0 traffic lacks and gets recognised by. - o.s3 = `${rand_int(8, 48)}`; - o.s4 = `${rand_int(4, 16)}`; - o.i1 = dns_query(); - o.i2 = dns_answer(); - return o; -}; - -/* ---------- disguise values AmneziaWG refuses ---------- */ - -// Checked with ltrim, not regexes: this module loads with every portal request. -const DEC = '0123456789', HEX = '0123456789abcdefABCDEF'; - -/** A whole number in digits up to `top`, or null (no spaces: callers trim where the tools drop them). */ -function uint(v, top) { - let s = `${v}`; - if (s == '' || length(s) > 10 || ltrim(s, DEC) != '') - return null; - return +s <= top ? +s : null; -} - -/** A number or a range as AmneziaWG writes them ("5", "5-15"), each end up to `top`: [ lo, hi ], or null. */ -function uint_range(v, top) { - let p = split(trim(`${v}`), '-'); - let lo = length(p) <= 2 ? uint(p[0], top) : null; - let hi = length(p) == 2 ? uint(p[1], top) : lo; - return lo != null && hi != null && lo <= hi ? [ lo, hi ] : null; -} - -/** Value `k` of disguise values `o` is set. */ -function given(o, k) { - return o[k] != null && o[k] != ''; -} - -/** - * Packet types H1-H4: a number or a range each, apart from the others (the - * kernel refuses an overlap). One not given keeps WireGuard's own type, 1-4. - */ -function headers_unsafe(o, errs) { - let hs = []; - for (let i = 1; i <= 4; i++) { - let r = given(o, `h${i}`) ? uint_range(o[`h${i}`], 4294967295) : [ i, i ]; - if (!r) - push(errs, sprintf(_('%s must be a number or a range like 100-200, up to 4294967295.'), OBF_CONF[`h${i}`])); - push(hs, r); - } - for (let i = 0; i < 4; i++) - for (let j = i + 1; j < 4; j++) - if (hs[i] && hs[j] && hs[i][0] <= hs[j][1] && hs[j][0] <= hs[i][1]) - push(errs, sprintf(_('%s and %s overlap: each packet type needs values of its own.'), OBF_CONF[`h${i + 1}`], OBF_CONF[`h${j + 1}`])); -} - -/** - * One tag of a signature packet as both the kernel and amneziawg-go read it: - * fixed bytes (an even number of hex digits), , , - * (N random bytes, letters, digits; a negative N writes past the packet in - * the kernel, kmod #267) or (the time). is the kernel's alone and - * , , amneziawg-go's: devices on the other refuse them. - */ -function itag_ok(tag) { - if (tag == 't') - return true; - let sp = index(tag, ' '); - if (sp < 0) - return false; - let key = substr(tag, 0, sp), val = substr(tag, sp + 1); - if (key == 'b') - return length(val) > 2 && length(val) % 2 == 0 && substr(val, 0, 2) == '0x' && ltrim(substr(val, 2), HEX) == ''; - if (key == 'r' || key == 'rc' || key == 'rd') - return (uint(val, 1000) ?? 0) >= 1; - return false; -} - -/** What is wrong with signature packet `name` (I1-I5) holding `s`, as a sentence; null when nothing. */ -function itag_error(name, s) { - // In a .conf file `#` starts a comment and a line break ends the line: the rest would be lost. - if (index(s, '#') >= 0 || index(s, '\n') >= 0 || index(s, '\r') >= 0) - return sprintf(_('%s may not contain # or a line break.'), name); - // Text between tags is skipped by both parsers. - for (let a = index(s, '<'); a >= 0; a = index(s, '<')) { - let b = index(substr(s, a), '>'); - if (b < 0) - return sprintf(_('%s has a tag that is not closed with >.'), name); - let tag = substr(s, a + 1, b - 1); - if (!itag_ok(tag)) - return sprintf(_('%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .'), - name, length(tag) > 24 ? `${substr(tag, 0, 24)}…` : tag); - s = substr(s, a + b + 1); - } - return null; -} - -/** Signature packets I1-I5: their tags, and all of them in one device's configuration (one QR code). */ -function itags_unsafe(o, errs) { - let total = 0; - for (let k in [ 'i1', 'i2', 'i3', 'i4', 'i5' ]) { - if (!given(o, k)) - continue; - total += length(`${o[k]}`); - let e = itag_error(OBF_CONF[k], `${o[k]}`); - if (e) - push(errs, e); - } - if (total > 2000) - push(errs, sprintf(_('I1-I5 together must be at most 2000 characters, not %d.'), total)); -} - -/** - * What in disguise values `o` AmneziaWG would refuse, crash on or break - * devices with: what an import, a restore or a hand edit in uci must never - * hand to the kernel (dawnline.backup, dawnline.netifd). Only those rules, - * none of Dawnline's own bounds (obf_errors): a backup the kernel takes stays - * usable. Sentences in the reader's language; [] when the values are safe. - */ -export function obf_unsafe(o) { - o ??= {}; - let errs = []; - let num = (k) => given(o, k) ? uint(trim(`${o[k]}`), 65535) : 0; - // 16-bit numbers for the tools; Jmin above Jmax sizes junk past its buffer (kmod #225). - for (let k in [ 'jc', 'jmin', 'jmax', 's1', 's2', 's3', 's4' ]) - if (num(k) == null) - push(errs, sprintf(_('%s must be a whole number from 0 to 65535.'), OBF_CONF[k])); - if (given(o, 'jmin') && given(o, 'jmax') && num('jmin') != null && num('jmax') != null && num('jmin') > num('jmax')) - push(errs, _('Jmin must not be larger than Jmax.')); - headers_unsafe(o, errs); - // Header protection: a 32-byte key, and every padding at least the 12 bytes of its nonce (the kernel checks). - if (given(o, 'header_protection_key')) { - if (!valid_key(o.header_protection_key)) - push(errs, _('The header protection key is not a key.')); - for (let k in [ 's1', 's2', 's3', 's4' ]) - if (num(k) != null && num(k) < 12) - push(errs, sprintf(_('%s must be at least 12 with header protection.'), OBF_CONF[k])); - } - // 3.1 timers and counts: 0 alone is the kernel's default; a 0 in a range - // would fire at once. Keys are dropped after 180 seconds whatever is set. - for (let k in [ 'rekey_after_time', 'rekey_timeout', 'reject_after_time', 'keepalive_timeout', 'max_handshake_attempts' ]) { - let r = given(o, k) ? uint_range(o[k], 65535) : [ 0, 0 ]; - if (!r || (r[0] == 0 && r[1] > 0)) - push(errs, sprintf(_('%s must be a number or a range like 5-15, from 1 to 65535.'), OBF_CONF[k])); - else if (k == 'reject_after_time' && r[1] > 180) - push(errs, _('RejectAfterTime must be at most 180 seconds.')); - } - if (given(o, 'content_padding_addition') && !uint_range(o.content_padding_addition, 65535)) - push(errs, sprintf(_('%s must be a number or a range like 10-100, up to 65535.'), OBF_CONF.content_padding_addition)); - // What both netifd and the .conf parser read as a switch. - for (let k in [ 'random_trailers', 'disable_cookies' ]) - if (given(o, k) && index([ 'on', 'off', '1', '0' ], `${o[k]}`) < 0) - push(errs, sprintf(_('%s must be on or off.'), OBF_CONF[k])); - itags_unsafe(o, errs); - return errs; -}; - -/** - * What is wrong with the disguise values of a server Dawnline sets up: what - * AmneziaWG refuses (obf_unsafe), and Dawnline's own bounds on top (junk that - * stays under the path MTU, a handshake initiation and response that never - * share a size). Its presets pass it. Sentences in the reader's language; [] - * when the values are fine. - */ -export function obf_errors(o) { - o ??= {}; - let errs = obf_unsafe(o); - for (let k, r in OBF_SPEC) { - let n = given(o, k) ? uint(trim(`${o[k]}`), 65535) : null; - if (n != null && (n < r[0] || n > r[1])) - push(errs, sprintf(_('%s must be from %d to %d.'), OBF_CONF[k], r[0], r[1])); - } - if (o.s1 != null && o.s2 != null && +o.s1 + 56 == +o.s2) - push(errs, _('S2 must not be S1 + 56: the handshake initiation and response would have the same size.')); - return errs; -}; - -/** - * Disguise values `o` as anyone who may read the status sees them: all but - * the header protection key, a secret every device of the server shares - * (with it and the server's public key, captured traffic can be unmasked). - * Devices get it in their own configuration (client_config). - */ -export function obf_public(o) { - let out = { ...(o ?? {}) }; - delete out.header_protection_key; - return out; -}; - -/* - * Everything but a device's own local network, for a device whose local - * network stays outside the tunnel (lan_bypass): every IPv4 address outside - * the private ranges the access table drops for internet people anyway - * (dawnline.nft PRIVATE4: 10/8, 172.16/12, 192.168/16, 100.64/10, - * 169.254/16, 224/3), and every IPv6 address outside fc00::/7, fe80::/10 - * and ff00::/8. Fixed lists (tests/ucode/awg.test.uc proves each is exactly - * that complement); what of the private ranges goes through the tunnel after - * all (DNS, home) is added to them. - */ -export const BYPASS4 = [ - '0.0.0.0/5', '8.0.0.0/7', '11.0.0.0/8', '12.0.0.0/6', '16.0.0.0/4', '32.0.0.0/3', '64.0.0.0/3', '96.0.0.0/6', - '100.0.0.0/10', '100.128.0.0/9', '101.0.0.0/8', '102.0.0.0/7', '104.0.0.0/5', '112.0.0.0/4', '128.0.0.0/3', '160.0.0.0/5', - '168.0.0.0/8', '169.0.0.0/9', '169.128.0.0/10', '169.192.0.0/11', '169.224.0.0/12', '169.240.0.0/13', '169.248.0.0/14', - '169.252.0.0/15', '169.255.0.0/16', '170.0.0.0/7', '172.0.0.0/12', '172.32.0.0/11', '172.64.0.0/10', '172.128.0.0/9', - '173.0.0.0/8', '174.0.0.0/7', '176.0.0.0/4', '192.0.0.0/9', '192.128.0.0/11', '192.160.0.0/13', '192.169.0.0/16', - '192.170.0.0/15', '192.172.0.0/14', '192.176.0.0/12', '192.192.0.0/10', '193.0.0.0/8', '194.0.0.0/7', '196.0.0.0/6', - '200.0.0.0/5', '208.0.0.0/4', -]; -export const BYPASS6 = [ '::/1', '8000::/2', 'c000::/3', 'e000::/4', 'f000::/5', 'f800::/6', 'fe00::/9', 'fec0::/10' ]; - -/** An IPv6 address BYPASS6 leaves out: in fc00::/7, fe80::/10 or ff00::/8 (the first 16 bits decide). False for anything else. */ -function private6(a) { - let g = ipv6_groups(a)?.[0]; - return g != null && ((g & 0xfe00) == 0xfc00 || (g & 0xffc0) == 0xfe80 || (g & 0xff00) == 0xff00); -} - -/** - * What a device sends into the tunnel (its AllowedIPs; the server's peer - * line stays its address/32). Home only: the person's home networks, the - * tunnel network or the router's address, and the DNS. Internet: everything, - * or with `dev.lan_bypass` everything but the device's own local network - * (BYPASS4, BYPASS6), every DNS server it is given (IPv4 and IPv6) and for - * home access what Home only gets. Without `dev`, as for a device without - * lan_bypass. - */ -export function allowed_ips(m, srv, p, dev) { - if (p.access != 'lan' && !dev?.lan_bypass) - return [ '0.0.0.0/0', '::/0' ]; - let home = () => { - let nets = core.person_home(srv, p).nets; - // With devices reaching each other, the whole tunnel network (the router's - // address is in it); otherwise only the router's own address. - let a = core.server_address(srv); - if (srv.device_mesh && srv.subnet) - push(nets, srv.subnet); - else if (a) - push(nets, `${a}/32`); - return nets; - }; - let dns = core.client_dns(m, srv, p); - if (p.access == 'lan') { - // The resolver address must be reachable through the tunnel too (not the fallback). - let nets = home(); - if (dns[0]) - push(nets, `${dns[0]}/32`); - return net.collapse(nets); - } - // Every DNS server stays in the tunnel: a private one left out would be - // asked on whatever network the device is on (a public one is in the rest). - let nets = [ ...BYPASS4 ], nets6 = []; - for (let a in dns) - if (ip2int(a) != null) - push(nets, `${a}/32`); - else if (private6(a)) - push(nets6, `${a}/128`); - if (p.access == 'both') - push(nets, ...home()); - return [ ...net.collapse(nets), ...BYPASS6, ...uniq(nets6) ]; -}; - - -/** True when the obfuscation settings change nothing on the wire (plain WireGuard). */ -export function obf_neutral(o) { - for (let k in core.OBF_KEYS) { - let v = o?.[k]; - if (v == null || v == '') - continue; - let want = { h1: '1', h2: '2', h3: '3', h4: '4' }[k] ?? '0'; - if (`${v}` != want) - return false; - } - return true; -}; - -/** - * The junk a device sends is its own: within the preset's own ranges, the - * count and sizes are shifted a little by the device (deterministic, so the - * configuration keeps its fingerprint), so two phones of one family do not - * share one profile. Server-side values (headers, padding sizes, the header - * protection key) stay the server's. - */ -function client_obf(srv, dev) { - let o = { ...srv.obf }; - if (obf_neutral(o) || !(+o.jc > 0)) - return o; - let key = `${srv.id}/${dev.id}/${srv.obf.h1 ?? ''}`; - let seed = 2166136261; - for (let i = 0; i < length(key); i++) - seed = ((seed ^ ord(key, i)) * 16777619) & 0x7fffffff; - let pick = (n) => { - seed = (seed * 1103515245 + 12345) & 0x7fffffff; - return seed % n; - }; - let jc = +o.jc, jmin = +o.jmin, jmax = +o.jmax; - o.jc = `${max(1, min(10, jc + pick(3) - 1))}`; - if (jmax > jmin + 32) { - let d = pick(17); - o.jmin = `${jmin + d}`; - o.jmax = `${jmax - pick(17)}`; - if (+o.jmax <= +o.jmin) - o.jmax = `${+o.jmin + 32}`; - } - return o; -} - -/** - * The keep-alive `dev` gets (its own or the server's, core.device_keepalive) - * as [ lo, hi ] seconds; null when it is off (0). With 3.1 (header - * protection: its apps take ranges) jittered over ten seconds like the other - * timers, since a fixed beat would be the one regular thing left. The online - * window follows its upper end (dawnline.live). - */ -export function keepalive_range(srv, dev) { - let k = core.device_keepalive(srv, dev); - if (!(k > 0)) - return null; - return srv.obf?.header_protection_key ? [ k, k + 10 ] : [ k, k ]; -}; - -/** - * The longest an idle device goes between two handshakes, in seconds; null - * when its keep-alive is off (an idle device then sends nothing at all). Its - * keep-alive packets are what it sends, and the first one after its key's - * rekey time (RekeyAfterTime, WireGuard's 120 s; past 180 s the key is - * refused anyway) starts a handshake (kmod send.c keep_key_fresh): up to one - * keep-alive past that time, or each keep-alive once they are further apart. - */ -export function idle_handshake(srv, dev) { - let ka = keepalive_range(srv, dev); - if (!ka) - return null; - let rekey = min(uint_range(srv.obf?.rekey_after_time ?? '', 65535)?.[1] || 120, 180); - return ka[0] > rekey ? ka[1] : rekey + ka[1]; -}; - -/** - * keepalive_range() as the apps write it ("25-35", "25"); null when off. The - * .conf and the AmneziaVPN key carry the same text (AmneziaVPN hands it on as - * written, ranges included). - */ -function keepalive_text(srv, dev) { - let r = keepalive_range(srv, dev); - if (!r) - return null; - return r[0] == r[1] ? `${r[0]}` : `${r[0]}-${r[1]}`; -} - -export function client_config(m, dev) { - let p = m.people[dev.person]; - let srv = p ? m.servers[p.server] : null; - if (!srv) - return null; - let host = core.endpoint_host(m, srv); - let ep = index(host, ':') >= 0 && substr(host, 0, 1) != '[' ? `[${host}]` : host; - let allowed = allowed_ips(m, srv, p, dev); - let dns = core.client_dns(m, srv, p); - let mtu = core.device_mtu(srv, dev); - let lines = [ '[Interface]' ]; - push(lines, `PrivateKey = ${dev.private_key || ''}`); - push(lines, `Address = ${dev.address}/32`); - if (length(dns)) - push(lines, `DNS = ${join(', ', dns)}`); - push(lines, `MTU = ${mtu}`); - // "Off" is plain WireGuard: neutral values (no junk, H1-H4 = 1-4) are left - // out, so any WireGuard app accepts the file. - let obf = client_obf(srv, dev); - if (!obf_neutral(obf)) - for (let k in core.OBF_KEYS) - if (obf[k] != null && obf[k] != '') - push(lines, `${OBF_CONF[k]} = ${obf[k]}`); - push(lines, '', '[Peer]'); - push(lines, `PublicKey = ${srv.public_key}`); - if (dev.preshared_key) - push(lines, `PresharedKey = ${dev.preshared_key}`); - push(lines, `AllowedIPs = ${join(', ', allowed)}`); - push(lines, `Endpoint = ${ep}:${srv.port}`); - let keepalive = keepalive_text(srv, dev); - if (keepalive) - push(lines, `PersistentKeepalive = ${keepalive}`); - return { - name: dev.name, - person: p.name, - server: srv.name, - // The file name is the tunnel's name in WireGuard apps: the server's, in the portal and the admin alike. - filename: `${tunnel_name(srv.name)}.conf`, - conf: join('\n', lines) + '\n', - has_private_key: dev.private_key != '', - amnezia: { - host, - port: srv.port, - mtu: `${mtu}`, - dns, - allowed_ips: allowed, - client_ip: dev.address, - client_priv_key: dev.private_key, - client_pub_key: dev.public_key, - psk_key: dev.preshared_key, - server_pub_key: srv.public_key, - persistent_keep_alive: keepalive ?? '0', - obfuscation: obf, - }, - }; -}; - - - - -/* ---------- the server's tunnel ---------- */ - -/** netifd options of the server's interface (proto amneziawg). */ -export function netifd_options(srv) { - let addr = core.server_address(srv); - let prefix = split(srv.subnet, '/')[1]; - let o = { - proto: 'amneziawg', - private_key: srv.private_key, - listen_port: srv.port, - addresses: [ `${addr}/${prefix}` ], - mtu: core.tunnel_mtu(srv), - }; - for (let k in core.OBF_KEYS) - o[`awg_${k}`] = srv.obf[k]; - // DisableCookies is the devices' alone (their .conf and key keep it): on - // the server it would turn off WireGuard's own defence against a flood of - // handshakes (cookie replies and a per-address limit, only ever under - // load), and anyone who held a configuration could keep both cores busy. - // Null takes it off an interface that had it. - o.awg_disable_cookies = null; - return o; -}; - -/** Person states whose devices stay in the tunnel: active, and the limits the portal explains. */ -export const SOFT_STATES = [ 'active', 'quota', 'hours' ]; - -/** - * The devices sync_peers() loads into server `sid`'s tunnel, in the model's - * order (an empty list when none). Pure: the model and the people's states - * (apply.states_for). Health and the agent compare a running tunnel with it. - */ -export function tunnel_devices(m, sid, states) { - let out = []; - let own = m.servers?.[sid]?.public_key; - for (let did, d in m.devices) { - let p = m.people[d.person]; - // One malformed line makes syncconf refuse the whole server: such a device - // stays out (Health's Data check names it), and so does one with the - // server's own key, which the kernel silently ignores (it would look - // missing for ever). Over the data limit or outside the allowed hours the - // tunnel stays: the access table blocks everything but the portal, which - // says why (a silent handshake failure would look like a broken VPN). - if (p && p.server == sid && !d.disabled && index(SOFT_STATES, states[p.id]) >= 0 && valid_key(d.public_key) && ip2int(d.address) != null && - (!own || d.public_key != own)) - push(out, d); - } - return out; -}; - -/** - * How the peers dump() read on `ifname` differ from the devices that belong - * there (tunnel_devices): { loaded, missing, extra }, counted by key, not by - * number (a stale peer standing in for a missing one would make the numbers - * match). Pure. - */ -export function peer_diff(devs, dmp, ifname) { - let want = {}; - for (let d in devs) - want[d.public_key] = true; - let loaded = 0, extra = 0, found = 0; - for (let k, p in dmp.peers) - if (p.ifname == ifname) { - loaded++; - if (want[k]) - found++; - else - extra++; - } - return { loaded, missing: length(keys(want)) - found, extra }; -}; - -/** Push the peer list of every server to the kernel without restarting it. */ -// Each tunnel's peers as last loaded ({ ifname: [ "Person · Device (address)" ] }), so a log line can say who came and went. -const PEERS_SEEN = `${RUN_DIR}/peers-seen.json`; - -export function sync_peers(m, states) { - ensure_dir(RUN_DIR); - let res = {}; - let seen = read_json(PEERS_SEEN, {}), now = {}; - for (let id, srv in m.servers) { - // Only Dawnline's own interfaces: never another tunnel of the same name (core.tunnels). - if (!srv.enabled || !length(core.tunnels(srv))) - continue; - if (system(`awg show ${q(srv.ifname)} public-key >/dev/null 2>&1`) != 0) { - res[id] = 'down'; - syslog('debug', 'awg', `interface ${srv.ifname} (${srv.name}): down, no devices to load`); - continue; - } - let lines = [ '[Interface]', `PrivateKey = ${srv.private_key}`, `ListenPort = ${srv.port}`, '' ]; - let who = []; - for (let d in tunnel_devices(m, id, states)) { - push(lines, '[Peer]', `PublicKey = ${d.public_key}`); - if (d.preshared_key) - push(lines, `PresharedKey = ${d.preshared_key}`); - push(lines, `AllowedIPs = ${d.address}/32`, ''); - push(who, `${m.people[d.person]?.name ?? d.person} · ${d.name} (${d.address})`); - } - let f = `${RUN_DIR}/${srv.ifname}.conf`; - write_file(f, join('\n', lines)); - let r = sh(`awg syncconf ${q(srv.ifname)} ${f}`); - unlink(f); - res[id] = r.code == 0 ? 'ok' : trim(r.out); - if (r.code != 0) { - slog('awg', 'error', L_("couldn't load devices into the tunnel"), trim(r.out), srv.name); - continue; - } - // Who came in and who left since the last load: info; the same peers: debug. - now[srv.ifname] = who; - let was = seen[srv.ifname]; - let head = `interface ${srv.ifname} (${srv.name}): awg syncconf · listen port ${srv.port} · ${length(who)} ${length(who) == 1 ? 'peer' : 'peers'}`; - // The first load since the router started (or since the tunnel came up): how many, the names at debug. - if (was == null) { - syslog('info', 'awg', `${head} loaded`); - syslog('debug', 'awg', `interface ${srv.ifname}: ${join(', ', who)}`); - continue; - } - let add = filter(who, (x) => index(was, x) < 0), del = filter(was, (x) => index(who, x) < 0); - if (length(add) || length(del)) - syslog('info', 'awg', `${head}${length(add) ? ' · added ' + some_of(add) : ''}${length(del) ? ' · removed ' + some_of(del) : ''}`); - else - syslog('debug', 'awg', `${head}, unchanged`); - } - if (sprintf('%J', now) != sprintf('%J', seen)) - write_json(PEERS_SEEN, now, 0o600); - return res; -}; - -/** The interface's index while it exists (a new one each time netifd sets the tunnel up), else null. */ -function ifindex(ifname) { - let s = trim(readfile(`/sys/class/net/${ifname}/ifindex`) ?? ''); - return s != '' ? +s : null; -} - -/* - * One interface's `awg show dump` into `out` (see dump()). Lines are - * told apart by their shape, not their length (each AmneziaWG generation adds - * fields to the interface line): an interface line carries its private and - * public key and a port, a peer line the peer's key, a preshared key or - * "(none)" and an endpoint. Unlike `show all`, the lines have no ifname. - */ -function read_iface(out, ifname) { - // Read around the call: a link set up again in between gave counters of either one. - let before = ifindex(ifname); - // Not there (a tunnel netifd could not bring up, AmneziaWG gone after an - // upgrade): no process to learn it. One that appears is read next time. - if (before == null) { - out.reads[ifname] = 'down'; - return; - } - let r = sh(`awg show ${q(ifname)} dump`); - let ix = ifindex(ifname); - let iface = null, peers = {}; - if (r.code == 0) - for (let line in split(r.out, '\n')) { - let f = split(line, '\t'); - if (length(f) < 4 || !valid_key(f[0])) - continue; - let key2 = valid_key(f[1]); - if (key2 && match(f[2], DIGITS)) - iface = { public_key: f[1], port: +f[2], ifindex: ix }; - else if (length(f) >= 8 && (key2 || f[1] == '(none)')) - peers[f[0]] = { - ifname, - endpoint: f[2] == '(none)' ? '' : f[2], - handshake: +f[4], - rx: +f[5], - tx: +f[6], - }; - } - let read = iface != null; - // Gone during the read: its peers and their counters are gone with it. - if (ix == null) { - out.reads[ifname] = 'down'; - return; - } - if (!read || ix != before) { - out.reads[ifname] = 'error'; - out.ok = false; - return; - } - out.reads[ifname] = 'read'; - out.ifaces[ifname] = iface; - for (let k, p in peers) - out.peers[k] = p; -} - -/** - * Dawnline's own tunnels, one `awg show dump` each for `ifnames` - * (live.tunnel_ifnames): never `all`, so another AmneziaWG interface on the - * router (a client tunnel with long I1-I5, say) neither slows the 1-second - * watcher down nor has its keys read. Returns { ok, reads: { ifname: 'read' | - * 'down' | 'error' }, ifaces: { ifname: { public_key, port, ifindex } }, - * peers: { pubkey: { ifname, endpoint, handshake, rx, tx } } }, with only - * what was read in `ifaces` and `peers`: - * down the interface does not exist (/sys/class/net has no such link; - * no process is started for it): its peers and counters are gone - * error it exists but could not be read (or was set up again during the - * read): that says nothing about its peers - * `ok` is false when any of them is 'error' (true for an empty list). - */ -export function dump(ifnames) { - let out = { ok: true, reads: {}, ifaces: {}, peers: {} }; - for (let ifn in ifnames ?? []) - read_iface(out, ifn); - return out; -}; - -/** Is the server's tunnel up and listening (for status and Overview). */ -export function server_state(srv) { - let st = iface_status(srv.ifname); - return { up: !!st?.up, uptime: st?.uptime ?? 0 }; -}; - -/* ---------- why a tunnel is kept down ---------- */ - -/* - * dawnline.netifd keeps a server's tunnel down for a reason, kept per server - * in core.BLOCKED and loaded as `srv.blocked`. apply writes it, at boot and - * from the agent with no language, so it holds a code and its values, made - * into text when read: - * { code: 'ifname', ifname } the interface name is invalid - * { code: 'taken', ifname } network. exists and isn't Dawnline's - * { code: 'disguise', need, installed } obf_unsupported() - * { code: 'disguise_invalid' } obf_unsafe() finds values AmneziaWG refuses - * (said again from the server's values when read) - * Files written by older versions hold the English fragment ("has an invalid - * interface name …"), shown as it is. - */ - -/** A reason as the service log says it after the server's name: English, like every log line. */ -export function blocked_note(r) { - if (type(r) != 'object') - return `${r}`; - if (r.code == 'ifname') - return sprintf(L_('has an invalid interface name "%s"'), r.ifname); - if (r.code == 'taken') - return sprintf(L_("can't use the network interface %s: it exists and isn't Dawnline's"), r.ifname); - if (r.code == 'disguise') - return r.installed ? sprintf(L_('is kept down: its disguise needs AmneziaWG %s (installed: %s)'), r.need, r.installed) - : sprintf(L_('is kept down: its disguise needs AmneziaWG %s (installed: none)'), r.need); - if (r.code == 'disguise_invalid') - return L_('is kept down: its disguise has values AmneziaWG cannot take'); - return L_('is kept down'); -}; - -/** What to do about a reason (blocked_note), for the service log's details. */ -export function blocked_fix(r) { - if (r?.code == 'disguise') - return L_('Install that AmneziaWG build in Dawnline → Components, or switch the disguise on the Server page.'); - if (r?.code == 'disguise_invalid') - return L_('Choose a disguise on the Server page: it replaces the values set by hand.'); - return L_('Choose another interface name in the server settings.'); -}; - -/** - * Why the server's tunnel is kept down (`srv.blocked`), as a sentence with - * its name in the reader's language: what the admin UI shows. Null when it - * is not kept down. - */ -export function blocked_text(srv) { - let r = srv?.blocked; - if (!r) - return null; - if (type(r) != 'object') - return `${srv.name} ${r}.`; - if (r.code == 'ifname') - return sprintf(_('%s has an invalid interface name "%s".'), srv.name, r.ifname); - if (r.code == 'taken') - return sprintf(_("%s can't use the network interface %s: it exists and isn't Dawnline's."), srv.name, r.ifname); - if (r.code == 'disguise') - return r.installed - ? sprintf(_('%s is kept down: its disguise needs AmneziaWG %s (installed: %s).'), srv.name, r.need, r.installed) - : sprintf(_('%s is kept down: its disguise needs AmneziaWG %s (installed: none).'), srv.name, r.need); - // Which values, from the server's own (the reason is kept as a code). - if (r.code == 'disguise_invalid') - return trim(sprintf(_('%s is kept down: its disguise has values AmneziaWG cannot take. %s'), srv.name, join(' ', obf_unsafe(srv.obf)))); - return sprintf(_('%s is kept down.'), srv.name); -}; - -/* ---------- watchdog ---------- */ - -/** Why a tunnel is down, from netifd and the last related syslog lines. */ -export function iface_errors(ifname) { - let s = iface_status(ifname); - let errs = map(s?.errors ?? [], (e) => e.code + (length(e.data ?? []) ? ` (${join(' ', e.data)})` : '')); - // Only what explains a failure, not the ordinary "is now up/down" lines. - let lines = sh_out(`logread -l 400 2>/dev/null | grep -E ${q(`${ifname}|amneziawg`)} | grep -iE 'error|fail|invalid|unrecogni|cannot|unable|not found|refused|denied' | tail -n 6`); - return join('\n', filter([ length(errs) ? `netifd: ${join(', ', errs)}` : null, lines ], (x) => x)); -}; - -/** - * What the watchdog looks at for AmneziaWG (see dawnline.watchdog): - * AmneziaWG itself, then every running server's tunnel. `ctx.udp_listening`, - * `ctx.reapply` and `ctx.owner` (dawnline.netifd) come from the watchdog - * (ops, apply and netifd import this module). - */ -export function probes(m, ctx) { - let out = []; - let srvs = filter(values(m.servers), (x) => x.enabled && x.private_key); - if (!length(srvs)) - return out; - // AmneziaWG itself first: without it no tunnel can run (they come back on the next pass). - // Missing packages and an unknown protocol are reported once; only the module can be loaded here. - let st = state(); - let base = { id: 'awg', src: 'awg', name: 'AmneziaWG', who: 'AmneziaWG', back: L_('is ready again') }; - if (!st.tools || !st.kmod) { - push(out, { ...base, ok: false, repair: null, - problem: st.tools ? L_("kernel module isn't installed: no tunnel can run - install it in Dawnline → Components") - : L_("isn't installed: no tunnel can run - install it in Dawnline → Components"), - detail: () => sprintf(L_('Missing: %s.'), join(', ', st.missing)) }); - return out; - } - push(out, { ...base, ok: st.loaded && st.handler, - problem: !st.loaded ? L_("kernel module isn't loaded") : L_("isn't known to the network service - restart the network or reboot"), - detail: !st.loaded - ? () => sh_out("modprobe amneziawg 2>&1; dmesg 2>/dev/null | grep -i amneziawg | grep -iE 'error|fail|invalid|unknown|disagrees|taint' | tail -n 4") - : () => L_('netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed.'), - repair: !st.loaded ? { what: L_('loading it'), run: () => system('modprobe amneziawg >/dev/null 2>&1') } : null, - }); - // Without the protocol handler ifup cannot work: the tunnels are not probed (or restarted) one by one. - if (st.loaded && !st.handler) - return out; - for (let srv in srvs) { - // A tunnel Dawnline may not set up (dawnline.netifd) is reported, never restarted: - // an interface of the same name that isn't Dawnline's may be your LAN. - let own = core.valid_ifname(srv.ifname) ? ctx.owner?.(srv.ifname) : null; - let why = srv.blocked ?? (!core.valid_ifname(srv.ifname) ? { code: 'ifname', ifname: srv.ifname } - : own != null && own != srv.id ? { code: 'taken', ifname: srv.ifname } : null); - if (why) { - push(out, { - id: `up_${srv.id}`, src: 'awg', name: `${srv.name} · AmneziaWG`, who: srv.name, ok: false, repair: null, - problem: blocked_note(why), back: L_('AmneziaWG is running again'), - detail: () => blocked_fix(why), - }); - continue; - } - let s = iface_status(srv.ifname); - let up = !!s?.up; - push(out, { - id: `up_${srv.id}`, src: 'awg', name: `${srv.name} · AmneziaWG`, who: srv.name, ok: up && ctx.udp_listening(srv.port), - problem: !s ? L_('AmneziaWG is missing from the router') : !up ? L_("AmneziaWG isn't running") - : sprintf(L_("AmneziaWG isn't accepting connections on port %d"), srv.port), - back: sprintf(L_('AmneziaWG is running again · accepting connections on port %d'), srv.port), - detail: () => iface_errors(srv.ifname), - repair: s ? { what: L_('restarting it'), run: () => system(`ifup ${q(srv.ifname)}`) } : { what: L_('setting it up again'), run: ctx.reapply }, - }); - } - return out; -}; - -/* ---------- issued configurations ---------- */ - -const ISSUED = `${DATA_DIR}/issued.json`; -// The lines a fingerprint leaves out. A module constant, compiled once, not -// for each line of each device's configuration. -const DEVICE_OWN = /^(PrivateKey|Jc|Jmin|Jmax) /; - -function fnv32(str) { - let h = 2166136261; - for (let i = 0; i < length(str); i++) - h = ((h ^ ord(str, i)) * 16777619) & 0xffffffff; - return sprintf('%08x', h); -} - -/** - * What a device holds, minus its private key: changes when it must import - * again. The junk count and sizes (Jc, Jmin, Jmax) are the device's own and - * never have to match the server, so they are left out: a change there is - * no reason to import again. - */ -export function config_fingerprint(m, dev) { - let c = dev ? client_config(m, dev) : null; - return c ? fnv32(join('\n', filter(split(c.conf, '\n'), (l) => !match(l, DEVICE_OWN)))) : null; -}; - -/** Device id → fingerprint of the configuration last shown or downloaded. */ -export function issued() { - return read_json(ISSUED, {}); -}; - -/** Remember that a device was just given its current configuration. */ -export function mark_issued(m, id) { - let fp = config_fingerprint(m, m.devices[id]); - if (!fp) - return; - let l = lock('issued'); - let all = issued(); - if (all[id] != fp) { - all[id] = fp; - for (let k in keys(all)) - if (!m.devices[k]) - delete all[k]; - ensure_dir(DATA_DIR, 0o700); - write_json(ISSUED, all, 0o600); - } - unlock(l); -}; - -/* ---------- set up again (Reconnect) ---------- */ - -const RECONNECT = `${DATA_DIR}/reconnect.json`; - -/** Device id → when the person asked to set it up again (router clock). */ -export function reconnects() { - return read_json(RECONNECT, {}); -}; - -/** - * The handshake a device counts with: none from before it was set up again, - * so it shows "Not set up yet" until it connects after that. - */ -export function handshake_since(hs, since) { - return since && hs <= since ? 0 : hs; -}; - -/** A device is set up again: handshakes up to `at` (router clock) are its old configuration's. */ -export function mark_reconnect(m, id, at) { - let l = lock('reconnect'); - let all = reconnects(); - all[id] = at ?? time(); - for (let k in keys(all)) - if (!m.devices[k]) - delete all[k]; - ensure_dir(DATA_DIR, 0o700); - write_json(RECONNECT, all, 0o600); - unlock(l); -}; - diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg_builds.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg_builds.uc deleted file mode 100644 index d2a6980..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/awg_builds.uc +++ /dev/null @@ -1,170 +0,0 @@ -// Dawnline — where AmneziaWG comes from: the awg-openwrt projects publish -// builds per OpenWrt release and target (the kernel module must match the -// firmware), and the record of what was installed on which kernel and boot -// (an update whose module could not be swapped starts with the next boot: -// until then caps() and Health go by the module that still runs). Used by -// the updater, the Components RPCs, dawnline.awg and Health. Installing -// itself is dawnline.upd_awg. - -import { readfile, stat } from 'fs'; -import { connect } from 'ubus'; -import { ensure_dir, read_json, write_json, DATA_DIR } from 'dawnline.util'; -import * as pkg from 'dawnline.pkg'; - -export const SOURCES = { - slava: { repo: 'Slava-Shchipunov/awg-openwrt', label: 'Slava-Shchipunov' }, - grey: { repo: '2Grey/awg-openwrt', label: '2Grey' }, -}; -/** Tried in this order when no build is chosen. */ -export const ORDER = [ 'slava', 'grey' ]; -export const PKGS = [ 'kmod-amneziawg', 'amneziawg-tools', 'luci-proto-amneziawg' ]; -export const RU = 'luci-i18n-amneziawg-ru'; - -/** - * This firmware as the builds name it: { tag: 'v24.10.6', postfix: - * '_v24.10.6_aarch64_cortex-a53_mediatek_filogic', ext }, or null. - */ -export function firmware() { - let u = connect(); - let b = u?.call('system', 'board') ?? {}; - u?.disconnect(); - let rel = b.release ?? {}; - let target = split(rel.target ?? '', '/'); - let arch = rel.arch ?? match(readfile('/etc/openwrt_release') ?? '', /DISTRIB_ARCH='([^']*)'/)?.[1]; - if (!rel.version || length(target) != 2 || !arch) - return null; - return { tag: `v${rel.version}`, postfix: `_v${rel.version}_${arch}_${target[0]}_${target[1]}`, ext: pkg.ext(), - snapshot: match(rel.version, /SNAPSHOT/) != null }; -}; - -/** What was installed, for whom: /etc/dawnline/awg.json (survives a sysupgrade with the data). */ -export const RECORD = `${DATA_DIR}/awg.json`; - -/** This boot (a new one loads the module on disk), or null when the kernel does not say. */ -export function boot_id() { - return trim(readfile('/proc/sys/kernel/random/boot_id') ?? '') || null; -}; - -/** - * The size in memory of the loaded kernel module, or null when none is - * loaded. sysfs has no version for it, but builds differ in size: a module - * reloaded by hand ends a wait for a reboot (pending()). - */ -export function module_core() { - let n = int(trim(readfile('/sys/module/amneziawg/coresize') ?? '')); - return n > 0 ? n : null; -}; - -/** - * Remember which build was installed on which kernel. After a firmware - * upgrade the module is gone (it was built for that kernel): Health can then - * say so and offer the build for the new one (dawnline.health). `run` comes - * from an install: prev_gen and prev_core, the module that ran before it - * (module_now()), and reloaded, false while that one stays loaded until the - * next boot. null for a module Dawnline did not install (adopt()). - */ -export function record(source, tag, packages, run) { - ensure_dir(DATA_DIR, 0o700); - write_json(RECORD, { - osrelease: trim(readfile('/proc/sys/kernel/osrelease') ?? ''), - source, tag, packages, installed: time(), boot: boot_id(), - prev_gen: run?.prev_gen ?? null, prev_core: run?.prev_core ?? null, reloaded: run?.reloaded ?? null, - }, 0o600); -}; - -/** - * A record for a module Dawnline did not install (install.sh, by hand, or - * before Dawnline kept records), so kernel_changed() notices the next - * firmware upgrade: the kernel it is for, source null, `installed` the time - * Dawnline first saw it. Only when there is no record and the module is - * loaded or on disk for the running kernel. The agent calls it when it starts. - */ -export function adopt() { - let rel = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - if (stat(RECORD) || (!stat('/sys/module/amneziawg') && (rel == '' || !stat(`/lib/modules/${rel}/amneziawg.ko`)))) - return; - record(null, null, null, null); -}; - -/** - * The firmware the recorded AmneziaWG build was for, when it is not this one - * (and the module is gone): { was, now, tag, source }, else null. - */ -export function kernel_changed() { - let r = read_json(RECORD, null); - let now = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - if (!r?.osrelease || r.osrelease == now) - return null; - return { was: r.osrelease, now, tag: r.tag, source: r.source }; -}; - -/** The file name of a package in a build. */ -export function asset(fw, name) { - return `${name}${fw.postfix}.${fw.ext}`; -}; - -/** The same firmware, another release of its series (v24.10.6 → v24.10.8). */ -export function for_tag(fw, tag) { - return { ...fw, tag, postfix: replace(fw.postfix, fw.tag, tag) }; -}; - -/** - * AmneziaWG generation of a package version: 3.x packages carry 3.1; 1.0.x - * ones are 2.0 (S3/S4, I1-I5, header ranges) from July 2025 on, and the - * first generation before that. A kernel module's version carries the kernel - * release in front (6.12.94.3.1.20260906): the AmneziaWG part is at the end. - */ -export function gen(version) { - if (version == null) - return null; - let v = match(`${version}`, /([0-9]+\.[0-9]+\.[0-9]{8})(-r?[0-9]+)?$/)?.[1] ?? `${version}`; - if (match(v, /^3\./)) - return '3.1'; - if (match(v, /^1\.0\.2024/) || match(v, /^1\.0\.20250[1-6]/)) - return '1.0'; - return '2.0'; -}; - -/** - * An installed update that waits for a reboot: the install could not swap - * the kernel module (the old one stayed loaded), this is still the boot it - * ran in, and the module loaded is still the one from before it (core: - * module_core() now). Pure: rec is the record or null. - */ -export function pending(rec, boot, core) { - return rec?.reloaded === false && rec.boot != null && rec.boot == boot && core != null && rec.prev_core == core; -}; - -/** - * The AmneziaWG generation of the kernel module that runs: the one from - * before the install while it waits for a reboot (pending(); null when that - * module had no package), else the installed package's version (gen()). - * Pure, with the record, this boot and module_core() passed in. - */ -export function running_gen(rec, boot, core, version) { - return pending(rec, boot, core) ? rec.prev_gen : gen(version); -}; - -/** - * The kernel module loaded now, taken before an install changes packages: - * { core, gen, pending }. core is null when none is loaded; gen is what it - * runs (running_gen(), from `version`, the kmod-amneziawg package installed - * now); pending, an earlier update that still waits for a reboot. - */ -export function module_now(version) { - let rec = read_json(RECORD, null), boot = boot_id(), core = module_core(); - return { core, gen: core == null ? null : running_gen(rec, boot, core, version), pending: pending(rec, boot, core) }; -}; - -/** The installed AmneziaWG update waits for a reboot (pending(), for Health and Components). */ -export function waits_for_reboot() { - return pending(read_json(RECORD, null), boot_id(), module_core()); -}; - -/** The installed AmneziaWG packages: { name: version | null }. */ -export function installed() { - let r = {}; - for (let p in PKGS) - r[p] = pkg.version(p); - return r; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc deleted file mode 100644 index 396d752..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/backup.uc +++ /dev/null @@ -1,326 +0,0 @@ -// Dawnline — backups (tar.gz of the config and its data files), restoring -// them, and the JSON export / import. Whatever comes back in is checked first: -// only Dawnline's own regular files, and servers that cannot take over one of -// the router's own interfaces or networks, or hand the kernel disguise values -// AmneziaWG refuses. - -import { readfile, stat, unlink, lsdir, rename } from 'fs'; -import { cursor } from 'uci'; -import { - q, sh, ensure_dir, read_json, write_json, write_file, file_exists, rand_hex, lock, unlock, DATA_DIR, RUN_DIR, VERSION -} from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as net from 'dawnline.net'; -import * as health from 'dawnline.health'; -import { _ } from 'dawnline.i18n'; - -const BACKUP_DIR = `${DATA_DIR}/backups`; -/** - * How many backups of each kind stay (the newest): the nightly ones must not - * push out what the admin made by hand or what a removal left behind. - */ -const KEEP = { manual: 10, auto: 7, 'pre-delete': 5, 'pre-remove': 3, 'pre-update': 3, 'pre-restore': 3, 'pre-import': 3 }; -const NAME = /^dawnline-([0-9]{8}-[0-9]{6})(-([a-z0-9-]+))?\.tar\.gz$/; -/** What a backup holds (paths inside the archive, relative to /). */ -const FILES = [ 'etc/config/dawnline', 'etc/dawnline/usage.json', 'etc/dawnline/events.json' ]; -/** - * Kinds that hold the config alone (about 20 KB): the history can be a - * megabyte or more, and these are made often and never to bring history - * back. Manual, pre-restore and pre-import backups protect the data that is - * about to be replaced, so they take everything. - */ -const CONFIG_ONLY = [ 'auto', 'pre-delete', 'pre-remove', 'pre-update' ]; -/** The unpacked size a backup may have (the upload itself is limited to 4 MB). */ -const MAX_UNPACKED = 16 * 1024 * 1024; - -/* ---------- checking a configuration before it is used ---------- */ - -/** - * What is wrong with a configuration about to replace the current one - * (cursor `c` holds it): each server must have a valid, unique interface - * name that is not one of the router's own interfaces, a free subnet, a - * unique port and disguise values AmneziaWG takes (awg.obf_unsafe), and the - * people and devices must be consistent (core.model_errors). [] when it can - * be used. - */ -export function config_errors(c) { - let m = core.load(c); - let errs = core.model_errors(m); - let nc = cursor(); - nc.load('network'); - let foreign = health.foreign_subnets(); - let internal = values(net.INTERNAL); - let ifnames = {}, ports = {}, subnets = []; - for (let id, srv in m.servers) { - for (let e in [ ...core.server_errors(m, srv, [ ...foreign, ...subnets ]), ...awg.obf_unsafe(srv.obf) ]) - push(errs, sprintf(_('Server %s: %s'), srv.name, e)); - if (ifnames[srv.ifname]) - push(errs, sprintf(_('Server %s: interface %s is also used by %s.'), srv.name, srv.ifname, ifnames[srv.ifname])); - ifnames[srv.ifname] = srv.name; - let t = nc.get('network', srv.ifname); - if (index(internal, srv.ifname) >= 0 || (t != null && (t != 'interface' || nc.get('network', srv.ifname, '_dawnline') == null))) - push(errs, sprintf(_("Server %s: %s is one of the router's own network interfaces."), srv.name, srv.ifname)); - if (ports[srv.port]) - push(errs, sprintf(_('Server %s: UDP %s is also used by %s.'), srv.name, srv.port, ports[srv.port])); - ports[srv.port] = srv.name; - if (srv.subnet) - push(subnets, srv.subnet); - } - return errs; -}; - -/** Check the config file in `dir` (as /etc/config/dawnline would be); dies listing the problems. */ -function check_config_dir(dir) { - ensure_dir(`${dir}/.delta`, 0o700); - // Its own delta directory: changes staged in LuCI must not leak into the check. - let c = cursor(dir, `${dir}/.delta`); - if (!c.load('dawnline')) - die(_('The configuration in this file cannot be read.')); - let errs = config_errors(c); - if (length(errs)) - die(sprintf(_("This configuration can't be used: %s"), join(' ', errs))); -} - -/** A private scratch directory under RUN_DIR (the caller removes it). */ -function scratch(kind) { - ensure_dir(RUN_DIR); - let dir = `${RUN_DIR}/${kind}.${rand_hex(4)}`; - system(`rm -rf ${q(dir)}; mkdir -m 700 -p ${q(dir)}`); - return dir; -} - -/* ---------- backups ---------- */ - -export function backup_list() { - let out = []; - for (let f in lsdir(BACKUP_DIR) ?? []) { - let mm = match(f, NAME); - if (!mm) - continue; - let st = stat(`${BACKUP_DIR}/${f}`); - push(out, { name: f, created: st?.mtime ?? 0, size: st?.size ?? 0, reason: mm[3] ?? 'manual' }); - } - return sort(out, (a, b) => b.created - a.created); -}; - -/** - * Make a backup now; returns its name. Written whole or not at all (a half - * archive from a full flash never shows up as a backup). Of each kind the - * oldest beyond KEEP are removed, except `keep` (the backup being restored, - * which must survive the backup made just before restoring it). - */ -export function backup_create(reason, keep) { - let kind = reason && match(reason, /^[a-z0-9-]{1,24}$/) ? reason : 'manual'; - let config_only = index(CONFIG_ONLY, kind) >= 0; - // Flush live counters first so the backup has current usage. - if (!config_only) { - let u = read_json(`${RUN_DIR}/usage.json`, null); - if (u) - write_json(`${DATA_DIR}/usage.json`, u, 0o600); - live.persist_events(); - } - ensure_dir(BACKUP_DIR, 0o700); - let t = localtime(); - let name = sprintf('dawnline-%04d%02d%02d-%02d%02d%02d%s.tar.gz', t.year, t.mon, t.mday, t.hour, t.min, t.sec, kind == 'manual' ? '' : `-${kind}`); - let want = config_only ? [ FILES[0] ] : FILES; - let files = join(' ', map(filter(want, (f) => file_exists(`/${f}`)), q)); - // Not a NAME until it is complete. - let tmp = `${BACKUP_DIR}/.${name}.tmp`; - let r = sh(`tar -czf ${q(tmp)} -C / ${files}`); - if (r.code != 0 || !rename(tmp, `${BACKUP_DIR}/${name}`)) { - unlink(tmp); - let why = trim(r.out); - die(why ? sprintf(_('Backup failed: %s'), why) : _('Backup failed: the archive could not be written (is the flash full?)')); - } - system(`chmod 600 ${q(BACKUP_DIR + '/' + name)}`); - let by_kind = {}; - for (let b in backup_list()) - if (b.name != keep && b.name != name) - push(by_kind[b.reason] ??= [], b); - for (let k, list in by_kind) - for (let i = KEEP[k] ?? 3; i < length(list); i++) - unlink(`${BACKUP_DIR}/${list[i].name}`); - return name; -}; - -function backup_path(name) { - if (!match(name ?? '', NAME)) - die(_('Invalid backup name.')); - let p = `${BACKUP_DIR}/${name}`; - if (!file_exists(p)) - die(_('Backup not found.')); - return p; -} - -/** - * Validate an archive: only Dawnline's own files, all of them regular files - * (no links, devices or directories), within a sane unpacked size. - */ -function check_archive(path) { - let r = sh(`tar -tvzf ${q(path)}`); - if (r.code != 0) - die(_('Not a valid backup archive.')); - let has_config = false, total = 0; - for (let line in split(trim(r.out), '\n')) { - let f = split(trim(line), /[ \t]+/); - let name = replace(f[length(f) >= 6 ? 5 : length(f) - 1] ?? '', /^\.?\//, ''); - // "-rw------- root/root 1234 2026-01-01 12:00:00 etc/config/dawnline"; links show "a -> b". - if (substr(line, 0, 1) != '-' || index(line, ' -> ') >= 0 || index(line, ' link to ') >= 0) - die(sprintf(_('Unexpected entry in backup: %s'), name)); - if (index(FILES, name) < 0) - die(sprintf(_('Unexpected file in backup: %s'), name)); - total += +(f[2] ?? 0) || 0; - if (name == 'etc/config/dawnline') - has_config = true; - } - if (!has_config) - die(_('Backup does not contain /etc/config/dawnline.')); - if (total > MAX_UNPACKED) - die(_('Backup is too large.')); -} - -/** - * Put the files unpacked in `dir` in place, under the config lock. The - * config goes first: when it cannot be written nothing else is touched, and - * a data file that fails afterwards is reported, not ignored. - */ -function install_files(dir) { - ensure_dir(DATA_DIR, 0o700); - let l = lock('config'); - try { - for (let f in FILES) { - let data = readfile(`${dir}/${f}`); - if (data != null && !write_file(`/${f}`, data, 0o600)) - die(sprintf(_("Couldn't write %s. Is the flash full?"), `/${f}`)); - } - } - catch (e) { - unlock(l); - die(e.message); - } - unlock(l); - system('chmod 600 /etc/config/dawnline'); -} - -export function backup_restore(name, path) { - path ??= backup_path(name); - check_archive(path); - let dir = scratch('restore'); - try { - let r = sh(`tar -xzf ${q(path)} -C ${q(dir)} ${join(' ', map(FILES, q))} 2>/dev/null; test -f ${q(dir + '/etc/config/dawnline')}`); - if (r.code != 0) - die(_('Not a valid backup archive.')); - check_config_dir(`${dir}/etc/config`); - backup_create('pre-restore', name); - install_files(dir); - } - catch (e) { - system(`rm -rf ${q(dir)}`); - die(e.message); - } - system(`rm -rf ${q(dir)}`); - // Live counters must follow the restored file: the agent reloads them from - // flash on its next tick (its watcher may write the old ones again before). - unlink(`${RUN_DIR}/usage.json`); - unlink(`${RUN_DIR}/events.json`); - write_file(live.USAGE_RELOAD, `${time()}`, 0o600); - return apply.apply(); -}; - -export function backup_delete(name) { - unlink(backup_path(name)); - return true; -}; - -export function backup_read(name) { - return b64enc(readfile(backup_path(name))); -}; - -export function backup_upload(data_b64) { - let data = b64dec(data_b64 ?? ''); - if (!data || length(data) > 4 * 1024 * 1024) - die(_('Upload is empty or too large.')); - ensure_dir(RUN_DIR); - let tmp = `${RUN_DIR}/upload.tar.gz`; - write_file(tmp, data); - let res; - try { - res = backup_restore(null, tmp); - } - catch (e) { - unlink(tmp); - die(e.message); - } - unlink(tmp); - return res; -}; - -/* ---------- export / import (JSON) ---------- */ - -export function export_json() { - let c = cursor(); - c.load('dawnline'); - let sections = []; - c.foreach('dawnline', null, (s) => { - let o = { '.type': s['.type'], '.name': s['.name'] }; - for (let k, v in s) - if (substr(k, 0, 1) != '.') - o[k] = v; - push(sections, o); - }); - return { format: 'dawnline', version: VERSION, exported: time(), sections }; -}; - -/** An export as /etc/config/dawnline text; dies on anything that is not one. */ -function export_to_uci(data) { - if (type(data) != 'object' || data.format != 'dawnline' || type(data.sections) != 'array') - die(_('Not a Dawnline export.')); - let types = { settings: true, server: true, person: true, device: true, service: true, circle: true }; - let esc = (x) => replace(`${x}`, "'", "'\\''"); - let lines = []; - for (let s in data.sections) { - if (type(s) != 'object' || !types[s['.type']] || !match(s['.name'] ?? '', /^[A-Za-z0-9_]{1,64}$/)) - die(sprintf(_('Invalid section %s.'), s?.['.name'])); - push(lines, `config ${s['.type']} '${s['.name']}'`); - for (let k, v in s) { - if (substr(k, 0, 1) == '.') - continue; - if (!match(k, /^[a-z0-9_]{1,32}$/) || (type(v) != 'string' && type(v) != 'array')) - die(sprintf(_('Invalid option %s.'), k)); - if (type(v) == 'array') - for (let x in v) { - if (type(x) != 'string') - die(sprintf(_('Invalid option %s.'), k)); - push(lines, `\tlist ${k} '${esc(x)}'`); - } - else - push(lines, `\toption ${k} '${esc(v)}'`); - } - push(lines, ''); - } - return join('\n', lines); -} - -export function import_json(data) { - let text = export_to_uci(data); - let dir = scratch('import'); - try { - write_file(`${dir}/dawnline`, text, 0o600); - check_config_dir(dir); - } - catch (e) { - system(`rm -rf ${q(dir)}`); - die(e.message); - } - system(`rm -rf ${q(dir)}`); - backup_create('pre-import'); - let l = lock('config'); - let ok = write_file('/etc/config/dawnline', text, 0o600); - unlock(l); - if (!ok) - die(sprintf(_("Couldn't write %s. Is the flash full?"), '/etc/config/dawnline')); - return apply.apply(); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc deleted file mode 100644 index 44656a9..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/core.uc +++ /dev/null @@ -1,1072 +0,0 @@ -// Dawnline — data model: reads /etc/config/dawnline, validates and mutates it -// and allocates addresses. Nothing here knows how the tunnel works: dawnline.awg -// renders AmneziaWG configurations and runs the tunnels. - -import { cursor } from 'uci'; -import { - valid_name, valid_device_name, DEVICE_NAME_MAX, valid_key, valid_host, valid_iface, valid_date, slugify, host_label, ucut, name_rule, parse_cidr, cidr_overlaps, int2ip, ip2int, - rand_hex, rand_bytes, date_end, month_key, read_json, DATA_DIR, RUN_DIR, uniq -} from 'dawnline.util'; -import { _, N_ } from 'dawnline.i18n'; -import * as net from 'dawnline.net'; -import * as schema from 'dawnline.schema'; -import { policy as updates_policy } from 'dawnline.updates'; - -export const CONFIG = 'dawnline'; -/** - * Servers whose network interface Dawnline may not set up (the name belongs - * to an interface it did not create, or is invalid): { id: why }. Written by - * dawnline.netifd; such a server has no tunnel anywhere (firewall, access - * table, "like a home device"), so nothing of Dawnline lands on that interface. - */ -export const BLOCKED = `${RUN_DIR}/netifd-blocked.json`; -export const ACCESS = [ 'lan', 'internet', 'both' ]; -export const KINDS = [ 'computer', 'phone', 'tablet', 'router', 'other' ]; -/** Kinds that mostly live on mobile networks: their configurations carry a smaller MTU. */ -export const MOBILE_KINDS = [ 'phone', 'tablet' ]; -/** Devices of different people reaching each other: never, everyone with home access, or within a circle. */ -export const MESH = [ 'off', 'all', 'circles' ]; -/** Circle colours (index into the admin palette). */ -export const CIRCLE_COLORS = 8; -/** AmneziaWG obfuscation options stored on a server (netifd uses `awg_`; dawnline.awg renders them). */ -export const OBF_KEYS = [ 'jc', 'jmin', 'jmax', 's1', 's2', 's3', 's4', 'h1', 'h2', 'h3', 'h4', 'i1', 'i2', 'i3', 'i4', 'i5', - // AmneziaWG 3.x - 'header_protection_key', 'content_padding_addition', 'rekey_after_time', 'rekey_timeout', 'reject_after_time', - 'keepalive_timeout', 'max_handshake_attempts', 'random_trailers', 'disable_cookies' ]; -function toint(v, dflt) { - if (v == null || v == '') - return dflt; - let n = +v; - return n != n ? dflt : int(n); -} - -function num(v, dflt) { - if (v == null || v == '') - return dflt; - let n = +v; - return n != n ? dflt : n; -} - -function bool(v, dflt) { - if (v == null || v == '') - return dflt; - return v == '1' || v == 'true' || v == 'yes' || v == 'on'; -} - -function list(v) { - if (v == null) - return []; - return type(v) == 'array' ? v : split(trim(v), /[[:space:],]+/); -} - -/* ---------- load ---------- */ - -export function open_cursor() { - let c = cursor(); - c.load(CONFIG); - return c; -}; - -export function load(c) { - c ??= open_cursor(); - let s = c.get_all(CONFIG, 'settings') ?? {}; - // Types, defaults and ranges of the settings live in dawnline.schema (one - // place): what is read here is what settings_update would have accepted. - let g = (k) => schema.get(s, k); - let m = { - settings: { - portal_enabled: g('portal_enabled'), - portal_port: g('portal_port'), - portal_host: g('portal_host'), - // More addresses for the same links (the main one is portal_host). - portal_alt: g('portal_alt'), - portal_cert: g('portal_cert'), - portal_key: g('portal_key'), - // Where unknown portal links go instead of a bare 404 (empty = 404). - portal_redirect: g('portal_redirect'), - default_device_limit: g('default_device_limit'), - geo_enabled: g('geo_enabled'), - geo_provider: g('geo_provider'), - hostnames: g('hostnames'), - domain: g('domain'), - log_connections: g('log_connections'), - // What goes to syslog (dawnline.util syslog). - log_level: g('log_level'), - // Repair tunnels and services on its own (the agent, every minute). - watchdog: g('watchdog'), - // Second DNS for "home names" devices, used by the device when the tunnel is down. - home_dns_fallback: g('home_dns_fallback'), - // Settings → Updates (automatic checks and updates of the components). - updates: updates_policy(s), - // Raw retention values; dawnline.live policy() interprets them. - retention: { - log_keep_days: s.log_keep_days, log_max: s.log_max, log_category: s.log_category, - log_connections: s.log_connections, log_persist: s.log_persist, - usage_keep_days: s.usage_keep_days, usage_keep_months: s.usage_keep_months, - }, - }, - servers: {}, - people: {}, - devices: {}, - services: {}, - circles: {}, - }; - - let blocked = read_json(BLOCKED, {}); - c.foreach(CONFIG, 'server', (r) => { - let id = r['.name']; - let srv = { - id, - name: r.name ?? id, - ifname: r.ifname ?? id, - port: toint(r.port, 51820), - subnet: r.subnet ?? '', - endpoint: r.endpoint ?? '', - // 0 = automatic (tunnel_mtu, device_mtu). - mtu: toint(r.mtu, 0), - dns: list(r.dns), - keepalive: toint(r.keepalive, 25), - private_key: r.private_key ?? '', - public_key: r.public_key ?? '', - preset: r.preset ?? 'standard', - lan_zone: r.lan_zone ?? 'lan', - wan_zone: r.wan_zone ?? 'wan', - auto_wan: bool(r.auto_wan, true), - wan_device: r.wan_device ?? '', - auto_lan: bool(r.auto_lan, true), - lan_devices: list(r.lan_device), - detected_wan: r.detected_wan ?? '', - detected_lan: r.detected_lan ?? '', - lan_like: bool(r.lan_like, true), - // Devices of people with home access reach each other: off, all, or within circles. - // (Older configs: device_mesh 0/1.) - mesh: index(MESH, r.mesh) >= 0 ? r.mesh : (bool(r.device_mesh, true) ? 'all' : 'off'), - enabled: bool(r.enabled, true), - // AmneziaWG disguise values, read by dawnline.awg. - obf: {}, - }; - for (let k in OBF_KEYS) - if (r[k] != null && r[k] != '') - srv.obf[k] = `${r[k]}`; - // A person's own devices reach each other whenever the mesh is not off. - srv.device_mesh = srv.mesh != 'off'; - if (blocked[id]) - srv.blocked = blocked[id]; - m.servers[id] = srv; - }); - - c.foreach(CONFIG, 'person', (r) => { - let id = r['.name']; - m.people[id] = { - id, - server: r.server ?? '', - name: r.name ?? id, - access: index(ACCESS, r.access) >= 0 ? r.access : 'internet', - device_limit: toint(r.device_limit, m.settings.default_device_limit), - code: r.code ?? '', - // When the personal link was last made (0 for links from before this was kept). - code_set: toint(r.code_set, 0), - expires: r.expires ?? '', - quota_gb: num(r.quota_gb, 0), - quota_period: r.quota_period == 'total' ? 'total' : 'month', - paused: bool(r.paused, false), - hours: r.hours ?? '', - expire_action: index([ 'pause', 'notify', 'remove' ], r.expire_action) >= 0 ? r.expire_action : 'pause', - // Home-only access: keep the device's own DNS, or use home names (Dawnline's resolver). - dns_mode: r.dns_mode == 'home' ? 'home' : 'device', - expire_warn: toint(r.expire_warn, 3), - bonus_gb: num(r.bonus_gb, 0), - bonus_month: r.bonus_month ?? '', - services: list(r.service), - // Home networks (interfaces) this person reaches; empty = all of the server's. - home_nets: list(r.home_net), - circle: r.circle ?? '', - note: r.note ?? '', - created: toint(r.created, 0), - devices: [], - }; - }); - - c.foreach(CONFIG, 'device', (r) => { - let id = r['.name']; - let d = { - id, - person: r.person ?? '', - name: r.name ?? id, - kind: index(KINDS, r.kind) >= 0 ? r.kind : 'other', - address: r.address ?? '', - public_key: r.public_key ?? '', - private_key: r.private_key ?? '', - preshared_key: r.preshared_key ?? '', - created: toint(r.created, 0), - created_by: r.created_by ?? 'admin', - disabled: bool(r.disabled, false), - // The device's own link values (admin only): 0 / null = the server's - // (device_mtu, device_keepalive). Out of range is kept as read, so - // model_errors can name it; the configuration then uses the server's. - mtu: toint(r.mtu, 0), - keepalive: r.keepalive == null || r.keepalive == '' ? null : toint(r.keepalive, null), - // Its own local network stays outside the tunnel (awg.allowed_ips). - lan_bypass: bool(r.lan_bypass, false), - }; - m.devices[id] = d; - if (m.people[d.person]) - push(m.people[d.person].devices, id); - }); - - c.foreach(CONFIG, 'circle', (r) => { - let id = r['.name']; - m.circles[id] = { id, server: r.server ?? '', name: r.name ?? id, color: toint(r.color, 0) % CIRCLE_COLORS }; - }); - - c.foreach(CONFIG, 'service', (r) => { - let id = r['.name']; - m.services[id] = { - id, - name: r.name ?? id, - address: r.address ?? '', - ports: list(r.port), - }; - }); - - return m; -}; - -/* ---------- derived state ---------- */ - -/** Parse "07:00-23:00" → [startMin, endMin] or null. */ -export function parse_hours(s) { - let m = match(s ?? '', /^([0-9]{1,2}):([0-9]{2})-([0-9]{1,2}):([0-9]{2})$/); - if (!m) - return null; - let a = +m[1] * 60 + +m[2], b = +m[3] * 60 + +m[4]; - if (a >= 1440 || b > 1440 || a == b) - return null; - return [ a, b ]; -}; - -function within_hours(h, ts) { - let t = localtime(ts); - let cur = t.hour * 60 + t.min; - return h[0] < h[1] ? (cur >= h[0] && cur < h[1]) : (cur >= h[0] || cur < h[1]); -} - -/** Bytes used in the person's quota period (the month of `ts`, default now). */ -export function person_usage(p, usage, ts) { - let u = usage?.people?.[p.id]; - if (!u) - return 0; - if (p.quota_period == 'total') - return (u.total?.[0] ?? 0) + (u.total?.[1] ?? 0); - let mm = u.months?.[month_key(ts)]; - return mm ? mm[0] + mm[1] : 0; -}; - -/** Quota in bytes for the period of `ts` (default now): base + that month's bonus, 0 = unlimited. */ -export function person_quota(p, ts) { - if (!(p.quota_gb > 0)) - return 0; - let gb = p.quota_gb; - if (p.bonus_gb > 0 && p.bonus_month == month_key(ts)) - gb += p.bonus_gb; - return gb * 1073741824; -}; - -export function person_expired(p, ts) { - if (p.expires == '') - return false; - let end = date_end(p.expires); - return end != null && (ts ?? time()) > end; -}; - -/** The person's state whatever their server is doing (paused, expired, …, or 'active'). */ -export function own_state(m, p, usage, ts) { - ts ??= time(); - if (p.paused) - return 'paused'; - // "notify" keeps access after the end date (shown in Overview and People). - if (person_expired(p, ts) && p.expire_action != 'notify') - return 'expired'; - let quota = person_quota(p, ts); - if (quota > 0 && person_usage(p, usage, ts) >= quota) - return 'quota'; - let h = parse_hours(p.hours); - if (h && !within_hours(h, ts)) - return 'hours'; - return 'active'; -}; - -/** - * Effective state of a person: 'active', or why they are off: - * 'paused' (admin), 'expired', 'quota', 'hours', 'no_server', - * 'server_off' (their server is turned off: about the server, not the person). - */ -export function person_state(m, p, usage, ts) { - let srv = m.servers[p.server]; - if (!srv) - return 'no_server'; - if (!srv.enabled) - return 'server_off'; - return own_state(m, p, usage, ts); -}; - -export function load_usage() { - return read_json(`${RUN_DIR}/usage.json`, null) ?? read_json(`${DATA_DIR}/usage.json`, { devices: {}, people: {} }); -}; - -/* ---------- tunnels and addresses ---------- */ - -/** A server's interface name: also a netifd section and an nft string, so nothing else. */ -export function valid_ifname(s) { - return type(s) == 'string' && match(s, /^[a-z][a-z0-9_]{0,11}$/) != null; -}; - -/** Router address inside the AmneziaWG subnet (first host). */ -export function server_address(srv) { - let c = parse_cidr(srv.subnet); - return c ? int2ip(c.first) : null; -}; - -/** - * The link a server's devices come in on: { ifname, subnet, address (the - * router's) }, as a list so the access table, firewall zone, "like a home - * device" and DNS treat every tunnel interface alike. None for a server - * without keys, subnet or a valid interface name (an imported config), or - * whose interface name is taken (BLOCKED). - */ -export function tunnels(srv) { - let c = srv?.private_key && !srv.blocked && valid_ifname(srv.ifname) ? parse_cidr(srv.subnet) : null; - return c ? [ { ifname: srv.ifname, subnet: srv.subnet, address: int2ip(c.first) } ] : []; -}; - -/** The server's tunnel link, or null. */ -export function tunnel(srv) { - return tunnels(srv)[0]; -}; - -/** The first free address in the server's subnet (the router has the first). */ -export function alloc_address(m, srv) { - let t = parse_cidr(srv.subnet); - if (!t) - return null; - let used = {}; - used[t.first] = true; - for (let id, d in m.devices) { - let p = m.people[d.person]; - if (p && p.server == srv.id) { - let n = ip2int(d.address); - if (n != null) - used[n] = true; - } - } - for (let n = t.first + 1; n <= t.last; n++) - if (!used[n]) - return int2ip(n); - return null; -}; - -/* ---------- what clients get ---------- */ - -/* - * Automatic MTU. A path is assumed to carry 1460 bytes (1500 less PPPoE, - * 464XLAT or DS-Lite), the tunnel's own headers take 80 over IPv6, and - * AmneziaWG's S4 adds its bytes to every data packet (its padding and random - * trailers stay within the largest packet already seen, so they cost - * nothing). Phones and tablets get 1280, the IPv6 minimum: mobile paths vary. - */ -const AUTO_MTU = 1380; -const MOBILE_MTU = 1280; -/** What an MTU set by hand may be (the server's and a device's alike). */ -export const MTU_RANGE = [ 1280, 1500 ]; -/** What a keep-alive set by hand may be, in seconds (0 = off). */ -export const KEEPALIVE_RANGE = [ 0, 600 ]; - -function in_range(n, r) { - return type(n) == 'int' && n >= r[0] && n <= r[1]; -} - -/** The server's tunnel MTU: the one set, or automatic for its disguise. */ -export function tunnel_mtu(srv) { - return srv.mtu || max(MOBILE_MTU, AUTO_MTU - toint(srv.obf?.s4, 0)); -}; - -/** - * The MTU a device's configuration carries: the device's own when the admin - * set one, else the tunnel's, at most 1280 for phones and tablets. - */ -export function device_mtu(srv, dev) { - if (in_range(dev.mtu, MTU_RANGE)) - return dev.mtu; - let mtu = tunnel_mtu(srv); - return index(MOBILE_KINDS, dev.kind) >= 0 ? min(mtu, MOBILE_MTU) : mtu; -}; - -/** - * The keep-alive a device's configuration carries, in seconds (0 = off): the - * device's own when the admin set one, else the server's. Both ends never - * have to agree on it (the server's peers carry none), so it is the device's. - */ -export function device_keepalive(srv, dev) { - return in_range(dev?.keepalive, KEEPALIVE_RANGE) ? dev.keepalive : srv.keepalive; -}; - -export function endpoint_host(m, srv) { - return srv.endpoint || m.settings.portal_host || ''; -}; - -/** - * DNS for a server's clients: the router's address in the tunnel subnet, - * which never changes after setup. The router forwards each query where it - * belongs (the LAN's DNS, from the LAN side; or the plain resolver), so - * configurations on devices keep working when the LAN, its DNS or the netns - * address change. - */ -export function dns_list(m, srv) { - if (!srv) - return []; - if (length(srv.dns)) - return srv.dns; - let a = server_address(srv); - return a ? [ a ] : []; -}; - -/** - * DNS a device uses. Home-only people keep their device's DNS unless they - * chose home names; then the first server is Dawnline's plain resolver - * (reached through the tunnel) and the second the fallback the device uses - * when the tunnel is down. - */ -export function client_dns(m, srv, p) { - if (p?.access != 'lan') - return dns_list(m, srv); - if (p.dns_mode != 'home') - return []; - let a = server_address(srv); - let out = a ? [ a ] : []; - if (m.settings.home_dns_fallback && m.settings.home_dns_fallback != a) - push(out, m.settings.home_dns_fallback); - return out; -}; - -/** - * The home networks a person reaches: all of the server's, or only the - * interfaces ticked on their page (networks added later are not included). - */ -export function person_home(srv, p, snap) { - let sn = net.server_net(srv, snap); - let pick = p?.home_nets ?? []; - if (!length(pick)) - return { all: true, nets: sn.nets, devs: map(sn.home, (h) => h.dev) }; - let nets = [], devs = []; - for (let h in sn.home) - if (index(pick, h.dev) >= 0) { - push(nets, ...h.nets); - push(devs, h.dev); - } - return { all: false, nets: net.collapse(nets), devs }; -}; - -/** The circle a person is in on their server (circles mode only), or null. */ -export function person_circle(m, p) { - let c = m.circles[p?.circle]; - return c && c.server == p.server ? c : null; -}; - -/* ---------- mutations (caller commits) ---------- */ - -function fail(msg) { - die(msg); -} - -/* - * Personal codes are three pronounceable words of three syllables each - * (kamiro-telosu-bavine): easy to read out or type, ~2^55 combinations, and - * guessing is rate-limited by the portal. The code is the whole link path. - */ -export const WORD_CODE = /^[a-z]{6}-[a-z]{6}-[a-z]{6}$/; -const SYL_C = 'bdfgklmnprstvz', SYL_V = 'aeiou'; -const CODE_AVOID = [ 'suka', 'pido', 'muda', 'zalup', 'dura', 'gavn' ]; - -function pick(alphabet) { - let n = length(alphabet), lim = 256 - 256 % n; - for (;;) { - let b = ord(rand_bytes(1), 0); - if (b < lim) - return substr(alphabet, b % n, 1); - } -} - -export function new_code() { - for (;;) { - let words = []; - for (let w = 0; w < 3; w++) { - let s = ''; - for (let i = 0; i < 3; i++) - s += pick(SYL_C) + pick(SYL_V); - push(words, s); - } - let code = join('-', words); - if (!length(filter(CODE_AVOID, (x) => index(code, x) >= 0))) - return code; - } -}; - -export function create_person(c, m, a) { - if (!valid_name(a.name)) - fail(name_rule()); - // The id is a UCI section name: letters, digits and underscores only (a dash - // makes uci drop the section). Repeated names get _2, _3, … - let base = replace(a.slug ?? slugify(a.name), /-/g, '_'); - if (!match(base, /^[a-z0-9_]{1,32}$/)) - fail(_('The id may use lowercase letters, digits and underscores.')); - // Any kind of section (store.id_taken, which imports this module). - let taken = (id) => m.people[id] || m.servers[id] || m.devices[id] || m.services[id] || m.circles[id] || - index([ 'settings', 'main', 'global', 'defaults' ], id) >= 0; - let slug = base; - for (let n = 2; taken(slug); n++) { - if (n > 99) - fail(sprintf(_('"%s" is already taken.'), base)); - slug = `${substr(base, 0, 28)}_${n}`; - } - let srv_id = a.server ?? keys(m.servers)[0]; - if (!m.servers[srv_id]) - fail(_('Set up a server first.')); - let access = a.access ?? 'internet'; - if (index(ACCESS, access) < 0) - fail(_('Access must be lan, internet or both.')); - let limit = toint(a.device_limit, m.settings.default_device_limit); - if (limit < 1 || limit > 32) - fail(_('Device limit must be between 1 and 32.')); - if (a.expires && !valid_date(a.expires)) - fail(_('End date must be YYYY-MM-DD.')); - let quota = num(a.quota_gb, 0); - if (quota < 0 || quota > 100000) - fail(_('Monthly data must be a positive number of GB.')); - - c.set(CONFIG, slug, 'person'); - c.set(CONFIG, slug, 'server', srv_id); - c.set(CONFIG, slug, 'name', trim(a.name)); - c.set(CONFIG, slug, 'access', access); - c.set(CONFIG, slug, 'device_limit', `${limit}`); - c.set(CONFIG, slug, 'code', new_code()); - c.set(CONFIG, slug, 'code_set', `${time()}`); - c.set(CONFIG, slug, 'created', `${time()}`); - if (a.expires) - c.set(CONFIG, slug, 'expires', a.expires); - if (quota > 0) { - c.set(CONFIG, slug, 'quota_gb', `${quota}`); - c.set(CONFIG, slug, 'quota_period', a.quota_period == 'total' ? 'total' : 'month'); - } - return slug; -}; - -/** - * Immediate edit of a person from the admin page. Only keys present in `a` - * change; '' clears optional values (end date, data limit, hours). - */ -export function update_person(c, m, id, a) { - let p = m.people[id]; - if (!p) - fail(_('Unknown person.')); - let set = (k, v) => (v == null || v == '') ? c.delete(CONFIG, id, k) : c.set(CONFIG, id, k, `${v}`); - if (a.name != null) { - if (!valid_name(a.name)) - fail(name_rule()); - set('name', trim(a.name)); - } - if (a.access != null) { - if (index(ACCESS, a.access) < 0) - fail(_('Access must be lan, internet or both.')); - set('access', a.access); - } - if (a.device_limit != null) { - let n = toint(a.device_limit, 0); - if (n < 1 || n > 32) - fail(_('Device limit must be between 1 and 32.')); - let have = length(p.devices); - if (n < have) - fail(sprintf(N_(have, '%s already has %d device. Remove one first to lower the limit to %d.', - '%s already has %d devices. Remove one first to lower the limit to %d.'), p.name, have, n)); - set('device_limit', n); - } - if (a.expires != null) { - if (a.expires != '' && !valid_date(a.expires)) - fail(_('End date must be YYYY-MM-DD.')); - set('expires', a.expires); - } - if (a.expire_action != null) { - if (index([ 'pause', 'notify', 'remove' ], a.expire_action) < 0) - fail(_('Unknown end action.')); - set('expire_action', a.expire_action == 'pause' ? '' : a.expire_action); - } - if (a.dns_mode != null) { - if (index([ 'device', 'home' ], a.dns_mode) < 0) - fail(_('Unknown DNS choice.')); - set('dns_mode', a.dns_mode == 'device' ? '' : a.dns_mode); - } - if (a.expire_warn != null) { - let n = toint(a.expire_warn, -1); - if (n < 0 || n > 60) - fail(_('Warning must be 0-60 days.')); - set('expire_warn', n == 3 ? '' : n); - } - if (a.quota_gb != null) { - let q = num(a.quota_gb, -1); - if (a.quota_gb != '' && (q < 0 || q > 100000)) - fail(_('Data limit must be a positive number of GB.')); - set('quota_gb', q > 0 ? q : ''); - } - if (a.quota_period != null) - set('quota_period', a.quota_period == 'total' ? 'total' : ''); - if (a.bonus_gb != null) { - let b = num(a.bonus_gb, -1); - if (b < 0 || b > 100000) - fail(_('Extra data must be a positive number of GB.')); - set('bonus_gb', b > 0 ? b : ''); - set('bonus_month', b > 0 ? month_key() : ''); - } - if (a.hours != null) { - if (a.hours != '' && !parse_hours(a.hours)) - fail(_('Hours must look like 07:00-23:00.')); - set('hours', a.hours); - } - if (a.note != null) - set('note', ucut(trim(a.note), 500)); - if (type(a.services) == 'array') { - for (let sid in a.services) - if (!m.services[sid]) - fail(sprintf(_('Unknown service %s.'), sid)); - if (length(a.services)) - c.set(CONFIG, id, 'service', a.services); - else - c.delete(CONFIG, id, 'service'); - } - if (a.circle != null) { - let ci = m.circles[a.circle]; - if (a.circle != '' && (!ci || ci.server != p.server)) - fail(_('Unknown circle.')); - set('circle', a.circle); - } - // Another server: every device gets an address in its tunnel (so each - // needs its configuration again); circles and home networks are the old - // server's and go. - if (a.server != null && a.server != '' && a.server != p.server) { - if (!m.servers[a.server]) - fail(_('Unknown server.')); - set('server', a.server); - p.server = a.server; - for (let did in p.devices) { - let addr = alloc_address(m, m.servers[a.server]); - if (!addr) - fail(sprintf(_('No free address left on %s.'), m.servers[a.server].name)); - m.devices[did].address = addr; - c.set(CONFIG, did, 'address', addr); - } - c.delete(CONFIG, id, 'circle'); - c.delete(CONFIG, id, 'home_net'); - } - if (type(a.home_nets) == 'array') { - let nets = uniq(filter(map(a.home_nets, (x) => trim(`${x}`)), valid_iface)); - if (length(nets)) - c.set(CONFIG, id, 'home_net', nets); - else - c.delete(CONFIG, id, 'home_net'); - } - if (a.paused != null) - set('paused', a.paused ? '1' : ''); -}; - -/** - * Add a device for a person. `opts.keys` = { private_key?, public_key, - * preshared_key } from dawnline.awg (or a public key the browser generated). - * `opts.by` is 'admin' or 'portal'; the portal is held to the device limit. - * `opts.lan_bypass` true keeps the device's own local network outside the - * tunnel (awg.allowed_ips). - */ -export function create_device(c, m, person_id, name, kind, opts) { - opts ??= {}; - let p = m.people[person_id]; - if (!p) - fail(_('Unknown person.')); - let srv = m.servers[p.server]; - if (!srv) - fail(_('The person has no server.')); - name = trim(name ?? ''); - if (!valid_device_name(name)) - fail(sprintf(_('Enter a device name: up to %d letters, digits, spaces and - _ .'), DEVICE_NAME_MAX)); - if (index(KINDS, kind) < 0) - kind = 'other'; - if (opts.by == 'portal' && length(p.devices) >= p.device_limit) - fail(sprintf(_('Device limit reached (%d).'), p.device_limit)); - for (let id in p.devices) - if (lc(m.devices[id].name) == lc(name)) - fail(sprintf(_('"%s" already exists.'), name)); - let addr = alloc_address(m, srv); - if (!addr) - fail(_('No free addresses left in the server subnet.')); - let k = opts.keys ?? {}; - if (!valid_key(k.public_key)) - fail(_('Key generation failed (is amneziawg-tools installed?).')); - for (let o, d in m.devices) - if (d.public_key == k.public_key) - fail(_('This key is already in use.')); - // A server's own key (it is in every configuration): the kernel would silently ignore such a peer. - for (let sid, s in m.servers) - if (s.public_key == k.public_key) - fail(_('This key is already in use.')); - - let id = `d_${rand_hex(4)}`; - let dev = { id, person: person_id, name, kind, address: addr, public_key: k.public_key, private_key: k.private_key ?? '', - preshared_key: k.preshared_key ?? '', created: time(), created_by: opts.by ?? 'admin', disabled: false, - mtu: 0, keepalive: null, lan_bypass: opts.lan_bypass === true }; - c.set(CONFIG, id, 'device'); - c.set(CONFIG, id, 'person', person_id); - c.set(CONFIG, id, 'name', name); - c.set(CONFIG, id, 'kind', kind); - c.set(CONFIG, id, 'address', addr); - for (let f in [ 'public_key', 'private_key', 'preshared_key' ]) - if (dev[f]) - c.set(CONFIG, id, f, dev[f]); - c.set(CONFIG, id, 'created', `${dev.created}`); - c.set(CONFIG, id, 'created_by', dev.created_by); - if (dev.lan_bypass) - c.set(CONFIG, id, 'lan_bypass', '1'); - - // Keep the in-memory model consistent for callers that continue. - m.devices[id] = dev; - push(p.devices, id); - return id; -}; - -export function rename_device(c, m, id, name) { - let d = m.devices[id]; - if (!d) - fail(_('Unknown device.')); - name = trim(name ?? ''); - if (!valid_device_name(name)) - fail(sprintf(_('Enter a device name: up to %d letters, digits, spaces and - _ .'), DEVICE_NAME_MAX)); - for (let o in m.people[d.person]?.devices ?? []) - if (o != id && lc(m.devices[o].name) == lc(name)) - fail(sprintf(_('"%s" already exists.'), name)); - c.set(CONFIG, id, 'name', name); - d.name = name; -}; - -/** - * The admin's link settings of a device: `a` = { mtu?, keepalive?, - * lan_bypass? }, only keys present change; '' takes a number back to the - * server's (0 is a keep-alive of its own: off). Each is in the device's - * configuration alone (the server's peers carry neither), so a change asks - * that device to import again and touches nothing on the router. Returns the - * names of the options that changed. - */ -export function set_device_link(c, m, id, a) { - let d = m.devices[id]; - if (!d) - fail(_('Unknown device.')); - let changed = []; - let put = (k, v, was) => { - if (v == was) - return; - if (v == null) - c.delete(CONFIG, id, k); - else - c.set(CONFIG, id, k, `${v}`); - push(changed, k); - }; - let number = (v, r, msg) => { - let s = trim(`${v}`); - if (s == '') - return null; - if (!match(s, /^[0-9]{1,4}$/) || +s < r[0] || +s > r[1]) - fail(msg); - return +s; - }; - if (a.mtu != null) - put('mtu', number(a.mtu, MTU_RANGE, _('MTU must be 1280-1500.')), d.mtu || null); - if (a.keepalive != null) - put('keepalive', number(a.keepalive, KEEPALIVE_RANGE, _('Keep-alive must be 0-600 seconds.')), d.keepalive); - if (a.lan_bypass != null) - put('lan_bypass', a.lan_bypass === true ? 1 : null, d.lan_bypass ? 1 : null); - return changed; -}; - -/** - * Change what a device is (one of KINDS): true when it changed, false when it - * already was. Its configuration follows (device_mtu: phones and tablets take - * smaller packets); nothing on the router changes. - */ -export function set_device_kind(c, m, id, kind) { - let d = m.devices[id]; - if (!d) - fail(_('Unknown device.')); - if (index(KINDS, kind) < 0) - fail(_('Unknown device type.')); - if (kind == d.kind) - return false; - c.set(CONFIG, id, 'kind', kind); - d.kind = kind; - return true; -}; - -export function delete_device(c, m, id) { - let d = m.devices[id]; - if (!d) - fail(_('Unknown device.')); - c.delete(CONFIG, id); - let p = m.people[d.person]; - if (p) - p.devices = filter(p.devices, (x) => x != id); - delete m.devices[id]; -}; - -/** New keys from dawnline.awg (the caller makes them: the model does not run tools). */ -export function rotate_device(c, m, id, keys) { - let d = m.devices[id]; - if (!d) - fail(_('Unknown device.')); - if (!valid_key(keys?.public_key) || !keys?.private_key) - fail(_('Key generation failed.')); - c.set(CONFIG, id, 'private_key', keys.private_key); - c.set(CONFIG, id, 'public_key', keys.public_key); - if (keys.preshared_key) - c.set(CONFIG, id, 'preshared_key', keys.preshared_key); -}; - -export function delete_person(c, m, id) { - let p = m.people[id]; - if (!p) - fail(_('Unknown person.')); - for (let d in p.devices) - c.delete(CONFIG, d); - c.delete(CONFIG, id); -}; - -const PRIVATE_NETS = map([ '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16' ], parse_cidr); - -/** The parsed subnet lies inside one of the private ranges. */ -export function private_cidr(c) { - for (let p in PRIVATE_NETS) - if (c.net >= p.net && c.net + c.size <= p.net + p.size) - return true; - return false; -}; - -/** Validate a server definition (as loaded) against the rest of the router. */ -export function server_errors(m, srv, others_subnets) { - let errs = []; - if (!valid_ifname(srv.ifname)) - push(errs, _('Interface name: 1-12 lowercase letters, digits or _.')); - if (srv.port < 1 || srv.port > 65535) - push(errs, _('Port must be 1-65535.')); - let c = parse_cidr(srv.subnet); - if (!c) - push(errs, _('Subnet must look like 10.77.0.0/24.')); - else - for (let o in others_subnets ?? []) { - let oc = parse_cidr(o); - if (oc && cidr_overlaps(c, oc)) - push(errs, sprintf(_('Subnet overlaps %s.'), o)); - } - if (srv.endpoint != '' && !valid_host(srv.endpoint)) - push(errs, _('Endpoint must be a hostname or IP address.')); - return errs; -}; - -/** - * What is wrong inside a model as a whole, beyond each server: devices with - * an address outside their server's subnet, the server's own address, a - * prefix on it or one shared with another device (the access sets are keyed - * by address, and one bad peer line makes `awg syncconf` refuse the whole - * server), malformed keys, an MTU or keep-alive of their own out of range, - * people and devices pointing at servers, people, circles or services that do - * not exist, and two people with one link. [] when it is consistent. Import, - * restore and Health check it; the runtime sync skips what it would reject - * (dawnline.awg, dawnline.nft), and a configuration takes the server's value - * for a link value out of range (device_mtu, device_keepalive). - */ -export function model_errors(m) { - let errs = []; - let codes = {}, addrs = {}; - for (let id, p in m.people) { - if (p.server != '' && !m.servers[p.server]) - push(errs, sprintf(_('Person %s: server %s does not exist.'), p.name, p.server)); - if (p.circle != '' && !m.circles[p.circle]) - push(errs, sprintf(_('Person %s: circle %s does not exist.'), p.name, p.circle)); - for (let sid in p.services) - if (!m.services[sid]) - push(errs, sprintf(_('Person %s: home service %s does not exist.'), p.name, sid)); - if (p.code != '') { - if (codes[p.code]) - push(errs, sprintf(_('Person %s: has the same personal link as %s.'), p.name, codes[p.code])); - codes[p.code] = p.name; - } - } - for (let id, d in m.devices) { - let p = m.people[d.person]; - if (!p) { - push(errs, sprintf(_('Device %s: person %s does not exist.'), d.name, d.person)); - continue; - } - let say = (msg, ...args) => push(errs, sprintf(msg, d.name, p.name, ...args)); - if (!valid_key(d.public_key)) - say(_('Device %s of %s: the public key is not a key.')); - if (d.private_key != '' && !valid_key(d.private_key)) - say(_('Device %s of %s: the private key is not a key.')); - if (d.preshared_key != '' && !valid_key(d.preshared_key)) - say(_('Device %s of %s: the preshared key is not a key.')); - // Its own link values (0 / null: the server's); one out of range is never used. - if (d.mtu && !in_range(d.mtu, MTU_RANGE)) - say(_('Device %s of %s: MTU %d is not between 1280 and 1500.'), d.mtu); - if (d.keepalive != null && !in_range(d.keepalive, KEEPALIVE_RANGE)) - say(_('Device %s of %s: keep-alive %d is not between 0 and 600 seconds.'), d.keepalive); - let n = ip2int(d.address); - if (n == null) { - if (d.address) - say(_('Device %s of %s: address %s is not a plain IPv4 address.'), d.address); - else - say(_('Device %s of %s: address (none) is not a plain IPv4 address.')); - continue; - } - let srv = m.servers[p.server]; - // AmneziaWG ignores a peer with the interface's own key (dawnline.awg tunnel_devices leaves it out). - if (srv?.public_key && d.public_key == srv.public_key) - say(_("Device %s of %s: the public key is the server's own.")); - let t = srv ? parse_cidr(srv.subnet) : null; - if (t && (n < t.first || n > t.last)) - say(_("Device %s of %s: address %s is outside %s's tunnel %s."), d.address, srv.name, srv.subnet); - else if (t && n == t.first) - say(_("Device %s of %s: address %s is the router's own address on %s."), d.address, srv.name); - let key = `${p.server} ${d.address}`; - let o = addrs[key]; - if (o) - say(_('Device %s of %s: address %s is also used by device %s of %s.'), d.address, o.device, o.person); - addrs[key] = { device: d.name, person: p.name }; - } - for (let id, ci in m.circles) - if (!m.servers[ci.server]) - push(errs, sprintf(_('Circle %s: server %s does not exist.'), ci.name, ci.server)); - return errs; -}; - -/** - * Give every device on a server an address in `subnet` (the server's new - * tunnel network), lowest first: used by server_update when the network - * changes. Each device then needs its configuration again (the address is - * in it). Fails when the subnet cannot hold them. - */ -export function renumber_server(c, m, srv, subnet) { - srv.subnet = subnet; - for (let pid, p in m.people) - if (p.server == srv.id) - for (let did in p.devices) - m.devices[did].address = ''; - for (let pid, p in m.people) - if (p.server == srv.id) - for (let did in p.devices) { - let addr = alloc_address(m, srv); - if (!addr) - fail(sprintf(_('%s has no room for every device on %s.'), subnet, srv.name)); - m.devices[did].address = addr; - c.set(CONFIG, did, 'address', addr); - } - c.set(CONFIG, srv.id, 'subnet', subnet); -}; - -/** - * The DNS labels of a person's devices, { device id: label }, unique within - * the person: two devices whose names give one label ("iPhone" and - * "iPhone!", or two Cyrillic names) get -2, -3 by age. Hostnames in - * /tmp/hosts (dawnline.apply) and the ones the UI shows (dawnline.view) both - * come from here, so what is shown resolves. - */ -export function device_labels(m, p) { - let out = {}, used = {}; - let devs = sort(map(p.devices, (id) => m.devices[id]), (a, b) => (a.created - b.created) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)); - for (let d in devs) { - let base = host_label(d.name), l = base; - for (let n = 2; used[l]; n++) - l = `${substr(base, 0, 37)}-${n}`; - used[l] = true; - out[d.id] = l; - } - return out; -}; - -/** - * Port forwards from `zone` for `proto` that aren't Dawnline's: [{ from, to, name }]. - * A forwarded port never reaches the router itself, so nothing here can listen on it. - */ -export function wan_forwards(zone, proto) { - let c = cursor(); - c.load('firewall'); - let out = []; - c.foreach('firewall', 'redirect', (r) => { - if (substr(r['.name'], 0, 9) == 'dawnline_' || r.enabled == '0' || (r.target ?? 'DNAT') != 'DNAT' || r.src != zone) - return; - // fw4's default is "tcp udp". - let protos = split(type(r.proto) == 'array' ? join(' ', r.proto) : r.proto ?? 'tcp udp', /[ ,]+/); - if (index(protos, proto) < 0 && index(protos, 'all') < 0 && index(protos, 'any') < 0) - return; - for (let p in split(`${r.src_dport ?? ''}`, /[ ,]+/)) { - let m = match(p, /^(\d+)([-:](\d+))?$/); - if (m) - push(out, { from: +m[1], to: +(m[3] || m[1]), name: r.name ?? r['.name'] }); - } - }); - return out; -}; - -/** Every address the links use, the main one first. */ -export function portal_hosts(m) { - let out = []; - for (let h in [ m.settings.portal_host, ...m.settings.portal_alt ]) - if (h && index(out, h) < 0) - push(out, h); - return out; -}; - -/** IP addresses have no certificate: the portal also answers plain HTTP for them. */ -export function portal_http(m) { - return length(filter(portal_hosts(m), (h) => ip2int(h) != null)) > 0; -}; - -/** Where the portal listens for plain HTTP (next to its HTTPS port). */ -export function portal_http_port(m) { - return m.settings.portal_port + 1; -}; - -/** The port in plain-HTTP links (the portal never takes 80 or 443 for itself). */ -export function portal_http_public(m) { - return portal_http_port(m); -}; - -/** The port in personal links: the portal's own. */ -export function portal_public_port(m) { - return m.settings.portal_port; -}; - -/** The link on one address: https for names, plain http for IP addresses. */ -export function portal_link(m, p, host) { - // No portal, no link: the page would not answer. - if (!m.settings.portal_enabled || !host || !m.servers[p.server] || !match(p.code ?? '', WORD_CODE)) - return null; - if (ip2int(host) != null) { - let hp = portal_http_public(m); - return `http://${host}${hp == 80 ? '' : `:${hp}`}/${p.code}`; - } - let pp = portal_public_port(m); - // An IPv6 address needs its brackets in a URL. - let h = index(host, ':') >= 0 && !match(host, /^\[/) ? `[${host}]` : host; - return `https://${h}${pp == 443 ? '' : `:${pp}`}/${p.code}`; -}; - -/** The main link (QR, invite card, Copy link). */ -export function portal_url(m, p) { - return portal_link(m, p, portal_hosts(m)[0]); -}; - -/** Every link to the same portal, the main one first. */ -export function portal_urls(m, p) { - return filter(map(portal_hosts(m), (h) => portal_link(m, p, h)), (x) => x != null); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc deleted file mode 100644 index 71b1b09..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/devices.uc +++ /dev/null @@ -1,187 +0,0 @@ -// Dawnline — adding, changing, rotating and removing a person's devices: one -// code path for the admin UI (rpcd) and the portal, with the config lock, -// the runtime sync, the activity log and the "configuration issued" mark. -// -// opts = { by: 'admin' | 'portal', person?: the only person whose devices may -// be touched (the portal), defer?: load new keys a moment later (the portal -// page came through the device being rotated) }. The portal is held to the -// device limit (dawnline.core) and cannot touch a device the admin turned off. - -import { sh_bg } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as apply from 'dawnline.apply'; -import * as live from 'dawnline.live'; -import * as store from 'dawnline.store'; -import { _ } from 'dawnline.i18n'; - -/** AmneziaWG is on the router, so device keys can be made and loaded. */ -export function ready() { - return awg.installed(); -}; - -/** Dies with the admin's wording when AmneziaWG is missing. */ -export function need_awg() { - if (!awg.installed()) { - let miss = awg.state().missing ?? []; - die(length(miss) ? sprintf(_('AmneziaWG is not installed (%s): install it in Dawnline → Components.'), join(', ', miss)) - : _('AmneziaWG is not installed: install it in Dawnline → Components.')); - } -}; - -/** - * What a device_changed event says changed: each option with its new value - * ("lan_bypass=on", "mtu=1400", "keepalive=auto": '' is the server's again, - * "kind=phone"), so the activity log can say what it became. - */ -function change_detail(names, ch) { - return join(', ', map(names, (k) => { - if (k == 'lan_bypass') - return `lan_bypass=${ch.lan_bypass === true ? 'on' : 'off'}`; - if (k == 'kind') - return `kind=${ch.kind}`; - let v = trim(`${ch[k] ?? ''}`); - return `${k}=${v == '' ? 'auto' : v}`; - })); -} - -/** The device `id` as `opts` may touch it (inside a transaction's model). */ -function own(m, id, opts) { - let d = m.devices[id]; - if (!d || (opts.person != null && d.person != opts.person)) - die(opts.person != null ? _('Device not found.') : _('Unknown device.')); - if (opts.by == 'portal' && d.disabled) - die(_('The admin has turned this device off.')); - return d; -} - -/** - * New device with fresh keys (or the browser's public key): { id, config }. - * `opts.lan_bypass` true keeps its own local network outside the tunnel. - */ -export function add(person, name, kind, opts) { - opts ??= {}; - let by = opts.by ?? 'admin'; - let id = store.transact((c, m) => core.create_device(c, m, person, name, kind, - { by, keys: awg.new_keys(opts.public_key || null), lan_bypass: opts.lan_bypass === true })); - let s = apply.sync(); - let m = core.load(); - live.add_event({ type: 'device_added', person, device: id, detail: m.devices[id].name, by }); - awg.mark_issued(m, id); - return { id, config: awg.client_config(m, m.devices[id]), warning: s.warning }; -}; - -/** - * Rename and/or turn a device off or on, or change how it connects (`ch` = - * { name?, disabled?, mtu?, keepalive?, lan_bypass? }, see - * core.set_device_link); only the admin turns devices off or sets the MTU and - * keep-alive, the portal may switch LAN Bypass (the device then takes its - * updated configuration, keys unchanged). Returns the runtime sync ({} after a - * change of the link values alone: they are in the device's configuration, - * nothing on the router changes). - */ -export function update(id, ch, opts) { - opts ??= {}; - let by = opts.by ?? 'admin'; - if (ch.disabled != null && by != 'admin') - die(_('Only the admin can turn devices off.')); - let link = ch.mtu != null || ch.keepalive != null || ch.lan_bypass != null; - if ((ch.mtu != null || ch.keepalive != null) && by != 'admin') - die(_('Only the admin can change how a device connects.')); - let linked = []; - let d0 = store.transact((c, m) => { - let d = own(m, id, opts); - let was = { ...d }; - if (ch.name != null && ch.name != d.name) - core.rename_device(c, m, id, ch.name); - if (ch.disabled != null) { - if (ch.disabled) - c.set(core.CONFIG, id, 'disabled', '1'); - else - c.delete(core.CONFIG, id, 'disabled'); - } - if (link) - linked = core.set_device_link(c, m, id, ch); - return was; - }); - let r = ch.name != null || ch.disabled != null ? apply.sync() : {}; - if (ch.disabled != null && !!ch.disabled != !!d0.disabled) - live.add_event({ type: 'device_changed', person: d0.person, device: id, detail: ch.disabled ? 'turned off' : 'turned on', by }); - else if (ch.name != null && ch.name != d0.name) - live.add_event({ type: 'device_changed', person: d0.person, device: id, detail: `renamed from ${d0.name}`, by }); - // The options with what they became (change_detail). - if (length(linked)) - live.add_event({ type: 'device_changed', person: d0.person, device: id, detail: change_detail(linked, ch), by }); - return r; -}; - -/* - * New keys for a device: returns its new configuration, marked as issued (it - * goes to the set-up sheet; the device then waits for it as "Not set up yet", - * not as "settings changed"). Only through reconnect: new keys always mean - * setting the device up again. - */ -function rotate(id, opts) { - opts ??= {}; - let by = opts.by ?? 'admin'; - let changed = []; - let person = store.transact((c, m) => { - let d = own(m, id, opts); - if (opts.kind != null && core.set_device_kind(c, m, id, opts.kind)) - push(changed, 'kind'); - if (opts.lan_bypass != null) - push(changed, ...core.set_device_link(c, m, id, { lan_bypass: opts.lan_bypass === true })); - core.rotate_device(c, m, id, awg.new_keys()); - return d.person; - }); - if (length(changed)) - live.add_event({ type: 'device_changed', person, device: id, by, - detail: change_detail(changed, { kind: opts.kind, lan_bypass: opts.lan_bypass === true }) }); - // The device a portal page came through would lose its tunnel before the - // answer gets out: load the new key a moment after answering. - let s = null; - if (opts.defer) - sh_bg('sleep 3; /usr/bin/dawnline sync'); - else - s = apply.sync(); - let m = core.load(); - let d = m.devices[id]; - live.add_event({ type: 'device_keys', person: d.person, device: id, detail: d.name, by }); - awg.mark_issued(m, id); - let cfg = awg.client_config(m, d); - if (s?.warning) - cfg.warning = s.warning; - return cfg; -} - -/** - * Set a device up from scratch (a new phone, the app reinstalled, settings - * the admin changed; the portal's Reconnect and the admin's New keys): new - * keys, so the configuration it holds stops working with the sync, and it - * counts as not set up until it connects with the new one. The usage keeps - * the old keys' last handshake: awg.handshake_since hides it. `opts.kind` and - * `opts.lan_bypass` (the portal's Reconnect: what it is, LAN Bypass) change - * with the keys, in the same write. Returns the new configuration (with - * `warning` when the sync did not fully take). - */ -export function reconnect(id, opts) { - opts ??= {}; - let cfg = rotate(id, opts); - // A deferred sync (the page came through this device) lets the old keys live a few seconds more. - awg.mark_reconnect(core.load(), id, time() + (opts.defer ? 5 : 0)); - return cfg; -}; - -/** Remove a device. Returns the runtime sync. */ -export function remove(id, opts) { - opts ??= {}; - let by = opts.by ?? 'admin'; - let d = store.transact((c, m) => { - let d = own(m, id, opts); - core.delete_device(c, m, id); - return d; - }); - let r = apply.sync(); - live.add_event({ type: 'device_removed', person: d.person, device: id, detail: d.name, dname: d.name, dkind: d.kind, by }); - return r; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/fw.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/fw.uc deleted file mode 100644 index 1578e73..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/fw.uc +++ /dev/null @@ -1,303 +0,0 @@ -// Dawnline — fw4 and routing around it: each tunnel's zone, its forwardings -// to home and WAN, the WAN rules for the tunnels and the portal (named -// sections dawnline_*), what the watchdog checks about them, and the nft -// table that keeps Dawnline's own answers out of proxies. Only sections -// named dawnline_* are ever changed. - -import { readfile, unlink } from 'fs'; -import { sh, sh_out, uniq, in_nets, uci_put, uci_section, ack_config, write_file, syslog, opts_text, RUN_DIR } from 'dawnline.util'; -import { cursor } from 'uci'; -import * as core from 'dawnline.core'; -import * as net from 'dawnline.net'; -import * as nft from 'dawnline.nft'; -import * as loop from 'dawnline.loop'; - -const LOOP_ZONE = 'dl_loop'; -/* - * Our own answers leave by the main table: the portal's (TCP) and each - * tunnel's (UDP). Proxies on the router (tproxy with an fwmark rule to a - * `local default` table) mark the router's own traffic to internet addresses - * in an output route chain, which diverts replies to outside clients into lo. - * A policy rule on the source port can't exempt them: the reroute after the - * mark is set looks up without ports. So a later output route chain of our - * own clears exactly those proxy marks on packets from our listening ports, - * and the kernel routes them again by main. Forwarded traffic is not touched. - */ -const REPLY_TABLE = 'dawnline_reply'; -const REPLY_SIG = `${RUN_DIR}/reply.nft`; -/** Older versions kept answers out of proxies with `ip rule` at this priority; it never matched. */ -const PREF_REPLY = 90; - -/** With `dry`, only says whether the firewall config differs from what Dawnline wants. */ -export function sync(m, dry) { - let c = cursor(); - c.load('firewall'); - let changed = false, want = {}; - // What changed, section by section, for syslog once it is saved (a dry run says nothing). - let notes = []; - - let sec = (name, stype, opts) => { - want[name] = true; - let created = uci_section(c, 'firewall', name, stype), diff = {}; - for (let k, v in opts) - if (uci_put(c, 'firewall', name, k, v)) - diff[k] = v; - if (created || length(keys(diff))) { - changed = true; - push(notes, [ 'info', `${stype} ${name}: ${created ? 'created' : 'updated'} · ${opts_text(created ? opts : diff)}` ]); - } - else - push(notes, [ 'debug', `${stype} ${name}: unchanged` ]); - }; - - let snap = net.snapshot(true); - let portal_zone = null, want_loop = false; - // Where tunnel DNS is sent (dawnline.nft): into the netns for home names - // while any server runs "like a home device", and to the LAN's DNS for - // everyone else. A server that does not forward to those zones on its own - // gets a rule for port 53 alone. - let any_loop = length(filter(values(m.servers), (s) => s.lan_like && length(core.tunnels(s)))) > 0; - let lan_dns = loop.lan_dns(); - let lan_dns_zone = null; - if (lan_dns) - for (let dev, d in snap.devices) - if (d.zone && in_nets(lan_dns, d.nets ?? [])) - lan_dns_zone ??= d.zone; - for (let id, srv in m.servers) { - if (!length(core.tunnels(srv))) - continue; - let z = `dawnline_${id}`; - let sn = net.server_net(srv, snap); - portal_zone ??= sn.wan.zone; - if (!srv.lan_like && any_loop) - sec(`${z}_loopdns`, 'rule', { - name: `Dawnline-${srv.ifname}-names`, src: srv.ifname, dest: LOOP_ZONE, - proto: 'tcp udp', dest_port: 53, target: 'ACCEPT', - }); - if (lan_dns_zone && lan_dns_zone != srv.ifname && index(sn.zones, lan_dns_zone) < 0) - sec(`${z}_landns`, 'rule', { - name: `Dawnline-${srv.ifname}-dns`, src: srv.ifname, dest: lan_dns_zone, dest_ip: lan_dns, - proto: 'tcp udp', dest_port: 53, target: 'ACCEPT', - }); - sec(`${z}_zone`, 'zone', { - // Forward within the zone (device to device) is decided by the inet dawnline table. - name: srv.ifname, network: [ srv.ifname ], - input: 'ACCEPT', output: 'ACCEPT', forward: 'ACCEPT', - }); - // Access per person is enforced by the inet dawnline table; the zone - // only needs to be allowed to reach each home-network zone and WAN. - // The home network may open connections to the devices too (a router - // or a NAS on the tunnel); their answers pass the table as established. - for (let i, zone in sn.zones) - if (zone != sn.wan.zone && zone != srv.ifname) { - let sfx = i == 0 ? '' : `_${replace(zone, /[^A-Za-z0-9_]/g, '_')}`; - sec(`${z}_lan${sfx}`, 'forwarding', { src: srv.ifname, dest: zone }); - sec(`${z}_from_lan${sfx}`, 'forwarding', { src: zone, dest: srv.ifname }); - } - sec(`${z}_wan`, 'forwarding', { src: srv.ifname, dest: sn.wan.zone }); - if (srv.lan_like) { - sec(`${z}_loop`, 'forwarding', { src: srv.ifname, dest: LOOP_ZONE }); - want_loop = true; - } - sec(`${z}_port`, 'rule', { - name: `Dawnline-${srv.ifname}`, src: sn.wan.zone, proto: 'udp', - dest_port: srv.port, target: 'ACCEPT', enabled: srv.enabled ? null : '0', - }); - } - - // The link into the netns that re-enters the router from the LAN. - if (want_loop) { - sec('dawnline_loop', 'zone', { - name: LOOP_ZONE, device: [ net.INTERNAL.transit ], - input: 'REJECT', output: 'ACCEPT', forward: 'REJECT', - }); - // The Home-only resolver in the netns reaches its upstream DNS this way. - sec('dawnline_loop_wan', 'forwarding', { src: LOOP_ZONE, dest: portal_zone ?? 'wan' }); - } - - // Never open SSH, DNS or the LuCI web server for the portal, whatever the settings say. - let portal_port_ok = (p) => p >= 1 && p <= 65535 && index([ 22, 53, 80, 443 ], p) < 0; - if (m.settings.portal_enabled && portal_port_ok(m.settings.portal_port)) { - let wan = portal_zone ?? 'wan'; - sec('dawnline_portal', 'rule', { - name: 'Dawnline-Portal', src: wan, proto: 'tcp', - dest_port: m.settings.portal_port, target: 'ACCEPT', - }); - // IP addresses in links: plain HTTP next to the HTTPS port, and 80 forwarded to it. - if (core.portal_http(m) && portal_port_ok(core.portal_http_port(m))) { - sec('dawnline_portal_http', 'rule', { - name: 'Dawnline-Portal-HTTP', src: wan, proto: 'tcp', - dest_port: core.portal_http_port(m), target: 'ACCEPT', - }); - } - // The portal keeps its own port: 80 and 443 stay with the LuCI web server. - } - - let stale = []; - c.foreach('firewall', null, (s) => { - if (substr(s['.name'], 0, 9) == 'dawnline_' && !want[s['.name']]) - push(stale, s['.name']); - }); - for (let s in stale) { - push(notes, [ 'info', `${c.get('firewall', s) ?? 'section'} ${s}: removed` ]); - c.delete('firewall', s); - changed = true; - } - if (dry) - return changed; - - for (let n in notes) - syslog(n[0], 'firewall', n[1]); - if (changed) { - c.commit('firewall'); - ack_config([ 'firewall' ]); - syslog('info', 'firewall', 'fw4 -q reload'); - system('fw4 -q reload'); - } - return changed; -}; - -/** - * For the watchdog: what is wrong with Dawnline's firewall, or null. - * 'off': fw4 is not running at all (not ours to start); 'changed': the config - * lost or changed Dawnline's sections; 'not loaded': fw4 runs without them. - */ -export function drift(m) { - let t = sh_out('nft -t list table inet fw4 2>/dev/null') ?? ''; - if (t == '') - return 'off'; - if (sync(m, true)) - return 'changed'; - // Named rules show up in fw4's ruleset as comments. - let names = []; - for (let id, srv in m.servers) - if (srv.enabled && length(core.tunnels(srv))) - push(names, `Dawnline-${srv.ifname}`); - if (m.settings.portal_enabled) - push(names, 'Dawnline-Portal'); - for (let n in names) - if (index(t, `${n}"`) < 0) - return 'not loaded'; - return null; -}; - -const MARK_ALL = 0xffffffff; -// "1000: from all fwmark 0x1 lookup 100", or "fwmark 0x1/0xff". A module -// constant, compiled once, not for each rule. -const MARK_RULE = /^(\d+):.*fwmark 0x([0-9a-f]+)(\/0x([0-9a-f]+))?.* lookup (\S+)/; - -function hx(n) { - return sprintf('0x%x', n); -} - -/** - * Policy rules that send marked traffic into a table with `local default`, - * the way transparent proxies capture the router's own traffic: - * [{ pref, mark, mask, table }], one per mark and mask. - */ -export function proxy_diverts() { - let out = [], seen = {}; - for (let fam in [ '-4', '-6' ]) - for (let line in split(sh_out(`ip ${fam} rule show 2>/dev/null`) ?? '', '\n')) { - let mm = match(line, MARK_RULE); - if (!mm || +mm[1] >= 32766) - continue; - let d = { pref: +mm[1], mark: hex(mm[2]), mask: mm[4] ? hex(mm[4]) : MARK_ALL, table: mm[5] }; - let key = `${d.mark}/${d.mask}`; - if (seen[key] || !match(sh_out(`ip ${fam} route show table ${d.table} 2>/dev/null`) ?? '', /(^|\n)local default/)) - continue; - seen[key] = true; - push(out, d); - } - return out; -}; - -/** A divert as `ip rule` shows it, for people: "pref 1000 fwmark 0x1 → table 100". */ -export function divert_str(d) { - return `pref ${d.pref} fwmark ${hx(d.mark)}${d.mask == MARK_ALL ? '' : `/${hx(d.mask)}`} → table ${d.table}`; -}; - -/** Ports Dawnline answers on from the outside: { tcp: [...], udp: [...] }. */ -function reply_ports(m) { - let p = { tcp: [], udp: [] }; - let ok = (n) => n >= 1 && n <= 65535; - if (m.settings.portal_enabled) { - push(p.tcp, +m.settings.portal_port); - if (core.portal_http(m)) - push(p.tcp, +core.portal_http_port(m)); - } - for (let id, srv in m.servers) - if (srv.private_key && srv.enabled) - push(p.udp, +srv.port); - return { tcp: uniq(filter(p.tcp, ok)), udp: uniq(filter(p.udp, ok)) }; -} - -/** The reply table for these diverts, or '' when there is nothing to keep out of them. */ -function reply_script(m, diverts) { - let p = reply_ports(m); - if (!length(diverts) || !length(p.tcp) && !length(p.udp)) - return ''; - let t = []; - push(t, `table inet ${REPLY_TABLE} {`); - push(t, ' chain out {'); - // After the proxies' own output chains (they mark at mangle, -150). - push(t, ' type route hook output priority filter + 10; policy accept;'); - for (let proto in [ 'tcp', 'udp' ]) { - if (!length(p[proto])) - continue; - for (let d in diverts) - // Only the divert's bits: other marks on the packet (multi-WAN) stay. - push(t, ` ${proto} sport { ${join(', ', p[proto])} } ` + (d.mask == MARK_ALL - ? `meta mark ${hx(d.mark)} meta mark set 0x0` - : `meta mark & ${hx(d.mask)} == ${hx(d.mark)} meta mark set meta mark & ${hx(~d.mask & MARK_ALL)}`)); - } - push(t, ' }'); - push(t, '}'); - return join('\n', t) + '\n'; -} - -function reply_loaded() { - return system(`nft list table inet ${REPLY_TABLE} >/dev/null 2>&1`) == 0; -} - -/** Are the answers from our ports kept out of these diverts right now (watchdog)? */ -export function reply_ok(m, diverts) { - let s = reply_script(m, diverts); - return s == '' || (s == readfile(REPLY_SIG) && reply_loaded()); -}; - -/** - * Keep the reply table in step with our ports and the proxies' diverts (apply - * and every agent tick: a proxy may start after Dawnline). Cheap when nothing changed. - */ -export function sync_reply_routes(m) { - // Rules of older versions ("90: from all iif lo ipproto udp sport 51820 lookup main", once without "iif lo"). - for (let fam in [ '-4', '-6' ]) - for (let line in split(sh_out(`ip ${fam} rule show priority ${PREF_REPLY} 2>/dev/null`) ?? '', '\n')) { - let mm = match(line, /(iif lo )?ipproto (tcp|udp) sport ([0-9]+) lookup main/); - if (mm) - sh(`ip ${fam} rule del priority ${PREF_REPLY}${mm[1] ? ' iif lo' : ''} ipproto ${mm[2]} sport ${mm[3]} lookup main 2>/dev/null`); - } - let s = reply_script(m, proxy_diverts()); - if (s == '') { - if (reply_loaded()) { - syslog('info', 'nftables', `table inet ${REPLY_TABLE}: removed (no proxy to keep Dawnline's answers out of)`); - system(`nft delete table inet ${REPLY_TABLE} 2>/dev/null`); - } - unlink(REPLY_SIG); - return; - } - if (s == readfile(REPLY_SIG) && reply_loaded()) { - syslog('debug', 'nftables', `table inet ${REPLY_TABLE}: unchanged`); - return; - } - let err = nft.load(`table inet ${REPLY_TABLE}\ndelete table inet ${REPLY_TABLE}\n${s}`); - if (err) { - unlink(REPLY_SIG); - syslog('error', 'nftables', `table inet ${REPLY_TABLE}: loading failed · ${err}`); - return; - } - syslog('info', 'nftables', `table inet ${REPLY_TABLE}: loaded · ${length(match(s, /\n/g) ?? []) + 1} lines (Dawnline's own answers kept out of proxies)`); - syslog('debug', 'nftables', `table inet ${REPLY_TABLE}: ${s}`); - write_file(REPLY_SIG, s, 0o644); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/geo.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/geo.uc deleted file mode 100644 index 3cfe5d9..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/geo.uc +++ /dev/null @@ -1,196 +0,0 @@ -// Dawnline — city-level locations for the admin map. -// -// Client addresses are looked up once with a third-party service (ipwho.is, -// ipapi.co as fallback) and cached: the live copy in RUN_DIR (tmpfs), put on -// flash (DATA_DIR/geo.json) by flush() about hourly, like the usage -// counters. Only the agent performs lookups, in a child process (the network -// may take seconds; neither its watcher nor its tick waits for them) and -// merges them into the cache itself; the UI reads the cache. - -import { stat } from 'fs'; -import { read_json, write_json, sh_out, q, ensure_dir, ip2int, DATA_DIR, RUN_DIR } from 'dawnline.util'; - -const CACHE = `${RUN_DIR}/geo.json`; -const SAVED = `${DATA_DIR}/geo.json`; -const TTL = 30 * 86400; -const RETRY = 86400; -// Entries kept at least; addresses still shown are never pushed out (merge). -const CAP = 500; - -// [base, prefix] of ranges with no meaningful location (private, CGNAT, multicast, …). -const PRIVATE4 = map([ [ '0.0.0.0', 8 ], [ '10.0.0.0', 8 ], [ '100.64.0.0', 10 ], [ '127.0.0.0', 8 ], [ '169.254.0.0', 16 ], - [ '172.16.0.0', 12 ], [ '192.168.0.0', 16 ], [ '198.18.0.0', 15 ], [ '224.0.0.0', 3 ] ], (r) => [ ip2int(r[0]), 1 << (32 - r[1]) ]); - -/** True for addresses a geolocation service can say something about. */ -export function is_public(ip) { - if (type(ip) != 'string' || ip == '') - return false; - let n = ip2int(ip); - if (n != null) { - for (let r in PRIVATE4) - if (n >= r[0] && n < r[0] + r[1]) - return false; - return true; - } - let l = lc(ip); - return match(l, /^[0-9a-f:]+$/) != null && !match(l, /^(fe[89ab]|f[cd]|::1$|::$)/); -}; - -export function load() { - return read_json(CACHE, null) ?? read_json(SAVED, null) ?? { ips: {}, home: null }; -}; - -/** The live copy (tmpfs); flush() puts it on flash. */ -export function save(cache) { - ensure_dir(RUN_DIR); - write_json(CACHE, cache, 0o600); -}; - -/** Copy the live cache to flash when it is newer (the agent, about hourly and on a clean stop). */ -export function flush() { - let live = stat(CACHE); - if (!live || live.mtime <= (stat(SAVED)?.mtime ?? 0)) - return false; - let c = read_json(CACHE, null); - if (!c) - return false; - ensure_dir(DATA_DIR, 0o700); - write_json(SAVED, c, 0o600); - return true; -}; - -function fetch_json(url) { - let out = sh_out(`uclient-fetch -q -T 5 -O - ${q(url)}`); - if (!out) - return null; - try { - return json(out); - } - catch (e) { - return null; - } -} - -function lookup_ipwho(ip) { - let j = fetch_json(`https://ipwho.is/${ip}?fields=success,ip,latitude,longitude,city,country,country_code,connection`); - if (!j || j.success !== true || j.latitude == null) - return null; - let cn = j.connection ?? {}; - return { lat: +j.latitude, lon: +j.longitude, city: j.city ?? '', country: j.country ?? '', cc: j.country_code ?? '', ip: j.ip, - asn: cn.asn ? +cn.asn : 0, org: cn.isp || cn.org || '' }; -} - -function lookup_ipapi(ip) { - let j = fetch_json(ip ? `https://ipapi.co/${ip}/json/` : 'https://ipapi.co/json/'); - if (!j || j.error || j.latitude == null) - return null; - return { lat: +j.latitude, lon: +j.longitude, city: j.city ?? '', country: j.country_name ?? '', cc: j.country_code ?? '', ip: j.ip, - asn: +replace(`${j.asn ?? ''}`, /^AS/i, '') || 0, org: j.org ?? '' }; -} - -/** One lookup with the configured provider and the other as fallback. */ -export function lookup(provider, ip) { - let order = provider == 'ipapi.co' ? [ lookup_ipapi, lookup_ipwho ] : [ lookup_ipwho, lookup_ipapi ]; - for (let fn in order) { - let r = fn(ip ?? ''); - if (r) - return r; - } - return null; -}; - -/** - * The public addresses of `ips` the cache does not know or knows from too - * long ago (a failed lookup is retried after a day), once each and in order. - * Returns an empty array when there is nothing to look up. - */ -export function stale(cache, ips, ts) { - let now = ts ?? time(), out = [], seen = {}; - for (let ip in ips) { - if (seen[ip] || !is_public(ip)) - continue; - seen[ip] = true; - let c = cache.ips[ip]; - if (c && ((c.fail && now - c.fail < RETRY) || (!c.fail && c.asn != null && now - c.ts < TTL))) - continue; - push(out, ip); - } - return out; -}; - -/** - * Look up at most `max` of `ips`, within `budget` seconds (each lookup may - * wait on the network). Returns { ip: place, or false when the services had - * nothing } for the ones tried. Network only, no cache: the agent runs it in - * a child process and merges the result itself. - */ -export function lookup_all(provider, ips, max, budget) { - let started = time(), out = {}, done = 0; - for (let ip in ips) { - if (done >= max || (budget != null && time() - started >= budget)) - break; - let r = lookup(provider, ip); - done++; - if (r) - delete r.ip; - out[ip] = r ?? false; - } - return out; -}; - -/** - * Put lookup_all() results into the cache. Returns true when the cache - * changed (the caller saves it). `shown` is what is still on the map: the - * cache is kept bounded by dropping other entries only, oldest first, so a - * lookup is never repeated for an address that is still on the map. - */ -export function merge(cache, found, shown, ts) { - let now = ts ?? time(), changed = false; - for (let ip, r in found) { - if (!is_public(ip)) - continue; - cache.ips[ip] = r ? { ...r, ts: now } : { fail: now }; - changed = true; - } - let keep = {}; - for (let ip in shown) - keep[ip] = true; - let all = keys(cache.ips); - if (length(all) > CAP) { - let other = sort(filter(all, (ip) => !keep[ip]), - (a, b) => (cache.ips[a].ts ?? cache.ips[a].fail ?? 0) - (cache.ips[b].ts ?? cache.ips[b].fail ?? 0)); - for (let i = 0; i < length(all) - CAP && i < length(other); i++) { - delete cache.ips[other[i]]; - changed = true; - } - } - return changed; -}; - -/** Locate the router itself (the arcs' origin), at most every 6 hours. */ -export function resolve_home(settings, cache, wan_ip) { - let h = cache.home; - let now = time(); - if (h && h.asn != null && now - (h.ts ?? 0) < 6 * 3600 && (!wan_ip || !is_public(wan_ip) || h.wan == wan_ip)) - return false; - // Behind NAT, ask the service for our public address instead. - let r = lookup(settings.geo_provider, is_public(wan_ip) ? wan_ip : ''); - cache.home = r ? { ...r, wan: wan_ip, ts: now } : { ...(h ?? {}), ts: now }; - return true; -}; - -export function place(cache, ip) { - let c = cache.ips[ip]; - return (c && !c.fail) ? c : null; -}; - -/** "City · ISP" for the activity log; null for no place. */ -export function label(pl) { - return pl ? join(' · ', filter([ pl.city, pl.org ], (x) => x)) : null; -}; - -export function clear() { - save({ ips: {}, home: null }); - ensure_dir(DATA_DIR, 0o700); - write_json(SAVED, { ips: {}, home: null }, 0o600); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc deleted file mode 100644 index 52dc3e2..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/github.uc +++ /dev/null @@ -1,257 +0,0 @@ -// Dawnline — GitHub for the updater and the Components tab: API calls with a -// short cache, releases (with each asset's sha256), the changes between two -// tags, and verified downloads. -// -// Trust: the API is only ever asked directly (TLS to api.github.com). Files -// may come through a mirror when GitHub is unreachable, but only when their -// sha256 is known from the API, and a file is kept only if it matches. - -import { stat, popen, access } from 'fs'; -import { q, read_json, write_json, ensure_dir, RUN_DIR } from 'dawnline.util'; -import { _ } from 'dawnline.i18n'; - -/** Prefixes that fetch github.com files when GitHub itself is unreachable. */ -export const MIRRORS = [ 'https://ghfast.top/', 'https://gh-proxy.com/', 'https://ghproxy.net/' ]; - -function run(cmd) { - let p = popen(cmd + ' 2>&1', 'r'); - if (!p) - return { code: 127, out: '' }; - let out = p.read('all') ?? ''; - return { code: p.close(), out }; -} - -function have_curl() { - return access('/usr/bin/curl', 'x'); -} - -/** - * GET a URL: { status, body } (status 0 when there was no answer). curl gives - * the HTTP status, so a 403 rate limit is told apart from a dead network. - */ -function get(url, timeout) { - timeout ??= 12; - if (have_curl()) { - let r = run(`curl -sSL --connect-timeout 6 --max-time ${+timeout} -H 'Accept: application/vnd.github+json' -A Dawnline -w '\\n%{http_code}' ${q(url)}`); - // The body, then the status on the last line (-w). - let i = rindex(r.out, '\n'); - let code = i < 0 ? '' : substr(r.out, i + 1); - return match(code, /^[0-9][0-9][0-9]$/) ? { status: +code, body: substr(r.out, 0, i) } : { status: 0, body: '' }; - } - let r = run(`uclient-fetch -q -T ${+timeout} -O - ${q(url)}`); - return { status: r.code == 0 ? 200 : 0, body: r.code == 0 ? r.out : '' }; -} - -/** JSON from the GitHub API, or null when GitHub did not answer; dies on a rate limit or another API error. */ -function api_json(url) { - let r = get(url); - if (r.status == 0) - return null; - let j = null; - try { - j = json(r.body); - } - catch (e) { - return null; - } - if (r.status == 403 || r.status == 429 || (type(j) == 'object' && match(j.message ?? '', /rate limit/i))) - die(_('GitHub API rate limit reached: try again in an hour.')); - if (r.status == 404) - return null; - if (r.status >= 400) - die(sprintf(_('GitHub: %s'), j?.message ?? `HTTP ${r.status}`)); - return j; -} - -function cached(key, ttl, fn) { - let path = `${RUN_DIR}/gh-${replace(key, /[^A-Za-z0-9_.-]/g, '_')}.json`; - let c = read_json(path, null); - if (c && time() - (c.at ?? 0) < ttl) - return c.data; - let data = fn(); - if (data != null) { - ensure_dir(RUN_DIR); - write_json(path, { at: time(), data }); - } - return data ?? c?.data; -} - -/* ---------- releases ---------- */ - -function slim(x) { - let digests = {}, ids = {}; - for (let a in x.assets ?? []) { - if (match(a.digest ?? '', /^sha256:[0-9a-f]{64}$/)) - digests[a.name] = substr(a.digest, 7); - if (type(a.id) == 'int' && a.id > 0) - ids[a.name] = a.id; - } - return { - tag: x.tag_name, name: x.name ?? x.tag_name, published: x.published_at ?? null, - prerelease: !!x.prerelease, url: x.html_url ?? null, body: substr(x.body ?? '', 0, 12000), - assets: map(x.assets ?? [], (a) => a.name), digests, ids, - }; -} - -/** Releases of a repository, newest first, five per page (drafts skipped). */ -export function releases(rp, page) { - page = page ?? 1; - return cached(`rel-${rp}-${page}`, 600, () => { - let j = api_json(`https://api.github.com/repos/${rp}/releases?per_page=5&page=${+page}`); - return type(j) == 'array' ? map(filter(j, (x) => !x.draft), slim) : null; - }) ?? []; -}; - -/** One release by tag (notes, assets and their sha256), or null. */ -export function release(rp, tag) { - return cached(`tag-${rp}-${tag}`, 600, () => { - let j = api_json(`https://api.github.com/repos/${rp}/releases/tags/${tag}`); - return type(j) == 'object' && j.tag_name ? slim(j) : null; - }); -}; - -/** The sha256 GitHub publishes for a release file, or null (unknown: no mirrors for it). */ -export function asset_sha256(rp, tag, name) { - try { - return release(rp, tag)?.digests?.[name] ?? null; - } - catch (e) { - return null; - } -}; - -/** The latest stable release; the /releases/latest redirect when the API is out of reach. */ -export function latest(rp) { - let r = null; - try { - r = cached(`latest-${rp}`, 300, () => { - let j = api_json(`https://api.github.com/repos/${rp}/releases/latest`); - return type(j) == 'object' && j.tag_name ? slim(j) : null; - }); - } - catch (e) {} - if (r) - return r; - if (have_curl()) { - let o = run(`curl -sI --connect-timeout 15 --max-time 30 -o /dev/null -w '%{redirect_url}' ${q('https://github.com/' + rp + '/releases/latest')}`); - let m = match(trim(o.out), /\/releases\/tag\/([^\/?#]+)$/); - if (m) - return { tag: m[1], name: m[1], published: null, prerelease: false, url: `https://github.com/${rp}/releases/tag/${m[1]}`, body: '', assets: [], digests: {} }; - } - return null; -}; - -/* ---------- what changed ---------- */ - -/** - * What changed in a commit message, as points: release commits ("Dawnline - * 0.3.1") list their changes as "- " lines in the body; other commits are - * their title. Wrapped points are joined back into one line. - */ -export function points(msg) { - let lines = split(msg ?? '', '\n'); - let title = trim(lines[0] ?? ''); - if (match(title, /^Merge /)) - return []; - let out = [], cur = null; - for (let i = 1; i < length(lines); i++) { - let m = match(lines[i], /^\s*[-*]\s+(.*)$/); - if (m) { - if (cur != null) - push(out, cur); - cur = trim(m[1]); - } - else if (cur != null && match(lines[i], /^\s+\S/)) - cur += ' ' + trim(lines[i]); - else if (cur != null) { - push(out, cur); - cur = null; - } - } - if (cur != null) - push(out, cur); - if (!length(out) && !match(title, /^(Dawnline )?v?[0-9]+\.[0-9]+(\.[0-9]+)?$/) && title != '') - push(out, title); - return out; -}; - -/** The changes from one tag to another, newest first: commit by commit, or the release's own commit. */ -export function changes(rp, base, head) { - return cached(`changes-${rp}-${base}-${head}`, 600, () => { - let out = []; - let j = base ? api_json(`https://api.github.com/repos/${rp}/compare/${base}...${head}`) : null; - if (type(j?.commits) == 'array') { - for (let i = length(j.commits) - 1; i >= 0; i--) - for (let p in points(j.commits[i]?.commit?.message)) - push(out, p); - return slice(out, 0, 20); - } - let c = api_json(`https://api.github.com/repos/${rp}/commits/${head}`); - return c?.commit ? slice(points(c.commit.message), 0, 20) : null; - }) ?? []; -}; - -/* ---------- downloads ---------- */ - -export function sha256(path) { - return match(run(`sha256sum ${q(path)}`).out, /^([0-9a-f]{64})/)?.[1]; -}; - -/** A release file's URL on github.com in parts: { repo, tag, name }, or null for any other URL. */ -export function release_file(url) { - let m = match(url ?? '', /^https:\/\/github\.com\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/releases\/download\/([^\/?#]+)\/([^\/?#]+)$/); - return m ? { repo: m[1], tag: m[2], name: m[3] } : null; -}; - -/** The same file through the API (api.github.com), when its release is known; else null. */ -function asset_api_url(url) { - let f = release_file(url); - if (!f) - return null; - let id = null; - try { - id = release(f.repo, f.tag)?.ids?.[f.name]; - } - catch (e) {} - return id ? `https://api.github.com/repos/${f.repo}/releases/assets/${id}` : null; -} - -/** - * Download to a file. o: { sha256, mirrors, log }. Direct first; mirrors - * only when the sha256 is known (from the API) and mirrors are allowed. A - * file that does not match the sha256 is thrown away and the next source is - * tried. Returns the URL that worked, or null. - */ -export function download(url, dest, o) { - o ??= {}; - let want = o.sha256 ? lc(o.sha256) : null; - let curl = have_curl(); - let tries = []; - // Without curl a release file comes through the API first: github.com's redirect to it carries a - // Content-Security-Policy header that can outgrow uclient-fetch's 4 KB line buffer, and it stalls there. - let api = curl ? null : asset_api_url(url); - if (api) - push(tries, { u: api, accept: 'application/octet-stream' }); - push(tries, { u: url }); - let direct = length(tries); - if (want && o.mirrors && match(url, /^https:\/\/(github\.com|raw\.githubusercontent\.com)\//)) - for (let m in MIRRORS) - push(tries, { u: m + url, mirror: true }); - for (let i, t in tries) { - let host = replace(t.u, /^https:\/\/([^\/]+)\/.*$/, '$1'); - if (t.mirror) - o.log?.(sprintf(_('Trying mirror %s'), host)); - let r = curl - ? run(`curl -fsSL --connect-timeout 15 --max-time 300 --retry 1 -o ${q(dest)} ${q(t.u)}`) - : run(`uclient-fetch -q -T 30 ${t.accept ? `--header=${q('Accept: ' + t.accept)} ` : ''}-O ${q(dest)} ${q(t.u)}`); - if (r.code == 0 && (stat(dest)?.size ?? 0) > 0) { - if (!want || sha256(dest) == want) - return t.u; - o.log?.(sprintf(_("Warning: %s sent a file that does not match GitHub's sha256, discarded"), host)); - } - system(`rm -f ${q(dest)}`); - if (i == direct - 1 && length(tries) > direct) - o.log?.(_('GitHub did not answer, trying mirrors')); - } - return null; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc deleted file mode 100644 index 1531773..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/health.uc +++ /dev/null @@ -1,758 +0,0 @@ -// Dawnline — Health: what the router has and lacks (packages, listeners, -// networks), the checks shown on Diagnostics → Health, and their fixes. -// The checks' texts are in the language of the call (dawnline.i18n). - -import { readfile, stat, lsdir } from 'fs'; -import { cursor } from 'uci'; -import { _, N_ } from 'dawnline.i18n'; -import { q, sh, sh_out, parse_cidr, cidr_overlaps, ip2int, in_cidr, file_exists, cloudflare_ip } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as fw from 'dawnline.fw'; -import * as loop from 'dawnline.loop'; -import * as net from 'dawnline.net'; -import * as awg from 'dawnline.awg'; -import * as builds from 'dawnline.awg_builds'; -import * as lookup from 'dawnline.lookup'; -import * as pc from 'dawnline.portalcert'; - -/* ---------- what the router has ---------- */ - -/** - * Packages a feature needs that are missing, by feature: https (the portal: openssl-util and any - * TLS module for uhttpd), acme (Let's Encrypt certificates), home (the home-like link), awg - * (AmneziaWG: the tools with netifd's protocol script, and the kernel module). Checked by - * files, so it is cheap enough for every page load. - */ -export function needs() { - let tls = false; - for (let d in [ '/lib', '/usr/lib' ]) - for (let f in lsdir(d) ?? []) - if (substr(f, 0, 16) == 'libustream-ssl.s') - tls = true; - let kver = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - let kmod = (name) => stat(`/sys/module/${name}`) != null || file_exists(`/lib/modules/${kver}/${name}.ko`); - let miss = (list) => map(filter(list, (x) => !x[0]), (x) => x[1]); - return { - https: miss([ [ file_exists('/usr/bin/openssl'), 'openssl-util' ], [ tls, 'libustream-openssl' ] ]), - acme: miss([ [ file_exists('/usr/lib/acme/client/acme.sh'), 'acme' ], [ file_exists('/usr/lib/acme/client/dnsapi/dns_cf.sh'), 'acme-acmesh-dnsapi' ], - [ file_exists('/www/luci-static/resources/view/acme.js'), 'luci-app-acme' ] ]), - home: miss([ [ file_exists('/usr/libexec/ip-full'), 'ip-full' ], [ kmod('veth'), 'kmod-veth' ] ]), - // amneziawg-tools ships both the awg tool and netifd's protocol script. - awg: miss([ [ file_exists('/usr/bin/awg') && file_exists('/lib/netifd/proto/amneziawg.sh'), 'amneziawg-tools' ], - [ kmod('amneziawg'), 'kmod-amneziawg' ] ]), - }; -}; - -// " 12: 00000000:1194 00000000:0000 07 …": local address, then the remote one (none). -// A module constant, compiled once: a literal in the loop would be compiled -// again for every socket (0.12 ms each on the WR3000P, some 90 sockets a call). -const UDP_UNCONNECTED = /^ *[0-9]+: [0-9A-F]+:([0-9A-F]{4}) [0-9A-F]+:0000 /; - -/** UDP ports an unconnected socket is bound to (IPv4 and IPv6): nothing else can listen there. */ -export function udp_bound() { - let out = {}; - for (let f in [ '/proc/net/udp', '/proc/net/udp6' ]) - for (let line in split(readfile(f) ?? '', '\n')) { - let m = match(line, UDP_UNCONNECTED); - if (m) - out[hex(m[1])] = true; - } - return map(keys(out), (k) => +k); -}; - -// netstat's columns and the port of "0.0.0.0:53" / ":::53". Module constants, -// compiled once, not for each socket. -const BLANKS = /[ \t]+/, PORT_SUFFIX = /:([0-9]+)$/; - -/** - * Programs on 'tcp' or 'udp' ports, our portal left out: { port: "dnsmasq" }. - * Kernel sockets (a tunnel's) have no name. - */ -function port_programs(proto) { - let out = {}; - for (let line in split(sh_out(`netstat -ln${proto == 'tcp' ? 't' : 'u'}p 2>/dev/null`) ?? '', '\n')) { - let f = split(trim(line), BLANKS); - if (f[0] != proto && f[0] != `${proto}6`) - continue; - let m = match(f[3] ?? '', PORT_SUFFIX); - let owner = split(f[length(f) - 1], '/'); - if (!m || !owner[1] || out[m[1]]) - continue; - // Our own portal runs as a dedicated uhttpd instance. - if (index(readfile(`/proc/${+owner[0]}/cmdline`) ?? '', '/usr/share/dawnline/portal') >= 0) - continue; - out[m[1]] = owner[1]; - } - return out; -} - -export function udp_port_programs() { - return port_programs('udp'); -}; - -export function tcp_port_programs() { - return port_programs('tcp'); -}; - -export function udp_listening(port) { - return index(udp_bound(), +port) >= 0; -}; - -export function tcp_listening(port) { - let hex = sprintf(':%04X ', port); - for (let f in [ '/proc/net/tcp', '/proc/net/tcp6' ]) - for (let line in split(readfile(f) ?? '', '\n')) - // state 0A = LISTEN - if (index(line, hex) > 0 && match(line, / 0A /)) - return true; - return false; -}; - -/** Processes other than our portal listening on a TCP port: [ "name" ]. */ -export function tcp_port_owners(port) { - let out = sh_out(`netstat -lntp 2>/dev/null | awk '$4 ~ /:${+port}$/ {print $7}'`) ?? ''; - let owners = []; - for (let o in split(out, '\n')) { - let name = split(o, '/')[1]; - if (!name || index(owners, name) >= 0) - continue; - // Our own portal runs as a dedicated uhttpd instance. - let pid = +split(o, '/')[0]; - let cmd = readfile(`/proc/${pid}/cmdline`) ?? ''; - if (index(cmd, '/usr/share/dawnline/portal') >= 0) - continue; - push(owners, name); - } - return owners; -}; - -export function service_running(name, instance) { - let s = sh_out(`ubus call service list '{"name":"${name}"}' 2>/dev/null`); - if (!s) - return false; - try { - return !!json(s)?.[name]?.instances?.[instance]?.running; - } - catch (e) { - return false; - } -}; - -/** IPv4 networks of netifd interfaces: [{ iface, cidr }], without the given server's tunnel. */ -function other_subnets(srv_id) { - let out = []; - let st = sh_out('ubus call network.interface dump 2>/dev/null'); - let d = null; - try { - d = st ? json(st) : null; - } - catch (e) { - d = null; - } - let ours = {}; - for (let id, s in core.load().servers) - ours[s.ifname] = id; - for (let i in d?.interface ?? []) { - if (srv_id != null && ours[i.interface] == srv_id) - continue; - if (srv_id === false && ours[i.interface] != null) - continue; - for (let a in i['ipv4-address'] ?? []) - push(out, { iface: i.interface, cidr: `${a.address}/${a.mask}` }); - } - return out; -}; - -/** Subnets in use on the router except the given server's (null: all of them). */ -/** The router's IPv4 networks, Dawnline's tunnels included: [{ iface, cidr }]. */ -export function networks() { - return other_subnets(null); -}; - -export function used_subnets(except_srv) { - return map(other_subnets(except_srv), (x) => x.cidr); -}; - -/** Subnets of interfaces that are not Dawnline tunnels (an imported config is checked against these). */ -export function foreign_subnets() { - return used_subnets(false); -}; - -/* ---------- checks ---------- */ - -/* - * Checks are named for the healthy state ("Clock is set"); a failed one also - * gets the problem in words for notices ("Clock isn't set"), passed with it. - * A server's checks carry its name after both (` (Home)`, with several servers). - */ -function check(id, title, status, detail, fix, problem) { - let bad = status == 'warn' || status == 'error'; - return { id, title, status, detail: detail ?? '', fix: fix ?? null, problem: bad ? (problem ?? title) : null }; -} - -/** - * Answers from our ports and the proxies that would swallow them (fw.sync_reply_routes): - * { ok, diverts: ["pref 1000 fwmark 0x1 → table 100"] }. - */ -function replies(m) { - let d = fw.proxy_diverts(); - return { ok: fw.reply_ok(m, d), diverts: map(d, fw.divert_str) }; -} - -function reply_check(id, title, problem, proto, port, r) { - let via = join(', ', r.diverts); - let from = `${uc(proto)} ${port}`; - return check(id, title, r.ok ? 'ok' : 'error', - !r.ok ? sprintf(_('Answers from %s are swallowed by a proxy on the router (%s): clients get no reply.'), from, via) - : length(r.diverts) ? sprintf(_('Answers from %s go straight out. A proxy on the router diverts its own traffic (%s); these answers skip it.'), from, via) - : sprintf(_('Answers from %s go straight out.'), from), - r.ok ? null : 'apply', problem); -} - -const PRIVATE = map([ '100.64.0.0/10', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16' ], parse_cidr); - -/** What kind of IPv4 the WAN has: public, cgnat (100.64/10), private (behind another router), or none. */ -export function wan_kind(wan) { - let wc = wan ? ip2int(wan) : null; - if (wc == null) - return 'none'; - if (in_cidr(wc, PRIVATE[0])) - return 'cgnat'; - return length(filter(PRIVATE, (c) => in_cidr(wc, c))) ? 'private' : 'public'; -}; - -const HEX = '0123456789abcdef'; - -// An IPv6 address as its 32 hex digits, so two spellings of one address -// compare equal (2001:DB8::1, 2001:db8:0::1, as typed or as a tool prints -// it); null when it is none. No regex: the router's addresses and a name's -// AAAA records go through it on every look. -function ip6_full(s) { - if (type(s) != 'string') - return null; - let halves = split(lc(s), '::'); - if (length(halves) > 2) - return null; - let head = halves[0] != '' ? split(halves[0], ':') : []; - let tail = length(halves) == 2 && halves[1] != '' ? split(halves[1], ':') : []; - let gap = 8 - length(head) - length(tail); - if (length(halves) == 2 ? gap < 1 : gap != 0) - return null; - let groups = [ ...head ]; - for (let i = 0; i < gap; i++) - push(groups, '0'); - push(groups, ...tail); - let out = ''; - for (let g in groups) { - if (length(g) < 1 || length(g) > 4 || ltrim(g, HEX) != '') - return null; - out += substr(`0000${g}`, length(g)); - } - return out; -} - -/** - * The router's public IPv6 addresses in `ip -6 -j addr show scope global` - * output (`links`), on any interface: a DDNS client may publish the LAN's - * address from the delegated prefix, which reaches the router too. Unique - * local addresses (fc00::/7: OpenWrt gives the LAN one even without IPv6 - * from the ISP) and failed duplicates do not count: nothing reaches them from - * outside. [] when there is none. - */ -export function own_ipv6(links) { - let out = []; - for (let l in (type(links) == 'array' ? links : [])) - for (let a in l?.addr_info ?? []) { - let k = ip6_full(a?.local); - if (k && a.family == 'inet6' && !a.dadfailed && substr(k, 0, 2) != 'fc' && substr(k, 0, 2) != 'fd') - push(out, a.local); - } - return out; -}; - -// The router's public IPv6 addresses (own_ipv6), or null when `ip` could not tell. -function router_ipv6() { - let out = sh_out('ip -6 -j addr show scope global'); - if (out == null) - return null; - try { - let links = json(out || '[]'); - return type(links) == 'array' ? own_ipv6(links) : null; - } - catch (e) { - // No JSON (an `ip` without -j): unknown, so the AAAA records get no verdict. - return null; - } -} - -// What the facts are made from, read on the router. -function endpoint_reads(srv, host) { - let ips = host ? lookup.resolve(host) : []; - // The router's IPv6 only when the name has some to compare with. - return { - ips, wan: srv ? (net.wan_address(srv) ?? lookup.wan_ipv4(srv.wan_zone)) : lookup.wan_ipv4('wan'), - router6: length(filter(ips, (a) => ip2int(a) == null)) ? router_ipv6() : null, - }; -} - -/** - * What a public address points at, for Health and the "as you type" check on - * the server page: { host, ips, ips4, ips6, wan, kind (wan_kind), cloudflare, - * here (an IPv4 of it is this router's WAN), v6_only, router6 (the router's - * public IPv6 addresses, own_ipv6; null when unknown, or not read because the - * name has no IPv6), foreign6 (its IPv6 addresses that are none of those, all - * of them when the router has none; null while router6 is), here6 (it has - * IPv6 addresses and each is one of the router's) }. `reads` (a test's) - * stands for what is read on the router: { ips, wan, router6 }. - */ -export function endpoint_facts(srv, host, reads) { - let r = reads ?? endpoint_reads(srv, host); - let ips = r.ips ?? [], wan = r.wan ?? null; - let ips4 = filter(ips, (a) => ip2int(a) != null), ips6 = filter(ips, (a) => ip2int(a) == null); - let own = r.router6 != null ? map(r.router6, ip6_full) : null; - let foreign6 = own != null ? filter(ips6, (a) => index(own, ip6_full(a)) < 0) : null; - return { - host, ips, ips4, ips6, wan, kind: wan_kind(wan), - cloudflare: length(filter(ips, (a) => cloudflare_ip(a))) > 0, - here: wan != null && index(ips4, wan) >= 0, - v6_only: !length(ips4) && length(ips6) > 0, - router6: r.router6 ?? null, foreign6, - here6: foreign6 != null && length(ips6) > 0 && !length(foreign6), - }; -}; - -/* - * The name's IPv6 addresses that do not reach this router from outside, in - * words, or null (each is a public one of the router, or those are unknown). - * A name with IPv4 too: devices that prefer IPv6 take these and fail, the - * others connect. - */ -function aaaa_words(f) { - let bad = f.foreign6 ?? [], n = length(bad); - if (!n) - return null; - if (!length(f.router6)) - return sprintf(N_(n, '%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router.', - '%s AAAA → %s, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove these AAAA records or set up IPv6 on the router.'), - f.host, join(', ', bad)); - return sprintf(N_(n, '%s AAAA → %s is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.', - '%s AAAA → %s are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records.'), - f.host, join(', ', bad)); -} - -// An IPv6-only name none of whose addresses is a public one of the router: no device connects. Null otherwise. -function v6_only_unreached(f) { - let n = length(f.foreign6 ?? []); - if (!n || n < length(f.ips6)) - return null; - if (!length(f.router6)) - return sprintf(_('%s → %s: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router.'), - f.host, join(', ', f.ips6)); - return sprintf(N_(n, '%s → %s: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS.', - '%s → %s: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS.'), - f.host, join(', ', f.ips6)); -} - -/** - * The facts in words, in the language of the call: { status: ok|warn|error, text } - * (text a whole sentence). `proto_note` names what must get through ("UDP 4500"). - */ -export function endpoint_words(f, proto_note) { - if (!f.host) - return { status: 'error', text: _('No public address: devices will not know where to connect.') }; - if (!length(f.ips)) - return { status: 'error', text: sprintf(_('%s does not resolve.'), f.host) }; - if (f.cloudflare) - return { status: 'error', text: sprintf(_("%s → %s (Cloudflare). %s reaches the router only if this name is DNS-only there, or use the router's IP."), - f.host, join(', ', f.ips), proto_note) }; - let v6 = aaaa_words(f); - if (f.v6_only) { - let none = v6_only_unreached(f); - if (none != null || v6 != null) - return { status: 'warn', text: none ?? v6 }; - return { status: f.kind == 'public' ? 'warn' : 'ok', text: f.kind == 'public' - ? sprintf(_("%s → %s: IPv6 only, so only devices with IPv6 connect (the router's IPv4 %s has no name)."), f.host, join(', ', f.ips6), f.wan) - : sprintf(_('%s → %s: IPv6 only, so only devices with IPv6 connect.'), f.host, join(', ', f.ips6)) }; - } - let v4 = null; - if (f.kind == 'cgnat' || f.kind == 'private') - v4 = f.kind == 'cgnat' - ? sprintf(_('The WAN address %s is CGNAT (shared by the ISP): %s cannot be forwarded to this router from outside unless the ISP gives a public address or IPv6.'), f.wan, proto_note) - : sprintf(_('The WAN address %s is private: this router is behind another one. Forward %s on it, or devices cannot connect.'), f.wan, proto_note); - else if (f.wan && !f.here) - v4 = sprintf(_('%s points at %s, not this router (WAN %s). Check your DNS / DDNS.'), f.host, join(', ', f.ips4), f.wan); - // Two separate facts, each a sentence of its own: the IPv4 one first. - if (v4 != null || v6 != null) - return { status: 'warn', text: join(' ', filter([ v4, v6 ], (x) => x != null)) }; - // Without the router's WAN address only the facts: names and addresses, no words. - return { status: 'ok', text: f.here ? sprintf(_('%s points at this router (%s).'), f.host, join(', ', [ f.wan, ...(f.here6 ? f.ips6 : []) ])) - : `${f.host} → ${join(', ', f.ips)}` }; -}; - -/** What a public address resolves to and whether that reaches this router (for a core's protocol). */ -function endpoint_check(id, title, problem, srv, host, proto_note) { - let w = endpoint_words(endpoint_facts(srv, host), proto_note); - return check(id, title, w.status, w.text, null, problem); -} - -// "1000: from all fwmark 0x1 lookup 100". A module constant, compiled once, not for each rule. -const MARK_RULE = /^(\d+):.*fwmark 0x([0-9a-f]+)(\/0x[0-9a-f]+)?.* lookup (\S+)/; - -/** - * Policy routing by another package (mwan3, pbr): an fwmark rule ahead of - * Dawnline's (pref < 5205) whose table has a default route of its own sends - * marked tunnel traffic straight out, past "like a home device". Reported, - * since those marks belong to that package. [] when none. - */ -function policy_routing() { - let out = []; - for (let line in split(sh_out('ip -4 rule show 2>/dev/null') ?? '', '\n')) { - let mm = match(line, MARK_RULE); - if (!mm || +mm[1] >= 5205) - continue; - let routes = sh_out(`ip -4 route show table ${q(mm[4])} 2>/dev/null`) ?? ''; - let def = match(routes, /(^|\n)default [^\n]*/)?.[0] ?? ''; - if (def == '' || match(def, /local default/) || index(def, `dev ${net.INTERNAL.transit}`) >= 0) - continue; - push(out, `pref ${mm[1]} fwmark 0x${mm[2]} → table ${mm[4]}`); - } - return out; -} - -function no_proto() { - return _("netifd doesn't know the amneziawg protocol (AmneziaWG missing, or the network wasn't restarted after installing it)."); -} - -/** Free space on the overlay in KB (null when unknown). */ -function overlay_free_kb() { - let out = sh('df -Pk /overlay 2>/dev/null || df -Pk / 2>/dev/null').out; - let m = match(out ?? '', /\n\S+\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s/); - return m ? +m[1] : null; -} - -/** Is AmneziaWG there and usable: packages, kernel module, netifd's protocol handler. */ -function awg_check() { - let st = awg.load(); - let title = _('AmneziaWG installed'); - let missing = st.missing ?? []; - if (length(missing)) { - // The module was built for the kernel of the firmware it was installed on. - let kc = builds.kernel_changed(); - if (kc && index(missing, 'kmod-amneziawg') >= 0) - return check('awg', title, 'error', - sprintf(_('The firmware changed (kernel %s → %s): the AmneziaWG build installed for it is gone. Install the build for this firmware.'), kc.was, kc.now), - 'install:awg', _('AmneziaWG needs a build for the new firmware')); - return check('awg', title, 'error', sprintf(N_(length(missing), '%s is missing.', '%s are missing.'), join(', ', missing)), 'install:awg', - _('AmneziaWG isn’t installed')); - } - if (!st.loaded) { - // load() tried it: the second modprobe only repeats why. - let why = trim(sh('modprobe amneziawg 2>&1; dmesg | grep -i amneziawg | tail -n 3').out); - return check('awg', title, 'error', - why ? sprintf(_("The kernel module doesn't load: %s Reinstall a build for this kernel in Components."), why) - : _("The kernel module doesn't load. Reinstall a build for this kernel in Components."), - 'updates', _('AmneziaWG’s kernel module doesn’t load')); - } - if (!st.handler) - return check('awg', title, 'error', no_proto(), 'netrestart', _('The network doesn’t know AmneziaWG yet')); - // The install could not swap the loaded module: the old one runs until the next boot (dawnline.awg_builds). - if (builds.waits_for_reboot()) - return check('awg', title, 'warn', _('The AmneziaWG update is installed and starts after a reboot.'), null, - _('The AmneziaWG update waits for a reboot')); - return check('awg', title, 'ok', _('Kernel module, awg tool and the netifd protocol are present.')); -} - -/** - * The /24s home routers come with out of the box. A home network on one of - * them is very likely the same as the network a person connects from, and - * home access then takes those addresses into the tunnel: their own printer or - * TV is out of reach while connected, LAN Bypass or not. - */ -const COMMON_HOME = [ - '192.168.0.0/24', '192.168.1.0/24', '192.168.2.0/24', '192.168.3.0/24', '192.168.8.0/24', '192.168.10.0/24', - '192.168.31.0/24', '192.168.50.0/24', '192.168.88.0/24', '192.168.100.0/24', '192.168.178.0/24', - '10.0.0.0/24', '10.1.1.0/24', -]; - -/** The home networks in `nets` that overlap a common out-of-the-box subnet. */ -export function common_home(nets) { - return filter(nets ?? [], (n) => { - let a = parse_cidr(n); - return a && length(filter(COMMON_HOME, (c) => cidr_overlaps(a, parse_cidr(c)))); - }); -}; - -/** - * Whether the server's home networks are on a common subnet, while anyone on - * it has home access (otherwise nothing of home goes into the tunnel). A - * warning on Health only: advice, not a fault, so no notice elsewhere. - */ -function home_check(m, id, srv, label) { - let reach = filter(values(m.people), (p) => p.server == id && (p.access == 'lan' || p.access == 'both')); - let nets = net.server_net(srv).nets; - if (!length(reach) || !length(nets)) - return null; - let bad = common_home(nets); - let c = check(`homenet_${id}`, _('Home network addresses') + label, length(bad) ? 'warn' : 'ok', - length(bad) - ? sprintf(_('%s is one of the most common home subnets. On a network with the same addresses, people with home access reach your home instead of their own: their printer or TV there is out of reach while connected, with LAN Bypass too. A rarer subnet for your home network avoids it, for example 10.37.12.0/24.'), join(', ', bad)) - : sprintf(_('%s is not a common home subnet: the networks people connect from rarely use the same addresses.'), join(', ', nets)), - null); - c.problem = null; - return c; -} - -/** Checks of a server's AmneziaWG tunnel. */ -function awg_checks(m, id, srv, label, fwc, dmp, rep) { - let out = []; - let st = live.iface_status(srv.ifname); - let up = !!st?.up; - let codes = map(st?.errors ?? [], (e) => e.code); - let running = _('AmneziaWG running') + label, down = _('AmneziaWG is down') + label; - if (!up && index(codes, 'INVALID_PROTO') >= 0) - push(out, check(`up_${id}`, running, 'error', no_proto(), 'netrestart', down)); - else - push(out, check(`up_${id}`, running, up ? 'ok' : 'error', - up ? sprintf(_('%s is up, listening on UDP %d.'), srv.ifname, srv.port) : - !st ? sprintf(_('%s does not exist.'), srv.ifname) : - length(codes) ? sprintf(_('%s is down: %s.'), srv.ifname, join(', ', codes)) : sprintf(_('%s is down.'), srv.ifname), - up ? null : (st ? 'ifup:' + srv.ifname : 'apply'), down)); - // The devices the sync loads, by the same choice the agent compares with every minute. - if (up && dmp.reads[srv.ifname] == 'error') - push(out, check(`peers_${id}`, _('AmneziaWG devices loaded') + label, 'warn', - _('The tunnel could not be read, so its devices could not be checked.'), null, - _('The devices in AmneziaWG could not be checked') + label)); - else if (up) { - let devs = awg.tunnel_devices(m, id, apply.states_for(m, core.load_usage())); - let diff = awg.peer_diff(devs, dmp, srv.ifname); - let expected = length(devs), missing = diff.missing, extra = diff.extra, actual = diff.loaded; - let same = !missing && !extra; - push(out, check(`peers_${id}`, _('AmneziaWG devices loaded') + label, same ? 'ok' : 'warn', - same ? sprintf(N_(actual, '%d device is loaded in the tunnel.', '%d devices are loaded in the tunnel.'), actual) : - extra ? sprintf(N_(expected, '%d of %d device missing, %d loaded that should not be.', '%d of %d devices missing, %d loaded that should not be.'), - missing, expected, extra) - : sprintf(N_(expected, '%d of %d device missing.', '%d of %d devices missing.'), missing, expected), - same ? null : 'sync', _('Not every device is loaded into AmneziaWG') + label)); - } - let rule = fwc.get('firewall', `dawnline_${id}_port`) == 'rule'; - let zone = fwc.get('firewall', `dawnline_${id}_zone`) == 'zone'; - push(out, check(`fw_${id}`, _('AmneziaWG firewall') + label, rule && zone ? 'ok' : 'error', - rule && zone ? sprintf(_('Zone %s and the WAN rule for UDP %d exist.'), srv.ifname, srv.port) : _('Firewall zone or WAN rule is missing.'), - rule && zone ? null : 'apply', _('AmneziaWG firewall rules are missing') + label)); - push(out, reply_check(`reply_${id}`, _('AmneziaWG answers reach devices') + label, _('AmneziaWG answers may not reach devices') + label, - 'udp', srv.port, rep)); - // Port collisions with other tunnels. - let clash = []; - let nc = cursor(); - nc.load('network'); - nc.foreach('network', 'interface', (s) => { - if (s['.name'] != srv.ifname && (s.proto == 'amneziawg' || s.proto == 'wireguard') && +s.listen_port == srv.port) - push(clash, s['.name']); - }); - if (length(clash)) - push(out, check(`port_${id}`, _('AmneziaWG port is free') + label, 'error', sprintf(_('UDP %d is also used by %s.'), srv.port, join(', ', clash)), - null, _('AmneziaWG port is taken') + label)); - let overlaps = []; - let sc = parse_cidr(srv.subnet); - for (let o in other_subnets(id)) { - let oc = parse_cidr(o.cidr); - if (sc && oc && cidr_overlaps(sc, oc)) - push(overlaps, `${o.iface} (${o.cidr})`); - } - push(out, check(`subnet_${id}`, _('AmneziaWG subnet is unique') + label, length(overlaps) ? 'error' : 'ok', - length(overlaps) ? sprintf(_('%s overlaps %s.'), srv.subnet, join(', ', overlaps)) : sprintf(_('%s does not overlap other networks.'), srv.subnet), - null, _('AmneziaWG subnet overlaps another network') + label)); - let home = home_check(m, id, srv, label); - if (home) - push(out, home); - return out; -} - -/** The portal's checks: listening, its address, answers, plain HTTP and the certificate. */ -function portal_checks(m, need, rep) { - let out = []; - let s = m.settings; - let portal = _('Personal portal'), portal_bad = _('Personal portal isn’t working'); - if (length(need.https)) - return [ check('portal', portal, 'error', sprintf(_("HTTPS isn't available on this router: install %s."), join(', ', need.https)), 'install:https', portal_bad) ]; - let owners = tcp_port_owners(s.portal_port); - let listening = tcp_listening(s.portal_port); - if (length(owners)) - push(out, check('portal', portal, 'error', - sprintf(_('TCP %d is already used by %s. Choose another port in Settings.'), s.portal_port, join(', ', owners)), null, portal_bad)); - else - push(out, check('portal', portal, listening ? 'ok' : 'error', - listening ? sprintf(_('Listening on TCP %d.'), s.portal_port) : sprintf(_('Nothing listens on TCP %d.'), s.portal_port), - listening ? null : 'restart', portal_bad)); - if (!s.portal_host) - push(out, check('portal_host', _('Portal address'), 'error', _('Set the public hostname in Settings so links can be generated.'), - null, _('Portal address isn’t set'))); - else { - let ips = lookup.resolve(s.portal_host), wan = lookup.router_wan(m); - let cf = filter(ips, (x) => cloudflare_ip(x)); - let h = s.portal_host; - push(out, check('portal_dns', _('Portal address points here'), !length(ips) ? 'error' : length(cf) ? 'ok' : wan && index(ips, wan) < 0 ? 'warn' : 'ok', - !length(ips) ? sprintf(_('%s does not resolve.'), h) : - length(cf) ? sprintf(_('%s goes through Cloudflare; in Russia such connections often stall after ~16 KB.'), h) : - wan && index(ips, wan) < 0 ? sprintf(_('%s points at %s, not this router (%s).'), h, join(', ', ips), wan) : - wan ? sprintf(_('%s → %s (this router).'), h, join(', ', ips)) : `${h} → ${join(', ', ips)}.`, - null, _('Portal address doesn’t point here'))); - } - push(out, reply_check('portal_reply', _('Portal answers reach visitors'), _('Portal answers may not reach visitors'), 'tcp', s.portal_port, rep)); - if (core.portal_http(m)) { - let ipl = filter(core.portal_hosts(m), (h) => ip2int(h) != null); - push(out, check('portal_http', _('Plain HTTP links'), 'warn', - sprintf(_('Links on %s use plain HTTP: the link and the VPN keys in configurations travel unencrypted.'), join(', ', ipl)), - null, _('Portal links use plain HTTP'))); - } - if (ip2int(s.portal_host) != null) { - push(out, check('cert', _('Portal certificate'), 'skip', _('The main address is an IP: its links use plain HTTP.'))); - return out; - } - let cert = pc.portal_cert(s); - let ok = system(`openssl x509 -checkend 1209600 -noout -in ${q(cert.cert)} >/dev/null 2>&1`) == 0; - let sans = cert.self_signed ? [] : pc.cert_names(cert.cert); - let covers = !s.portal_host || cert.self_signed || length(filter(sans, (n) => pc.name_covers(n, s.portal_host))) > 0; - push(out, check('cert', _('Portal certificate'), cert.self_signed || !ok || !covers ? 'warn' : 'ok', - cert.self_signed ? (length(need.acme) ? _('Using a self-signed certificate: browsers will show a warning. ACME can get a free Let’s Encrypt one.') - : _('Using a self-signed certificate: browsers will show a warning.')) : - !covers ? sprintf(_('%s does not cover %s (it has %s): browsers will warn.'), cert.cert, s.portal_host, join(', ', sans)) : - ok ? sprintf(_('%s covers %s and is valid for more than 14 days.'), cert.cert, s.portal_host) : sprintf(_('%s expires within 14 days.'), cert.cert), - null, _('Portal certificate needs attention'))); - return out; -} - -/** - * Run all checks. Each result: { id, title, status: ok|warn|error|skip, detail, fix, - * problem (a failed check in words, else null) }, the texts in the language of the call. - * `fix` names an action accepted by fix(), or one the UI handles itself - * (install:, updates). - */ -export function health(m) { - m ??= core.load(); - let rep = replies(m); - let out = []; - let dmp = live.dump(m); - let need = needs(); - - if (length(m.servers)) - push(out, awg_check()); - let y = localtime().year; - push(out, check('clock', _('Clock is set'), y >= 2025 ? 'ok' : 'error', - y >= 2025 ? _('End dates and quotas use the router clock.') : _('The router clock looks wrong; end dates will misbehave. Check NTP.'), - null, _('Clock isn’t set'))); - - let agent = service_running('dawnline', 'agent'); - push(out, check('agent', _('Background agent running'), agent ? 'ok' : 'error', - _('Counts traffic and enforces end dates and quotas.'), agent ? null : 'restart', _('Background agent isn’t running'))); - - // A full overlay fails every config write on the router, Dawnline's and - // OpenWrt's own; backups and history are what Dawnline adds to it. - let free = overlay_free_kb(); - if (free != null) - push(out, check('flash', _('Free space on the router'), free < 512 ? 'error' : free < 2048 ? 'warn' : 'ok', - free < 2048 ? sprintf(_('%s MB free: settings may stop saving. Remove old backups (Settings → Backups) or shorten the history.'), int(free / 1024 * 10) / 10) - : sprintf(_('%d MB free on the overlay.'), int(free / 1024)), - null, _('The router is running out of flash'))); - - if (!length(m.servers)) { - push(out, check('server', _('Server configured'), 'warn', _('Run the setup wizard on the Server tab.'), null, _('No server yet'))); - return out; - } - - let nft_ok = system('nft list table inet dawnline >/dev/null 2>&1') == 0; - push(out, check('nft', _('Access rules loaded'), nft_ok ? 'ok' : 'error', - nft_ok ? _('Table inet dawnline enforces who may reach LAN and the internet.') - : _('Table inet dawnline is missing: no device is loaded into the tunnels until it is back.'), - nft_ok ? null : 'apply', _('Access rules aren’t loaded'))); - - if (length(filter(values(m.servers), (s) => s.lan_like && s.enabled))) { - let pr = policy_routing(); - push(out, check('policy', _('Internet like a home device not bypassed'), length(pr) ? 'warn' : 'ok', - length(pr) ? sprintf(_("Policy routing on the router (%s) sends marked traffic straight out, past the home-device path: tunnel traffic it matches skips your LAN's proxies and filters."), join('; ', pr)) - : _('No other policy routing ahead of the tunnel rules.'), - null, _('Other policy routing bypasses the home-device path'))); - } - - // A device the sync has to leave out (a merged import, a hand-edited config). - // Its sentences (core.model_errors), how many more, then what it means. - let data = core.model_errors(m); - push(out, check('data', _('People and devices consistent'), length(data) ? 'error' : 'ok', - length(data) ? join(' ', filter([ join(' ', slice(data, 0, 4)), length(data) > 4 ? sprintf(_('(%d more)'), length(data) - 4) : null, - _('Such devices are left out of the tunnels: fix or remove them.') ], (x) => x)) - : _('Every device has a key and an address of its own inside its server.'), - null, _('People and devices are inconsistent'))); - - let fwc = cursor(); - fwc.load('firewall'); - - for (let id, srv in m.servers) { - let label = length(m.servers) > 1 ? ` (${srv.name})` : ''; - if (!srv.enabled) { - push(out, check(`srv_${id}`, _('Server') + label, 'skip', _('Server is disabled.'))); - continue; - } - push(out, ...awg_checks(m, id, srv, label, fwc, dmp, rep)); - push(out, endpoint_check(`ep_${id}`, _('Public address') + label, _('Public address needs attention') + label, - srv, core.endpoint_host(m, srv), `UDP ${srv.port}`)); - - if (srv.lan_like) { - let ls = loop.status(); - let nh = need.home; - push(out, check(`home_${id}`, _('Internet like a home device') + label, ls.active && ls.bridged ? 'ok' : 'warn', - ls.active && ls.bridged ? sprintf(_('Traffic enters %s as %s, so it is handled like any device on your LAN.'), ls.dev, ls.address) : - length(nh) ? sprintf(_('Needs %s. Internet traffic leaves through WAN directly until then.'), join(', ', nh)) : - ls.active ? sprintf(_('The link is up but not attached to %s.'), ls.dev) : - // loop.status()'s own sentence, then what it means. - `${ls.error ?? _('Not set up.')} ${_('Internet traffic leaves through WAN directly.')}`, - ls.active && ls.bridged ? null : length(nh) ? 'install:home' : 'apply', _('Internet like a home device isn’t working') + label)); - } - } - - // While every server is off the resolver only idles on loopback: nothing to check. - if (length(filter(values(m.servers), (x) => x.enabled && x.private_key))) { - let rt = loop.resolver_target(); - let conf = stat(loop.RESOLVER.conf); - let running = conf != null && loop.resolver_running(); - // A new config (a server turned on, the home link up) restarts it: give it a few seconds. - let restarting = !running && conf != null && time() - conf.mtime < 10; - let ok = running || restarting; - push(out, check('resolver', _('DNS for Home-only devices'), ok ? 'ok' : 'warn', - restarting ? _('Restarting with the new settings.') : - ok ? (rt.mode == 'ns' ? sprintf(_('Plain resolver running next to the LAN (%s).'), rt.address) : sprintf(_('Plain resolver on port %d.'), rt.port)) - : _('The resolver is not running; Home-only devices cannot resolve names.'), - ok ? null : 'apply', _('DNS for Home-only devices isn’t working'))); - } - - if (m.settings.portal_enabled) - push(out, ...portal_checks(m, need, rep)); - return out; -}; - -/** Run a fix named by a check. */ -export function fix(id) { - if (id == 'apply') - return apply.apply(); - if (id == 'sync') - return apply.sync(); - if (id == 'restart') - return { code: system('/etc/init.d/dawnline restart >/dev/null 2>&1') }; - // netifd learns protocol handlers (amneziawg) only when it starts. In the - // background: the answer goes out before the network blinks. - if (id == 'netrestart') { - system('( sleep 1; /etc/init.d/network restart ) >/dev/null 2>&1 s.ifname == m[1] && s.private_key); - if (!length(mine)) - die(sprintf(_("%s is not one of Dawnline's tunnels."), m[1])); - system(`ifup ${q(m[1])}`); - return { ok: true }; - } - die(_('Unknown fix.')); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/i18n.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/i18n.uc deleted file mode 100644 index e40803d..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/i18n.uc +++ /dev/null @@ -1,71 +0,0 @@ -// Dawnline — the backend's messages in the admin's language: what die() -// reports, the health checks, the updater's phases. Text is English in the -// code, wrapped in _() and N_() (web/i18n/extract.ts collects them into the -// luci-i18n-dawnline- catalog with the admin UI's strings), with -// placeholders filled by sprintf() after the lookup: -// -// die(sprintf(_('Download failed: %s'), asset)); -// -// Translated through LuCI's own catalog reader (luci.core, as LuCI's pages -// are) in the language use() set: the admin page's, sent with every RPC call -// (rpcd/ucode/luci.dawnline) and handed to the updater. With no language, -// no Dawnline translation installed for it, or no luci-base (the unit tests' -// rootfs), the English as written. The portal sets none: its page translates -// the messages it gets with its own catalog. - -import { stat } from 'fs'; - -const DIR = '/usr/lib/lua/luci/i18n'; - -// A C module, loaded at run time: luci-base may be missing, and a static import would not compile then. -let lmo = null; -try { - lmo = require('luci.core'); -} -catch (e) { - lmo = null; -} - -let active = null; - -/** - * Speak `lang` from now on ("ru"; null or "en" for English). Only a language - * with a Dawnline catalog: LuCI's others alone would translate a few words. - */ -export function use(lang) { - active = null; - if (!lmo || type(lang) != 'string' || lang == 'en' || !match(lang, /^[a-z][a-z][a-z]?([_-][A-Za-z][A-Za-z][A-Za-z]?[A-Za-z]?)?$/)) - return; - lang = lc(replace(lang, '_', '-')); - if (!stat(`${DIR}/dawnline.${lang}.lmo`)) - return; - if (lmo.load_catalog(lang, DIR) && lmo.change_catalog(lang)) - active = lang; -}; - -/** The language use() set, when its catalog is in use; null for English. */ -export function current() { - return active; -}; - -/** `msg` in the language use() set (the English when the catalog has no translation). */ -export function _(msg) { - return (active ? lmo.translate(msg) : null) ?? msg; -}; - -/** `one` or `many` for n, by the language's plural rules (Russian has three forms). */ -export function N_(n, one, many) { - return (active ? lmo.ntranslate(n, one, many) : null) ?? (n == 1 ? one : many); -}; - -/** - * A service log line's words, as written: the log is kept in English (the - * agent that writes most of it has no language) and read later in any. - * Marking them collects them into the catalog and into the admin page's list - * of log templates, which puts each line into the reader's language when it - * is shown (web/src/admin/events/logwords.ts): sprintf(L_('updated · %s → %s'), a, b). - * Keep a line's English as it was: old lines match it too. - */ -export function L_(s) { - return s; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/link.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/link.uc deleted file mode 100644 index 5965b5e..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/link.uc +++ /dev/null @@ -1,433 +0,0 @@ -// Dawnline — how each device's link behaves, from the counters the agent's -// watcher reads every second (dawnline.awg.dump): a device that knocks but -// never finishes connecting, one whose configuration is in use on two devices, -// one whose traffic the router drops, one whose connection keeps breaking. -// -// The agent keeps one history per device in memory (fresh(), observe(): a few -// events of the last HISTORY seconds, not one entry per tick), classifies it -// (classify(), pure) and shows a state only once it held HOLD seconds -// (settle()). It writes what is shown to dawnline.live.LINK on a change; the -// read side (live.dump's `link`, view.device_view) is dawnline.live's, so the -// portal never loads this module. Who is online stays live.PRESENCE's. -// -// The same history tells the set-up sheet, at once and without HOLD, what a -// device that is being set up does right now (setup_state(), setup()): it -// knocks without finishing, data flows, or it connected but nothing it sends -// comes through. The agent writes that to dawnline.live.SETUP on a change. -// -// What the counters mean (kmod 3.1, receive.c and send.c): -// * an accepted handshake initiation adds exactly INITIATION bytes to the -// peer's rx: the S1 prefix and any trailer are cut off and the header -// protection is undone in place before update_rx_stats(skb->len). The -// router answers it; its own handshake time moves only when the first -// packet under the new keys arrives. -// * a keepalive adds KEEPALIVE plus its content padding; a handshake -// response (the router initiated) RESPONSE; data 32 + its padded length. -// Plain data is a multiple of 16, so 148, 296 and 444 never are data. -// * a data packet the router then drops (its source is not the device's -// address: an old configuration after renumbering; this is what moves -// the interface's rx_frame_errors) adds nothing to rx, but the router -// still answers it with a keepalive within KeepaliveTimeout (about 10 s). - -/** Seconds of events kept per device. */ -export const HISTORY = 600; -/** A state is shown once it held this long (a flapping mobile link passes). */ -export const HOLD = 180; -/** A device is classified at least this often when nothing happened (its spans age). */ -export const CHECK_EVERY = 15; - -/** Bytes an accepted initiation adds to rx (sizeof(struct message_handshake_initiation)). */ -export const INITIATION = 148; -/** Bytes a handshake response adds to rx (the router initiated). */ -export const RESPONSE = 92; -/** Bytes an empty data packet adds to rx, before content padding. */ -export const KEEPALIVE = 32; -// Random trailers without content padding: a keepalive grows up to a full packet. -const TRAILER_MAX = 1500; -// Initiations a device sends at most in one second (retries are 5 s apart). -const KNOCKS_PER_TICK = 3; - -/** trying: at least TRY_KNOCKS accepted initiations within TRY_SPAN seconds while not online. */ -export const TRY_SPAN = 120; -export const TRY_KNOCKS = 3; -/* - * Churning: at least CHURN_COUNT handshakes within CHURN_SPAN seconds, with - * CHURN_COUNT - 1 of the gaps under CHURN_GAP seconds. A device that is - * there renews its keys every 100-120 s (RekeyAfterTime), more only when - * its packets get nothing back (KeepaliveTimeout + RekeyTimeout, ~15 s). - */ -export const CHURN_SPAN = 300; -export const CHURN_COUNT = 4; -export const CHURN_GAP = 45; -/** shared: while churning, the endpoint (ip:port) went back to an earlier one this often. */ -export const SHARE_RETURNS = 2; -/* - * dropped: online with a handshake within DROP_HS seconds, nothing but - * handshakes and keepalives received for DROP_SPAN seconds, and the router - * sent something at least DROP_ANSWERS times in that span with nothing - * coming in (its keepalives answering packets it dropped), under DROP_TX - * bytes in all (a real download is far more). - */ -export const DROP_SPAN = 180; -export const DROP_HS = 240; -export const DROP_ANSWERS = 6; -export const DROP_TX = 65536; - -/** Every state classify() can give. */ -export const STATES = [ 'trying', 'shared', 'dropped', 'unstable' ]; - -/* - * The set-up sheet's trying: at least SETUP_KNOCKS accepted initiations - * within SETUP_SPAN seconds, none of them followed by a handshake. A device - * retries every 5 s, so it shows with the second (5-6 s in) and goes about - * 15 s after the last. - */ -export const SETUP_SPAN = 20; -export const SETUP_KNOCKS = 2; -/* - * nodata: online for SETUP_QUIET seconds since the handshake its session - * began with, nothing but handshakes and keepalives in since, and the router - * answered at least once with nothing coming in (a keepalive for data it - * dropped, about 10 s after it: an old address in the configuration). An - * idle device gets no answers, so it never shows. - */ -export const SETUP_QUIET = 15; - -// Per list, the newest entries kept (a device whose endpoint flips every second). -const KEEP = 64; - -function keep(list, entry) { - push(list, entry); - if (length(list) > KEEP) - shift(list); -} - -/** - * A new, empty history for a device first seen at `now`. Fields: rx, tx - * (the counters last read, null before the first read), hs (the newest - * handshake), ep (the endpoint), data (when rx last carried data), hsev - * (handshake times), epev ([ ts, ip:port, the one before ] endpoint - * changes), knocks (times - * of accepted initiations), ans ([ ts, bytes ] the router sent with nothing - * received), state/since (what is shown), pend (a state waiting for HOLD), - * raw (the last classification), checked (when it was made); for the set-up - * sheet (setup()): on (online at the last read), sess (the handshake its - * online stretch began with, 0 while away), setup ({ state, since } or null) - * and due (when setup_state() may change with time alone, 0 for never). - */ -export function fresh(now) { - return { - start: now, rx: null, tx: null, hs: 0, ep: null, data: 0, - hsev: [], epev: [], knocks: [], ans: [], - state: null, since: 0, pend: null, raw: null, checked: 0, - on: false, sess: 0, setup: null, due: 0, - }; -}; - -/** - * The largest rx a keepalive adds for a server's disguise: KEEPALIVE plus - * the top of its ContentPaddingAddition, or a full packet with random - * trailers and no content padding (the apps get the server's values). - */ -export function keepalive_max(srv) { - let o = srv?.obf ?? {}; - let cpa = split(`${o.content_padding_addition ?? ''}`, '-'); - let hi = +(cpa[length(cpa) - 1]); - if (o.content_padding_addition != null && o.content_padding_addition != '' && hi > 0) - return KEEPALIVE + hi; - if (o.random_trailers == 'on' || o.random_trailers == '1') - return KEEPALIVE + TRAILER_MAX; - return KEEPALIVE; -}; - -/** keepalive_max() for each device's server: { device id: bytes }. */ -export function keepalive_sizes(m) { - let out = {}; - for (let id, d in m.devices) - out[id] = keepalive_max(m.servers[m.people[d.person]?.server]); - return out; -}; - -/** An rx increment made of accepted initiations only. */ -export function knock(drx) { - return drx > 0 && drx % INITIATION == 0 && drx <= KNOCKS_PER_TICK * INITIATION; -}; - -/** - * An rx increment that carried no data: nothing, or one keepalive of up to - * `ka` bytes (keepalive_max); in the second a handshake completed (`shook`) - * also the handshake messages that came with it. Outside that second a - * handshake message is never counted in: with a padded keepalive their - * sums would cover every small packet (a DNS query, an ACK) up to some - * 670 bytes, and a device with light traffic would look like one whose - * data never comes through. - */ -export function bare(drx, ka, shook) { - if (drx <= 0) - return true; - if (!shook) - return drx >= KEEPALIVE && drx <= ka; - if (drx > KNOCKS_PER_TICK * INITIATION + RESPONSE + ka) - return false; - for (let k = 0; k <= KNOCKS_PER_TICK; k++) - for (let r = 0; r <= 1; r++) { - let rest = drx - k * INITIATION - r * RESPONSE; - if (rest == 0 || (rest >= KEEPALIVE && rest <= ka)) - return true; - } - return false; -}; - -/** - * Fold one read of the device's peer ({ endpoint, handshake, rx, tx } from - * awg.dump) at `now` into its history `h`; `ka` is its keepalive_max(). - * Returns true when something worth classifying again happened (a - * handshake, a new endpoint, a knock, an answer, data after a quiet span). - * Counters that went down (the peer re-added, its tunnel set up again) - * start a new baseline. - */ -export function observe(h, peer, now, ka) { - let changed = false; - let shook = peer.handshake > h.hs; - if (shook) { - keep(h.hsev, peer.handshake); - h.hs = peer.handshake; - changed = true; - } - if (peer.endpoint != h.ep) { - if (h.ep != null && peer.endpoint != '') { - keep(h.epev, [ now, peer.endpoint, h.ep ]); - changed = true; - } - h.ep = peer.endpoint; - } - if (h.rx == null || peer.rx < h.rx || peer.tx < h.tx) { - h.rx = peer.rx; - h.tx = peer.tx; - return changed; - } - let drx = peer.rx - h.rx, dtx = peer.tx - h.tx; - h.rx = peer.rx; - h.tx = peer.tx; - if (drx > 0) { - if (!shook && knock(drx)) { - keep(h.knocks, now); - changed = true; - } - else if (!bare(drx, ka, shook)) { - if (now - h.data >= DROP_SPAN) - changed = true; - h.data = now; - } - } - else if (dtx > 0) { - keep(h.ans, [ now, dtx ]); - changed = true; - } - return changed; -}; - -/** The device's peer is not in its tunnel: the next read starts a new baseline. */ -export function gone(h) { - h.rx = null; - h.tx = null; -}; - -/** Forget events older than HISTORY seconds. */ -export function prune(h, now) { - let cut = now - HISTORY; - h.hsev = filter(h.hsev, (t) => t > cut); - h.knocks = filter(h.knocks, (t) => t > cut); - h.epev = filter(h.epev, (e) => e[0] > cut); - h.ans = filter(h.ans, (e) => e[0] > cut); -}; - -/** Endpoint changes within the span that went back to an endpoint seen before in it (A → B → A → B: 2). */ -function returns(h, now) { - let seen = null, n = 0; - for (let e in h.epev) - if (now - e[0] < CHURN_SPAN) { - if (seen == null) { - seen = {}; - seen[e[2]] = true; - } - if (seen[e[1]]) - n++; - seen[e[1]] = true; - } - return n; -} - -function churning(h, now) { - let hs = filter(h.hsev, (t) => now - t < CHURN_SPAN); - if (length(hs) < CHURN_COUNT) - return false; - let short = 0; - for (let i = 1; i < length(hs); i++) - if (hs[i] - hs[i - 1] < CHURN_GAP) - short++; - return short >= CHURN_COUNT - 1; -} - -function dropped(h, now) { - if (now - h.start < DROP_SPAN || now - h.data < DROP_SPAN || !(h.hs > 0 && now - h.hs < DROP_HS)) - return false; - let n = 0, bytes = 0; - for (let a in h.ans) - if (now - a[0] < DROP_SPAN) { - n++; - bytes += a[1]; - } - return n >= DROP_ANSWERS && bytes < DROP_TX; -} - -/** - * What the history says about the device at `now` (`on`: it is online, as - * the watcher decides it): null (nothing wrong, or nothing to tell), or - * 'trying' not online, but its initiations reach the router and are - * answered, and it never finishes connecting (the network - * may block it, or its configuration is out of date: a - * stale preshared key looks the same) - * 'shared' connecting over and over from two or more alternating - * endpoints (ip:port): one configuration on two devices - * 'unstable' connecting over and over from one place: the connection - * keeps breaking - * 'dropped' connected, but nothing it sends gets through: the router - * drops it (an old address in its configuration) - */ -export function classify(h, now, on) { - if (!on) { - let n = 0; - for (let t in h.knocks) - if (now - t < TRY_SPAN) - n++; - return n >= TRY_KNOCKS ? 'trying' : null; - } - if (churning(h, now)) - return returns(h, now) >= SHARE_RETURNS ? 'shared' : 'unstable'; - return dropped(h, now) ? 'dropped' : null; -}; - -/** - * Turn a classification into what is shown (h.state, h.since): a state, or - * a change of state, shows once classify() gave it for HOLD seconds (since - * = when it began); nothing wrong shows at once when the device is online - * (it works), else after HOLD as well. Returns the change, { from, to } - * (either may be null), or null when what is shown stays. - */ -export function settle(h, raw, now, on) { - if (raw == h.state) { - h.pend = null; - return null; - } - let since = now; - if (raw != null || !on) { - if (h.pend == null || h.pend.state != raw) { - h.pend = { state: raw, since: now }; - return null; - } - if (now - h.pend.since < HOLD) - return null; - since = h.pend.since; - } - let from = h.state; - h.state = raw; - h.since = raw != null ? since : 0; - h.pend = null; - return { from, to: raw }; -}; - -/** - * What the device's link does at `now` for the set-up sheet (pure; `on`: it - * is online, as the watcher decides it): { state, due }. state is - * 'trying' its initiations reach the router and are answered, and no - * handshake follows (SETUP_KNOCKS within SETUP_SPAN): the - * network blocks the answers, or the configuration is not this - * device's any more - * 'flowing' online, and data came in during this session (since h.sess) - * 'nodata' online for SETUP_QUIET seconds, nothing but handshakes and - * keepalives came in, and the router answered packets it - * dropped: an old address in the configuration - * null none of these (waiting, idle, or away) - * due: when the state may change with time alone (a knock ages out, the - * quiet span ends), 0 for never: anything else comes with a read. - */ -export function setup_state(h, now, on) { - let n = 0; - for (let i = length(h.knocks) - 1; i >= 0; i--) { - let t = h.knocks[i]; - if (t <= h.hs || now - t >= SETUP_SPAN) - break; - if (++n == SETUP_KNOCKS) - return { state: 'trying', due: t + SETUP_SPAN }; - } - if (!on || !h.sess) - return { state: null, due: 0 }; - if (h.data >= h.sess) - return { state: 'flowing', due: 0 }; - if (now - h.sess < SETUP_QUIET) - return { state: null, due: h.sess + SETUP_QUIET }; - let a = h.ans[length(h.ans) - 1]; - return { state: a != null && a[0] >= h.sess ? 'nodata' : null, due: 0 }; -}; - -/** - * Bring h.setup to setup_state() after a read at `now` (`moved`: what - * observe() returned). Most reads cost a few compares: the state is worked - * out again only when something happened, the device came or went, data - * came in while it is not 'flowing', or its `due` time came. Returns true - * when h.setup changed ({ state, since: when it began } or null). - */ -export function setup(h, now, on, moved) { - // A session begins with the handshake that brought the device online. - if (!on) - h.sess = 0; - else if (!h.sess) - h.sess = h.hs; - let came = on != h.on; - h.on = on; - let cur = h.setup?.state; - if (!moved && !came && !(h.due && now >= h.due) && !(h.data == now && cur != 'flowing')) - return false; - let s = setup_state(h, now, on); - h.due = s.due; - if (s.state == cur) - return false; - h.setup = s.state != null ? { state: s.state, since: now } : null; - return true; -}; - -/** setup() of every device: { device id: { state, since } }, devices with none left out. */ -export function setups(hist) { - let out = {}; - for (let id, h in hist) - if (h.setup != null) - out[id] = h.setup; - return out; -}; - -/** What is shown for every device: { device id: { state, since } }, devices with nothing to show left out. */ -export function shown(hist) { - let out = {}; - for (let id, h in hist) - if (h.state != null) - out[id] = { state: h.state, since: h.since }; - return out; -}; - -/** - * The activity event for a change settle() made, or null: device_failing - * (detail: the new state) when a state shows, device_recovered (detail: - * the state it had) when it clears while the device is online. One that - * clears while the device is away (it stopped trying, it was paused) logs - * nothing: nobody saw it work. - */ -export function event_for(change, dev, on) { - if (!change) - return null; - if (change.to != null) - return { type: 'device_failing', person: dev.person, device: dev.id, detail: change.to }; - if (on && change.from != null) - return { type: 'device_recovered', person: dev.person, device: dev.id, detail: change.from }; - return null; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/live.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/live.uc deleted file mode 100644 index f8983b7..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/live.uc +++ /dev/null @@ -1,603 +0,0 @@ -// Dawnline — live data: peer status from the tunnels (dawnline.awg), traffic -// accounting and the connection/event log. -// -// Counters live in RUN_DIR (tmpfs) and are flushed to DATA_DIR at most once -// an hour, so flash is not worn by the 60-second agent loop. - -import { readfile, stat, unlink } from 'fs'; -import { cursor } from 'uci'; -import { - ensure_dir, read_json, write_json, lock, unlock, month_key, day_key, day_key_ago, uniq, syslog, - iface_status as util_iface_status, RUN_DIR, DATA_DIR -} from 'dawnline.util'; -import * as awg from 'dawnline.awg'; -import * as core from 'dawnline.core'; -import * as schema from 'dawnline.schema'; - -// Online while the WireGuard session lives: it is dropped 180 s after its -// handshake, and a device that is there renews it every 2 min (a little slack -// for a renewal that needs a retry). One that left goes offline 1-3 min later. -// The shortest window: a device whose keep-alive is longer gets more -// (online_window), or it would flap between its handshakes. -export const ONLINE_WINDOW = 190; -/** A restore put other counters on flash: the agent reloads from there (dawnline.backup writes it). */ -export const USAGE_RELOAD = `${RUN_DIR}/usage.reload`; - -/* ---------- retention policy ---------- */ - -/** Event type → log category (what Settings lets you switch off or clear). */ -export const CATEGORY = { - connect: 'connections', disconnect: 'connections', roam: 'connections', - // People and their devices: one category (devices used to have their own). - device_added: 'people', device_removed: 'people', devices_removed: 'people', - device_changed: 'people', device_keys: 'people', link_changed: 'people', - person_added: 'people', person_removed: 'people', person_changed: 'people', - paused: 'people', resumed: 'people', expiring: 'people', expired_kept: 'people', - server_down: 'problems', server_up: 'problems', portal_blocked: 'problems', - // A device's link (dawnline.link): failing in a named way, and working again. - device_failing: 'problems', device_recovered: 'problems', -}; -export const CATEGORIES = [ 'connections', 'people', 'problems' ]; - -export function category_of(type) { - return CATEGORY[type] ?? 'problems'; -}; - - -/** - * Log and history retention from /etc/config/dawnline (read fresh, the - * portal and rpcd call add_event without a loaded model). - * log_keep_days days of activity to keep, 0 = until log_max - * log_max newest N events kept - * log_category categories that are recorded - * log_persist how often the log is saved to flash: 10min | hourly | off - * usage_keep_days / usage_keep_months daily / monthly traffic buckets - */ -export function policy(s) { - if (s == null) { - let c = cursor(); - s = c.get_all('dawnline', 'settings') ?? {}; - } - let cats = s.log_category; - if (cats == null) - cats = (s.log_connections == '0') ? filter(CATEGORIES, (x) => x != 'connections') : CATEGORIES; - else if (type(cats) != 'array') - cats = split(cats, /[ ,]+/); - cats = uniq(filter(map(cats, (x) => x == 'devices' ? 'people' : x), (x) => index(CATEGORIES, x) >= 0)); - // Defaults and ranges come from dawnline.schema, like every other setting. - return { - keep_days: schema.get(s, 'log_keep_days'), - max: schema.get(s, 'log_max'), - categories: cats, - persist: schema.get(s, 'log_persist'), - usage_days: schema.get(s, 'usage_keep_days'), - usage_months: schema.get(s, 'usage_keep_months'), - }; -}; - -/** Drop events older than keep_days and beyond max. */ -function trim_events(ev, pol) { - if (pol.keep_days > 0) { - let cut = time() - pol.keep_days * 86400; - ev = filter(ev, (e) => (e.ts ?? 0) >= cut); - } - if (length(ev) > pol.max) - ev = slice(ev, length(ev) - pol.max); - return ev; -} - -/* ---------- live peers ---------- */ - -/* ---------- presence (the agent's watcher) ---------- */ - -/** - * Written by the agent's watcher on every change: { online: { device id: bool }, - * endpoint: { device id: ip }, rev, people: { person id: rev } }. `rev` moves on - * any connect, disconnect, roam or logged change; `people` per person (the portal). - */ -export const PRESENCE = `${RUN_DIR}/presence.json`; -// The agent's heartbeat (dawnline.watchdog.BEAT): its presence counts while it runs. -const BEAT = `${RUN_DIR}/agent.beat`; -const BEAT_STALE = 180; - -/** The agent runs (its heartbeat is fresh): what its watcher wrote counts. */ -function agent_running() { - let beat = +(read_json(BEAT, 0) ?? 0); - return beat > 0 && time() - beat <= BEAT_STALE; -} - -/** What the watcher sees, or null when the agent isn't running. */ -export function presence() { - return agent_running() ? read_json(PRESENCE, null) : null; -}; - -/** - * Written by the agent's watcher when what it shows changes (dawnline.link): - * { device id: { state: 'trying' | 'shared' | 'dropped' | 'unstable', since } }, - * only devices whose link fails in one of these ways (link.classify()). - */ -export const LINK = `${RUN_DIR}/link.json`; - -/** - * Written by the agent's watcher when it changes (dawnline.link.setup, at - * once, without LINK's hold): what each device's link does right now, for the - * set-up sheet: { device id: { state: 'trying' | 'flowing' | 'nodata', since } }, - * devices with none of these left out. - */ -export const SETUP = `${RUN_DIR}/setup.json`; - -/** - * The interfaces of the servers that run: enabled, with keys and an - * interface that is Dawnline's (core.tunnels: never another tunnel that - * took the name); with `sid`, only that server's. What dawnline.awg.dump() - * reads; an empty list when none. - */ -export function tunnel_ifnames(m, sid) { - let out = []; - for (let id, srv in m.servers) - if (srv.enabled && (sid == null || id == sid)) - for (let t in core.tunnels(srv)) - push(out, t.ifname); - return out; -}; - -/** - * How long after its last handshake a device still counts as online, in - * seconds: ONLINE_WINDOW, or 30 s more than an idle device with its - * keep-alive goes between handshakes (awg.idle_handshake) when that is - * longer. A device that sends nothing renews its session only with its - * keep-alive: with one of about 95-120 s, or over 160 s, the fixed window - * would see it leave and come back between two handshakes. Keep-alive off: - * ONLINE_WINDOW. - */ -export function online_window(srv, dev) { - let h = srv ? awg.idle_handshake(srv, dev) : null; - return h != null ? max(ONLINE_WINDOW, h + 30) : ONLINE_WINDOW; -}; - -/** online_window() of every device (with `sid`, of that server's): { device id: seconds }. */ -export function online_windows(m, sid) { - let out = {}; - for (let id, d in m.devices) { - let s = m.people[d.person]?.server; - if (sid == null || s == sid) - out[id] = online_window(m.servers[s], d); - } - return out; -}; - -/** - * Dawnline's tunnels as dawnline.awg.dump() reads them (only those, each on - * its own: { ok, reads, ifaces, peers: { public key: { ifname, endpoint, - * handshake, rx, tx } } }), plus `presence`, the agent watcher's, `windows`, - * each device's online_window() (online() without the agent), `link`, the - * watcher's LINK ({} without the agent: its states would be stale), and - * `setup`, its SETUP (null without the agent: nobody tells data from a bare - * handshake then, view.device_view goes by the handshake). With `sid` only - * that server's tunnel is read (one person's page needs no other: one `awg` - * process, not one per server). - */ -export function dump(m, sid) { - let d = awg.dump(tunnel_ifnames(m, sid)); - let up = agent_running(); - d.presence = up ? read_json(PRESENCE, null) : null; - d.windows = online_windows(m, sid); - d.link = up ? (read_json(LINK, null) ?? {}) : {}; - d.setup = up ? (read_json(SETUP, null) ?? {}) : null; - return d; -}; - -/** A device is online: as the agent's watcher says, or (without the agent) by a recent handshake. */ -export function online(dmp, id, peer) { - let p = dmp?.presence?.online; - if (p) - return !!(peer && p[id]); - return !!(peer && peer.handshake > 0 && time() - peer.handshake < (dmp?.windows?.[id] ?? ONLINE_WINDOW)); -}; - -// "203.0.113.7:41821", "[2001:db8::1]:41821". A module constant, compiled once: -// the agent's watcher asks for every device, every second. -const ENDPOINT = /^\[?([^\]]+)\]?:[0-9]+$/; - -export function endpoint_ip(ep) { - let m = match(ep ?? '', ENDPOINT); - return m ? m[1] : ep; -}; - -/* ---------- usage ---------- */ - -function empty_usage() { - return { devices: {}, people: {}, updated: 0, flushed: 0 }; -} - -/** - * The usage counters: the live copy in RUN_DIR, else what flash holds. With - * `from_flash` only flash counts (a restore put new counters there, and the - * watcher may have written the old live ones again since). - */ -export function load_usage(from_flash) { - let u = (from_flash ? null : read_json(`${RUN_DIR}/usage.json`, null)) ?? read_json(`${DATA_DIR}/usage.json`, null) ?? empty_usage(); - // Per-app counters of earlier test builds are not kept. - delete u.clients; - return u; -}; - -function add(bucket, key, rx, tx) { - let v = bucket[key] ?? [ 0, 0 ]; - bucket[key] = [ v[0] + rx, v[1] + tx ]; -} - -function prune(obj, keep) { - let ks = sort(keys(obj)); - for (let i = 0; i < length(ks) - keep; i++) - delete obj[ks[i]]; -} - -function account(rec, rx, tx, ts) { - rec.total = [ (rec.total?.[0] ?? 0) + rx, (rec.total?.[1] ?? 0) + tx ]; - rec.months ??= {}; - rec.days ??= {}; - add(rec.months, month_key(ts), rx, tx); - add(rec.days, day_key(ts), rx, tx); -} - -/** Apply the traffic history retention to every record. */ -export function prune_usage(usage, pol) { - pol ??= policy(); - for (let grp in [ usage.devices, usage.people ]) - for (let id, rec in grp) { - if (rec.months) - prune(rec.months, pol.usage_months); - if (rec.days) - prune(rec.days, pol.usage_days); - } -}; - -/** Forget a record's traffic history; kernel counters (raw) and the last handshake stay. */ -function wipe(rec) { - if (!rec) - return; - delete rec.total; - delete rec.months; - delete rec.days; -} - -/** - * Reset traffic history. scope: all | person | device. A person reset also - * clears their devices and restarts their data limit; a device reset leaves - * the person's totals (and so their limit) alone. - */ -export function reset_usage(usage, m, scope, id) { - if (scope == 'all') { - for (let k, rec in usage.devices) - wipe(rec); - for (let k, rec in usage.people) - wipe(rec); - } - else if (scope == 'person') { - wipe(usage.people[id]); - for (let did in m.people[id]?.devices ?? []) - wipe(usage.devices[did]); - } - else if (scope == 'device') - wipe(usage.devices[id]); -}; - -function offline(rec) { - return { online: false, handshake: rec?.handshake ?? 0, endpoint: rec?.endpoint ?? '', present: false }; -} - -/** - * Fold the current kernel counters into `usage`. Counters restart from zero - * when a peer is re-added or its tunnel is set up again; a drop is treated - * as a reset, and so is a new link (each record keeps the interface index - * its counters were read on: new counters that already passed the old ones - * would be counted short). Returns the per-device live view keyed by device id. - * - * A device missing from the dump had its counters reset only when its tunnel - * was read or is down (dawnline.awg.dump's `reads`): one the tool couldn't - * read says nothing, and forgetting the last counters there would count them - * again on the next good read. - */ -export function collect(m, usage, d) { - d ??= dump(m); - let ts = time(); - let live = {}; - for (let id, dev in m.devices) { - let rec = usage.devices[id] ??= { raw: [ 0, 0 ] }; - let peer = d.peers[dev.public_key]; - if (!peer) { - let ifname = m.servers[m.people[dev.person]?.server]?.ifname; - if (d.reads[ifname] != 'error') - rec.raw = [ 0, 0 ]; - live[id] = offline(rec); - continue; - } - let raw = rec.raw ?? [ 0, 0 ]; - let link = d.ifaces[peer.ifname]?.ifindex; - if (link != null && rec.ifindex != null && link != rec.ifindex) - raw = [ 0, 0 ]; - if (link != null) - rec.ifindex = link; - let drx = peer.rx >= raw[0] ? peer.rx - raw[0] : peer.rx; - let dtx = peer.tx >= raw[1] ? peer.tx - raw[1] : peer.tx; - rec.raw = [ peer.rx, peer.tx ]; - if (drx > 0 || dtx > 0) { - account(rec, drx, dtx, ts); - let p = usage.people[dev.person] ??= {}; - account(p, drx, dtx, ts); - } - if (peer.handshake > 0) { - rec.handshake = peer.handshake; - rec.endpoint = endpoint_ip(peer.endpoint); - // Recent client addresses (for the map): ip → last seen, newest 8. - rec.ips ??= {}; - if (rec.endpoint) - rec.ips[rec.endpoint] = peer.handshake; - let ips = sort(keys(rec.ips), (x, y) => rec.ips[y] - rec.ips[x]); - for (let i = 8; i < length(ips); i++) - delete rec.ips[ips[i]]; - } - live[id] = { - online: peer.handshake > 0 && ts - peer.handshake < online_window(m.servers[m.people[dev.person]?.server], dev), - handshake: peer.handshake || rec.handshake || 0, - endpoint: endpoint_ip(peer.endpoint) || rec.endpoint || '', - present: true, - }; - } - - // Forget counters of devices that no longer exist (their bytes stay in - // the person's totals). - for (let id in keys(usage.devices)) - if (!m.devices[id]) - delete usage.devices[id]; - - prune_usage(usage, policy(m.settings.retention)); - usage.updated = ts; - return live; -}; - -export function save_usage(usage, persist) { - ensure_dir(RUN_DIR); - write_json(`${RUN_DIR}/usage.json`, usage, 0o600); - if (persist) { - usage.flushed = time(); - ensure_dir(DATA_DIR, 0o700); - write_json(`${DATA_DIR}/usage.json`, usage, 0o600); - } -}; - -/** Sum of [rx, tx] over the last `days` days for a usage record. */ -export function recent(rec, days) { - let out = [ 0, 0 ]; - for (let i = 0; i < days; i++) { - let v = rec?.days?.[day_key_ago(i)]; - if (v) { - out[0] += v[0]; - out[1] += v[1]; - } - } - return out; -}; - -export function month(rec) { - return rec?.months?.[month_key()] ?? [ 0, 0 ]; -}; - -/** Daily series for the last `days` days: [{ day, rx, tx }]. */ -export function series(recs, days) { - let out = []; - for (let i = days - 1; i >= 0; i--) { - let k = day_key_ago(i); - let rx = 0, tx = 0; - for (let r in recs) { - let v = r?.days?.[k]; - if (v) { - rx += v[0]; - tx += v[1]; - } - } - push(out, { day: k, rx, tx }); - } - return out; -}; - -/* ---------- events ---------- */ - -export function load_events() { - return read_json(`${RUN_DIR}/events.json`, null) ?? read_json(`${DATA_DIR}/events.json`, []); -}; - -/* - * Names as they are now (pname, dname, dkind), so the log still reads well - * once the person or device is gone. Callers that delete first pass them. - */ -function with_names(e, c) { - if (e.person && !e.pname) - e.pname = c.get('dawnline', e.person, 'name'); - if (e.device && !e.dname) - e.dname = c.get('dawnline', e.device, 'name'); - if (e.device && !e.dkind) - e.dkind = c.get('dawnline', e.device, 'kind'); - return e; -} - -// Events about someone's connection, not about the system: they stay out of syslog -// (the activity log has them). Connects, roams, a device's link trouble and its end. -const NOT_SYSTEM = [ 'connect', 'disconnect', 'roam', 'device_failing', 'device_recovered' ]; - -/** - * An activity event at its syslog level, or null when it stays out (a - * connection: syslog says what the system does). People and their devices - * (what changes the tunnels and the rules) are info, problems warn and their - * end ("…_up") info. - */ -export function event_level(e) { - let cat = category_of(e.type); - if (cat == 'connections' || index(NOT_SYSTEM, e.type) >= 0) - return null; - if (cat == 'problems' && !match(e.type, /_up$/)) - return 'warn'; - return 'info'; -}; - -/** An activity event as a syslog line: "Myata · Phone device changed · kind=phone, lan_bypass=on (portal)". */ -export function event_line(e) { - let who = join(' · ', filter([ e.pname ?? e.person, e.dname ?? e.device ], (x) => x != null && x != '')); - return join(' ', filter([ who, replace(e.type ?? 'event', /_/g, ' '), e.detail ? `· ${e.detail}` : '', e.by ? `(${e.by})` : '' ], (x) => x != '')); -}; - -/** The system's events to syslog, whatever the activity log records (its categories are the admin's choice for the page). */ -function syslog_events(list, c) { - for (let e in list) { - let lvl = event_level(e); - if (lvl) - syslog(lvl, category_of(e.type), event_line(with_names(e, c))); - } -} - -export function add_events(list, pol) { - pol ??= policy(); - list ??= []; - if (!length(list)) - return; - let c = cursor(); - c.load('dawnline'); - syslog_events(list, c); - list = filter(list, (e) => index(pol.categories, category_of(e.type)) >= 0); - if (!length(list)) - return; - let l = lock('events'); - let ev = load_events(); - let ts = time(); - for (let e in list) { - e.ts ??= ts; - push(ev, with_names(e, c)); - } - ev = trim_events(ev, pol); - ensure_dir(RUN_DIR); - write_json(`${RUN_DIR}/events.json`, ev, 0o600); - unlock(l); -}; - -export function add_event(e) { - add_events([ e ]); -}; - -/** - * Like add_event, but folds into the previous event of the same kind, person - * and device (when it has one) within `window` s. - */ -export function add_event_merged(e, window) { - let c0 = cursor(); - c0.load('dawnline'); - syslog_events([ { ...e } ], c0); - let pol = policy(); - if (index(pol.categories, category_of(e.type)) < 0) - return; - let l = lock('events'); - let ev = load_events(); - let last = ev[length(ev) - 1]; - let ts = time(); - if (last && last.type == e.type && last.person == e.person && last.device == e.device && ts - last.ts < (window ?? 120)) { - let parts = uniq([ ...split(last.detail ?? '', ', '), ...split(e.detail ?? '', ', ') ]); - last.detail = join(', ', filter(parts, (x) => x != '')); - last.ts = ts; - } - else { - let c = cursor(); - c.load('dawnline'); - e.ts = ts; - push(ev, with_names(e, c)); - } - ev = trim_events(ev, pol); - ensure_dir(RUN_DIR); - write_json(`${RUN_DIR}/events.json`, ev, 0o600); - unlock(l); -}; - -/** - * Places for connections logged before their address was located (the - * lookup finishes after the event): connect events since `since` from an - * address in `where` ({ ip: "City · ISP" }) that have no place yet get it. - * Returns true when `ev` changed. - */ -export function fill_places(ev, where, since) { - let changed = false; - for (let i = length(ev) - 1; i >= 0 && ev[i].ts >= since; i--) { - let e = ev[i]; - if (e.type == 'connect' && !e.where && where[e.detail]) { - e.where = where[e.detail]; - changed = true; - } - } - return changed; -}; - -/** fill_places() on the live log, written only when something changed. */ -export function set_places(where, since) { - let l = lock('events'); - let ev = load_events(); - if (fill_places(ev, where, since)) { - ensure_dir(RUN_DIR); - write_json(`${RUN_DIR}/events.json`, ev, 0o600); - } - unlock(l); -}; - -/** Save the log to flash, or drop the flash copy when it is kept in RAM only. */ -export function persist_events(pol) { - pol ??= policy(); - if (pol.persist == 'off') { - if (stat(`${DATA_DIR}/events.json`)) - unlink(`${DATA_DIR}/events.json`); - return; - } - // Only when something was logged since the last copy: flash is written rarely. - let live_st = stat(`${RUN_DIR}/events.json`); - if (!live_st || live_st.mtime <= (stat(`${DATA_DIR}/events.json`)?.mtime ?? 0)) - return; - let ev = read_json(`${RUN_DIR}/events.json`, null); - if (ev != null) { - ensure_dir(DATA_DIR, 0o700); - write_json(`${DATA_DIR}/events.json`, trim_events(ev, pol), 0o600); - } -}; - -/** - * Remove events matching every given filter (person, device, category, - * older than `before` ts); no filters clears the whole log. Edits both the - * live copy and the one on flash. Returns how many were removed. - */ -export function clear_events(f) { - f ??= {}; - let hit = (e) => - (!f.person || e.person == f.person) && - (!f.device || e.device == f.device) && - (!f.category || category_of(e.type) == f.category) && - (!f.before || (e.ts ?? 0) < f.before); - let l = lock('events'); - let removed = 0; - for (let path in [ `${RUN_DIR}/events.json`, `${DATA_DIR}/events.json` ]) { - let ev = read_json(path, null); - if (ev == null) - continue; - let keep = filter(ev, (e) => !hit(e)); - if (path == `${RUN_DIR}/events.json` || removed == 0) - removed = max(removed, length(ev) - length(keep)); - write_json(path, keep, 0o600); - } - unlock(l); - return removed; -}; - -/* ---------- health ---------- */ - -export function iface_status(ifname) { - return util_iface_status(ifname); -}; - -export function uptime() { - let s = readfile('/proc/uptime'); - return s ? int(+split(s, ' ')[0]) : 0; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/lookup.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/lookup.uc deleted file mode 100644 index 453505b..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/lookup.uc +++ /dev/null @@ -1,114 +0,0 @@ -// Dawnline — where names point and the router's public address, for Health -// and the portal settings. Lookups are cached in RUN_DIR for a few minutes -// and made in parallel with a short timeout: rpcd answers one call at a -// time, so a slow DNS server must not hold up the whole admin UI. - -import { readfile } from 'fs'; -import { q, sh, ensure_dir, read_json, write_json, ip2int, is_ip6, rand_hex, RUN_DIR } from 'dawnline.util'; -import * as live from 'dawnline.live'; -import * as net from 'dawnline.net'; - -const CACHE = `${RUN_DIR}/resolve.json`; -// Answers are kept 5 minutes, failures 1 minute. -const TTL = 300; -const TTL_FAIL = 60; -const TIMEOUT = 2; -const MAX_NAMES = 16; -// Public resolvers first: local DNS often rewrites the router's own name to -// its LAN address (split horizon). -const SERVERS = [ '1.1.1.1', '8.8.8.8', '127.0.0.1' ]; - -function valid_name(h) { - return type(h) == 'string' && length(h) <= 253 && match(h, /^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/) != null; -} - -/** - * Addresses of each name, IPv4 and IPv6: { host: [ ip, … ] } (empty when it - * does not resolve). IP addresses map to themselves. Every uncached name is - * asked of every server at once, A and AAAA; the first server (in SERVERS - * order) that answers wins. - */ -export function resolve_all(hosts) { - let out = {}, now = time(), todo = []; - let cache = read_json(CACHE, {}); - for (let h in hosts) { - if (h == null || out[h] != null) - continue; - if (ip2int(h) != null || is_ip6(h)) { - out[h] = [ h ]; - continue; - } - let c = cache[h]; - if (c && now - c.ts < (length(c.ips) ? TTL : TTL_FAIL)) - out[h] = c.ips; - else if (valid_name(h) && length(todo) < MAX_NAMES) { - out[h] = []; - push(todo, h); - } - else - out[h] = []; - } - if (!length(todo)) - return out; - - ensure_dir(RUN_DIR); - let dir = `${RUN_DIR}/resolve.${rand_hex(4)}`; - let cmds = []; - for (let i = 0; i < length(todo); i++) - for (let j = 0; j < length(SERVERS); j++) - for (let t in [ 'a', 'aaaa' ]) - // nslookup's own timeout: some firmware builds BusyBox without `timeout`. - push(cmds, `( nslookup -type=${t} -timeout=${TIMEOUT} -retry=1 ${q(todo[i])} ${SERVERS[j]} 2>/dev/null | awk '/^Address/ && NR>2 {print $NF}' > ${dir}/${i}.${j}.${t} ) &`); - sh(`mkdir -p ${dir}; ${join(' ', cmds)} wait`); - for (let i = 0; i < length(todo); i++) { - let ips = []; - for (let j = 0; j < length(SERVERS) && !length(ips); j++) - for (let t in [ 'a', 'aaaa' ]) { - let r = readfile(`${dir}/${i}.${j}.${t}`) ?? ''; - push(ips, ...filter(split(trim(r), '\n'), (x) => ip2int(x) != null || is_ip6(x))); - } - out[todo[i]] = ips; - cache[todo[i]] = { ts: now, ips }; - } - system(`rm -rf ${dir}`); - // Only what is still fresh is kept. - for (let h, c in cache) - if (now - c.ts >= TTL) - delete cache[h]; - write_json(CACHE, cache, 0o644); - return out; -}; - -/** IPv4 addresses of one name (see resolve_all). */ -export function resolve(host) { - return resolve_all([ host ])[host] ?? []; -}; - -/** - * The address to give an app that takes no name for the server (V2RayTun's - * Android core hands the endpoint over as it is): IPv4 first, as a phone on - * mobile data may have no IPv6. The host itself when it is an IP; null when - * the name does not resolve. - */ -export function host_ip(host) { - let ips = resolve(host); - let v4 = filter(ips, (x) => ip2int(x) != null); - return v4[0] ?? ips[0] ?? null; -}; - -/** The IPv4 address of a netifd interface (a zone name for older configs). */ -export function wan_ipv4(zone) { - let st = live.iface_status(zone == 'wan' ? 'wan' : zone); - return st?.['ipv4-address']?.[0]?.address; -}; - -/** The router's public IPv4 (the first server's WAN, else the wan interface). */ -export function router_wan(m) { - for (let id, srv in m.servers) - if (srv.private_key) { - let a = net.wan_address(srv) ?? wan_ipv4(srv.wan_zone); - if (a) - return a; - } - return wan_ipv4('wan'); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc deleted file mode 100644 index a51d5cc..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/loop.uc +++ /dev/null @@ -1,686 +0,0 @@ -// Dawnline — "like a home device": tunnel clients' internet traffic enters -// the router from the LAN, so whatever handles LAN traffic there (proxies, -// DPI bypass, DNS filters, fw4's lan zone, ...) handles it too, without -// Dawnline knowing about any of them. -// -// dawn0 ──policy route──▶ dlx0 ═veth═ dlx1 ┐ netns "dawnline" ┌ dll1 ═veth═ dll0 ── br-lan -// └── NAT to a LAN address ┘ -// -// The netns is one more device on the LAN bridge with its own address (picked -// from the LAN subnet above the DHCP pool) and its own MAC (hashed from the -// bridge's), the same each time it is created: the router's neighbour table -// knows the address by that MAC, so a netns created again keeps its address -// instead of seeing it held by another device. Replies come back the same way. -// Home-network destinations keep their direct route; per-person access is -// still enforced on dawn0 before any of this (table inet dawnline). -// -// Clients also use the netns address as DNS: it forwards to the DNS the LAN -// gets from DHCP, from the LAN side, so DNS interception applies as well. -// -// The netns forwards and NATs every packet a second time (conntrack, the -// forward hook): about 40% more CPU per packet on an MT7981. A flowtable on -// its two links (dlx1, dll1) lets established TCP and UDP flows skip that -// work. The netns holds no access rules: who may reach what is judged on the -// tunnel interfaces in the root namespace, which no flowtable here touches. -// Without kernel flowtables (kmod-nft-offload) the loop runs as before, -// slower, and logs it once. -// -// Separately, people with Home-only access get a plain resolver -// (dawnline.resolver). While the netns exists it runs inside it and sends its -// upstream queries back out through the transit link as forwarded traffic — -// not as the router's own traffic and not from the LAN — so tools that -// capture either leave it alone. This module says where it runs. -// -// Everything is derived from the router at run time; nothing assumes a -// particular subnet or tool. If the LAN is not a bridge or setup fails, the -// direct path stays and status() says why (kept as a code in loop.json, which -// apply and the agent write with no language; error_text() makes the words). - -import { readfile, writefile, readlink, stat, unlink } from 'fs'; -import { cursor } from 'uci'; -import { - sh, sh_out, q, ip2int, int2ip, parse_cidr, cidr_any, ensure_dir, read_json, write_json, slog, syslog, syslog_lines, RUN_DIR -} from 'dawnline.util'; -import * as net from 'dawnline.net'; -import * as core from 'dawnline.core'; -import * as store from 'dawnline.store'; -import * as resolver from 'dawnline.resolver'; -import { _, L_ } from 'dawnline.i18n'; - -export const NS = 'dawnline'; -const TX_ROOT = net.INTERNAL.transit, TX_NS = 'dlx1', LAN_ROOT = net.INTERNAL.lan, LAN_NS = 'dll1'; -const PREF_LOOP_DNS = 5205, PREF_MAIN = 5210, PREF_LOOP = 5290; -export const RESOLVER_CONF = resolver.CONF; -const STATE = `${RUN_DIR}/loop.json`; -const NS_RULES = '/var/etc/dawnline-ns.nft'; - -const WHO = L_('Internet like a home device'); - -function log(msg, level, detail) { - slog('dawnline', level ?? 'info', msg, detail, WHO); -} - -/** - * Run the commands that set the path up or take it down, each in syslog as - * it is given ("$ ip netns add dawnline"), a failure with what it said. - * Only called when something changes (ensure() returns early otherwise). - */ -function run(cmds) { - let errs = []; - syslog_lines('info', 'loop', join('\n', cmds), '$ '); - for (let c in cmds) { - let r = sh(c); - if (r.code != 0) { - push(errs, `${c}: ${trim(r.out)}`); - syslog('error', 'loop', `failed: ${c} · ${trim(r.out)}`); - } - } - return errs; -} - -function exists(dev) { - return stat(`/sys/class/net/${dev}`) != null; -} - -/* ---------- facts about the LAN ---------- */ - -/** DHCP pool, static leases and the DNS handed to LAN clients, for one netifd interface. */ -function dhcp_facts(logical, lan) { - let c = cursor(); - c.load('dhcp'); - let pool = null, dns = null, statics = []; - c.foreach('dhcp', 'dhcp', (s) => { - if (s.interface != logical || s.ignore == '1') - return; - let start = +(s.start ?? 100), limit = +(s.limit ?? 150); - pool = [ lan.net + start, lan.net + start + limit - 1 ]; - let opts = type(s.dhcp_option) == 'array' ? s.dhcp_option : (s.dhcp_option ? [ s.dhcp_option ] : []); - for (let o in opts) { - let m = match(o, /^(option:dns-server|6),([0-9.]+)/); - if (m && !dns) - dns = m[2]; - } - }); - c.foreach('dhcp', 'host', (s) => { - let ip = ip2int(s.ip ?? ''); - if (ip != null) - push(statics, ip); - }); - return { pool, dns, statics }; -} - -/** Addresses other devices are using right now (neighbour table + leases). */ -function used_addresses(dev) { - let used = {}; - try { - for (let n in json(sh_out(`ip -j -4 neigh show dev ${q(dev)}`) || '[]') ?? []) - if (n.dst && !(index(n.state ?? [], 'FAILED') >= 0 || index(n.state ?? [], 'INCOMPLETE') >= 0)) - used[n.dst] = n.lladdr ?? true; - } - catch (e) {} - for (let l in split(readfile('/tmp/dhcp.leases') ?? '', '\n')) { - let f = split(l, ' '); - if (length(f) >= 3) - used[f[2]] = f[1]; - } - return used; -} - -/** The MAC the netns's LAN link has now; null without the link. */ -function our_mac() { - return sh_out(`ip -n ${NS} -j link show ${LAN_NS} 2>/dev/null | jsonfilter -e '@[0].address'`); -} - -/** 32-bit FNV-1a of a string, continuing from `h`. */ -function fnv1a(s, h) { - for (let i = 0; i < length(s); i++) - h = ((h ^ ord(s, i)) * 16777619) & 0xffffffff; - return h; -} - -/** - * The MAC for the netns's LAN link, from the bridge's MAC: a locally - * administered unicast address hashed from it, so it is the same every time - * and differs between routers. Not the bridge's MAC with a bit flipped: radios - * and ports often get those. - */ -export function lan_mac(bridge) { - let s = lc(trim(bridge ?? '')); - let h1 = fnv1a(`dawnline lan ${s}`, 0x811c9dc5), h2 = fnv1a(s, h1); - let b = [ ((h1 >> 24) & 0xfc) | 0x02, (h1 >> 16) & 0xff, (h1 >> 8) & 0xff, h1 & 0xff, (h2 >> 24) & 0xff, (h2 >> 16) & 0xff ]; - return join(':', map(b, (x) => sprintf('%02x', x))); -}; - -/** - * True when the netns may use a LAN address (a number): a host of the - * network, not the router's, not a static lease, outside the DHCP pool and - * not held by another device in `used` (address → MAC, or true without one). - * An entry with one of the MACs in `mine` is the netns itself, also from - * before it was created again. - */ -export function address_free(ip, lan, facts, used, mine) { - if (ip <= lan.net || ip >= lan.net + lan.size - 1 || ip == lan.ip || index(facts.statics, ip) >= 0) - return false; - if (facts.pool && ip >= facts.pool[0] && ip <= facts.pool[1]) - return false; - let u = used[int2ip(ip)]; - return u == null || index(mine, u) >= 0; -}; - -/** - * A LAN address for the netns: keep the saved one while it is free (see - * address_free; `mine` are the netns's MACs), otherwise the highest free host - * above the DHCP pool (then below it) that does not answer. - */ -function pick_address(lan, facts, saved, dev, mine) { - let used = used_addresses(dev); - let sv = ip2int(saved ?? ''); - if (sv != null && address_free(sv, lan, facts, used, mine)) - return int2ip(sv); - for (let ip = lan.net + lan.size - 2; ip > lan.net; ip--) { - if (!address_free(ip, lan, facts, used, mine)) - continue; - // Last check: nobody answers on it. - sh(`ping -c 1 -W 1 -I ${q(dev)} ${int2ip(ip)}`); - if (address_free(ip, lan, facts, used_addresses(dev), mine)) - return int2ip(ip); - } - return null; -} - -/** A /30 in 169.254.0.0/16 that no route or address on the router overlaps. */ -function pick_transit(saved) { - let busy = []; - for (let dev, d in net.snapshot().devices) - for (let n in [ ...d.nets, ...d.addrs ]) - push(busy, n); - let free = (base) => { - for (let b in busy) { - let c = cidr_any(b); - if (c && base < c.net + c.size && c.net < base + 4) - return false; - } - return true; - }; - let sv = ip2int(saved ?? ''); - if (sv != null && free(sv)) - return sv; - for (let k = 77; k < 77 + 256; k++) { - let base = ip2int(`169.254.${k % 256}.0`); - if (free(base)) - return base; - } - return null; -} - -/** A routing table nobody else uses (ours holds a single route via the transit link). */ -function pick_table(saved) { - let free = (t) => { - let r = sh_out(`ip -4 route show table ${t}`) ?? ''; - return r == '' || (length(split(r, '\n')) == 1 && index(r, ` dev ${TX_ROOT}`) >= 0); - }; - if (saved && free(saved)) - return saved; - for (let t = 2077; t < 2177; t++) - if (free(t)) - return t; - return null; -} - -/* ---------- why it is off ---------- */ - -/* - * The reasons plan() and ensure() give, kept in loop.json: - * { code: 'no_lan' } no LAN detected - * { code: 'not_bridge', dev } the LAN is not a bridge - * { code: 'no_ipv4', dev } the LAN has no IPv4 address - * { code: 'no_address', net } no free address on the LAN's network - * { code: 'no_transit' } no free link-local range for the internal link - * { code: 'no_table' } no free routing table - * { code: 'setup', detail } a command failed (detail: it and what it said) - */ - -/** A reason from plan() for the service log and syslog: English, like every log line. */ -export function error_note(e) { - if (e.code == 'no_lan') - return L_('No LAN detected.'); - if (e.code == 'not_bridge') - return sprintf(L_('%s is not a bridge, so Dawnline cannot join the LAN as a device.'), e.dev); - if (e.code == 'no_ipv4') - return sprintf(L_('%s has no IPv4 address.'), e.dev); - if (e.code == 'no_address') - return sprintf(L_('No free address on %s.'), e.net); - if (e.code == 'no_transit') - return L_('No free link-local range for the internal link.'); - return L_('No free routing table.'); -}; - -/** - * Why "like a home device" is off (a reason above), as a sentence in the - * reader's language. Null for none; the English of a loop.json written by an - * older version as it is. - */ -export function error_text(e) { - if (type(e) != 'object') - return e ?? null; - if (e.code == 'no_lan') - return _('No LAN detected.'); - if (e.code == 'not_bridge') - return sprintf(_('%s is not a bridge, so Dawnline cannot join the LAN as a device.'), e.dev); - if (e.code == 'no_ipv4') - return sprintf(_('%s has no IPv4 address.'), e.dev); - if (e.code == 'no_address') - return sprintf(_('No free address on %s.'), e.net); - if (e.code == 'no_transit') - return _('No free link-local range for the internal link.'); - if (e.code == 'no_table') - return _('No free routing table.'); - return sprintf(_('Setup failed: %s'), e.detail); -}; - -/* ---------- plan ---------- */ - -function settings() { - let c = cursor(); - c.load('dawnline'); - return c.get_all('dawnline', 'settings') ?? {}; -} - -/** Servers that want "like a home device" (default on) and run a core. */ -function wanted(m) { - return filter(values(m.servers), (s) => length(core.tunnels(s)) && s.enabled && s.lan_like); -} - -/** Every server's interface, for rules. */ -function all_ifnames(m) { - return map(values(m.servers), (s) => s.ifname); -} - -/** - * What should exist, or { error } (a reason, see error_text) when it cannot. - * Pure apart from reading router state (and one ping per candidate address). - */ -export function plan(m) { - let srvs = wanted(m); - if (!length(srvs)) - return { off: true }; - let snap = net.snapshot(); - let dev = snap.lan; - let d = snap.devices[dev]; - if (!dev || !d) - return { error: { code: 'no_lan' } }; - if (d.kind != 'bridge') - return { error: { code: 'not_bridge', dev } }; - let lan = parse_cidr(d.addrs[0]); - if (!lan) - return { error: { code: 'no_ipv4', dev } }; - let facts = dhcp_facts(d.logical, lan); - let st = settings(); - let mac = lan_mac(readfile(`/sys/class/net/${dev}/address`)); - // The netns's MACs: the one it gets, and the one it has (a random one from an older version). - let addr = pick_address(lan, facts, st.lan_address, dev, [ mac, our_mac() ]); - if (!addr) - return { error: { code: 'no_address', net: `${int2ip(lan.net)}/${lan.prefix}` } }; - let last = read_json(STATE, {}); - let tx = pick_transit(last?.transit); - if (tx == null) - return { error: { code: 'no_transit' } }; - let table = pick_table(last?.plan?.table); - if (table == null) - return { error: { code: 'no_table' } }; - let servers = []; - for (let srv in srvs) { - let sn = net.server_net(srv, snap); - for (let t in core.tunnels(srv)) - push(servers, { ifname: t.ifname, subnet: t.subnet, direct: net.collapse([ t.subnet, ...sn.nets ]) }); - } - return { - dev, - gateway: int2ip(lan.ip), - address: addr, - mac, - prefix: lan.prefix, - dns: facts.dns ?? int2ip(lan.ip), - transit: tx, - tx_root: int2ip(tx + 1), - tx_ns: int2ip(tx + 2), - table, - servers, - }; -}; - -/* ---------- apply ---------- */ - -/** - * The netns's nft script as text (nothing is loaded). With `fast`, a - * flowtable on the netns's own two links takes established TCP and UDP flows - * past conntrack and the forward hook here. Only dlx1 and dll1: the root - * namespace's links (dawn0, dlx0) stay out, the guard there sees every packet. - */ -export function ns_rules(p, fast) { - return `table inet dawnline -delete table inet dawnline -table inet dawnline {${fast ? ` - flowtable ft { - hook ingress priority 0; - devices = { "${TX_NS}", "${LAN_NS}" }; - }` : ''} - chain nat_pre { - type nat hook prerouting priority dstnat; policy accept; - iifname "${TX_NS}" ip daddr ${p.address} meta l4proto { tcp, udp } th dport 53 dnat ip to ${p.dns}:53 - } - chain nat_post { - type nat hook postrouting priority srcnat; policy accept; - oifname "${LAN_NS}" masquerade - } - chain filter_forward { - type filter hook forward priority filter; policy drop;${fast ? ` - ct state established meta l4proto { tcp, udp } flow add @ft` : ''} - ct state established,related accept - iifname "${TX_NS}" oifname "${LAN_NS}" accept - } - chain filter_input { - type filter hook input priority filter; policy drop; - ct state established,related accept - iifname "lo" accept - icmp type echo-request accept - iifname "${TX_NS}" meta l4proto { tcp, udp } th dport 53 accept - } -} -`; -}; - -/** - * Load the netns's rules, with the flowtable when the kernel takes it, else - * without (the loop works either way). { fast, slow, err }: slow is why the - * flowtable failed, err why the rules without it failed too. - */ -function load_ns_rules(p) { - ensure_dir('/var/etc'); - let load = (fast) => { - writefile(NS_RULES, ns_rules(p, fast)); - return run([ `ip netns exec ${NS} nft -f ${NS_RULES}` ])[0]; - }; - let slow = load(true); - return slow ? { fast: false, slow, err: load(false) } : { fast: true }; -} - -/** - * The policy rules plan `p` wants (pure), in order: [{ pref, iif, to, table }] - * (to null: all). Per server interface: DNS to the netns address through the - * netns, home networks and the tunnel network by main, the rest into the netns. - */ -export function rules(p) { - let out = []; - let rule = (pref, iif, to, table) => push(out, { pref, iif, to, table }); - for (let s in p?.servers ?? []) { - rule(PREF_LOOP_DNS, s.ifname, `${p.address}/32`, `${p.table}`); - for (let n in s.direct) - rule(PREF_MAIN, s.ifname, n, 'main'); - rule(PREF_LOOP, s.ifname, null, `${p.table}`); - } - return out; -}; - -/** Our policy rules: in our priority band and bound to a Dawnline tunnel interface. */ -function current_rules(ifnames) { - let out = []; - try { - // Ours, plus ours left behind by a removed tunnel (its interface is gone). - for (let r in json(sh_out('ip -j -4 rule show') || '[]') ?? []) - if (r.priority >= 5200 && r.priority < 5300 && r.iif && (index(ifnames, r.iif) >= 0 || 'iif_detached' in r)) - push(out, r); - } - catch (e) {} - return out; -} - - -// A rule of ours with a source (none of rules() has one) is told apart, so it is removed. -function rule_key(pref, from, iif, to, table) { - // `ip -j rule` shows a /32 source or destination without its length. - let full = (n) => n && index(n, '/') < 0 ? `${n}/32` : n; - return `${pref} ${full(from) ?? 'all'} ${iif} ${full(to) ?? 'all'} ${table}`; -} - -/** - * A source or destination as `ip -j rule` has it ("10.9.0.2", or with its - * length), or null for all: a rule without a source shows `"src": "all"` - * (iproute2 prints "from all"), one without a destination no `dst`. - */ -function rule_net(addr, len) { - return addr && addr != 'all' ? `${addr}${len != null ? '/' + len : ''}` : null; -} - -/** The command that removes one of current_rules(). */ -function rule_del(r) { - let from = rule_net(r.src, r.srclen), to = rule_net(r.dst, r.dstlen); - return `ip -4 rule del priority ${r.priority}${from ? ' from ' + from : ''} iif ${q(r.iif)}${to ? ' to ' + to : ''} lookup ${r.table}`; -} - -/** - * The commands that turn rules `current` (ours, as `ip -j -4 rule show` - * prints them) into rules(p) (pure): the missing ones added first, then the - * ones no longer wanted removed, so a device's traffic never falls between - * two rules while others change. [] when they are as wanted. - */ -export function rule_cmds(p, current) { - let have = {}, want = {}, cmds = [], twice = []; - for (let r in current) { - let k = rule_key(r.priority, rule_net(r.src, r.srclen), r.iif, rule_net(r.dst, r.dstlen), r.table); - if (have[k]) - push(twice, rule_del(r)); - have[k] = r; - } - for (let w in rules(p)) { - let k = rule_key(w.pref, null, w.iif, w.to, w.table); - if (!have[k] && !want[k]) - push(cmds, `ip -4 rule add priority ${w.pref} iif ${q(w.iif)}${w.to ? ' to ' + w.to : ''} lookup ${w.table}`); - want[k] = true; - } - for (let k, r in have) - if (!want[k]) - push(cmds, rule_del(r)); - // The same rule twice (one deletion removes one of them). - push(cmds, ...twice); - return cmds; -}; - -function sync_rules(p, ifnames) { - return rule_cmds(p, current_rules(ifnames)); -} - -function tunnel_ifnames() { - let c = cursor(); - c.load('dawnline'); - let out = []; - c.foreach('dawnline', 'server', (s) => { - push(out, s.ifname ?? s['.name']); - }); - return out; -} - -/** Remove the netns, links and rules, and the router's neighbour entry for the netns. */ -export function remove(ifnames) { - ifnames ??= tunnel_ifnames(); - let last = read_json(STATE, {})?.plan; - // Read while the link is there: the entry is ours when it carries the netns's MAC. - let held = last?.dev ? used_addresses(last.dev)[last.address] : null; - let stale = type(held) == 'string' && index([ last.mac, our_mac() ], held) >= 0; - let cmds = map(current_rules(ifnames), rule_del); - if (last?.table) - push(cmds, `ip -4 route flush table ${last.table}`); - if (exists(TX_ROOT)) - push(cmds, `ip link del ${TX_ROOT}`); - if (exists(LAN_ROOT)) - push(cmds, `ip link del ${LAN_ROOT}`); - if (stat(`/var/run/netns/${NS}`)) - push(cmds, `ip netns del ${NS}`); - // Left there, it would hold the address for a MAC nobody has. - if (stale) - push(cmds, `ip -4 neigh del ${q(last.address)} dev ${q(last.dev)}`); - run(cmds); - unlink(STATE); -}; - -/** - * Bring the loop to the plan. Cheap when nothing changed: compares with the - * last applied plan and only checks that links, bridge port and rules exist. - */ -export function ensure(m, force) { - let ifnames = all_ifnames(m); - let p = plan(m); - if (p.off || p.error) { - // Read before remove(), which deletes it: the error is logged once, not every tick. - let was = read_json(STATE, {}); - if (was.plan || exists(TX_ROOT) || exists(LAN_ROOT) || length(current_rules(ifnames))) - remove(ifnames); - ensure_dir(RUN_DIR); - write_json(STATE, { error: p.error, off: !!p.off }, 0o644); - if (p.error && sprintf('%J', p.error) != sprintf('%J', was.error)) - log(L_('is off'), 'error', error_note(p.error)); - return p; - } - let last = read_json(STATE, {}); - let same = !force && last.applied && sprintf('%J', last.plan) == sprintf('%J', p); - let healthy = exists(TX_ROOT) && exists(LAN_ROOT) && stat(`/var/run/netns/${NS}`) && - replace(readlink(`/sys/class/net/${LAN_ROOT}/master`) ?? '', /^.*\//, '') == p.dev; - let rules = sync_rules(p, ifnames); - if (same && healthy && !length(rules)) - return p; - - // A link made by an older version has a random MAC (its plan had none, so - // this runs once after an update): it gets the stable one. - let remac = exists(LAN_ROOT) && our_mac() != p.mac; - let cmds = []; - if (!stat(`/var/run/netns/${NS}`)) - push(cmds, `ip netns add ${NS}`); - if (!exists(TX_ROOT)) - push(cmds, `ip link add ${TX_ROOT} type veth peer name ${TX_NS} netns ${NS}`); - if (!exists(LAN_ROOT)) - push(cmds, `ip link add ${LAN_ROOT} type veth peer name ${LAN_NS} address ${p.mac} netns ${NS}`); - if (remac) - push(cmds, `ip -n ${NS} link set ${LAN_NS} down`, `ip -n ${NS} link set ${LAN_NS} address ${p.mac}`); - let errs = run(cmds); - cmds = [ - `ip addr flush dev ${TX_ROOT}`, - `ip addr add ${p.tx_root}/30 dev ${TX_ROOT}`, - `ip link set ${TX_ROOT} up`, - `ip link set ${LAN_ROOT} master ${q(p.dev)}`, - `ip link set ${LAN_ROOT} up`, - `ip -n ${NS} link set lo up`, - `ip -n ${NS} addr flush dev ${TX_NS}`, - `ip -n ${NS} addr add ${p.tx_ns}/30 dev ${TX_NS}`, - `ip -n ${NS} link set ${TX_NS} up`, - `ip -n ${NS} addr flush dev ${LAN_NS}`, - `ip -n ${NS} addr add ${p.address}/${p.prefix} dev ${LAN_NS}`, - `ip -n ${NS} link set ${LAN_NS} up`, - `ip -n ${NS} route replace default via ${p.gateway} dev ${LAN_NS}`, - // The resolver's own queries (from the transit address) go back out the transit link. - `ip -n ${NS} route replace default via ${p.tx_root} dev ${TX_NS} table 100`, - `ip -n ${NS} rule del from ${p.tx_ns} lookup 100 2>/dev/null; ip -n ${NS} rule add from ${p.tx_ns} lookup 100`, - `ip netns exec ${NS} sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward; echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter; echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter'`, - `ip -4 route replace default via ${p.tx_ns} dev ${TX_ROOT} table ${p.table}`, - ]; - for (let s in p.servers) - push(cmds, `ip -n ${NS} route replace ${q(s.subnet)} via ${q(p.tx_root)} dev ${TX_NS}`); - // The router knows the address by the old MAC: ask again now, not when the entry expires. - if (remac) - push(cmds, `ip -4 neigh flush to ${p.address} dev ${q(p.dev)}`); - push(errs, ...run(cmds)); - let ft = load_ns_rules(p); - if (ft.err) - push(errs, ft.err); - push(errs, ...run(sync_rules(p, ifnames))); - - if (length(errs)) { - let why = { code: 'setup', detail: errs[0] }; - if (sprintf('%J', read_json(STATE, {}).error) != sprintf('%J', why)) - log(L_('failed - internet goes out directly for now'), 'error', errs[0]); - remove(ifnames); - write_json(STATE, { error: why }, 0o644); - return { error: why }; - } - ensure_dir(RUN_DIR); - write_json(STATE, { applied: time(), plan: p, transit: p.transit, fast: ft.fast }, 0o644); - if (!last.applied || last.plan?.dev != p.dev || last.plan?.address != p.address) - log(sprintf(L_('is on · traffic enters %s as %s'), p.dev, p.address), 'up'); - else if (!healthy) - log(sprintf(L_('was broken - set up again (%s as %s)'), p.dev, p.address), 'repair'); - // Once, not again on every apply while the module is still missing. - if (!ft.fast && last.fast !== false) - log(L_('runs without its fast path'), 'info', join('\n', [ - L_('Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline.'), - ft.slow, - ])); - return p; -}; - -/** - * Keep the chosen LAN address stable across restarts (settings.lan_address). - * Called by dawnline.apply once its own lock is released: the config lock is - * never taken inside it. - */ -export function remember(p) { - if (!p?.address || settings().lan_address == p.address) - return; - store.transact((c, m) => { - c.set('dawnline', 'settings', 'settings'); - c.set('dawnline', 'settings', 'lan_address', p.address); - }); -}; - -/** Last applied state for views and health checks; `error` says why it is off (error_text). */ -export function status() { - let s = read_json(STATE, {}); - if (s.plan) - return { - active: exists(TX_ROOT) && exists(LAN_ROOT), - dev: s.plan.dev, address: s.plan.address, dns: s.plan.dns, gateway: s.plan.gateway, transit: s.plan.tx_ns, - bridged: replace(readlink(`/sys/class/net/${LAN_ROOT}/master`) ?? '', /^.*\//, '') == s.plan.dev, - }; - return { active: false, off: !!s.off, error: error_text(s.error) }; -}; - -/** The DNS address tunnel clients should use while the loop is up. */ -export function client_dns() { - let s = status(); - return s.active ? s.address : null; -}; - -/* ---------- plain resolver for Home-only clients ---------- */ - -/** The DNS your LAN gets from DHCP (option 6), else the router on the LAN. */ -export function lan_dns() { - let st = status(); - if (st.dns) - return st.dns; - let snap = net.snapshot(); - let d = snap.devices[snap.lan]; - let a = d?.addrs?.[0]; - if (!a) - return null; - let lan = parse_cidr(a); - return (lan ? dhcp_facts(d.logical, lan).dns : null) ?? split(a, '/')[0]; -}; - -/** - * Where Home-only clients' DNS goes: inside the netns while it is up - * (`ns`: transit address, port 53), otherwise on the tunnel address (`root`). - */ -export function resolver_target() { - let st = status(); - return st.active && st.transit ? { mode: 'ns', address: st.transit, port: 53 } : { mode: 'root', port: resolver.PORT }; -}; - -/** Write the resolver config where it should run now; true when it changed (see dawnline.resolver). */ -export function sync_resolver(m) { - return resolver.sync(m, resolver_target(), lan_dns()); -}; - -/** True when the resolver process is alive. */ -export function resolver_running() { - return resolver.running(); -}; - -export const RESOLVER = { port: resolver.PORT, conf: resolver.CONF }; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/meter.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/meter.uc deleted file mode 100644 index eeb1076..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/meter.uc +++ /dev/null @@ -1,155 +0,0 @@ -// Dawnline — the live meter (Speed now on the Overview, the People list and a -// person's page): each server's throughput and that of each device moving -// traffic, one point a second over the last two minutes. -// -// The meter RPC (dawnline.rpc.status) calls want() and read(); the agent's -// watcher makes a point from every read it already does (sample(), point()) -// and keeps the last two minutes in memory (keep()) whether anyone looks or -// not, so a look gets them all at once. It writes them to FILE (save()) only -// while WANT is younger than WANT_FOR seconds: the first second of a look, -// then with each new point. When WANT goes stale it removes FILE: with nobody -// looking the watcher pays a little arithmetic and one stat() a second, and -// writes nothing. FILE holds server and device ids and byte rates only, no -// keys, names or personal codes. Who is online and the per-minute rates are not here -// (dawnline.live, the agent's tick). -// -// Bytes are the peers' counters (dawnline.awg.dump): tx includes the -// disguise (S prefixes, padding, junk), rx the packets as they were -// received without their prefix, so both are close to what is on the wire. - -import { writefile, stat, unlink } from 'fs'; -import { read_json, write_file, ensure_dir, RUN_DIR } from 'dawnline.util'; - -/** Touched by every meter RPC: the watcher samples while it is fresh. */ -export const WANT = `${RUN_DIR}/meter.want`; -/** The points, written by the watcher each second while WANT is fresh. */ -export const FILE = `${RUN_DIR}/meter.json`; -/** Seconds after the last meter RPC the watcher keeps sampling. */ -export const WANT_FOR = 10; -/** Points kept: two minutes, one a second. */ -export const POINTS = 120; - -/** Ask the watcher to sample for the next WANT_FOR seconds (the meter RPC). */ -export function want() { - ensure_dir(RUN_DIR); - writefile(WANT, `${time()}`); -}; - -/** Someone asked for the meter within WANT_FOR seconds of `now`. */ -export function wanted(now) { - let st = stat(WANT); - return st != null && now - st.mtime < WANT_FOR && st.mtime - now < WANT_FOR; -}; - -/** - * What the watcher wrote, for the RPC: { now, want: WANT_FOR, keep: POINTS, - * ts (newest point, 0 for none), points } with only the points newer than - * `since` when it is given (a page that polls asks for what it lacks). - * No points when nobody asked within WANT_FOR seconds or the agent is not - * running: FILE is gone (the agent removes it as it stops and starts), or, - * from one that died while someone looked, its newest point is over - * WANT_FOR seconds old (ts then stops moving). - */ -export function read(since) { - let f = read_json(FILE, null); - let ts = +(f?.ts ?? 0); - let pts = type(f?.points) == 'array' && time() - ts <= WANT_FOR ? f.points : []; - if (since > 0) - pts = filter(pts, (p) => p.ts > since); - return { now: time(), want: WANT_FOR, keep: POINTS, ts: ts, points: pts }; -}; - -/** Monotonic seconds, with the fraction: the gap between two samples. */ -function mono() { - let c = clock(true); - return c[0] + c[1] / 1e9; -} - -/** - * One sample at `now` from the dump the watcher just read (`d`): { t, ts, - * servers: [ server id ] (those whose tunnel was read), dev: { device id: - * [ rx, tx, server id ] } (its peer's counters, on those servers) }. Nothing - * but the dump is read. - */ -export function sample(m, d, now) { - let s = { t: mono(), ts: now, servers: [], dev: {} }; - let read = {}; - for (let sid, srv in m.servers) - if (d.reads[srv.ifname] == 'read') { - read[sid] = true; - push(s.servers, sid); - } - for (let id, dev in m.devices) { - let peer = d.peers[dev.public_key]; - let sid = m.people[dev.person]?.server; - if (peer && read[sid]) - s.dev[id] = [ peer.rx, peer.tx, sid ]; - } - return s; -}; - -/** A counter's change, 0 when it went down (a tunnel set up again starts from zero). */ -function delta(a, b) { - return (b ?? 0) >= (a ?? 0) ? (b ?? 0) - (a ?? 0) : 0; -} - -/** - * The point between samples `a` and `b`, null when they are not a second or - * so apart (the first sample, a stalled watcher): { ts, servers: { server - * id: [ rx, tx ] }, dev: { device id: [ rx, tx ] } }, bytes per second of - * each server's devices together (rx what came from them, tx what went to - * them, as a server's per-minute `rate`), for every server whose tunnel `b` - * read ([ 0, 0 ] when nothing moved), and of each device that moved - * something (one left out moved nothing, while its server was read). A - * device is counted from its second sample on, on the server it was on in both. - */ -export function point(a, b) { - let dt = b.t - a.t; - if (!(dt > 0.2 && dt < 5)) - return null; - let sum = {}, dev = {}; - for (let sid in b.servers) - sum[sid] = [ 0, 0 ]; - for (let id, v in b.dev) { - let o = a.dev[id]; - if (!o || o[2] != v[2]) - continue; - let rx = delta(o[0], v[0]), tx = delta(o[1], v[1]); - sum[v[2]][0] += rx; - sum[v[2]][1] += tx; - if (rx || tx) - dev[id] = [ int(rx / dt), int(tx / dt) ]; - } - let p = { ts: b.ts, servers: {}, dev }; - for (let sid, v in sum) - p.servers[sid] = [ int(v[0] / dt), int(v[1] / dt) ]; - return p; -}; - -/** - * Keep point `p` in `ring` ([ [ ts, the point as JSON ] ], newest last; each - * point is turned into text once, when it is made, not again every second for - * as long as it is kept): at most POINTS of them, none older than POINTS - * seconds before `p` (the watcher may have stalled in between) and none from - * its second or later (the clock went back). - */ -export function keep(ring, p) { - while (length(ring) && ring[length(ring) - 1][0] >= p.ts) - pop(ring); - push(ring, [ p.ts, sprintf('%J', p) ]); - while (length(ring) > POINTS || ring[0][0] <= p.ts - POINTS) - shift(ring); -}; - -/** Write the points kept in `ring` (keep()) to FILE. */ -export function save(ring) { - let ts = length(ring) ? ring[length(ring) - 1][0] : 0; - ensure_dir(RUN_DIR); - write_file(FILE, `{"ts":${ts},"points":[${join(',', map(ring, (r) => r[1]))}]}`, 0o644); -}; - -/** Nobody looks any more: FILE goes (the next look gets the points kept then). */ -export function stop() { - if (stat(FILE)) - unlink(FILE); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc deleted file mode 100644 index c23529d..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/migrate.uc +++ /dev/null @@ -1,114 +0,0 @@ -// 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 { slog, syslog } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as store from 'dawnline.store'; -import { L_ } from 'dawnline.i18n'; - -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', L_('moved to word codes'), null, L_('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'); - syslog('info', 'portal', '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')); -}; - -/** The portal names itself after the server now (the breadcrumb, the tab): its own title setting is gone. */ -function portal_title() { - let c = cursor(); - c.load('dawnline'); - if (c.get('dawnline', 'settings', 'portal_title') != null) - store.transact((w, m) => w.delete('dawnline', 'settings', 'portal_title')); -} - -/* - * Steps that cannot tell from the config whether they ran are recorded in - * `settings.migrated` (a list), so they run exactly once. - */ -function migrated(c, name) { - let done = c.get('dawnline', 'settings', 'migrated') ?? []; - return index(type(done) == 'array' ? done : [ done ], name) >= 0; -} - -function mark_migrated(w, name) { - let done = w.get('dawnline', 'settings', 'migrated') ?? []; - w.set('dawnline', 'settings', 'migrated', [ ...(type(done) == 'array' ? done : [ done ]), name ]); -} - -/* - * 1380 was every server's stored MTU before it became automatic (by device - * type and disguise). Once only: an admin may choose 1380 again on purpose. - */ -function auto_mtu() { - let c = cursor(); - c.load('dawnline'); - if (migrated(c, 'auto_mtu')) - return; - let any = false; - c.foreach('dawnline', 'server', (s) => { - if (s.mtu == '1380') - any = true; - }); - store.transact((w, m) => { - w.foreach('dawnline', 'server', (s) => { - if (s.mtu == '1380') - w.delete('dawnline', s['.name'], 'mtu'); - }); - mark_migrated(w, 'auto_mtu'); - }); - if (any) - slog('dawnline', 'info', L_('MTU is now automatic'), null, L_('Servers')); -} - -/** All of them, in order. */ -export function run() { - word_codes(); - uhttpd(); - auto_mtu(); - portal_title(); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/net.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/net.uc deleted file mode 100644 index d41db36..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/net.uc +++ /dev/null @@ -1,308 +0,0 @@ -// Dawnline — the router's network interfaces: what exists, which one is the -// WAN, and which ones make up a server's "home network". -// -// Per server (uci `server` section): -// auto_wan 1 = use the interface of the default route (detected_wan -// is kept as a fallback while the WAN is down) -// wan_device the WAN interface when auto_wan is off -// auto_lan 1 = include the detected LAN (detected_lan as fallback) -// lan_device extra interfaces that count as the home network (list) -// -// Home access is enforced by destination: the networks routed out of the -// chosen interfaces form the server's nft `home_` set, and the tunnel's -// firewall zone gets a forwarding to each of their zones. - -import { readfile, readlink, lsdir, stat } from 'fs'; -import { cursor } from 'uci'; -import { sh_out, ip2int, int2ip, cidr_any, uniq } from 'dawnline.util'; - -const SYS = '/sys/class/net'; -/** Links Dawnline creates itself (dawnline.loop); never offered as interfaces. */ -export const INTERNAL = { transit: 'dlx0', lan: 'dll0' }; -const VPN_PROTOS = [ 'amneziawg', 'wireguard', 'openvpn', 'openconnect', 'vpnc', 'pptp', 'l2tp', 'gre', 'gretap', 'vti', 'xfrm' ]; -const VPN_NAMES = /^(wg|awg|tun|tap|ovpn|ipsec|vti|xfrm)/; -// Never the WAN while another default route exists: VPN clients. (PPTP and -// L2TP stay eligible: some ISPs connect the WAN with them.) -const NOT_WAN_PROTOS = [ 'amneziawg', 'wireguard', 'openvpn', 'openconnect', 'vpnc' ]; -const NOT_WAN_NAMES = /^(wg|awg|tun|tap|ovpn)/; -// Kernel placeholder devices that never carry a network on their own. -const NOISE = /^(ifb|teql|sit|ip6tnl|gre|gretap|erspan|ip6gre|ip6gretap|ip_vti|ip6_vti|tunl|bond)[0-9]*$/; -const PRIVATE = [ [ '10.0.0.0', 8 ], [ '172.16.0.0', 12 ], [ '192.168.0.0', 16 ], [ '100.64.0.0', 10 ] ]; - -function sysread(dev, f) { - return trim(readfile(`${SYS}/${dev}/${f}`) ?? ''); -} - -function ip_json(args) { - try { - return json(sh_out(`ip -j ${args} 2>/dev/null`) || '[]') ?? []; - } - catch (e) { - return []; - } -} - -function ubus_json(path, method) { - try { - return json(sh_out(`ubus call ${path} ${method} 2>/dev/null`) || 'null'); - } - catch (e) { - return null; - } -} - -/** "a.b.c.d[/len]" → { net, prefix, size } for any prefix 1-32; null for default or junk. */ -function net_of(s) { - let c = cidr_any(s); - return c && c.prefix >= 1 ? c : null; -} - -function net_str(n) { - return `${int2ip(n.net)}/${n.prefix}`; -} - -/** Drop networks already covered by a wider one. */ -export function collapse(list) { - let nets = filter(map(uniq(list), net_of), (x) => x != null); - nets = sort(nets, (a, b) => a.prefix - b.prefix || a.net - b.net); - let keep = []; - for (let n in nets) { - let inside = false; - for (let k in keep) - if (n.net >= k.net && n.net < k.net + k.size) { - inside = true; - break; - } - if (!inside) - push(keep, n); - } - return map(sort(keep, (a, b) => a.net - b.net), net_str); -}; - -function is_private(cidr) { - let n = net_of(cidr); - if (!n) - return false; - for (let p in PRIVATE) { - let base = ip2int(p[0]), size = 1 << (32 - p[1]); - if (n.net >= base && n.net < base + size) - return true; - } - return false; -} - -/* ---------- snapshot ---------- */ - -let cache = null; - -/** - * One consistent view of the router's interfaces, cached for a few seconds - * (rpcd keeps this module loaded, so the cache must expire). - */ -export function snapshot(fresh) { - if (!fresh && cache && time() - cache.ts < 5) - return cache; - - // Networks reachable through each device (main table, IPv4). - let routes = {}, defaults = []; - for (let r in ip_json('-4 route show table main')) { - if (!r.dev) - continue; - if (r.dst == 'default') { - push(defaults, r); - continue; - } - push(routes[r.dev] ??= [], r.dst); - } - let addrs = {}; - for (let l in ip_json('-4 addr show')) - for (let a in l.addr_info ?? []) - if (a.family == 'inet') - push(addrs[l.ifname] ??= [], `${a.local}/${a.prefixlen}`); - - // Logical (netifd) interfaces by device, and firewall zones by network. - let logical = {}; - for (let i in ubus_json('network.interface', 'dump')?.interface ?? []) { - let dev = i.l3_device ?? i.device; - if (dev && !logical[dev]) - logical[dev] = { name: i.interface, proto: i.proto, up: i.up }; - } - // The WAN: the default route with the lowest metric that does not go into - // a VPN client (its default route is not where the tunnels listen); only - // VPN routes: the lowest of them. - let vpn = (dev) => index(NOT_WAN_PROTOS, logical[dev]?.proto) >= 0 || match(dev, NOT_WAN_NAMES) != null; - let wan_dev = null, wan_metric = null, wan_vpn = true; - for (let r in defaults) { - let v = vpn(r.dev), metric = r.metric ?? 0; - if (wan_dev == null || (wan_vpn && !v) || (wan_vpn == v && metric < wan_metric)) { - wan_dev = r.dev; - wan_metric = metric; - wan_vpn = v; - } - } - let zone_by_net = {}, zone_by_dev = {}, zones = []; - let fc = cursor(); - fc.load('firewall'); - fc.foreach('firewall', 'zone', (z) => { - if (!z.name) - return; - push(zones, z.name); - for (let n in (type(z.network) == 'array' ? z.network : split(z.network ?? '', /\s+/))) - if (n != '') - zone_by_net[n] ??= z.name; - for (let d in (type(z.device) == 'array' ? z.device : split(z.device ?? '', /\s+/))) - if (d != '') - zone_by_dev[d] ??= z.name; - }); - - let devices = {}; - for (let dev in sort(lsdir(SYS) ?? [])) { - if (dev == 'lo' || dev == INTERNAL.transit || dev == INTERNAL.lan) - continue; - let lg = logical[dev]; - let flags = hex(sysread(dev, 'flags') || '0'); - let kind = +(sysread(dev, 'type') || '0'); - let master = readlink(`${SYS}/${dev}/master`); - master = master ? substr(master, rindex(master, '/') + 1) : null; - let bridge = stat(`${SYS}/${dev}/bridge`) != null; - let wifi = stat(`${SYS}/${dev}/phy80211`) != null || stat(`${SYS}/${dev}/wireless`) != null; - let nets = routes[dev] ? collapse(routes[dev]) : []; - let up = (flags & 1) != 0; - if (match(dev, NOISE) && !length(nets)) - continue; - let cat; - if (wifi) - cat = 'wifi'; - else if ((lg && index(VPN_PROTOS, lg.proto) >= 0) || kind == 65534 || ((flags & 0x10) && kind != 1) || match(dev, VPN_NAMES)) - cat = 'vpn'; - else if (kind == 1 || bridge) - cat = 'ethernet'; - else - cat = 'other'; - devices[dev] = { - name: dev, - category: dev == wan_dev ? 'wan' : cat, - kind: bridge ? 'bridge' : cat, - up, - master, - members: [], - nets, - addrs: addrs[dev] ?? [], - logical: lg?.name, - proto: lg?.proto, - zone: zone_by_dev[dev] ?? (lg ? zone_by_net[lg.name] : null), - }; - } - for (let dev, d in devices) - if (d.master && devices[d.master]) - push(devices[d.master].members, dev); - - // The LAN: netifd's "lan" if present, otherwise the first bridge (then - // ethernet device) carrying a private network. - let lan_dev = null; - for (let dev, lg in logical) - if (lg.name == 'lan' && devices[dev]) - lan_dev = dev; - if (!lan_dev) - for (let pass in [ 'bridge', 'ethernet' ]) - for (let dev, d in devices) - if (!lan_dev && dev != wan_dev && d.kind == pass && !d.master && length(filter(d.nets, is_private))) - lan_dev = dev; - - cache = { ts: time(), devices, wan: wan_dev, lan: lan_dev, zones }; - return cache; -}; - -/* ---------- per server ---------- */ - -/** - * What a server actually uses right now: - * wan: { dev, zone, auto, missing } - * home: [{ dev, auto, nets, zone, missing }] - * nets: home networks (collapsed), zones: their firewall zones - */ -export function server_net(srv, snap) { - snap ??= snapshot(); - let devs = snap.devices; - - let wan_dev = srv.auto_wan ? (snap.wan ?? srv.detected_wan) : srv.wan_device; - let wan = { - dev: wan_dev || null, - auto: !!srv.auto_wan, - zone: devs[wan_dev]?.zone ?? srv.wan_zone ?? 'wan', - missing: !!wan_dev && !devs[wan_dev], - }; - - let picked = []; - let auto_lan = srv.auto_lan ? (snap.lan ?? srv.detected_lan) : null; - if (auto_lan) - push(picked, [ auto_lan, true ]); - for (let d in srv.lan_devices ?? []) - if (d != auto_lan) - push(picked, [ d, false ]); - - let home = [], nets = [], zones = []; - for (let p in picked) { - let dev = p[0]; - // Never the WAN, the tunnel itself, or a bridge port (routing only sees the bridge). - if (dev == wan.dev || dev == srv.ifname || devs[dev]?.master) - continue; - let d = devs[dev]; - // The detected LAN missing for a moment (bridge recreated) keeps its zone, - // so its forwardings are not removed meanwhile. - let h = { dev, auto: p[1], nets: d?.nets ?? [], zone: d?.zone ?? (p[1] ? srv.lan_zone : null), missing: !d }; - push(home, h); - push(nets, ...h.nets); - if (h.zone) - push(zones, h.zone); - } - // Older configs and routers where nothing could be resolved: the zone set at setup. - if (!length(home) && srv.auto_lan && srv.lan_zone) - push(zones, srv.lan_zone); - return { wan, home, nets: collapse(nets), zones: uniq(zones) }; -}; - -/** Router address on the home network (DNS for tunnel clients). */ -export function home_address(srv, snap) { - snap ??= snapshot(); - let sn = server_net(srv, snap); - for (let h in sn.home) - for (let a in snap.devices[h.dev]?.addrs ?? []) - return split(a, '/')[0]; - return null; -}; - -/** WAN IPv4 address of a server's WAN interface. */ -export function wan_address(srv, snap) { - snap ??= snapshot(); - let a = snap.devices[server_net(srv, snap).wan.dev]?.addrs?.[0]; - return a ? split(a, '/')[0] : null; -}; - -/** Names of devices at home by address: DHCP leases, then static hosts. */ -export function lan_names() { - let out = {}; - for (let line in split(readfile('/tmp/dhcp.leases') ?? '', '\n')) { - let f = split(line, ' '); - if (length(f) >= 4 && f[3] != '*') - out[f[2]] = f[3]; - } - let c = cursor(); - c.foreach('dhcp', 'host', (h) => { - if (h.ip && h.name) - out[h.ip] ??= h.name; - }); - return out; -}; - -// A module constant, compiled once: event_hosts runs for every event of the log. -const ANY_IPV4 = /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/g; - -/** Event addresses that belong to devices at home, with their names ({ ip: name }). */ -export function event_hosts(e, names) { - let out = null; - for (let ip in match(e.detail ?? '', ANY_IPV4) ?? []) - if (names[ip[0]]) - (out ??= {})[ip[0]] = names[ip[0]]; - return out; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc deleted file mode 100644 index 0247ab3..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/netifd.uc +++ /dev/null @@ -1,185 +0,0 @@ -// Dawnline — netifd: one AmneziaWG interface per server, named after its -// ifname and marked `_dawnline` = server id. Only interfaces Dawnline created -// are changed or removed: a name already used by another interface (`lan`, a -// tunnel of your own, one from an imported config) is left alone and the -// server is reported instead. Why a server is kept down is kept in -// core.BLOCKED as a code with its values (awg.blocked_text says it). -// drift() tells the watchdog when one of them was edited outside Dawnline. - -import { cursor } from 'uci'; -import { stat, unlink, writefile } from 'fs'; -import { q, uci_put, uci_section, ack_config, iface_intent, ensure_dir, read_json, write_json, slog, syslog, opts_text, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import { L_ } from 'dawnline.i18n'; - -// Set while AmneziaWG is missing and that was logged (once until it is back). -const NO_AWG = `${RUN_DIR}/netifd-no-awg`; - -function log(who, msg, level, detail) { - slog('dawnline', level ?? 'info', msg, detail, who); -} - -/** The server id that owns network.: null when the section is free, '' when someone else's. */ -export function owner(ifname, c) { - if (!c) { - c = cursor(); - c.load('network'); - } - if (c.get('network', ifname) == null) - return null; - return c.get('network', ifname, '_dawnline') ?? ''; -}; - -/** What sync() writes into network. apart from the markers: what netifd sets the tunnel up from. */ -function options(srv) { - let o = awg.netifd_options(srv); - o.disabled = srv.enabled ? null : '1'; - o.auto = srv.enabled ? null : '0'; - return o; -} - -/** Bring network config in line with the servers; true when it changed. */ -export function sync(m) { - let c = cursor(); - c.load('network'); - let changed = false, touched = [], want = {}; - // Servers whose interface can't be set up (core.BLOCKED), each logged once while it lasts. - let was = read_json(core.BLOCKED, {}), blocked = {}; - let block = (srv, why, detail) => { - blocked[srv.id] = why; - // The rest of this apply works from the same model: no tunnel for it there either. - srv.blocked = why; - if (sprintf('%J', was[srv.id]) != sprintf('%J', why)) - log(srv.name, awg.blocked_note(why), 'error', detail); - }; - - // Without amneziawg-tools there is no protocol script: changing or bringing - // up an interface would only stop a tunnel that is still running. - let tools = awg.state().tools; - if (tools && stat(NO_AWG)) - unlink(NO_AWG); - else if (!tools && length(filter(values(m.servers), (s) => s.private_key)) && !stat(NO_AWG)) { - log('AmneziaWG', L_("isn't installed: tunnels were left as they are"), 'error', L_('Install it in Dawnline → Components.')); - ensure_dir(RUN_DIR); - writefile(NO_AWG, `${time()}`); - } - - for (let id, srv in m.servers) { - if (!srv.private_key) - continue; - let ifn = srv.ifname; - if (!core.valid_ifname(ifn)) { - block(srv, { code: 'ifname', ifname: ifn }, 'Interface name: 1-12 lowercase letters, digits or _.'); - continue; - } - let own = owner(ifn, c); - if (own != null && own != id) { - block(srv, { code: 'taken', ifname: ifn }, - 'Dawnline never changes interfaces it did not create. Choose another interface name for this server.'); - continue; - } - // Disguise values AmneziaWG refuses or crashes on (a hand edit in uci; - // import and restore refuse them) never reach setconf and the kernel. - // A disguise this build cannot run (a 3.1 preset after a rollback to - // 2.0): the kernel would drop those options silently and run a tunnel - // no device can reach. Down, and said so, until the build or the - // disguise is changed. - let why = !tools ? null : length(awg.obf_unsafe(srv.obf)) ? { code: 'disguise_invalid' } : awg.obf_unsupported(srv.obf); - if (why) { - block(srv, why, awg.blocked_fix(why)); - continue; - } - delete srv.blocked; - want[ifn] = true; - if (!tools) - continue; - // Per server: with several, each changed one has to be brought up again. - let created = uci_section(c, 'network', ifn, 'interface'); - let mine = created, diff = {}; - for (let k, v in options(srv)) - if (uci_put(c, 'network', ifn, k, v)) { - mine = true; - diff[k] = v; - } - if (mine) - syslog('info', 'network', `interface ${ifn} (${srv.name}): ${created ? 'created' : 'updated'} · ${opts_text(diff)}`); - else - syslog('debug', 'network', `interface ${ifn} (${srv.name}): unchanged · ${opts_text(options(srv))}`); - // The markers are saved, but netifd does not read them: a renamed server - // keeps its tunnel and every session in it. - if (uci_put(c, 'network', ifn, '_dawnline', id)) - changed = true; - // For the log once the server is gone. - if (uci_put(c, 'network', ifn, '_dawnline_name', srv.name)) - changed = true; - if (mine) { - changed = true; - push(touched, ifn); - // The hotplug log says why the tunnel goes down (not a failure). - iface_intent(ifn, srv.enabled ? 'settings' : 'off', srv.name); - } - } - - if (sprintf('%J', blocked) != sprintf('%J', was)) { - ensure_dir(RUN_DIR); - write_json(core.BLOCKED, blocked, 0o644); - } - - // Remove interfaces Dawnline created for servers that no longer exist. - let stale = []; - c.foreach('network', 'interface', (s) => { - if (s._dawnline && !want[s['.name']]) - push(stale, s['.name']); - }); - for (let ifn in stale) { - iface_intent(ifn, 'removed', c.get('network', ifn, '_dawnline_name') ?? ifn); - syslog('info', 'network', `interface ${ifn} (${c.get('network', ifn, '_dawnline_name') ?? 'a removed server'}): removed, ifdown ${ifn}`); - system(`ifdown ${q(ifn)} 2>/dev/null`); - c.delete('network', ifn); - changed = true; - } - - if (changed) { - c.commit('network'); - ack_config([ 'network' ]); - } - // Only the markers changed: nothing for netifd to read (it ignores them, and so does a reload). - if (length(touched) || length(stale)) { - syslog('info', 'network', 'ubus call network reload'); - system('ubus call network reload'); - for (let ifn in touched) - if (m.servers[c.get('network', ifn, '_dawnline')]?.enabled) { - syslog('info', 'network', `ifup ${ifn}`); - system(`ifup ${q(ifn)}`); - } - // Each tunnel's own line (restarting, turned off, removed) comes from hotplug. - } - return changed; -}; - -/** - * For the watchdog: what of each running server's interface differs from - * what sync() writes, by option name (a LuCI or uci edit of network., - * which would otherwise last until the next apply): { server id: [ names ] }, - * an empty list when it is as Dawnline set it. Only enabled servers whose - * section exists and is theirs (a missing one is the tunnel probe's); the - * markers are not compared, netifd does not read them. A dry run on a - * cursor of its own: nothing is saved. Meaningful while amneziawg-tools is - * installed (sync() leaves the interfaces alone without it). - */ -export function drift(m) { - let c = cursor(); - c.load('network'); - let out = {}; - for (let id, srv in m.servers) { - if (!srv.enabled || !length(core.tunnels(srv)) || owner(srv.ifname, c) != id || c.get('network', srv.ifname) != 'interface') - continue; - let diff = []; - for (let k, v in options(srv)) - if (uci_put(c, 'network', srv.ifname, k, v)) - push(diff, k); - out[id] = diff; - } - return out; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/nft.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/nft.uc deleted file mode 100644 index aa9e14b..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/nft.uc +++ /dev/null @@ -1,353 +0,0 @@ -// Dawnline — the nft table `inet dawnline`: each person's access, enforced -// on the tunnel interfaces before anything else on the router sees the -// traffic, and where tunnel DNS goes. Its shape follows the servers and their -// home networks (rebuild); who is in which set follows people's state and -// changes often (update, one atomic transaction). - -import { unlink } from 'fs'; -import { sh, ensure_dir, write_file, rand_hex, ip2int, uniq, read_json, write_json, syslog, syslog_lines, some_of, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as net from 'dawnline.net'; -import * as loop from 'dawnline.loop'; - -/** Private IPv4 ranges: internet people never reach them (awg.BYPASS4 is the rest). */ -export const PRIVATE4 = [ '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', '100.64.0.0/10', '169.254.0.0/16', '224.0.0.0/3' ]; -/** The sets whose members change at run time (update replaces them together). */ -const SETS = [ 'lan_ok', 'lan_all', 'lan_part', 'mesh_pairs', 'inet_ok', 'svc_ok', 'svc_host', 'dns_real' ]; -// The sets' members as last loaded, so a log line can say what changed. -const SETS_SEEN = `${RUN_DIR}/nft-sets.json`; - -/** What a table script holds: its chains, its sets and the rules in its chains (for a log line). */ -export function shape(t) { - let n = { chains: 0, sets: 0, rules: 0 }, in_chain = false; - for (let l in split(t ?? '', '\n')) { - l = trim(l); - if (substr(l, 0, 6) == 'chain ') { - n.chains++; - in_chain = true; - } - else if (substr(l, 0, 4) == 'set ') - n.sets++; - else if (in_chain && l == '}') - in_chain = false; - else if (in_chain && l != '' && substr(l, 0, 5) != 'type ' && substr(l, 0, 7) != 'policy ' && substr(l, 0, 1) != '#') - n.rules++; - } - return n; -}; - -/** - * The sets in syslog: info with each set that changed ("inet_ok 3 → 4: +10.8.0.5"), - * debug when none did; remembered for the next time. - */ -function log_sets(sets, how) { - let first = read_json(SETS_SEEN, null) == null; - let was = read_json(SETS_SEEN, {}), now = {}, diff = []; - for (let name in SETS) { - let a = uniq(was[name] ?? []), b = uniq(sets[name] ?? []); - now[name] = b; - let add = filter(b, (x) => index(a, x) < 0), del = filter(a, (x) => index(b, x) < 0); - if (length(add) || length(del)) - push(diff, `${name} ${length(a)} → ${length(b)}${length(add) ? ': +' + some_of(add) : ''}${length(del) ? (length(add) ? ' ' : ': ') + '-' + some_of(del) : ''}`); - } - write_json(SETS_SEEN, now, 0o600); - // The first load since the router started: how many in each set (the members at debug). - if (first) { - syslog('info', 'nftables', `table inet dawnline: ${how} · ${join(', ', map(SETS, (n) => `${n} ${length(now[n])}`))}`); - for (let n in SETS) - if (length(now[n])) - syslog('debug', 'nftables', `set ${n}: ${join(' ', now[n])}`); - } - else if (length(diff)) - syslog('info', 'nftables', `table inet dawnline: ${how} · ${join('; ', diff)}`); - else - syslog('debug', 'nftables', `table inet dawnline: ${how} · sets unchanged (${join(', ', map(SETS, (n) => `${n} ${length(now[n])}`))})`); -} - -function ip4(a) { - return ip2int(a ?? '') != null; -} - -/** - * Per-person runtime membership: which tunnel addresses may reach what. - * `snap` is the network (net.snapshot() when not given). - */ -export function access_sets(m, usage, states, snap) { - // lan_ok: home access (the router itself, the mesh); lan_all: every home - // network; lan_part: device . network for people limited to some networks; - // mesh_pairs: device . device within a circle (or one person's own devices); - // svc_ok: device . service . port; svc_host: device . service with no ports (all of them). - let sets = {}; - for (let k in SETS) - sets[k] = []; - snap ??= net.snapshot(); - let homes = {}, groups = {}; - for (let id, d in m.devices) { - let p = m.people[d.person]; - // Off: paused, ended, over quota or out of hours. Addresses go into nft as they are: IPv4 only. - if (!p || d.disabled || !ip4(d.address) || states[p.id] != 'active') - continue; - // Home names: the plain resolver (their internet does not use the tunnel). - if (p.access == 'lan' && p.dns_mode == 'home') - push(sets.dns_real, d.address); - if (p.access == 'internet' || p.access == 'both') - push(sets.inet_ok, d.address); - if (p.access == 'both' || (p.access == 'lan' && !length(p.services))) { - push(sets.lan_ok, d.address); - let srv = m.servers[p.server]; - let h = homes[p.id] ??= srv ? core.person_home(srv, p, snap) : { all: true, nets: [] }; - if (h.all) - push(sets.lan_all, d.address); - else - for (let n in h.nets) - push(sets.lan_part, `${d.address} . ${n}`); - // Who this device may reach directly: its circle, or at least its owner's devices. - if (srv?.mesh == 'circles') { - let ci = core.person_circle(m, p); - push(groups[ci ? `c:${ci.id}` : `p:${p.id}`] ??= [], d.address); - } - } - else if (p.access == 'lan') - for (let sid in p.services) { - let s = m.services[sid]; - if (!s || !ip4(s.address)) - continue; - if (!length(s.ports)) - push(sets.svc_host, `${d.address} . ${s.address}`); - for (let port in s.ports) - if (match(port, /^[0-9]+$/)) - push(sets.svc_ok, `${d.address} . ${s.address} . ${port}`); - } - } - for (let g, addrs in groups) - for (let a in addrs) - for (let b in addrs) - if (a != b) - push(sets.mesh_pairs, `${a} . ${b}`); - return sets; -}; - -// Duplicate members (two devices with one address) would make the whole load fail. -function set_elems(arr) { - arr = uniq(arr); - return length(arr) ? `elements = { ${join(', ', arr)} }` : ''; -} - -/** The portal's TCP ports people may reach through the tunnel (never SSH, DNS or LuCI, whatever is stored). */ -function portal_ports(m) { - if (!m.settings.portal_enabled) - return []; - let ok = (p) => p >= 1 && p <= 65535 && index([ 22, 53, 80, 443 ], p) < 0; - let ports = filter([ m.settings.portal_port ], ok); - if (core.portal_http(m) && ok(core.portal_http_port(m))) - push(ports, core.portal_http_port(m)); - return ports; -} - -/** - * What the table is made from besides the model, read from the router: the - * netns's DNS address (loop.client_dns), where the Home-only resolver runs - * (loop.resolver_target), the LAN's DNS and the network snapshot. - */ -function router_ctx() { - return { dns_addr: loop.client_dns(), resolver: loop.resolver_target(), lan_dns: loop.lan_dns(), snap: net.snapshot() }; -} - -function table(m, sets, ctx) { - ctx ??= router_ctx(); - let ifs = [], tun = []; - let dns_addr = ctx.dns_addr; - if (!ip4(dns_addr)) - dns_addr = null; - let rt = ctx.resolver; - let snap = ctx.snap; - // Each server's home networks are its own: with several servers, "all - // home" on one never reaches the other's networks (set lan_). - let homes = {}; - for (let id, srv in m.servers) { - // Only valid interface names reach here (core.tunnels): they are written into the rules as strings. - let tns = core.tunnels(srv); - for (let t in tns) { - push(ifs, `"${t.ifname}"`); - push(tun, t.subnet); - } - if (length(tns)) - homes[id] = net.collapse(net.server_net(srv, snap).nets); - } - tun = net.collapse(tun); - let t = []; - push(t, 'table inet dawnline {'); - for (let id, nets in homes) - push(t, ` set home_${id} { type ipv4_addr; flags interval; auto-merge; ${set_elems(nets)} }`); - // Tunnel subnets are never "home", even inside a wider route to the LAN. - push(t, ` set tun_nets { type ipv4_addr; flags interval; auto-merge; ${set_elems(tun)} }`); - push(t, ` set lan_ok { type ipv4_addr; ${set_elems(sets.lan_ok)} }`); - push(t, ` set lan_all { type ipv4_addr; ${set_elems(sets.lan_all)} }`); - push(t, ` set lan_part { type ipv4_addr . ipv4_addr; flags interval; ${set_elems(sets.lan_part)} }`); - push(t, ` set mesh_pairs { type ipv4_addr . ipv4_addr; ${set_elems(sets.mesh_pairs)} }`); - push(t, ` set inet_ok { type ipv4_addr; ${set_elems(sets.inet_ok)} }`); - push(t, ` set svc_ok { type ipv4_addr . ipv4_addr . inet_service; ${set_elems(sets.svc_ok)} }`); - push(t, ` set svc_host { type ipv4_addr . ipv4_addr; ${set_elems(sets.svc_host)} }`); - push(t, ` set dns_real { type ipv4_addr; ${set_elems(sets.dns_real)} }`); - push(t, ' chain pre {'); - // Ahead of mangle-priority hooks (transparent proxies mark at -150). - push(t, ' type filter hook prerouting priority -160; policy accept;'); - if (length(ifs)) - push(t, ` iifname { ${join(', ', ifs)} } jump guard`); - push(t, ' }'); - push(t, ' chain guard {'); - push(t, ' meta nfproto ipv6 drop'); - // Every packet is judged by the rules below, not only the first of a - // connection: a change of access cuts open connections too, instead of - // letting a session or a long UDP flow run on for days. Only what has no - // rule of its own passes on its connection: errors and the like, answers - // to the admin's port forwards, and the router's own pings. - push(t, ' ct state related accept'); - push(t, ' ct status dnat accept'); - push(t, ' icmp type { echo-request, echo-reply } fib daddr type local accept'); - push(t, ' fib daddr type local meta l4proto { tcp, udp } th dport 53 accept'); - let pp = portal_ports(m); - if (length(pp)) - // Their own portal, also with the VPN on (the address may be this router's). - push(t, ` fib daddr type local tcp dport { ${join(', ', pp)} } accept`); - // The router itself is part of home: for everyone with all of it, and for - // people limited to some networks only on the addresses in those. - push(t, ' fib daddr type local ip saddr @lan_all accept'); - push(t, ' fib daddr type local ip saddr . ip daddr @lan_part accept'); - push(t, ' fib daddr type local counter drop'); - if (dns_addr) - // DNS through the netns (it forwards to the LAN's DNS), for everyone. - push(t, ` ip daddr ${dns_addr} meta l4proto { tcp, udp } th dport 53 accept`); - for (let id, nets in homes) - for (let tn in core.tunnels(m.servers[id])) - push(t, ` iifname "${tn.ifname}" ip daddr @home_${id} ip daddr != @tun_nets ip saddr @lan_all accept`); - push(t, ' ip saddr . ip daddr @lan_part ip daddr != @tun_nets accept'); - // Devices with home access are part of home: they reach each other, where the - // server allows it (everyone, or within circles). Within one server: the - // firewall has no forwarding between different servers' zones. - for (let id, srv in m.servers) - for (let tn in core.tunnels(srv)) - if (srv.mesh == 'all') - push(t, ` iifname "${tn.ifname}" ip saddr @lan_ok ip daddr @lan_ok accept`); - else if (srv.mesh == 'circles') - push(t, ` iifname "${tn.ifname}" ip saddr . ip daddr @mesh_pairs accept`); - push(t, ' meta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept'); - push(t, ' ip saddr . ip daddr @svc_host accept'); - push(t, ` ip daddr { ${join(', ', PRIVATE4)} } counter drop`); - push(t, ' ip saddr @inet_ok accept'); - push(t, ' counter drop'); - push(t, ' }'); - // The other way: fw4 lets the server's home zones reach the tunnel; here - // only connections from its home networks to people with home access pass - // (paused, ended and internet-only people are not reachable). The admin's - // own port forwards (DNAT) stay with fw4. - push(t, ' chain inbound {'); - push(t, ' type filter hook forward priority filter - 5; policy accept;'); - if (length(ifs)) - push(t, ` oifname { ${join(', ', ifs)} } iifname != { ${join(', ', ifs)} } ct state new jump to_device`); - push(t, ' }'); - push(t, ' chain to_device {'); - push(t, ' meta nfproto ipv6 drop'); - push(t, ' ct status dnat accept'); - for (let id, nets in homes) - for (let tn in core.tunnels(m.servers[id])) - push(t, ` oifname "${tn.ifname}" ip saddr @home_${id} ip saddr != @tun_nets ip daddr @lan_all accept`); - push(t, ' ip daddr . ip saddr @lan_part ip saddr != @tun_nets accept'); - push(t, ' counter reject with icmpx admin-prohibited'); - push(t, ' }'); - // Devices ask the tunnel address; send each query where it belongs. - let to_resolver = rt.mode == 'ns' && ip4(rt.address) ? `dnat ip to ${rt.address}:53` : `redirect to :${+rt.port}`; - let lan_dns = ctx.lan_dns; - if (!ip4(lan_dns)) - lan_dns = null; - push(t, ' chain dns {'); - push(t, ' type nat hook prerouting priority dstnat - 5; policy accept;'); - if (length(ifs)) - // Home names (and no LAN DNS at all): the plain resolver, whatever address was asked. - push(t, ` iifname { ${join(', ', ifs)} } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 ${to_resolver}`); - push(t, ' }'); - // After the LAN's own DNS interceptors (transparent proxies redirect port 53 - // at dstnat - 1): only the first NAT of a connection counts, so a DNAT here - // first would hand the query to the plain resolver behind their back. When - // none of them takes the tunnel, this sends it to the LAN's DNS. - push(t, ' chain dns_lan {'); - push(t, ' type nat hook prerouting priority dstnat + 5; policy accept;'); - for (let id, srv in m.servers) - for (let tn in core.tunnels(srv)) { - // Everyone else: the LAN's DNS, through the netns (from the LAN side) when internet goes that way. - let target = srv.lan_like && dns_addr ? `dnat ip to ${dns_addr}:53` : lan_dns ? `dnat ip to ${lan_dns}:53` : to_resolver; - push(t, ` iifname "${tn.ifname}" ip daddr ${tn.address} meta l4proto { tcp, udp } th dport 53 ${target}`); - } - push(t, ' }'); - push(t, '}'); - return join('\n', t) + '\n'; -} - -/** Run an nft script (one transaction); null when it loaded, else what nft said. */ -export function load(script) { - ensure_dir(RUN_DIR); - // A file of its own: two writers must never load each other's script. - let f = `${RUN_DIR}/nft.${rand_hex(4)}.rules`; - if (!write_file(f, script)) - return `couldn't write ${f}`; - let r = sh(`nft -f ${f}`); - unlink(f); - if (r.code == 0) - return null; - // Without the random file name, so the same failure reads the same every time. - return replace(trim(r.out), f, 'rules') || `nft exited with ${r.code}`; -}; - -/** - * The table as text, for a check (`nft -c -f`) or a test; nothing is loaded. - * `ctx` (a test's) stands for what is read from the router: { dns_addr, - * resolver, lan_dns, snap } (router_ctx). - */ -export function render(m, sets, ctx) { - return table(m, sets, ctx); -}; - -/** Full table rebuild (structure changes: servers, home networks, DNS paths); null or the error. */ -export function rebuild(m, sets) { - let t = table(m, sets); - let err = load('table inet dawnline\ndelete table inet dawnline\n' + t); - if (err) { - syslog('error', 'nftables', `table inet dawnline: rebuild failed · ${err}`); - return err; - } - let n = shape(t); - syslog('info', 'nftables', sprintf('table inet dawnline: rebuilt · %d chains, %d sets, %d rules', n.chains, n.sets, n.rules)); - syslog_lines('debug', 'nftables', t, 'nft: '); - log_sets(sets, 'sets loaded with the table'); - return null; -}; - -/** - * Replace the members of every runtime set at once; null or the error. Fails - * as a whole when the table or one of its sets is missing (not loaded yet, - * or an older shape): the caller then rebuilds. - */ -export function update(sets) { - let s = ''; - for (let name in SETS) { - let members = uniq(sets[name]); - s += `flush set inet dawnline ${name}\n`; - if (length(members)) - s += `add element inet dawnline ${name} { ${join(', ', members)} }\n`; - } - let err = load(s); - if (err) - syslog('warn', 'nftables', `table inet dawnline: set update failed, rebuilding · ${err}`); - else - log_sets(sets, 'sets updated'); - return err; -}; - -/** Is the table loaded (watchdog). */ -export function present() { - return system('nft list table inet dawnline >/dev/null 2>&1') == 0; -}; - -export function remove() { - system('nft delete table inet dawnline 2>/dev/null'); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc deleted file mode 100644 index a1f6178..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/pkg.uc +++ /dev/null @@ -1,207 +0,0 @@ -// Dawnline — one interface over the router's package manager: opkg on -// OpenWrt 24.10, apk on 25.12. Commands that change packages take a log(line) -// callback, which gets their output line by line. - -import { access, popen, stat } from 'fs'; -import { q } from 'dawnline.util'; -import { _ } from 'dawnline.i18n'; - -function run(cmd) { - let p = popen(cmd + ' 2>&1', 'r'); - if (!p) - return { code: 127, out: '' }; - let out = p.read('all') ?? ''; - return { code: p.close(), out }; -} - -function logged(cmd, log) { - let r = run(cmd); - for (let line in split(trim(r.out), '\n')) - if (length(trim(line))) - log?.(` ${line}`); - return r; -} - -export function is_apk() { - return access('/usr/bin/apk', 'x'); -}; - -export function ext() { - return is_apk() ? 'apk' : 'ipk'; -}; - -/** The installed version of a package, or null. */ -export function version(name) { - let esc = replace(name, /[.+]/g, '\\$&'); - if (is_apk()) { - let m = match(run(`apk list --installed ${q(name)}`).out, regexp(`^${esc}-([^ ]+) `)); - return m ? m[1] : null; - } - // Libraries carry their ABI in the name (libustream-openssl20201210). - let re = regexp(`^${esc}([0-9]+)? - (.+)$`), found = null; - for (let line in split(run('opkg list-installed').out, '\n')) { - let m = match(trim(line), re); - if (m && (found == null || m[1] == null)) - found = m; - } - return found ? trim(found[2]) : null; -}; - -/** - * The package a control text names: { name, version }, each null when it - * does not say. Pure: an ipk's control file (ipk true), else `apk adbdump` - * of an apk, whose first name and version are the package's own (its files - * are "- name:" entries further down). - */ -export function control_info(text, ipk) { - if (ipk) - return { name: match(text, /(^|\n)Package: *([^\n]+)/)?.[2], version: match(text, /(^|\n)Version: *([^\n]+)/)?.[2] }; - return { name: match(text, /\n *name: *([^\n]+)/)?.[1], version: match(text, /\n *version: *([^\n]+)/)?.[1] }; -}; - -/** The package inside a file: { name, version }, each null when the file does not say. */ -export function file_info(path) { - if (match(path, /\.ipk$/)) - return control_info(run(`tar -xzOf ${q(path)} ./control.tar.gz | tar -xzO ./control`).out, true); - return control_info(run(`apk adbdump ${q(path)}`).out, false); -}; - -/** The version inside a package file, or null. */ -export function file_version(path) { - return file_info(path).version; -}; - -/** - * Compare two package versions the way the package manager does (so -r10 is - * newer than -r9 and ~rc before the release): -1, 0 or 1; null when unknown. - */ -export function cmp(a, b) { - if (a == null || b == null) - return null; - if (a == b) - return 0; - if (is_apk()) { - let r = trim(run(`apk version -t ${q(a)} ${q(b)}`).out); - return r == '<' ? -1 : r == '>' ? 1 : r == '=' ? 0 : null; - } - if (run(`opkg compare-versions ${q(a)} '<<' ${q(b)}`).code == 0) - return -1; - if (run(`opkg compare-versions ${q(a)} '>>' ${q(b)}`).code == 0) - return 1; - return 0; -}; - -export function refresh(log) { - return logged(is_apk() ? 'apk update' : 'opkg update', log).code == 0; -}; - -/** Free space on the overlay in KB (null when unknown). */ -function overlay_free_kb() { - let out = run('df -Pk /overlay 2>/dev/null || df -Pk / 2>/dev/null').out; - let m = match(out, /\n\S+\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s/); - return m ? +m[1] : null; -} - -/** - * Room for `files` (or `need_kb` from the feeds): the package manager - * unpacks before it removes, so a full flash leaves half an install behind. - * Dies with the numbers. - */ -function preflight(files, need_kb, log) { - let free = overlay_free_kb(); - if (free == null) - return; - let need = need_kb ?? 512; - for (let f in files ?? []) - need += int(((stat(f)?.size ?? 0) * 3) / 1024); - if (free < need) - die(sprintf(_('Not enough free space on the router: %d MB free, about %d MB needed. Remove old backups or packages first'), - int(free / 1024), int(need / 1024) + 1)); - log?.(' ' + sprintf(_('%d MB free on the overlay'), int(free / 1024))); -} - -/** Dawnline's own package: a file of it tells whether apk really reinstalled it. */ -const SELF = 'luci-app-dawnline', SELF_MARKER = '/usr/share/ucode/dawnline/util.uc'; - -/** - * The packages an apk install did not leave at their file's version: apk - * takes a given file as it is (an older version too, a rollback) but leaves - * an installed version alone, whatever the file. Pure: want [{ name, - * version, file }] from the files (file_info()), have { name: installed - * version }. [] when every package took. - */ -export function mismatched(want, have) { - return filter(want, (w) => w.name == null || w.version == null || have?.[w.name] != w.version); -}; - -/** - * Package files (from a release): true when every one is installed. force - * also reinstalls the same version or goes back to an older one (opkg; apk - * takes a file as it is: Dawnline's own package is checked by a file of it, - * any other by its installed version). - */ -export function install_files(files, force, log) { - preflight(files, 0, log); - let args = join(' ', map(files, q)); - if (!is_apk()) - return logged(`opkg install ${force ? '--force-reinstall --force-downgrade ' : ''}${args}`, log).code == 0; - let want = map(files, (f) => ({ ...file_info(f), file: f })); - let own = length(filter(want, (w) => w.name == SELF)) > 0; - // Dawnline's own reinstall that changed nothing is a failure, not a silent "done". - let before = own && force ? stat(SELF_MARKER)?.mtime : null; - if (logged(`apk add --allow-untrusted ${args}`, log).code != 0) - return false; - if (own) { - if (force && before != null && stat(SELF_MARKER)?.mtime == before) { - log?.(' ' + _('apk did not reinstall the version that is already installed')); - die(_("apk doesn't reinstall an installed version. Install a different release, or run install.sh on the router")); - } - return true; - } - // Any other package took when it is at its file's version (the same - // version again counts: apk keeps the installed one). - let have = {}; - for (let w in want) - if (w.name != null) - have[w.name] = version(w.name); - let bad = mismatched(want, have); - for (let w in bad) - log?.(' ' + sprintf(_('apk did not install %s %s (installed: %s)'), w.name ?? w.file, w.version ?? '?', have[w.name] ?? '-')); - return !length(bad); -}; - -/** Packages by name from the feeds. */ -export function add(names, log) { - preflight(null, 2048, log); - return logged(is_apk() ? `apk add ${join(' ', map(names, q))}` : `opkg install ${join(' ', map(names, q))}`, log).code == 0; -}; - -export function upgrade(names, log) { - preflight(null, 2048, log); - return logged(is_apk() ? `apk upgrade ${join(' ', map(names, q))}` : `opkg upgrade ${join(' ', map(names, q))}`, log).code == 0; -}; - -export function remove(names, log) { - return logged(is_apk() ? `apk del ${join(' ', map(names, q))}` : `opkg remove ${join(' ', map(names, q))}`, log).code == 0; -}; - -/** Installed packages with a newer version in the feeds: { name: latest }. */ -export function upgradable() { - let up = {}; - if (is_apk()) { - for (let line in split(run('apk version -l "<"').out, '\n')) { - // "name-version-rN < newer": the version is what follows the last dash - // before the release suffix (a name may hold digits, a version no dash). - let m = match(line, /^(\S+)-([^- ]+-r[0-9]+)\s+<\s+(\S+)/); - if (m) - up[m[1]] = m[3]; - } - } - else - for (let line in split(run('opkg list-upgradable').out, '\n')) { - let m = match(line, /^(\S+) - (\S+) - (\S+)/); - if (m) - up[m[1]] = m[3]; - } - return up; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc deleted file mode 100644 index 39ce6f1..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portal.uc +++ /dev/null @@ -1,624 +0,0 @@ -// Dawnline — the personal portal. -// -// GET / the app shell -// GET //assets/ its script and styles (gzipped when the browser takes it) -// GET //api/state -// POST //api/devices { name, kind, public_key?, lan_bypass? } -// GET //api/devices//config -// POST //api/devices/ { action: rename|reconnect|bypass|delete, name?, kind?, lan_bypass?, on? } -// -// The personal link is the key: every request carries its code, there are -// no sessions. Without a valid code every path answers the same bare 404 — -// the root, a person's link, the API and the assets alike — so nothing tells -// a scanner there is a portal here. Wrong codes are rate-limited per client -// (blocked clients get the same 404 even with the right code): per IPv4 -// address or IPv6 /64; behind Cloudflare per visitor (CF-Connecting-IP), with -// a higher ceiling for all Cloudflare visitors together. -// Regenerating the code in LuCI locks the old link out at once. POST bodies -// must be JSON from the same origin; Referrer-Policy keeps the code out of -// other sites' logs. The portal can only manage the person's own devices -// within their limits, and not those the admin turned off (dawnline.devices). -// -// Changes through a link are limited too (a link is not a terminal: a few -// dozen every quarter hour), and the configurations themselves (keys, the -// disguise) only go over HTTPS: a plain-HTTP link (an IP address in Settings) -// shows the page, but gets them from its HTTPS twin. -// -// Messages go out in the page's language (Accept-Language: the portal's -// fetch sends the visitor's choice) when a Dawnline translation for it is -// installed; else in English, and the page translates the ones it knows. -// -// handle() serves one request: `io` = { env, headers, read(n), write(s) }; the -// CGI script (cgi.uc) is its wrapper, behind the shell door www/cgi-bin/portal -// that answers anything not shaped like a link (its not_found() twin). - -import { stat, readfile } from 'fs'; -import { read_json, write_json, ensure_dir, lock, unlock, cloudflare_ip, ip2int, today, syslog, VERSION, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as live from 'dawnline.live'; -import * as lookup from 'dawnline.lookup'; -import * as view from 'dawnline.view'; -import * as schema from 'dawnline.schema'; -import * as devices from 'dawnline.devices'; -import * as i18n from 'dawnline.i18n'; -import { _ } from 'dawnline.i18n'; - -const RATE = `${RUN_DIR}/portal-rate.json`; -const ASSETS = '/usr/share/dawnline/portal/assets'; -const TYPES = { js: 'text/javascript', css: 'text/css', png: 'image/png' }; -const FAIL_LIMIT = 8; -const FAIL_WINDOW = 900; -// All Cloudflare visitors together (three-word codes can't be guessed anyway). -const SHARED_LIMIT = FAIL_LIMIT * 25; -const SHARED_KEY = 'cloudflare'; -// Clients remembered at most (the oldest go first). -const RATE_MAX = 2000; -// Changes one link may make within FAIL_WINDOW (each one writes flash and syncs the tunnels). -const ACTION_LIMIT = 40; -const BODY_MAX = 8192; -// The early end of a request (a response was written). -const DONE = '__dawnline_done__'; - -const SECURITY_HEADERS = { - 'X-Content-Type-Options': 'nosniff', - 'Referrer-Policy': 'no-referrer', - 'X-Frame-Options': 'DENY', - 'Cache-Control': 'no-store', -}; - -// States the admin stopped the person in: the portal only shows, it changes nothing. -const LOCKED = [ 'paused', 'expired' ]; - -/** Why a stopped person (a LOCKED state) can't change anything, in the visitor's language; null for other states. */ -function locked_reason(st) { - if (st == 'paused') - return _('Your access is paused.'); - if (st == 'expired') - return _('Your access has ended.'); - return null; -} - -/** Why a new device or a new set-up is refused while the router has no AmneziaWG. */ -function not_ready() { - return _("Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link."); -} - -function html_escape(s) { - return replace(`${s}`, /[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]); -} - -/* ---------- answering ---------- */ - -function headers(r, status, extra) { - let h = `Status: ${status}\r\n`; - let all = { ...SECURITY_HEADERS, ...(extra ?? {}) }; - // HSTS pins the whole name: only when the visitor is on the standard port. - if (r.hsts) - all['Strict-Transport-Security'] = 'max-age=31536000'; - for (let k, v in all) - h += `${k}: ${v}\r\n`; - r.io.write(h + '\r\n'); -} - -function finish() { - die(DONE); -} - -function send_json(r, status, obj) { - headers(r, status, { 'Content-Type': 'application/json' }); - r.io.write(sprintf('%J', obj)); - finish(); -} - -function fail(r, status, msg) { - send_json(r, status, { error: msg }); -} - -/** - * The one answer for anything without a valid code: a bare 404, or the redirect from Settings. - * Files always get the 404: a missing asset must not turn into someone's website. - */ -function not_found(r) { - let redirect = r.m.settings.portal_redirect; - let parts = split(r.path, '/'); - let file = match(r.path, /^\/(luci-static|cgi-bin|ubus)(\/|$)/) || match(parts[length(parts) - 1], /\./); - if (redirect && !file) { - headers(r, '302 Found', { 'Location': redirect, 'Cache-Control': 'no-store', 'Content-Type': 'text/plain' }); - r.io.write('Moved\n'); - } - else { - headers(r, '404 Not Found', { 'Content-Type': 'text/plain' }); - r.io.write('Not found\n'); - } - finish(); -} - -/** The JSON object a POST carries ({} without a body). */ -function body(r) { - let len = +(r.env.CONTENT_LENGTH ?? 0); - if (len <= 0) - return {}; - if (len > BODY_MAX) - fail(r, '413 Payload Too Large', _('Request too large.')); - let raw = ''; - while (length(raw) < len) { - let chunk = r.io.read(len - length(raw)); - if (chunk == null || chunk == '') - break; - raw += chunk; - } - try { - let j = json(raw); - return type(j) == 'object' ? j : {}; - } - catch (e) { - fail(r, '400 Bad Request', _('Invalid JSON.')); - } -} - -/** Run a change; what it refuses becomes a 400 with its message. */ -function guard(r, fn) { - try { - return fn(); - } - catch (e) { - if (e.message == DONE) - die(DONE); - fail(r, '400 Bad Request', e.message); - } -} - -/* ---------- rate limiting ---------- */ - -/** The rate-limit key of an address: an IPv4 address, or the /64 of an IPv6 one. */ -function addr_key(a) { - if (schema.ipv4(a)) - return a; - let g = schema.ipv6_groups(a); - if (!g) - return null; - // An IPv4 address seen through an IPv6 socket. - if (g[0] == 0 && g[1] == 0 && g[2] == 0 && g[3] == 0 && g[4] == 0 && g[5] == 0xffff) - return sprintf('%d.%d.%d.%d', g[6] >> 8, g[6] & 255, g[7] >> 8, g[7] & 255); - return sprintf('%x:%x:%x:%x::/64', g[0], g[1], g[2], g[3]); -} - -/** - * The buckets a request counts against, [{ key, limit }]: its client, and - * behind Cloudflare (the only proxy whose CF-Connecting-IP is believed) also - * the bucket all Cloudflare visitors share. - */ -function buckets(env) { - let peer = env.REMOTE_ADDR ?? ''; - if (!cloudflare_ip(peer)) - return [ { key: addr_key(peer) ?? peer, limit: FAIL_LIMIT } ]; - let out = [ { key: SHARED_KEY, limit: SHARED_LIMIT } ]; - let visitor = addr_key(trim(env.HTTP_CF_CONNECTING_IP ?? '')); - if (visitor && !cloudflare_ip(visitor)) - unshift(out, { key: visitor, limit: FAIL_LIMIT }); - return out; -} - -function rate_state() { - let st = read_json(RATE, {}); - let now = time(); - for (let k, v in st) - if (type(v) != 'object' || now - v.first > FAIL_WINDOW) - delete st[k]; - return st; -} - -function rate_blocked(r) { - let st = rate_state(); - return length(filter(r.buckets, (b) => (st[b.key]?.count ?? 0) >= b.limit)) > 0; -} - -function rate_fail(r) { - let l = lock('portal-rate'); - let st = rate_state(); - let now = time(); - let hit = []; - for (let b in r.buckets) { - let v = st[b.key] ?? { first: now, count: 0 }; - v.count++; - st[b.key] = v; - if (v.count == b.limit) - push(hit, b.key); - } - // Bounded: an attacker with many addresses cannot grow the file without end. - let all = keys(st); - if (length(all) > RATE_MAX) { - all = sort(all, (a, b) => st[a].first - st[b].first); - for (let i = 0; i < length(all) - RATE_MAX; i++) - delete st[all[i]]; - } - ensure_dir(RUN_DIR); - write_json(RATE, st, 0o600); - unlock(l); - for (let k in hit) - live.add_event({ type: 'portal_blocked', detail: k == SHARED_KEY ? 'all Cloudflare visitors' : k }); -} - -/** One more change through this link; refused beyond ACTION_LIMIT per window. */ -function rate_action(r) { - let key = `act:${r.person.id}`; - let l = lock('portal-rate'); - let st = rate_state(); - let v = st[key] ?? { first: time(), count: 0 }; - v.count++; - st[key] = v; - ensure_dir(RUN_DIR); - write_json(RATE, st, 0o600); - unlock(l); - if (v.count > ACTION_LIMIT) - fail(r, '429 Too Many Requests', _('Too many changes in a short time. Try again in a few minutes.')); -} - -/* ---------- pages ---------- */ - -/** What the page is called (the tab, the first crumb): the person's server, or Dawnline. */ -function place(r) { - return r.person ? r.m.servers[r.person.server]?.name || 'Dawnline' : 'Dawnline'; -} - -/** The app shell; it reads the code from its own URL and sends it along. */ -function shell(r) { - // The build's time joins the version: every update gives the assets new URLs, so they are cached for good. - let v = `?v=${VERSION}.${stat(`${ASSETS}/portal.js`)?.mtime ?? 0}`; - let base = r.base, title = place(r); - // The icon goes in the page: a request of its own would start another CGI process. - let icon = readfile(`${ASSETS}/icon.svg`); - let favicon = icon ? `\n` : ''; - headers(r, '200 OK', { - 'Content-Type': 'text/html; charset=utf-8', - 'Content-Security-Policy': "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:; " + - "connect-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'", - }); - r.io.write(` - - - - - - -${html_escape(title)} -${favicon} - - -
- - - -`); - finish(); -} - -/** Script and styles (kept outside the web root); the shell's ?v= changes with every build, so they never go stale. */ -function asset(r, name) { - let ext = match(name, /^[a-z0-9-]+\.(js|css|png)$/)?.[1]; - // The build keeps a gzipped copy beside each: a third of the bytes for a browser that takes it. - let gz = ext && r.gzip ? readfile(`${ASSETS}/${name}.gz`) : null; - let data = gz ?? (ext ? readfile(`${ASSETS}/${name}`) : null); - if (data == null) - not_found(r); - let h = { 'Content-Type': TYPES[ext], 'Cache-Control': 'private, max-age=31536000, immutable', 'Vary': 'Accept-Encoding' }; - if (gz != null) - h['Content-Encoding'] = 'gzip'; - headers(r, '200 OK', h); - r.io.write(data); - finish(); -} - -/* ---------- the API ---------- */ - -/** The model again after a change. */ -function reload(r) { - r.m = core.load(); - r.person = r.m.people[r.person.id]; - if (!r.person) - not_found(r); -} - -/** - * The person's state for the page: a stop by the admin (pause, end of access) - * wins over their server being off, so they learn that their access is stopped. - */ -function person_state(m, p, usage) { - let st = core.person_state(m, p, usage); - if (st == 'server_off') { - let own = core.own_state(m, p, usage); - if (index(LOCKED, own) >= 0) - return own; - } - return st; -} - -/** Why the person can't change anything right now, or null. */ -function locked(r) { - return locked_reason(person_state(r.m, r.person, core.load_usage())); -} - -/** Refuses a change (or a config) while the person is stopped. */ -function need_open(r) { - let why = locked(r); - if (why) - fail(r, '403 Forbidden', why); -} - -/** The same link over HTTPS (for a plain-HTTP visitor), or null when this is it. */ -function https_url(r) { - if (r.https) - return null; - let host = r.host; - let h = match(host, /^\[/) ? match(host, /^(\[[^\]]*\])/)?.[1] : split(host, ':')[0]; - let port = r.m.settings.portal_port; - return `https://${h}${port == 443 ? '' : `:${port}`}${r.base}`; -} - -/** - * Keys and the disguise never travel in the clear: over plain HTTP a - * configuration is refused, and the answer names the HTTPS link to use. - */ -function need_https(r) { - let u = https_url(r); - if (u) - send_json(r, '403 Forbidden', { error: _('Open this link over HTTPS to get the connection settings.'), https_url: u }); -} - -/** The router's offset from UTC in minutes: the admin sets hours in its time, the page shows the visitor's. */ -function tz_offset() { - let t = time(); - return int((timegm(localtime(t)) - t) / 60); -} - -/** Everything the page shows. */ -function state(r) { - let m = r.m, person = r.person; - let usage = core.load_usage(); - // Only their server's tunnel: one `awg` process per request, however many servers there are. - let v = view.person_view(m, person, usage, live.dump(m, person.server ?? ''), view.states(m, usage)); - v.state = person_state(m, person, usage); - // Day by day this month, for the page's chart (the admin's views have no use for it). - v.month_days = view.month_days(usage.people?.[person.id]); - let srv = m.servers[person.server]; - // The device this page was opened from, through the tunnel or beside it. - let here = view.device_here(v.devices, r.peer); - return { - person: v, - here, - server: { - name: srv?.name, endpoint: srv ? core.endpoint_host(m, srv) : '', device_mesh: !!srv?.device_mesh, - // AmneziaWG with the disguise off is plain WireGuard (any WireGuard app). - awg_disguise: srv ? !awg.obf_neutral(srv.obf) : false, - // Which apps (and versions) connect: off, balanced (2.0), max (3.1); legacy = the old junk-only presets. - preset: !srv || awg.obf_neutral(srv.obf) ? 'off' : index([ 'balanced', 'max' ], srv.preset) >= 0 ? srv.preset : 'legacy', - // The home networks a device with LAN Bypass still sends into the tunnel (home and internet access): - // its own local network on the same addresses is out of reach (Add a device says so). - home: srv && person.access == 'both' ? core.person_home(srv, person).nets : [], - }, - can_add: length(person.devices) < person.device_limit, - locked: index(LOCKED, v.state) >= 0, - // Over plain HTTP: where the configurations are (keys only travel encrypted). - https_url: https_url(r), - kinds: core.KINDS, - // The router's day: access ends and usage days follow its clock, not the browser's. - today: today(), - // Its clock too: "last connected 3 min ago" is measured against it, not the phone's. - now: time(), - // And its time zone: hours are set in the router's time, shown in the visitor's. - tz_offset: tz_offset(), - version: VERSION, - }; -} - -/** One of the person's own devices, or a 404. */ -function own_device(r, id) { - let d = r.m.devices[id]; - if (!d || d.person != r.person.id) - fail(r, '404 Not Found', _('Device not found.')); - return d; -} - -function api_state(r) { - send_json(r, '200 OK', state(r)); -} - -/** - * A configuration as the portal sends it: with the server's address as an IP - * too (amnezia.host_ip, lookup.host_ip()), for V2RayTun on Android, which - * takes no name for AmneziaWG. Lookups are cached for minutes (lookup.uc). - */ -function with_ip(cfg) { - if (cfg?.amnezia) - cfg.amnezia.host_ip = lookup.host_ip(cfg.amnezia.host); - return cfg; -} - -function api_add(r) { - need_open(r); - need_https(r); - let b = body(r); - if (!devices.ready()) - fail(r, '503 Service Unavailable', not_ready()); - rate_action(r); - // lan_bypass: JSON true keeps the device's own local network out of the tunnel; anything else is off. - let res = guard(r, () => devices.add(r.person.id, b.name, b.kind, { by: 'portal', public_key: b.public_key, lan_bypass: b.lan_bypass === true })); - reload(r); - send_json(r, '200 OK', { id: res.id, config: with_ip(res.config), state: state(r) }); -} - -function api_config(r, id) { - let d = own_device(r, id); - need_open(r); - need_https(r); - awg.mark_issued(r.m, d.id); - send_json(r, '200 OK', with_ip(awg.client_config(r.m, d))); -} - -/** POST /devices/ { action }: what each action does; the answer carries the new state. */ -const ACTIONS = { - rename: (r, d, b) => { - guard(r, () => devices.update(d.id, { name: b.name }, { by: 'portal', person: r.person.id })); - return {}; - }, - // Set up from scratch: new keys and the new configuration, which the set-up sheet takes in. - reconnect: (r, d, b) => { - need_https(r); - if (!devices.ready()) - fail(r, '503 Service Unavailable', not_ready()); - // What it is and LAN Bypass may change with the keys (the sheet asks again); left out, they stay. - let kind = type(b.kind) == 'string' ? b.kind : null; - let bypass = type(b.lan_bypass) == 'bool' ? b.lan_bypass : null; - let config = guard(r, () => devices.reconnect(d.id, { by: 'portal', person: r.person.id, defer: d.address == r.peer, - kind, lan_bypass: bypass })); - return { config: with_ip(config) }; - }, - // LAN Bypass on or off, keys unchanged: the device takes its updated configuration (the set-up sheet opens on it). - bypass: (r, d, b) => { - need_https(r); - if (type(b.on) != 'bool') - fail(r, '400 Bad Request', _('Unknown action.')); - guard(r, () => devices.update(d.id, { lan_bypass: b.on }, { by: 'portal', person: r.person.id })); - return {}; - }, - 'delete': (r, d, b) => { - guard(r, () => devices.remove(d.id, { by: 'portal', person: r.person.id })); - return {}; - }, -}; - -function api_device(r, id) { - let d = own_device(r, id); - need_open(r); - let b = body(r); - let act = ACTIONS[b.action]; - if (!act) - fail(r, '400 Bad Request', _('Unknown action.')); - rate_action(r); - let res = act(r, d, b); - reload(r); - send_json(r, '200 OK', { ok: true, ...res, state: state(r) }); -} - -/** API routes: method, path under //api ('*' matches one segment, passed to run). */ -const API = [ - { method: 'GET', path: [ 'state' ], run: api_state }, - { method: 'POST', path: [ 'devices' ], run: api_add }, - { method: 'GET', path: [ 'devices', '*', 'config' ], run: api_config }, - { method: 'POST', path: [ 'devices', '*' ], run: api_device }, -]; - -/** The route for a request: { run, args } or null (routes take at most one '*'). */ -function route(table, method, segs) { - for (let rt in table) { - if (rt.method != method || length(rt.path) != length(segs)) - continue; - let args = [], ok = true; - for (let i = 0; i < length(segs) && ok; i++) - if (rt.path[i] == '*') - push(args, segs[i]); - else if (rt.path[i] != segs[i]) - ok = false; - if (ok) - return { run: rt.run, args }; - } - return null; -} - -/* ---------- one request ---------- */ - -export function handle(io) { - let env = io.env ?? {}; - // Header names arrive lower-case from uhttpd; CGI has only HTTP_* variables. - let hdr = {}; - for (let k, v in io.headers ?? {}) - hdr[lc(k)] = v; - let header = (name) => hdr[name] ?? env[`HTTP_${uc(replace(name, /-/g, '_'))}`]; - let uri = env.REQUEST_URI ?? '/'; - let qpos = index(uri, '?'); - let path = qpos >= 0 ? substr(uri, 0, qpos) : uri; - let https = env.HTTPS == 'on'; - let host = header('host') ?? ''; - let m = core.load(); - let r = { - io, env, m, path, https, host, - method: env.REQUEST_METHOD ?? 'GET', - peer: env.REMOTE_ADDR ?? '', - buckets: buckets(env), - // The port in the visitor's address bar ([v6]:port, name:port, or the default). - hsts: https && (match(host, /:([0-9]+)$/)?.[1] ?? '443') == '443', - person: null, - base: '', - gzip: match(lc(header('accept-encoding') ?? ''), /(^|[ ,])gzip([ ;,]|$)/) != null, - }; - let segs = filter(split(path, '/'), (s) => s != ''); - - // Plain HTTP only for an IP address chosen in Settings (no certificate exists - // for it); names stay HTTPS-only. - if (!https) { - let h = match(host, /^\[/) ? host : split(host, ':')[0]; - if (ip2int(h) == null || index(core.portal_hosts(m), h) < 0) - not_found(r); - } - // The link is /[/assets/…|/api/…]: the code is the address. - if (length(segs) < 1 || !match(segs[0], core.WORD_CODE)) - not_found(r); - let code = segs[0]; - for (let id, p in m.people) - if (p.code == code) - r.person = p; - - // A wrong code is indistinguishable from a path that does not exist. Only - // well-formed guesses count towards the limit, and a client over it is just - // no longer counted: a valid link always opens, so guesses from a shared - // address (every Cloudflare visitor) cannot lock its owner out. - if (r.person == null) { - if (!rate_blocked(r)) - rate_fail(r); - not_found(r); - } - r.base = `/${code}`; - let rest = slice(segs, 1); - - if (length(rest) == 0 && r.method == 'GET') - shell(r); - if (rest[0] == 'assets' && length(rest) == 2 && r.method == 'GET') - asset(r, rest[1]); - if (rest[0] != 'api') - not_found(r); - - // CSRF: only same-origin JSON requests (a cross-site page cannot send - // application/json without CORS, and it would need the code anyway). - if (r.method == 'POST') { - let origin = header('origin'); - if (!match(env.CONTENT_TYPE ?? '', /^application\/json/) || - (origin != null && origin != `${https ? 'https' : 'http'}://${host}`)) - fail(r, '403 Forbidden', _('Cross-site request refused.')); - } - else if (r.method != 'GET') - fail(r, '405 Method Not Allowed', _('Method not allowed.')); - - let rt = route(API, r.method, slice(rest, 1)); - if (!rt) - fail(r, '404 Not Found', _('Not found.')); - rt.run(r, rt.args[0]); - fail(r, '404 Not Found', _('Not found.')); -}; - -/** Run handle() and swallow its early end. */ -export function serve(io) { - try { - // "ru-RU,ru;q=0.9" → ru (i18n.use takes plain language codes only). - i18n.use((match(io.env.HTTP_ACCEPT_LANGUAGE ?? '', /^[ \t]*([A-Za-z][A-Za-z][A-Za-z]?)/) ?? [])[1]); - handle(io); - } - catch (e) { - if (e.message != DONE) { - // What broke and where; the path without its first part (the person's link code is a secret). - let path = replace(split(io.env.REQUEST_URI ?? '', '?')[0], /^\/[^\/]*/, '/'); - syslog('error', 'portal', `${io.env.REQUEST_METHOD ?? '?'} ${path}: 500 · ${e.message}${e.stacktrace?.[0]?.context ? ' · ' + replace(e.stacktrace[0].context, /[\r\n\t]+/g, ' ') : ''}`); - io.write(`Status: 500 Internal Server Error\r\nContent-Type: text/plain\r\n\r\nError\n`); - } - } -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portalcert.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portalcert.uc deleted file mode 100644 index 7ec1050..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/portalcert.uc +++ /dev/null @@ -1,119 +0,0 @@ -// Dawnline — the portal's certificate (configured, ACME or self-signed) and -// the addresses its links could use. - -import { lsdir } from 'fs'; -import { cursor } from 'uci'; -import { q, sh, sh_out, ensure_dir, file_exists, valid_host, ip2int, cloudflare_ip, DATA_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as lookup from 'dawnline.lookup'; - -/** The DNS names a certificate file covers. */ -export function cert_names(path) { - let sans = sh_out(`openssl x509 -in ${q(path)} -noout -text 2>/dev/null | grep -o 'DNS:[^,]*'`) ?? ''; - return filter(split(replace(sans, /DNS:/g, ''), /[ \t\r\n]+/), (x) => x != ''); -}; - -/** A certificate name covers host: the same name, or a wildcard one level up. */ -export function name_covers(name, host) { - if (name == host) - return true; - let dot = index(host ?? '', '.'); - return substr(name, 0, 2) == '*.' && dot > 0 && substr(host, dot) == substr(name, 1); -}; - -// A module constant, compiled once, not for each file of the directory. -const FULLCHAIN = /^(.+)\.fullchain\.crt$/; - -/** ACME certificates on the router and the names each covers. */ -export function acme_certs() { - let out = []; - for (let f in sort(lsdir('/etc/ssl/acme') ?? [])) { - let m = match(f, FULLCHAIN); - if (!m) - continue; - let c = `/etc/ssl/acme/${f}`, k = `/etc/ssl/acme/${m[1]}.key`; - if (file_exists(k)) - push(out, { cert: c, key: k, names: cert_names(c) }); - } - return out; -}; - -/** The ACME certificate that covers host (exact name or a wildcard), if any. */ -export function acme_cert_for(host) { - for (let a in acme_certs()) - for (let n in a.names) - if (name_covers(n, host)) - return a; - return null; -}; - -/** Certificate the portal should use: configured, ACME for the host, or self-signed. */ -export function portal_cert(s) { - if (s.portal_cert && s.portal_key && file_exists(s.portal_cert) && file_exists(s.portal_key)) - return { cert: s.portal_cert, key: s.portal_key, self_signed: false }; - if (s.portal_host) { - for (let base in [ `/etc/ssl/acme/${s.portal_host}`, `/etc/acme/${s.portal_host}_ecc/${s.portal_host}` ]) { - let c = `${base}.fullchain.crt`, k = `${base}.key`; - if (file_exists(c) && file_exists(k)) - return { cert: c, key: k, self_signed: false }; - } - // An ACME certificate issued for several names, the portal's among them. - let a = acme_cert_for(s.portal_host); - if (a) - return { cert: a.cert, key: a.key, self_signed: false }; - } - let c = `${DATA_DIR}/portal.crt`, k = `${DATA_DIR}/portal.key`; - if (!file_exists(c) || !file_exists(k)) { - ensure_dir(DATA_DIR, 0o700); - let cn = s.portal_host || 'dawnline'; - sh(`openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 -subj ${q('/CN=' + cn)} -keyout ${k} -out ${c}`); - system(`chmod 600 ${k}`); - } - return { cert: c, key: k, self_signed: true }; -}; - -/* - * Addresses the portal could use in links, found on the router: names in ACME - * certificates, server endpoints, DDNS names, the current one, and the WAN IP. - * Each says where it points and whether a certificate covers it. - */ -export function portal_candidates(m) { - let wan = lookup.router_wan(m); - let names = []; - let add = (h) => { - if (h && valid_host(h) && ip2int(h) == null && substr(h, 0, 2) != '*.' && index(names, h) < 0) - push(names, h); - }; - let certs = acme_certs(); - for (let a in certs) - for (let n in a.names) - add(n); - for (let id, srv in m.servers) - add(srv.endpoint); - let dc = cursor(); - if (dc.load('ddns')) - dc.foreach('ddns', 'service', (sv) => { - if (sv.enabled != '0') { - add(sv.lookup_host); - add(sv.domain); - } - }); - for (let h in core.portal_hosts(m)) - add(h); - let found = lookup.resolve_all(names); - let covered = (h) => length(filter(certs, (a) => length(filter(a.names, (n) => name_covers(n, h))) > 0)) > 0; - let out = []; - for (let h in names) { - let ips = found[h] ?? []; - push(out, { host: h, kind: 'name', ips, here: wan != null && index(ips, wan) >= 0, - cloudflare: length(filter(ips, (x) => cloudflare_ip(x))) > 0, cert: covered(h) }); - } - if (wan) - push(out, { host: wan, kind: 'ip', ips: [ wan ], here: true, cloudflare: false, cert: false }); - for (let ph in core.portal_hosts(m)) - if (ip2int(ph) != null && ph != wan) - push(out, { host: ph, kind: 'ip', ips: [ ph ], here: false, cloudflare: false, cert: false }); - // Best first: here with a certificate, then here, then the rest. - let score = (c) => (c.here ? 4 : 0) + (c.cert ? 2 : 0) + (c.kind == 'name' ? 1 : 0) - (c.cloudflare ? 8 : 0); - return sort(out, (a, b) => score(b) - score(a)); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/resolver.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/resolver.uc deleted file mode 100644 index ad7e37a..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/resolver.uc +++ /dev/null @@ -1,106 +0,0 @@ -// Dawnline — the plain resolver for people with Home-only access: real -// addresses from the WAN's DNS, home names from the LAN DNS. Their internet -// does not use the tunnel, so fake-IP answers would break it. dawnline.loop -// says where it runs (inside the netns while it exists, otherwise on the -// tunnel interfaces); procd runs dnsmasq through /usr/libexec/dawnline/resolver. - -import { readfile, writefile, stat } from 'fs'; -import { cursor } from 'uci'; -import { ensure_dir, iface_status, uniq, syslog, syslog_lines } from 'dawnline.util'; -import * as net from 'dawnline.net'; -import * as core from 'dawnline.core'; - -/** Port on the tunnel addresses while it runs on the router itself. */ -export const PORT = 5354; -export const CONF = '/var/etc/dawnline-dns.conf'; -const RESOLV = '/var/etc/dawnline-dns.resolv'; -const PID = '/var/run/dawnline-dns.pid'; -const FALLBACK_DNS = [ '1.1.1.1', '8.8.8.8' ]; - -function wan_dns() { - let out = []; - let snap = net.snapshot(); - let wan = snap.devices[snap.wan]?.logical; - for (let name in uniq([ wan, 'wan', 'wan6' ])) { - if (!name) - continue; - for (let a in iface_status(name)?.['dns-server'] ?? []) - if (match(a, /^[0-9.]+$/)) - push(out, a); - } - return length(out) ? uniq(out) : FALLBACK_DNS; -} - -/** Local domain of the LAN DNS (dnsmasq `domain`, else the Dawnline hostname domain). */ -function lan_domain(m) { - let c = cursor(); - c.load('dhcp'); - let d = null; - c.foreach('dhcp', 'dnsmasq', (s) => { d ??= s.domain; }); - return uniq(filter([ d, m.settings.domain ], (x) => x)); -} - -/** True when the resolver process is alive. */ -export function running() { - let pid = trim(readfile(PID) ?? ''); - return match(pid, /^[0-9]+$/) != null && stat(`/proc/${pid}`) != null; -}; - -/** - * Write the config for `target` (dawnline.loop resolver_target) with home - * names from `lan` (the LAN's DNS); returns true when it changed (the running - * instance is then restarted by procd's respawn after a kill). The first line - * tells /usr/libexec/dawnline/resolver where to run it. - */ -export function sync(m, target, lan) { - ensure_dir('/var/etc'); - // Servers that are on: with none, the resolver idles on loopback. - let ifs = []; - for (let id, s in m.servers) - if (s.enabled) - for (let t in core.tunnels(s)) - push(ifs, t.ifname); - let lines = [ - `# mode=${target.mode}`, - '# Generated by Dawnline: plain DNS for Home-only tunnel clients.', - `port=${target.port}`, - 'no-hosts', - 'bogus-priv', - 'cache-size=1000', - `pid-file=${PID}`, - 'user=dnsmasq', - 'group=dnsmasq', - ]; - if (target.mode == 'ns') { - push(lines, `listen-address=${target.address}`, 'bind-interfaces', 'no-resolv'); - // Upstream from the transit address: forwarded through the router to the WAN. - for (let a in wan_dns()) - push(lines, `server=${a}@${target.address}`); - } - else { - // No tunnel on: loopback only (without any interface= line dnsmasq would answer everywhere). - push(lines, 'bind-dynamic', ...(length(ifs) ? map(ifs, (i) => `interface=${i}`) : [ 'listen-address=127.0.0.1' ]), `resolv-file=${RESOLV}`); - let resolv = join('', map(wan_dns(), (a) => `nameserver ${a}\n`)); - if ((readfile(RESOLV) ?? '') != resolv) { - writefile(RESOLV, resolv); - system(`chmod 644 ${RESOLV}`); - } - } - if (lan) - for (let d in lan_domain(m)) - push(lines, `server=/${d}/${lan}`); - let conf = join('\n', lines) + '\n'; - let where = target.mode == 'ns' ? `${target.address}:${target.port} in the netns` : length(ifs) ? `port ${target.port} on ${join(', ', ifs)}` : 'loopback only (no tunnel on)'; - if ((readfile(CONF) ?? '') == conf) { - syslog('debug', 'dns', `resolver for Home-only devices: unchanged · ${where}`); - return false; - } - writefile(CONF, conf); - system(`chmod 644 ${CONF}`); - syslog('info', 'dns', `resolver for Home-only devices: ${CONF} written · ${where} · upstream ${join(' ', wan_dns()) || 'none'}${lan ? ` · home names via ${lan}` : ''}; restarting it`); - syslog_lines('debug', 'dns', conf, 'dnsmasq: '); - let pid = trim(readfile(PID) ?? ''); - if (match(pid, /^[0-9]+$/)) - system(`kill ${pid} 2>/dev/null`); - return true; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc deleted file mode 100644 index 9efdbf2..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/common.uc +++ /dev/null @@ -1,134 +0,0 @@ -// Dawnline — what the rpcd method modules (dawnline.rpc.*) share: the call -// wrapper, argument helpers, the disguise check and the portal port check. - -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as health from 'dawnline.health'; -import * as schema from 'dawnline.schema'; -import { uniq } from 'dawnline.util'; -import { _ } from 'dawnline.i18n'; - -/** - * An rpcd handler from fn(args): an object result is passed on, anything else - * is wrapped as { result }, and a failure becomes { error } (the UI shows it). - */ -export function wrap(fn) { - return function(req) { - try { - let r = fn(req.args ?? {}); - return type(r) == 'object' ? r : { result: r }; - } - catch (e) { - return { error: e.message ?? `${e}` }; - } - }; -}; - -/** An argument as a trimmed string ('' for null). */ -export function str(v) { - return v == null ? '' : trim(`${v}`); -}; - -/** Days of history a caller may ask for: 1–400, default 30. */ -export function clamp_days(v) { - let n = +(v ?? 30); - return n >= 1 ? (n > 400 ? 400 : int(n)) : 30; -}; - -export const METHODS = [ 'off', 'balanced', 'max' ]; - -/** The disguise a new server gets: the strongest this router can run. */ -export function default_method() { - let c = awg.caps(); - return c.v3 ? 'max' : c.v2 ? 'balanced' : 'off'; -}; - -/** A disguise method the installed AmneziaWG can run. */ -export function check_method(name) { - if (index(METHODS, name) < 0) - die(_('Unknown disguise method.')); - let c = awg.caps(); - if (name == 'max' && !c.v3) - die(awg.installed() - ? _('Maximum needs AmneziaWG 3.1 on the router (kmod-amneziawg, amneziawg-tools 3.1): install a 3.1 build in Dawnline → Components.') - : _('AmneziaWG is not installed: install it in Dawnline → Components, then choose Maximum.')); - if (name == 'balanced' && !c.v2) - die(awg.installed() - ? _('Balanced needs AmneziaWG 2.0 or newer on the router: install a current build in Dawnline → Components.') - : _('AmneziaWG is not installed: install it in Dawnline → Components, then choose Balanced.')); - return name; -}; - -/** - * The portal's ports in the final configuration `m` (compared with `was`, - * before the change) are acceptable: its HTTPS port and, when links on IP - * addresses use plain HTTP, the next port too — both get a WAN ACCEPT rule. - * Neither may be 22, 53, 80 or 443, beyond 65535, or taken by another program. - */ -/** TCP port forwards from the servers' WAN zones: [{ from, to, name }]. */ -function tcp_forwards(m) { - let out = []; - for (let z in uniq([ 'wan', ...map(values(m.servers), (s) => s.wan_zone) ])) - push(out, ...core.wan_forwards(z, 'tcp')); - return out; -} - -/** - * TCP ports the portal can't take, and who holds them: [{ from, to, who }]. - * The router's own (22, 53, 80, 443), other programs and port forwards from WAN. - * `who` is shown in the admin's language ("Used by %s."). - */ -export function tcp_taken(m) { - let out = []; - let held = {}; - let hold = (p, who) => { - if (!held[p]) { - held[p] = true; - push(out, { from: p, to: p, who }); - } - }; - for (let p in schema.RESERVED_PORTS) - hold(p, _('the router itself')); - for (let p, name in health.tcp_port_programs()) - hold(+p, sprintf(_('%s on this router'), name)); - for (let f in tcp_forwards(m)) - push(out, { from: f.from, to: f.to, who: sprintf(_('port forward “%s”'), f.name) }); - return out; -}; - -export function check_portal(m, was) { - let s = m.settings; - if (!s.portal_enabled) - return; - let port = s.portal_port; - if (!schema.valid_port(port) || index(schema.RESERVED_PORTS, port) >= 0) - die(_('Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).')); - let ports = [ port ]; - if (core.portal_http(m)) { - let hp = core.portal_http_port(m); - if (!schema.valid_port(hp) || index(schema.RESERVED_PORTS, hp) >= 0) - die(sprintf(_('Links on IP addresses use plain HTTP on the next port (%d), which the portal cannot take. Choose another portal port.'), hp)); - push(ports, hp); - } - // Only ports the portal does not hold already: our own uhttpd is not an owner anyway. - let held = []; - if (was?.settings?.portal_enabled) { - push(held, was.settings.portal_port); - if (core.portal_http(was)) - push(held, core.portal_http_port(was)); - } - for (let p in ports) { - if (index(held, p) >= 0) - continue; - let owners = health.tcp_port_owners(p); - if (length(owners)) - die(sprintf(p != port - ? _("TCP %d is already used by %s. Links on IP addresses use plain HTTP on the port after the portal's. Choose another portal port.") - : _('TCP %d is already used by %s. Choose another portal port.'), p, join(', ', owners))); - } - // A forwarded port never reaches the router: the portal would be unreachable. - for (let p in ports) - for (let f in tcp_forwards(m)) - if (f.from <= p && p <= f.to) - die(sprintf(_('TCP %d is sent on by port forward “%s”. Choose another portal port.'), p, f.name)); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc deleted file mode 100644 index 4b27dc7..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/home.uc +++ /dev/null @@ -1,215 +0,0 @@ -// Dawnline rpcd methods: what people reach at home — services (home -// devices and ports), circles (who reaches whom), the devices found at home, -// and "Check access". - -import { readfile } from 'fs'; -import { cursor } from 'uci'; -import { sh_out, ip2int, rand_int, rand_hex, admin_log, valid_name, ulength } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as apply from 'dawnline.apply'; -import * as net from 'dawnline.net'; -import * as access from 'dawnline.access'; -import * as store from 'dawnline.store'; -import * as schema from 'dawnline.schema'; -import { wrap, str } from 'dawnline.rpc.common'; -import { _ } from 'dawnline.i18n'; - -/* ---------- services ---------- */ - -/** A new id from make() that no section has yet. */ -function new_id(m, make) { - for (let i = 0; i < 20; i++) { - let id = make(); - if (!store.id_taken(m, id)) - return id; - } - die(_('Could not find a free id, try again.')); -} - -function service_set(a) { - let name = str(a.name); - if (!valid_name(name)) - die(_('Service: Enter a name: up to 48 characters, without < > " or \\.')); - let address = str(a.address); - if (!schema.ipv4(address)) - die(_('Address must be an IPv4 address.')); - let ports = filter(map(type(a.ports) == 'array' ? a.ports : split(str(a.ports), /[ ,]+/), str), (x) => x != ''); - for (let pt in ports) - if (!schema.valid_port(pt)) - die(sprintf(_('Invalid port %s.'), pt)); - let id = store.transact((c, m) => { - let id = str(a.id); - if (id == '') - id = new_id(m, () => `svc_${rand_int(100000, 999999)}`); - else if (!match(id, /^[A-Za-z0-9_]{1,32}$/)) - die(_('Invalid service id.')); - // Never turn a person, device, server, circle or the settings into a service. - else if (!m.services[id] && store.id_taken(m, id)) - die(_('That id is taken.')); - c.set(core.CONFIG, id, 'service'); - c.set(core.CONFIG, id, 'name', name); - c.set(core.CONFIG, id, 'address', address); - if (length(ports)) - c.set(core.CONFIG, id, 'port', ports); - else - c.delete(core.CONFIG, id, 'port'); - return id; - }); - let s = apply.sync(); - return { id, warning: s.warning }; -} - -function service_delete(a) { - store.transact((c, m) => { - if (!m.services[a.id]) - die(_('Unknown service.')); - c.delete(core.CONFIG, a.id); - for (let pid, p in m.people) - if (index(p.services, a.id) >= 0) { - let rest = filter(p.services, (x) => x != a.id); - if (length(rest)) - c.set(core.CONFIG, pid, 'service', rest); - else - c.delete(core.CONFIG, pid, 'service'); - } - }); - let s = apply.sync(); - return { ok: true, warning: s.warning }; -} - -/* ---------- circles ---------- */ - -/** Create or edit a circle; `members` (person ids) replaces who is in it. */ -function circle_set(a) { - let name = str(a.name); - if (!valid_name(name) || ulength(name) > 32) - die(_('Enter a circle name: up to 32 characters, without < > " or \\.')); - let res = store.transact((c, m) => { - let ci = a.id ? m.circles[a.id] : null; - if (a.id && !ci) - die(_('Unknown circle.')); - let server = ci?.server ?? a.server; - if (!m.servers[server]) - die(_('Unknown server.')); - for (let id, o in m.circles) - if (id != a.id && o.server == server && lc(o.name) == lc(name)) - die(sprintf(_('%s already exists.'), name)); - let id = ci?.id ?? new_id(m, () => `c_${rand_hex(4)}`); - let n = core.CIRCLE_COLORS; - c.set(core.CONFIG, id, 'circle'); - c.set(core.CONFIG, id, 'server', server); - c.set(core.CONFIG, id, 'name', name); - c.set(core.CONFIG, id, 'color', `${((int(a.color) || 0) % n + n) % n}`); - if (type(a.members) == 'array') { - let want = {}; - for (let pid in a.members) - if (m.people[pid]?.server == server) - want[pid] = true; - for (let pid, p in m.people) - if (want[pid]) - c.set(core.CONFIG, pid, 'circle', id); - else if (p.circle == id) - c.delete(core.CONFIG, pid, 'circle'); - } - return { id, edit: !!ci, server: m.servers[server].name }; - }); - let s = apply.sync(); - admin_log('awg', res.edit ? 'changed' : 'added', 'circle', name, res.server); - return { id: res.id, circles: values(core.load().circles), warning: s.warning }; -} - -function circle_delete(a) { - let res = store.transact((c, m) => { - let ci = m.circles[a.id]; - if (!ci) - die(_('Unknown circle.')); - c.delete(core.CONFIG, a.id); - for (let pid, p in m.people) - if (p.circle == a.id) - c.delete(core.CONFIG, pid, 'circle'); - return { name: ci.name, server: m.servers[ci.server]?.name }; - }); - let s = apply.sync(); - admin_log('awg', 'removed', 'circle', res.name, res.server); - return { circles: values(core.load().circles), warning: s.warning }; -} - -/* ---------- devices at home ---------- */ - -/** True while OpenWrt's mDNS daemon answers on ubus. */ -function mdns_running() { - return index(split(sh_out('ubus list umdns 2>/dev/null') ?? '', '\n'), 'umdns') >= 0; -} - -/** - * Services announced on the home networks (Bonjour), from umdns: - * [{ type: '_airplay._tcp', name, host, address, port, txt }]. - */ -function mdns_services() { - if (!mdns_running()) - return []; - let r = {}; - try { - r = json(sh_out(`ubus call umdns browse '{"address":true,"array":true}' 2>/dev/null`) || '{}') ?? {}; - } - catch (e) { - r = {}; - } - let out = []; - for (let t, insts in r) - for (let name, i in insts) { - let addr = type(i.ipv4) == 'array' ? i.ipv4[0] : i.ipv4; - if (addr) - push(out, { type: t, name, host: replace(i.host ?? '', /\.local\.?$/, ''), address: addr, port: i.port ?? 0, txt: i.txt ?? [] }); - } - return out; -} - -/** - * Devices at home for the Home services picker: DHCP leases and static hosts - * in the server's home networks, with the services they announce (Bonjour, - * when umdns runs). - */ -function home_hosts(a) { - let m = core.load(); - let srv = m.servers[a.id] ?? values(m.servers)[0]; - if (!srv) - die(_('No server yet.')); - let nets = []; - for (let cidr in net.server_net(srv).nets) { - let x = match(cidr, /^([0-9.]+)\/([0-9]+)$/); - if (x && ip2int(x[1]) != null) - push(nets, [ ip2int(x[1]), 1 << (32 - +x[2]) ]); - } - let inside = (ip) => { - let n = ip2int(ip); - return n != null && length(filter(nets, (r) => n >= r[0] && n < r[0] + r[1])) > 0; - }; - let hosts = {}; - for (let line in split(readfile('/tmp/dhcp.leases') ?? '', '\n')) { - let f = split(line, ' '); - if (length(f) >= 4 && inside(f[2])) - hosts[f[2]] = { address: f[2], name: f[3] == '*' ? '' : f[3], mac: f[1], services: [] }; - } - let c = cursor(); - if (c.load('dhcp')) - c.foreach('dhcp', 'host', (h) => { - if (h.ip && inside(h.ip)) - hosts[h.ip] ??= { address: h.ip, name: h.name ?? '', mac: type(h.mac) == 'array' ? h.mac[0] : h.mac ?? '', services: [] }; - }); - for (let s in mdns_services()) - if (hosts[s.address]) - push(hosts[s.address].services, { type: s.type, name: s.name, port: s.port }); - else if (inside(s.address)) - hosts[s.address] = { address: s.address, name: s.host ?? '', mac: '', services: [ { type: s.type, name: s.name, port: s.port } ] }; - return { hosts: sort(values(hosts), (x, y) => ip2int(x.address) - ip2int(y.address)), mdns: mdns_running() }; -} - -export const methods = { - service_set: { args: { id: '', name: '', address: '', ports: [] }, call: wrap(service_set) }, - service_delete: { args: { id: '' }, call: wrap(service_delete) }, - circle_set: { args: { id: '', server: '', name: '', color: 0, members: [] }, call: wrap(circle_set) }, - circle_delete: { args: { id: '' }, call: wrap(circle_delete) }, - home_hosts: { args: { id: '' }, call: wrap(home_hosts) }, - access_check: { args: { from: '', to: '' }, call: wrap((a) => access.check(core.load(), a.from, a.to)) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc deleted file mode 100644 index a4a64fc..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/maint.uc +++ /dev/null @@ -1,90 +0,0 @@ -// Dawnline rpcd methods: Diagnostics (Health, the service log), backups, -// export / import, and removing Dawnline. - -import { _ } from 'dawnline.i18n'; -import { slog_clear, admin_log } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as apply from 'dawnline.apply'; -import * as watchdog from 'dawnline.watchdog'; -import * as upd from 'dawnline.updates'; -import * as store from 'dawnline.store'; -import * as health from 'dawnline.health'; -import * as backup from 'dawnline.backup'; -import { wrap } from 'dawnline.rpc.common'; - -function health_view(extra) { - return { ...(extra ?? {}), checks: health.health(), ...watchdog.view(core.load()) }; -} - -function service_log_clear(a) { - let removed = slog_clear(+a.older_days || 0); - if (removed) - admin_log('dawnline', 'cleared', null, 'the service log', `${removed} entr${removed == 1 ? 'y' : 'ies'}${+a.older_days ? ` older than ${a.older_days} days` : ''}`); - return { removed }; -} - -function backup_restore(a) { - let r = backup.backup_restore(a.name); - admin_log('dawnline', 'restored', 'backup', a.name); - return r; -} - -function backup_upload(a) { - let r = backup.backup_upload(a.data); - admin_log('dawnline', 'restored', 'backup', 'from a file'); - return r; -} - -function export_all(a) { - let r = backup.export_json(); - admin_log('dawnline', 'exported', null, 'all settings', 'the file holds private keys'); - return r; -} - -function import_all(a) { - let r = backup.import_json(a.data); - admin_log('dawnline', 'imported', null, 'settings from a file'); - return r; -} - -/** Remove Dawnline's state from the router (the package is removed by the UI afterwards). */ -function uninstall(a) { - if (a.confirm != 'remove') - die(_('Type "remove" to confirm.')); - // Not in the middle of an update (opkg/apk may be installing Dawnline itself). - if (upd.busy()) - die(_('An update is running: wait for it to finish, then remove Dawnline.')); - backup.backup_create('pre-remove'); - // Stop first: the agent would put back what teardown removes, and could start an automatic update. - system('/etc/init.d/dawnline stop >/dev/null 2>&1; /etc/init.d/dawnline disable >/dev/null 2>&1'); - apply.teardown(); - store.transact((c, m) => { - let rm = []; - c.foreach(core.CONFIG, null, (s) => { - if (s['.type'] != 'settings') - push(rm, s['.name']); - }); - for (let n in rm) - c.delete(core.CONFIG, n); - c.set(core.CONFIG, 'settings', 'settings'); - c.set(core.CONFIG, 'settings', 'portal_enabled', '0'); - }); - return { ok: true }; -} - -export const methods = { - apply: { call: wrap((a) => apply.apply()) }, - health: { call: wrap((a) => health_view()) }, - health_fix: { args: { id: '' }, call: wrap((a) => health_view({ result: health.fix(a.id) })) }, - service_log: { call: wrap((a) => watchdog.view(core.load())) }, - service_log_clear: { args: { older_days: '' }, call: wrap(service_log_clear) }, - backup_list: { call: wrap((a) => ({ backups: backup.backup_list() })) }, - backup_create: { call: wrap((a) => ({ name: backup.backup_create(null) })) }, - backup_restore: { args: { name: '' }, call: wrap(backup_restore) }, - backup_delete: { args: { name: '' }, call: wrap((a) => ({ ok: backup.backup_delete(a.name) })) }, - backup_read: { args: { name: '' }, call: wrap((a) => ({ data: backup.backup_read(a.name) })) }, - backup_upload: { args: { data: '' }, call: wrap(backup_upload) }, - 'export': { call: wrap(export_all) }, - 'import': { args: { data: {} }, call: wrap(import_all) }, - uninstall: { args: { confirm: '' }, call: wrap(uninstall) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc deleted file mode 100644 index ae189a9..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/people.uc +++ /dev/null @@ -1,195 +0,0 @@ -// Dawnline rpcd methods: people (adding, editing, pausing, their personal -// links and traffic) and their devices. - -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as view from 'dawnline.view'; -import * as awg from 'dawnline.awg'; -import * as store from 'dawnline.store'; -import * as devices from 'dawnline.devices'; -import * as lookup from 'dawnline.lookup'; -import { wrap, str, clamp_days } from 'dawnline.rpc.common'; -import { _ } from 'dawnline.i18n'; - -const PERSON_FIELDS = [ 'name', 'access', 'device_limit', 'expires', 'expire_action', 'expire_warn', 'quota_gb', 'quota_period', - 'bonus_gb', 'hours', 'note', 'dns_mode', 'server' ]; - -/* ---------- people ---------- */ - -function person_create(a) { - let id = store.transact((c, m) => core.create_person(c, m, { - name: str(a.name), slug: str(a.slug) || null, server: str(a.server) || null, access: a.access, - device_limit: str(a.device_limit), expires: str(a.expires), quota_gb: str(a.quota_gb), quota_period: a.quota_period, - })); - let m = core.load(); - live.add_event({ type: 'person_added', person: id, detail: m.people[id].name, by: 'admin' }); - return { id, link: core.portal_url(m, m.people[id]) }; -} - -/** Immediate edits from the person's page; returns the person as the page shows them. */ -function person_update(a) { - let fields = {}; - for (let k in PERSON_FIELDS) - if (a[k] != null) - fields[k] = a[k]; - if (a.paused != null) - fields.paused = a.paused; - if (type(a.services) == 'array') - fields.services = a.services; - if (a.circle != null) - fields.circle = a.circle; - if (type(a.home_nets) == 'array') - fields.home_nets = a.home_nets; - let m0 = null; - let before = store.transact((c, m) => { - let p = m.people[a.id]; - m0 = m; - core.update_person(c, m, a.id, fields); - return p; - }); - // "moved to Test" says more than "server". - let changes = join(', ', map(filter(keys(fields), (k) => k != 'note'), - (k) => k == 'server' && m0?.servers[fields.server] ? `moved to ${m0.servers[fields.server].name}` : k)); - if (changes) - live.add_event_merged({ type: 'person_changed', person: a.id, detail: changes, by: 'admin' }, 120); - // Access changes affect the nft sets and client AllowedIPs. - let s = apply.sync(); - let m = core.load(); - let u = core.load_usage(); - // One person: only their server's tunnel is read. - let p = m.people[a.id]; - return { person: view.person_view(m, p, u, live.dump(m, p.server ?? ''), view.states(m, u), { admin: true }), was: before?.access, warning: s.warning }; -} - -function person_pause(a) { - store.transact((c, m) => { - if (!m.people[a.id]) - die(_('Unknown person.')); - if (a.paused) - c.set(core.CONFIG, a.id, 'paused', '1'); - else - c.delete(core.CONFIG, a.id, 'paused'); - }); - live.add_event({ type: a.paused ? 'paused' : 'resumed', person: a.id, by: 'admin' }); - return apply.sync(); -} - -/** - * A new personal link: the old one stops working at once (every portal - * request carries the code). What the old link already handed out stays - * unless asked: `remove` lists the person's devices to take away with it. - */ -function person_regen(a) { - let gone = store.transact((c, m) => { - if (!m.people[a.id]) - die(_('Unknown person.')); - c.set(core.CONFIG, a.id, 'code', core.new_code()); - c.set(core.CONFIG, a.id, 'code_set', `${time()}`); - let gone = []; - for (let id in (type(a.remove) == 'array' ? a.remove : [])) - if (m.devices[id]?.person == a.id) { - push(gone, m.devices[id]); - core.delete_device(c, m, id); - } - return gone; - }); - live.add_event({ type: 'link_changed', person: a.id, by: 'admin' }); - let s = null; - if (length(gone)) { - for (let d in gone) - live.add_event({ type: 'device_removed', person: a.id, device: d.id, detail: d.name, dname: d.name, dkind: d.kind, by: 'admin' }); - s = apply.sync(); - } - let m = core.load(); - return { link: core.portal_url(m, m.people[a.id]), removed: length(gone), warning: s?.warning }; -} - -/** The personal code and links (Copy link, QR, invite): admins only, unlike status. */ -function person_links(a) { - let m = core.load(); - let p = m.people[a.id]; - if (!p) - die(_('Unknown person.')); - return { code: p.code, link: core.portal_url(m, p), links: core.portal_urls(m, p) }; -} - -function person_delete(a) { - let name = store.transact((c, m) => { - let name = m.people[a.id]?.name; - core.delete_person(c, m, a.id); - return name; - }); - live.add_event({ type: 'person_removed', person: a.id, detail: name, pname: name, by: 'admin' }); - return apply.sync(); -} - -function person_usage(a) { - let usage = core.load_usage(); - let m = core.load(); - let p = m.people[a.id]; - if (!p) - die(_('Unknown person.')); - let days = clamp_days(a.days); - let devs = {}; - for (let d in p.devices) - devs[d] = live.series([ usage.devices?.[d] ], days); - return { person: live.series([ usage.people?.[a.id] ], days), devices: devs }; -} - -/* ---------- devices ---------- */ - -function device_create(a) { - devices.need_awg(); - return devices.add(a.person, a.name, a.kind, { by: 'admin', lan_bypass: a.lan_bypass === true }); -} - -/** - * A device's configuration. Only `issue` (true: the admin shows its QR code, - * downloads or copies it) counts as handing it out; a look at the device - * marks nothing, so its "settings changed" stays until it really gets them. - */ -function device_config(a) { - let m = core.load(); - let d = m.devices[a.id]; - if (!d) - die(_('Unknown device.')); - if (a.issue === true) - awg.mark_issued(m, d.id); - let cfg = awg.client_config(m, d); - // V2RayTun on Android takes the server by its IP (the admin's set-up shows its link for phones, tablets and - // other devices): only where it can connect at all, and AmneziaWG 3.1 (Maximum) is beyond it. - let srv = m.servers[m.people[d.person]?.server]; - if (cfg && d.kind != 'router' && d.kind != 'computer' && srv?.preset != 'max') - cfg.amnezia.host_ip = lookup.host_ip(cfg.amnezia.host); - return cfg; -} - -/** Name, on/off and the link values (mtu, keepalive: strings, '' = the server's; lan_bypass: true or false). */ -function device_update(a) { - return devices.update(a.id, { name: a.name, disabled: a.disabled, mtu: a.mtu, keepalive: a.keepalive, - lan_bypass: a.lan_bypass == null ? null : a.lan_bypass === true }, { by: 'admin' }); -} - -export const methods = { - person_create: { - args: { name: '', slug: '', server: '', access: '', device_limit: '', expires: '', quota_gb: '', quota_period: '' }, - call: wrap(person_create), - }, - person_update: { - args: { id: '', name: '', access: '', device_limit: '', expires: '', expire_action: '', expire_warn: '', quota_gb: '', - quota_period: '', bonus_gb: '', hours: '', note: '', dns_mode: '', paused: false, services: [], circle: '', home_nets: [], server: '' }, - call: wrap(person_update), - }, - person_pause: { args: { id: '', paused: false }, call: wrap(person_pause) }, - person_regen: { args: { id: '', remove: [] }, call: wrap(person_regen) }, - person_links: { args: { id: '' }, call: wrap(person_links) }, - person_delete: { args: { id: '' }, call: wrap(person_delete) }, - person_usage: { args: { id: '', days: 30 }, call: wrap(person_usage) }, - device_create: { args: { person: '', name: '', kind: '', lan_bypass: false }, call: wrap(device_create) }, - device_config: { args: { id: '', issue: false }, call: wrap(device_config) }, - device_update: { args: { id: '', name: '', disabled: false, mtu: '', keepalive: '', lan_bypass: false }, call: wrap(device_update) }, - device_delete: { args: { id: '' }, call: wrap((a) => devices.remove(a.id, { by: 'admin' })) }, - // New keys: the device is set up again, as with the portal's Reconnect. - device_rotate: { args: { id: '' }, call: wrap((a) => devices.reconnect(a.id, { by: 'admin' })) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc deleted file mode 100644 index fadd2dc..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/servers.uc +++ /dev/null @@ -1,662 +0,0 @@ -// Dawnline rpcd methods: setting up a server, its General / Network / -// Interfaces settings, its disguise, and removing it. - -import { cursor } from 'uci'; -import { sh_out, sh_bg, parse_cidr, cidr_str, cidr_overlaps, valid_host, valid_name, rand_int, uniq, admin_log } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as net from 'dawnline.net'; -import * as loop from 'dawnline.loop'; -import * as awg from 'dawnline.awg'; -import * as store from 'dawnline.store'; -import * as schema from 'dawnline.schema'; -import * as health from 'dawnline.health'; -import * as backup from 'dawnline.backup'; -import * as devices from 'dawnline.devices'; -import { wrap, str, check_method, default_method, check_portal, tcp_taken } from 'dawnline.rpc.common'; -import { _ } from 'dawnline.i18n'; - -/** Server ids that would shadow a portal path. */ -const PORTAL_PATHS = [ 'api', 'assets', 'cgi-bin' ]; - -const MESH_WORDS = { off: 'devices kept apart', all: 'devices reach each other', circles: 'devices reach each other in circles' }; - -/* ---------- free names, ports and subnets ---------- */ - -/** - * UDP ports a server can't listen on, and who holds them: [{ from, to, who }]. - * Other servers, tunnel interfaces, programs on the router and port forwards - * from its WAN zone. `srv` is the server being edited: its own port isn't counted. - * `who` is shown in the admin's language ("Used by %s."). - */ -function udp_taken(m, srv, wan_zone) { - let out = []; - let held = {}; - let hold = (p, who) => { - if (p > 0 && !held[p]) { - held[p] = true; - push(out, { from: p, to: p, who }); - } - }; - for (let id, o in m.servers) - if (id != srv?.id) - hold(o.port, sprintf(_('server “%s”'), o.name)); - let nc = cursor(); - nc.load('network'); - nc.foreach('network', 'interface', (s) => { - if (s.listen_port && s['.name'] != srv?.ifname) - hold(+s.listen_port, sprintf(_('interface %s'), s['.name'])); - }); - let progs = health.udp_port_programs(); - for (let p in health.udp_bound()) - if (p != srv?.port) - hold(p, progs[`${p}`] ? sprintf(_('%s on this router'), progs[`${p}`]) : _('another program on this router')); - for (let f in core.wan_forwards(wan_zone, 'udp')) - push(out, { from: f.from, to: f.to, who: sprintf(_('port forward “%s”'), f.name) }); - return out; -} - -function check_udp_port(port, taken) { - for (let t in taken) - if (t.from <= port && port <= t.to) - die(sprintf(_('UDP %d is used by %s. Choose another port.'), port, t.who)); -} - -/** The usual AmneziaWG port when free, otherwise a random high one. */ -const DEFAULT_PORT = 4500; - -function free_port(taken) { - let used = (p) => length(filter(taken, (t) => t.from <= p && p <= t.to)) > 0; - if (!used(DEFAULT_PORT)) - return DEFAULT_PORT; - for (let i = 0; i < 50; i++) { - let p = rand_int(40000, 60000); - if (!used(p)) - return p; - } - return 51830; -} - -function free_subnet(taken) { - for (let i = 0; i < 300; i++) { - // 10.x first; past 200 tries (a 10/8 LAN) the 172.16-31 range. - let cand = parse_cidr(i < 200 ? sprintf('10.%d.%d.0/24', rand_int(60, 250), rand_int(0, 250)) : sprintf('172.%d.%d.0/24', rand_int(16, 31), rand_int(0, 250))); - let bad = false; - for (let t in taken) { - let tc = parse_cidr(t); - if (tc && cidr_overlaps(cand, tc)) { - bad = true; - break; - } - } - if (!bad) - return cidr_str(cand); - } - return '10.77.0.0/24'; -} - -/** - * A portal port free together with the next one (plain HTTP for IP links): - * `first` (the server's UDP number, TCP is another port) before the usual ones. - */ -function free_portal_port(first, cur, taken) { - let used = (p) => length(filter(taken, (t) => t.from <= p && p <= t.to)) > 0; - for (let p in uniq([ first, cur || 8443, 8443, 9443, 10443, 7443, 4443 ])) - if (!used(p) && !used(p + 1)) - return p; - return 9443; -} - -/** A network section name nothing uses: not the router's, not Dawnline's own links, not another server's. */ -function ifname_free(m, nc, n) { - if (nc.get('network', n) != null || index(values(net.INTERNAL), n) >= 0) - return false; - for (let id, s in m.servers) - if (s.ifname == n) - return false; - return true; -} - -function free_ifname(m) { - let nc = cursor(); - nc.load('network'); - for (let i = 0; i < 10; i++) - if (ifname_free(m, nc, `dawn${i}`)) - return `dawn${i}`; - return 'dawnx'; -} - -function id_free(m, id) { - return !store.id_taken(m, id) && index(PORTAL_PATHS, id) < 0; -} - -/** A free server id: home, then server2, server3, … (never an id anything else has). */ -function free_server_id(m) { - if (id_free(m, 'home')) - return 'home'; - for (let n = 2; ; n++) - if (id_free(m, `server${n}`)) - return `server${n}`; -} - -/** Networks a new server must not overlap, by name: the router's and the other servers'. */ -function taken_networks(m) { - let out = []; - let seen = {}; - let add = (name, cidr) => { - let c = parse_cidr(cidr); - if (c && !seen[cidr_str(c)]) { - seen[cidr_str(c)] = true; - push(out, { name, cidr: cidr_str(c) }); - } - }; - for (let n in health.networks()) - add(n.iface, n.cidr); - for (let id, s in m.servers) - add(s.name, s.subnet); - return out; -} - -/* ---------- setup ---------- */ - -function setup_defaults(a) { - let m = core.load(); - let networks = taken_networks(m); - let zones = []; - let fc = cursor(); - fc.load('firewall'); - fc.foreach('firewall', 'zone', (z) => push(zones, z.name)); - let snap = net.snapshot(true); - let wan_ip = snap.wan ? split(snap.devices[snap.wan]?.addrs?.[0] ?? '', '/')[0] : ''; - let kind = health.wan_kind(wan_ip || null); - let host = m.settings.portal_host, from = host ? 'portal' : ''; - if (!host) { - // Prefer a DDNS name, then an ACME certificate's, then the WAN address — - // but never a private or CGNAT one: nobody on the internet reaches it. - let dc = cursor(); - if (dc.load('ddns')) - dc.foreach('ddns', 'service', (s) => { - if (!host && s.lookup_host && s.enabled == '1') { - host = s.lookup_host; - from = 'ddns'; - } - }); - if (!host) { - host = sh_out("ls /etc/ssl/acme/ 2>/dev/null | sed -n 's/\\.fullchain\\.crt$//p' | head -n1") || ''; - from = host ? 'cert' : ''; - } - if (!host && kind == 'public') { - host = wan_ip; - from = 'wan'; - } - } - // The zones the WAN and LAN devices are in, whatever they are called. - let wan_zone = snap.devices[snap.wan]?.zone ?? (index(zones, 'wan') >= 0 ? 'wan' : zones[1]); - let lan_zone = snap.devices[snap.lan]?.zone ?? (index(zones, 'lan') >= 0 ? 'lan' : zones[0]); - let udp = udp_taken(m, null, wan_zone); - let tcp = tcp_taken(m); - let port = free_port(udp); - return { - id: free_server_id(m), - // A name to start from, in the admin's language (it is theirs once saved). - name: length(m.servers) ? sprintf(_('Server %d'), length(m.servers) + 1) : _('Home'), - ifname: free_ifname(m), - port, - subnet: free_subnet(map(networks, (n) => n.cidr)), - endpoint: host, - // Where the address came from (ddns, cert, wan, portal) and what the WAN is (public, private, cgnat, none). - endpoint_from: from, - wan_kind: kind, - wan_ip: wan_ip || null, - // Automatic. - mtu: 0, - zones, - lan_zone, - wan_zone, - // A portal already on keeps its port; a new one takes the server's number when it can. - portal_port: m.settings.portal_enabled ? m.settings.portal_port : free_portal_port(port, m.settings.portal_port, tcp), - awg: awg.caps(), - awg_state: awg.load(), - networks, - udp_taken: udp, - tcp_taken: tcp, - }; -} - -/** - * Where a public address points, as the admin types it (debounced in the - * UI): the same facts Health uses, in words. `id` names the server whose WAN - * to compare with (a new one: the default WAN). - */ -function endpoint_probe(a) { - let host = str(a.host); - if (host != '' && !valid_host(host)) - die(_('Public address must be a hostname or IP address.')); - let m = core.load(); - let srv = m.servers[str(a.id)] ?? null; - let f = health.endpoint_facts(srv, host); - let w = health.endpoint_words(f, `UDP ${srv?.port ?? +a.port || 4500}`); - return { ...f, status: w.status, text: w.text }; -} - -/** AmneziaWG can run a server: installed, and its kernel module loads. */ -function need_awg_loaded() { - devices.need_awg(); - if (!awg.load().loaded) - die(_("AmneziaWG's kernel module doesn't load on this firmware: reinstall a build for this kernel in Components.")); -} - -/** An MTU as typed: '' (automatic) or 1280-1500. */ -function check_mtu(v) { - let s = str(v); - if (s != '' && (!match(s, /^[0-9]{1,4}$/) || +s < 1280 || +s > 1500)) - die(_('MTU must be 1280-1500.')); - return s; -} - -function server_create(a) { - need_awg_loaded(); - let snap = net.snapshot(true); - let router_subnets = health.used_subnets(null); - let id = store.transact((c, m) => { - let id = str(a.id) || 'home'; - // A UCI section name: a dash would make uci drop it silently. - if (!match(id, /^[a-z][a-z0-9_]{0,23}$/)) - die(_('Server ID may use lowercase letters, digits and underscores.')); - if (!id_free(m, id)) - die(sprintf(_('"%s" is already taken.'), id)); - let nc = cursor(); - nc.load('network'); - let ifname = str(a.ifname) || free_ifname(m); - if (!ifname_free(m, nc, ifname)) - die(sprintf(_('Network interface %s already exists.'), ifname)); - let udp = udp_taken(m, null, str(a.wan_zone) || 'wan'); - let port = free_port(udp); - if (a.port != null && str(a.port) != '' && str(a.port) != '0') { - if (!schema.valid_port(a.port)) - die(_('UDP port must be 1-65535.')); - port = +str(a.port); - } - check_udp_port(port, udp); - let mtu = check_mtu(a.mtu == 0 ? '' : a.mtu); - let preset = str(a.preset) || default_method(); - let srv = { id, ifname, port, subnet: str(a.subnet), endpoint: str(a.endpoint), obf: awg.obf_preset(check_method(preset)) }; - let pc = parse_cidr(srv.subnet); - if (pc) - srv.subnet = cidr_str(pc); - // Public addresses inside the tunnel would hide the real hosts behind them. - // New servers only: a restored backup keeps what it had. - if (pc && !core.private_cidr(pc)) - die(_('Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.')); - let taken = [ ...router_subnets ]; - for (let sid, o in m.servers) - push(taken, o.subnet); - let errs = core.server_errors(m, srv, taken); - push(errs, ...awg.obf_errors(srv.obf)); - if (length(errs)) - die(join(' ', errs)); - - let set = (k, v) => c.set(core.CONFIG, id, k, v); - c.set(core.CONFIG, 'settings', 'settings'); - c.set(core.CONFIG, id, 'server'); - if (!valid_name(str(a.name) || 'Home')) - die(_('Server: Enter a name: up to 48 characters, without < > " or \\.')); - set('name', str(a.name) || 'Home'); - set('ifname', ifname); - set('port', `${port}`); - set('subnet', srv.subnet); - if (srv.endpoint) - set('endpoint', srv.endpoint); - if (mtu) - set('mtu', mtu); - set('keepalive', '25'); - let kp = awg.server_keys(); - set('private_key', kp.private_key); - set('public_key', kp.public_key); - set('preset', preset); - for (let ok, ov in srv.obf) - set(ok, ov); - set('lan_zone', str(a.lan_zone) || 'lan'); - set('wan_zone', str(a.wan_zone) || 'wan'); - set('auto_wan', '1'); - set('auto_lan', '1'); - if (snap.wan) - set('detected_wan', snap.wan); - if (snap.lan) - set('detected_lan', snap.lan); - // Off unless asked for: the loop through the LAN costs speed (the wizard says how much). - set('lan_like', a.lan_like === true || a.lan_like === 1 || a.lan_like === '1' ? '1' : '0'); - set('enabled', '1'); - if (a.portal_enabled != null) { - let on = a.portal_enabled === true || a.portal_enabled === 1 || a.portal_enabled === '1'; - c.set(core.CONFIG, 'settings', 'portal_enabled', on ? '1' : '0'); - if (a.portal_port != null && str(a.portal_port) != '' && str(a.portal_port) != '0') { - if (!schema.valid_port(a.portal_port)) - die(_('Portal port must be 1-65535.')); - c.set(core.CONFIG, 'settings', 'portal_port', `${+str(a.portal_port)}`); - } - } - if (srv.endpoint && !c.get(core.CONFIG, 'settings', 'portal_host') && valid_host(srv.endpoint)) - c.set(core.CONFIG, 'settings', 'portal_host', srv.endpoint); - // The portal as it will be, whatever this call changed. - check_portal(core.load(c), m); - return id; - }); - let r = apply.apply(); - system('/etc/init.d/dawnline enabled || /etc/init.d/dawnline enable'); - let made = core.load().servers[id]; - admin_log('dawnline', 'created', 'server', made?.name ?? id, made ? `UDP ${made.port}` : null); - // netifd reads its protocol handlers when it starts: AmneziaWG installed - // after that (by hand, or by an older installer) needs a network restart. - let network_restart = !awg.state().handler; - sh_bg(network_restart ? '/etc/init.d/network restart; /etc/init.d/dawnline restart' : '/etc/init.d/dawnline restart'); - return { id, applied: r, network_restart, warning: r.warning }; -} - -/* ---------- interfaces ---------- */ - -/** Interfaces card on the Server page: what exists, what is detected, what the server uses. */ -function interfaces_view(m, srv, snap) { - let sn = net.server_net(srv, snap); - let home = {}; - for (let h in sn.home) - home[h.dev] = h; - let devs = []; - for (let dev, d in snap.devices) - push(devs, { - ...d, - own: dev == srv.ifname, - home: !!home[dev], - auto: !!home[dev]?.auto, - }); - // Saved names that no longer exist still show, so they can be removed. - for (let h in sn.home) - if (h.missing) - push(devs, { name: h.dev, category: 'other', kind: 'other', missing: true, nets: [], addrs: [], members: [], home: true, auto: h.auto }); - let lan_only = 0; - for (let id, p in m.people) - if (p.server == srv.id && p.access == 'lan') - lan_only++; - return { - server: srv.id, - ifname: srv.ifname, - detected: { wan: snap.wan, lan: snap.lan }, - saved: { wan: srv.detected_wan, lan: srv.detected_lan }, - config: { auto_wan: srv.auto_wan, wan_device: srv.wan_device, auto_lan: srv.auto_lan, lan_devices: srv.lan_devices, lan_like: srv.lan_like, - device_mesh: srv.device_mesh, mesh: srv.mesh }, - like_home: loop.status(), - needs: health.needs().home, - effective: sn, - zones: snap.zones, - devices: devs, - lan_only, - }; -} - -function interfaces_get(a) { - let m = core.load(); - let srv = m.servers[a.id] ?? values(m.servers)[0]; - if (!srv) - die(_('No server yet.')); - return interfaces_view(m, srv, net.snapshot(true)); -} - -function server_interfaces(a) { - let snap = net.snapshot(true); - let auto_wan = a.auto_wan != false && a.auto_wan != '0'; - let auto_lan = a.auto_lan != false && a.auto_lan != '0'; - let wan_dev = str(a.wan_device); - let res = store.transact((c, m) => { - let srv = m.servers[a.id]; - if (!srv) - die(_('Unknown server.')); - if (!auto_wan) { - if (!snap.devices[wan_dev]) - die(_('Choose the interface that leads to the internet.')); - if (!snap.devices[wan_dev].zone) - die(sprintf(_('%s is not in a firewall zone, so the server port cannot be opened on it.'), wan_dev)); - } - let lans = []; - for (let d in (type(a.lan_devices) == 'array' ? a.lan_devices : [])) { - d = str(d); - // Unknown names are kept only if they were saved before (interface down right now). - if (d == '' || d == srv.ifname || (!snap.devices[d] && index(srv.lan_devices, d) < 0)) - continue; - if (snap.devices[d]?.master) - die(sprintf(_('%s is part of %s; choose %s instead.'), d, snap.devices[d].master, snap.devices[d].master)); - if (d == (auto_wan ? snap.wan : wan_dev)) - die(sprintf(_('%s is the WAN.'), d)); - push(lans, d); - } - lans = uniq(lans); - let id = srv.id; - if (a.lan_like != null) - c.set(core.CONFIG, id, 'lan_like', a.lan_like === false || a.lan_like === '0' ? '0' : '1'); - let mesh = index(core.MESH, a.mesh) >= 0 ? a.mesh - : a.device_mesh == null ? srv.mesh : (a.device_mesh === false || a.device_mesh === '0' ? 'off' : 'all'); - c.set(core.CONFIG, id, 'mesh', mesh); - c.delete(core.CONFIG, id, 'device_mesh'); - c.set(core.CONFIG, id, 'auto_wan', auto_wan ? '1' : '0'); - c.set(core.CONFIG, id, 'auto_lan', auto_lan ? '1' : '0'); - if (auto_wan || wan_dev == '') - c.delete(core.CONFIG, id, 'wan_device'); - else - c.set(core.CONFIG, id, 'wan_device', wan_dev); - if (length(lans)) - c.set(core.CONFIG, id, 'lan_device', lans); - else - c.delete(core.CONFIG, id, 'lan_device'); - // Remember what was detected, as the fallback while an interface is down. - if (snap.wan) - c.set(core.CONFIG, id, 'detected_wan', snap.wan); - if (snap.lan) - c.set(core.CONFIG, id, 'detected_lan', snap.lan); - // Keep the legacy zone options in step (older code paths, health checks). - let now = core.load(c).servers[id]; - let sn = net.server_net(now, snap); - if (sn.wan.zone) - c.set(core.CONFIG, id, 'wan_zone', sn.wan.zone); - if (length(sn.zones)) - c.set(core.CONFIG, id, 'lan_zone', sn.zones[0]); - return { was: srv, now: core.load(c).servers[id], mesh }; - }); - let srv = res.was; - // What the admin changed here: the networks, and/or whether devices reach each other. - let sig = (x) => { - let sn = net.server_net(x, snap); - return `${join(',', sn.nets)}|${sn.wan.dev}|${x.lan_like}`; - }; - let what = []; - if (sig(res.now) != sig(srv)) - push(what, 'home network and internet path'); - if (res.mesh != srv.mesh) - push(what, MESH_WORDS[res.mesh]); - if (length(what)) - admin_log('awg', 'changed', 'server', srv.name, join(', ', what)); - let before = join(',', net.server_net(srv, snap).nets); - apply.apply(); - let m = core.load(); - let v = interfaces_view(m, m.servers[srv.id], net.snapshot(true)); - v.nets_changed = before != join(',', v.effective.nets); - return v; -} - -/* ---------- settings ---------- */ - -/** A list of DNS servers as typed (array or "a, b"): each an IPv4 or IPv6 address. */ -function dns_list(v) { - let list = filter(map(type(v) == 'array' ? v : split(str(v), /[ ,]+/), str), (x) => x != ''); - for (let d in list) - if (!schema.ip(d)) - die(sprintf(_('%s is not an IP address.'), d)); - return list; -} - -/** Server settings from the General and Network tabs; applied at once. */ -function server_update(a) { - let v = a.values ?? {}; - if (v.device_mesh != null && v.mesh == null) - v.mesh = v.device_mesh === true || v.device_mesh == '1' ? 'all' : 'off'; - let srv = store.transact((c, m) => { - let srv = m.servers[a.id]; - if (!srv) - die(_('Unknown server.')); - let set = (k, val) => (val == null || val == '') ? c.delete(core.CONFIG, srv.id, k) : c.set(core.CONFIG, srv.id, k, val); - if (v.name != null) { - if (!valid_name(str(v.name))) - die(_('Server: Enter a name: up to 48 characters, without < > " or \\.')); - set('name', str(v.name)); - } - // Empty = the portal's address (core.endpoint_host), as at creation. - if (v.endpoint != null) { - if (str(v.endpoint) != '' && !valid_host(str(v.endpoint))) - die(_('Public address must be a hostname or IP address.')); - set('endpoint', str(v.endpoint)); - } - if (v.port != null) { - if (!schema.valid_port(v.port)) - die(_('UDP port must be 1-65535.')); - let n = +str(v.port); - if (n != srv.port) - check_udp_port(n, udp_taken(m, srv, srv.wan_zone)); - set('port', `${n}`); - } - if (v.enabled != null) - set('enabled', v.enabled === true || v.enabled == '1' ? '1' : '0'); - if (v.mesh != null) { - if (index(core.MESH, v.mesh) < 0) - die(_('Unknown choice for devices reaching each other.')); - set('mesh', v.mesh); - set('device_mesh', null); - } - if (v.mtu != null) - set('mtu', check_mtu(v.mtu)); - if (v.keepalive != null) { - if (str(v.keepalive) != '' && (!match(str(v.keepalive), /^[0-9]{1,3}$/) || +v.keepalive > 600)) - die(_('Keep-alive must be 0-600 seconds.')); - set('keepalive', str(v.keepalive)); - } - if (v.dns != null) { - let list = dns_list(v.dns); - if (length(list)) - c.set(core.CONFIG, srv.id, 'dns', list); - else - c.delete(core.CONFIG, srv.id, 'dns'); - } - // A new tunnel network: private, free, and every device renumbered into it. - if (v.subnet != null && str(v.subnet) != '' && str(v.subnet) != srv.subnet) { - let pc = parse_cidr(str(v.subnet)); - if (!pc) - die(_('Subnet must look like 10.77.0.0/24.')); - if (!core.private_cidr(pc)) - die(_('Use a private range: 10.x.x.x, 172.16–31.x.x or 192.168.x.x.')); - let taken = map(filter(taken_networks(m), (n) => n.cidr != srv.subnet && n.name != srv.name), (n) => n.cidr); - for (let t in taken) - if (cidr_overlaps(pc, parse_cidr(t))) - die(sprintf(_('Subnet overlaps %s.'), t)); - core.renumber_server(c, m, srv, cidr_str(pc)); - } - return srv; - }); - // For the log: what changed, in words. Turning on or off is its own line. - let labels = { name: 'name', endpoint: 'public address', port: 'AmneziaWG port', mtu: 'MTU', keepalive: 'keep-alive', dns: 'DNS', subnet: 'tunnel network' }; - let what = []; - for (let k, label in labels) { - if (v[k] == null) - continue; - let was = k == 'dns' ? join(' ', srv.dns ?? []) : k == 'mtu' && !srv.mtu ? '' : `${srv[k] ?? ''}`; - let now = k == 'dns' ? join(' ', dns_list(v.dns)) : str(v[k]); - if (trim(was) != trim(now)) - push(what, label); - } - let turned = v.enabled == null ? null : (v.enabled === true || v.enabled == '1'); - let name = v.name != null ? str(v.name) : srv.name; - let r = apply.apply(); - if (turned != null && turned != srv.enabled) - admin_log('dawnline', turned ? 'turned on' : 'turned off', 'server', name); - if (length(what)) - admin_log('dawnline', 'changed', 'server', name, join(', ', what)); - if (v.mesh != null && v.mesh != srv.mesh) - admin_log('dawnline', 'changed', 'server', name, MESH_WORDS[v.mesh]); - return r; -} - -/** What the ports of an existing server must avoid (the AmneziaWG card checks as you type). */ -function server_ports(a) { - let m = core.load(); - let srv = m.servers[a.id]; - if (!srv) - die(_('Unknown server.')); - // `networks`: what a new tunnel network must not overlap (everything but this server's own). - return { udp_taken: udp_taken(m, srv, srv.wan_zone), tcp_taken: tcp_taken(m), - networks: filter(taken_networks(m), (n) => n.cidr != srv.subnet) }; -} - -function server_obfuscation(a) { - let preset = str(a.preset) || default_method(); - let o = awg.obf_preset(check_method(preset)); - // A cheap self-check: new values pass what a restore would be held to. - let errs = awg.obf_errors(o); - if (length(errs)) - die(join(' ', errs)); - let srv = store.transact((c, m) => { - let srv = m.servers[a.id]; - if (!srv) - die(_('Unknown server.')); - for (let k in core.OBF_KEYS) - c.delete(core.CONFIG, srv.id, k); - for (let k, v in o) - c.set(core.CONFIG, srv.id, k, v); - c.set(core.CONFIG, srv.id, 'preset', preset); - return srv; - }); - let r = apply.apply(); - admin_log('awg', 'changed', 'server', srv.name, `disguise: ${preset}`); - return r; -} - -/** Remove a server with its people, their devices and its circles (a backup is made first). */ -function server_delete(a) { - if (!core.load().servers[a.id]) - die(_('Unknown server.')); - backup.backup_create('pre-delete'); - let res = store.transact((c, m) => { - let srv = m.servers[a.id]; - if (!srv) - die(_('Unknown server.')); - let gone = 0; - for (let pid, p in m.people) - if (p.server == srv.id) { - core.delete_person(c, m, pid); - gone++; - } - for (let cid, ci in m.circles) - if (ci.server == srv.id) - c.delete(core.CONFIG, cid); - c.delete(core.CONFIG, srv.id); - return { name: srv.name, gone }; - }); - let r = apply.apply(); - admin_log('awg', 'removed', 'server', res.name, res.gone ? `with ${res.gone} ${res.gone == 1 ? 'person' : 'people'}` : null); - return r; -} - -export const methods = { - setup_defaults: { call: wrap(setup_defaults) }, - server_create: { - args: { id: '', name: '', ifname: '', port: 0, subnet: '', endpoint: '', mtu: 0, preset: '', lan_zone: '', wan_zone: '', - lan_like: true, portal_enabled: false, portal_port: 0 }, - call: wrap(server_create), - }, - server_ports: { args: { id: '' }, call: wrap(server_ports) }, - endpoint_probe: { args: { host: '', id: '', port: 0 }, call: wrap(endpoint_probe) }, - server_obfuscation: { args: { id: '', preset: '' }, call: wrap(server_obfuscation) }, - server_update: { args: { id: '', values: {} }, call: wrap(server_update) }, - interfaces: { args: { id: '' }, call: wrap(interfaces_get) }, - server_interfaces: { - args: { id: '', auto_wan: false, wan_device: '', auto_lan: false, lan_devices: [], lan_like: false, device_mesh: true, mesh: '' }, - call: wrap(server_interfaces), - }, - server_delete: { args: { id: '' }, call: wrap(server_delete) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/settings.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/settings.uc deleted file mode 100644 index 25e05f5..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/settings.uc +++ /dev/null @@ -1,169 +0,0 @@ -// Dawnline rpcd methods: the Settings page (the portal, defaults, logs and -// history, updates). What may be saved is dawnline.schema's. - -import { stat } from 'fs'; -import { q, sh_out, admin_log, syslog, RUN_DIR, DATA_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as apply from 'dawnline.apply'; -import * as geo from 'dawnline.geo'; -import * as store from 'dawnline.store'; -import * as schema from 'dawnline.schema'; -import * as health from 'dawnline.health'; -import * as pc from 'dawnline.portalcert'; -import { wrap, check_portal, tcp_taken } from 'dawnline.rpc.common'; -import { _ } from 'dawnline.i18n'; - -/** The portal's own checks from Health, shown next to its settings. */ -const PORTAL_CHECKS = [ 'portal', 'portal_dns', 'portal_reply', 'portal_http', 'cert' ]; - -function file_size(path) { - return stat(path)?.size ?? 0; -} - -/** What the log and traffic history hold right now (Settings → Logs & history). */ -function logs_info(m) { - let ev = live.load_events(); - let by = {}; - for (let cat in live.CATEGORIES) - by[cat] = 0; - for (let e in ev) - by[live.category_of(e.type)]++; - let usage = core.load_usage(); - let days = {}; - for (let grp in [ usage?.devices ?? {}, usage?.people ?? {} ]) - for (let id, rec in grp) - for (let k in keys(rec.days ?? {})) - days[k] = true; - let dk = sort(keys(days)); - return { - policy: live.policy(m.settings.retention), - events: length(ev), - oldest: length(ev) ? ev[0].ts : 0, - by_category: by, - log_ram: file_size(`${RUN_DIR}/events.json`), - log_flash: file_size(`${DATA_DIR}/events.json`), - usage_flash: file_size(`${DATA_DIR}/usage.json`), - usage_since: length(dk) ? dk[0] : '', - usage_days: length(dk), - geo_flash: file_size(`${DATA_DIR}/geo.json`), - }; -} - -function settings_get(a) { - let c = core.open_cursor(); - let raw = c.get_all(core.CONFIG, 'settings') ?? {}; - let m = core.load(c); - let out = {}; - for (let k in keys(schema.SETTINGS)) - out[k] = raw[k] ?? ''; - out.log_category = live.policy(m.settings.retention).categories; - let cert = m.settings.portal_enabled ? pc.portal_cert(m.settings) : null; - return { - settings: out, - needs: health.needs(), - effective: m.settings, - services: values(m.services), - cert: cert ? { path: cert.cert, self_signed: cert.self_signed, - expires: sh_out(`openssl x509 -enddate -noout -in ${q(cert.cert)} 2>/dev/null | cut -d= -f2`) } : null, - tcp_taken: tcp_taken(m), - portal_public_port: core.portal_public_port(m), - geo_cached: length(keys(geo.load().ips)), - logs: logs_info(m), - }; -} - -/* - * The slow part of the portal settings (DNS lookups and the Health checks), - * fetched after the page shows. - */ -function portal_info(a) { - let m = core.load(); - return { - candidates: pc.portal_candidates(m), - checks: filter(health.health(m), (x) => index(PORTAL_CHECKS, x.id) >= 0), - }; -} - -function same(a, b) { - return (type(a) == 'array' ? join('\n', a) : a ?? '') == (type(b) == 'array' ? join('\n', b) : b ?? ''); -} - -/** Save settings (`values`: key → value, '' back to the default); the portal is checked as it will be. */ -function settings_update(a) { - let v = a.values ?? {}; - if (type(v) != 'object') - die(_('Nothing to save.')); - let res = store.transact((c, m) => { - let restart = false; - // What each key was and became, as uci holds them (for syslog: every change, not only those worth a line). - let diff = []; - let note = (k, to) => { - let from = c.get(core.CONFIG, 'settings', k); - if (!same(to, from)) - push(diff, { k, from, to }); - }; - c.set(core.CONFIG, 'settings', 'settings'); - for (let k, val in v) { - if (k == 'log_category') { - let lst = filter(type(val) == 'array' ? val : [], (x) => index(live.CATEGORIES, x) >= 0); - note(k, length(lst) ? lst : [ '' ]); - c.set(core.CONFIG, 'settings', 'log_category', length(lst) ? lst : [ '' ]); - // Superseded by the category list. - c.delete(core.CONFIG, 'settings', 'log_connections'); - continue; - } - let nv = schema.validate(k, val); - note(k, nv); - if (schema.SETTINGS[k].restart && !same(nv, c.get(core.CONFIG, 'settings', k))) - restart = true; - if (nv == null) - c.delete(core.CONFIG, 'settings', k); - else - c.set(core.CONFIG, 'settings', k, nv); - } - check_portal(core.load(c), m); - return { restart, was: m.settings, diff }; - }); - // Every setting that changed, in syslog: "admin changed settings · log_keep_days: 30 → 90, domain: lan → home". - if (length(res.diff)) { - let val = (x) => x == null || x == '' ? 'default' : type(x) == 'array' ? join(' ', filter(x, (y) => y != '')) || 'none' : `${x}`; - syslog('info', 'settings', `admin changed settings · ${join(', ', map(res.diff, (d) => `${d.k}: ${val(d.from)} → ${val(d.to)}`))}`); - } - let s = null; - if (res.restart) - system('/etc/init.d/dawnline reload >/dev/null 2>&1'); - else - s = apply.sync(); - // The changes worth a line: the portal and the watchdog (other settings are housekeeping). - let now = core.load().settings, was = res.was; - if (now.portal_enabled != was.portal_enabled) - admin_log('portal', now.portal_enabled ? 'turned on' : 'turned off', null, 'the personal portal', now.portal_enabled ? `port ${now.portal_port}` : null); - else if (now.portal_enabled) { - let what = []; - if (now.portal_port != was.portal_port) - push(what, `port ${now.portal_port}`); - if (now.portal_host != was.portal_host) - push(what, `address ${now.portal_host}`); - if (join(' ', now.portal_alt) != join(' ', was.portal_alt)) - push(what, 'other addresses'); - if (now.portal_cert != was.portal_cert || now.portal_key != was.portal_key) - push(what, 'certificate'); - if (now.portal_redirect != was.portal_redirect) - push(what, 'redirect'); - if (length(what)) - admin_log('portal', 'changed', null, 'the personal portal', join(', ', what)); - } - if (now.watchdog != was.watchdog) - admin_log('dawnline', now.watchdog ? 'turned on' : 'turned off', null, 'the watchdog', now.watchdog ? null : 'problems are only logged, nothing is repaired'); - let out = settings_get({}); - if (s?.warning) - out.warning = s.warning; - return out; -} - -export const methods = { - settings_get: { call: wrap(settings_get) }, - portal_info: { call: wrap(portal_info) }, - settings_update: { args: { values: {} }, call: wrap(settings_update) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc deleted file mode 100644 index 75ec1d0..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/status.uc +++ /dev/null @@ -1,309 +0,0 @@ -// Dawnline rpcd methods: the live revision, the Overview status (servers, -// people, totals, map, recent activity), the live meter, the activity log and -// traffic history. - -import { readfile } from 'fs'; -import { _ } from 'dawnline.i18n'; -import { read_json, write_json, ensure_dir, lock, unlock, admin_log, VERSION, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as view from 'dawnline.view'; -import * as geo from 'dawnline.geo'; -import * as net from 'dawnline.net'; -import * as loop from 'dawnline.loop'; -import * as awg from 'dawnline.awg'; -import * as lookup from 'dawnline.lookup'; -import * as health from 'dawnline.health'; -import * as meter from 'dawnline.meter'; -import { wrap, str, clamp_days } from 'dawnline.rpc.common'; - -/** The router's public IPv4 (null when none or private). */ -function wan_public(m) { - let w = lookup.router_wan(m); - return w && health.wan_kind(w) == 'public' ? w : null; -} - -/** The router's own public addresses: a device at home that reaches the server through the WAN address (NAT loopback) is not "outside". */ -function own_addresses(m) { - let own = {}; - for (let id, srv in m.servers) { - let a = net.wan_address(srv) ?? lookup.wan_ipv4(srv.wan_zone); - if (a) - own[a] = true; - } - let wan = lookup.wan_ipv4('wan'); - if (wan) - own[wan] = true; - return own; -} - -/** Router location plus one point per (device, recent client address). */ -function geo_view(m, usage, dmp) { - if (!m.settings.geo_enabled) - return { enabled: false, home: null, points: [] }; - let cache = geo.load(); - let points = []; - let now = time(); - // The router's own public addresses: a device at home that reaches the server through the - // WAN address (NAT loopback) shows up from there. Home is not a place people connect from. - let own = {}; - for (let id, srv in m.servers) { - let a = net.wan_address(srv) ?? lookup.wan_ipv4(srv.wan_zone); - if (a) - own[a] = true; - } - let wan = lookup.wan_ipv4('wan'); - if (wan) - own[wan] = true; - for (let id, d in m.devices) { - let rec = usage.devices?.[id]; - let peer = dmp.peers[d.public_key]; - let cur = live.endpoint_ip(peer?.endpoint); - let online = live.online(dmp, id, peer); - for (let ip, ts in rec?.ips ?? {}) { - // Local (LAN / CGNAT) client addresses and the router's own are not shown on the map. - let pl = geo.is_public(ip) && !own[ip] ? geo.place(cache, ip) : null; - if (!pl) - continue; - push(points, { - person: d.person, device: id, ip, ts, - online: online && ip == cur, - lat: pl.lat, lon: pl.lon, city: pl.city, country: pl.country, cc: pl.cc, - asn: pl.asn ?? 0, org: pl.org ?? '', - }); - } - } - let h = cache.home; - return { - enabled: true, - provider: m.settings.geo_provider, - cached: length(keys(cache.ips)), - home: (h && h.lat != null) ? { lat: h.lat, lon: h.lon, city: h.city, country: h.country, cc: h.cc, asn: h.asn ?? 0, org: h.org ?? '' } : null, - points, - }; -} - -/** Older connections from home get the DHCP name their address has now. */ -function with_hosts(ev) { - let names = null; - for (let e in ev) - if ((e.type == 'connect' || e.type == 'roam') && !e.hosts) { - let h = net.event_hosts(e, names ??= net.lan_names()); - if (h) - e.hosts = h; - } - return ev; -} - -function server_view(m, srv, usage, dmp, rates, days) { - let online = 0, peers = 0; - let links = map(core.tunnels(srv), (t) => t.ifname); - let ids = {}; - for (let id, d in m.devices) - ids[d.public_key] = id; - for (let k, p in dmp.peers) - if (index(links, p.ifname) >= 0) { - peers++; - if (live.online(dmp, ids[k], p)) - online++; - } - let st = srv.private_key ? awg.server_state(srv) : { up: false, uptime: 0 }; - // The newest handshake from a public address that is not the router's own: - // proof that the port is reachable from the internet. - let own = own_addresses(m); - let reached = 0; - for (let id, d in m.devices) - if (m.people[d.person]?.server == srv.id) - for (let ip, ts in usage.devices?.[id]?.ips ?? {}) - if (geo.is_public(ip) && !own[ip] && ts > reached) - reached = ts; - return { - id: srv.id, name: srv.name, ifname: srv.ifname, port: srv.port, subnet: srv.subnet, reached, - endpoint: core.endpoint_host(m, srv), public_key: srv.public_key, enabled: srv.enabled, - lan_like: srv.lan_like, device_mesh: srv.device_mesh, mesh: srv.mesh, preset: srv.preset, mtu: srv.mtu, keepalive: srv.keepalive, dns: srv.dns, - // What devices get now, by kind (mtu 0 = automatic). - mtus: { computer: core.device_mtu(srv, { kind: 'computer' }), phone: core.device_mtu(srv, { kind: 'phone' }) }, - address: core.server_address(srv), up: !!st.up, uptime: st.uptime ?? 0, - // Why the tunnel cannot run (its interface name belongs to another network section), or null. - // Why it can't start, as a whole sentence in the admin's language (stored as a code). - blocked: awg.blocked_text(srv), - // Home networks (interfaces) for the per-person picker. - home: map(net.server_net(srv).home, (h) => ({ dev: h.dev, nets: h.nets })), - // The header protection key is a secret every device shares: whether there is one. - peers, online, obf: awg.obf_public(srv.obf), hpk: !!srv.obf.header_protection_key, - // Bytes per second, one point a minute: [ts, rx, tx] (rx = from devices). - rate: rates[srv.id] ?? [], - // Daily traffic of the people on this server (its Overview chart). - series: live.series(map(filter(keys(m.people), (pid) => m.people[pid].server == srv.id), (pid) => usage.people?.[pid]), days), - }; -} - -/* - * Everything the pages show at once. Readable by read-only users: no personal - * codes or links here (person_links has them), and no keys but public ones - * (device_config has the rest). - */ -function status(a) { - let m = core.load(); - let usage = core.load_usage(); - let dmp = live.dump(m); - let states = view.states(m, usage); - let days = clamp_days(a.days); - - let servers = []; - let rates = read_json(`${RUN_DIR}/rate.json`, {}); - let prates = read_json(`${RUN_DIR}/rate_people.json`, {}); - for (let id, srv in m.servers) - push(servers, server_view(m, srv, usage, dmp, rates, days)); - - let people = []; - for (let id, p in m.people) { - let pv = view.person_view(m, p, usage, dmp, states, { admin: true }); - pv.rate = type(prates[p.id]?.[0]) == 'array' ? prates[p.id] : []; - push(people, pv); - } - people = sort(people, (a, b) => (b.online - a.online) || (b.last_seen - a.last_seen) || (a.name < b.name ? -1 : 1)); - - let totals = { people: length(people), devices: 0, online: 0, active: 0 }; - for (let p in people) { - totals.devices += length(p.devices); - totals.online += p.online; - if (p.state == 'active') - totals.active++; - } - let recs = values(usage.people ?? {}); - let day = live.series(recs, 1)[0]; - totals.today = [ day.rx, day.tx ]; - let mon = [ 0, 0 ]; - for (let r in recs) { - let v = live.month(r); - mon[0] += v[0]; - mon[1] += v[1]; - } - totals.month = mon; - - let events = live.load_events(); - let s = m.settings; - return { - geo: geo_view(m, usage, dmp), - version: VERSION, - now: time(), - hostname: trim(readfile('/proc/sys/kernel/hostname') ?? ''), - settings: { - portal_enabled: s.portal_enabled, portal_port: s.portal_port, portal_host: s.portal_host, - portal_public_port: core.portal_public_port(m), - default_device_limit: s.default_device_limit, domain: s.domain, - hostnames: s.hostnames, geo_enabled: s.geo_enabled, home_dns_fallback: s.home_dns_fallback, - }, - servers, - people, - services: values(m.services), - circles: values(m.circles), - totals, - series: live.series(recs, days), - events: with_hosts(slice(events, length(events) > 60 ? length(events) - 60 : 0)), - like_home: loop.status(), - awg: awg.caps(), - awg_state: awg.state(), - // The router's public IPv4 (null when none or private): a server whose public address is an old one is told so. - wan: wan_public(m), - }; -} - - -/** The newest `limit` events; `person` keeps one person's only, `since` only those after a time. */ -function events_list(a) { - // Tunnel down/up events of older versions: the service log tells it better (names, reasons). - let person = str(a.person), since = +a.since || 0; - let ev = filter(live.load_events(), (e) => e.type != 'server_down' && e.type != 'server_up' && - (!person || e.person == person) && (!since || (e.ts ?? 0) > since)); - let n = +a.limit || 300; - return { events: with_hosts(slice(ev, length(ev) > n ? length(ev) - n : 0)), total: length(ev), policy: live.policy() }; -} - -/** Remove activity by person, device, category and/or age; nothing given clears it all. */ -function logs_clear(a) { - let m = core.load(); - let f = {}; - if (a.person) { - if (!m.people[a.person]) - die(_('Unknown person.')); - f.person = a.person; - } - if (a.device) - f.device = a.device; - if (a.category) { - if (index(live.CATEGORIES, a.category) < 0) - die(_('Unknown category.')); - f.category = a.category; - } - if (a.older_days) { - if (!match(a.older_days, /^[1-9][0-9]{0,3}$/)) - die(_('Older than must be a number of days.')); - f.before = time() - +a.older_days * 86400; - } - let removed = live.clear_events(f); - if (removed) - admin_log('dawnline', 'cleared', null, 'the activity log', - join(' · ', filter([ `${removed} event${removed == 1 ? '' : 's'}`, f.category, f.person ? m.people[f.person].name : null, - a.older_days ? `older than ${a.older_days} days` : null ], (x) => x))); - return { ok: true, removed }; -} - -/** - * Reset traffic history (all | person | device). The agent owns the live - * counters, so it gets a marker; the tmpfs copy is edited too so the UI - * shows the result straight away. - */ -function usage_clear(a) { - let m = core.load(); - if (index([ 'all', 'person', 'device' ], a.scope) < 0) - die(_('Unknown scope.')); - if (a.scope == 'person' && !m.people[a.id]) - die(_('Unknown person.')); - if (a.scope == 'device' && !m.devices[a.id]) - die(_('Unknown device.')); - let req = { scope: a.scope, id: a.id, ts: time() }; - ensure_dir(RUN_DIR); - let l = lock('usage-reset'); - let pending = read_json(`${RUN_DIR}/usage.reset`, []); - push(pending, req); - write_json(`${RUN_DIR}/usage.reset`, pending, 0o600); - unlock(l); - let usage = core.load_usage(); - if (usage) { - live.reset_usage(usage, m, a.scope, a.id); - write_json(`${RUN_DIR}/usage.json`, usage, 0o600); - } - admin_log('dawnline', 'reset traffic history', null, - a.scope == 'all' ? 'for everyone' : a.scope == 'person' ? `for ${m.people[a.id].name}` : `for ${m.devices[a.id].name} (${m.people[m.devices[a.id].person]?.name})`); - return { ok: true }; -} - -/** The live revision (dawnline.live.PRESENCE): pages refresh when it moves; 0 without the agent. */ -/** The live revision, and the version answering (a page notices an update under it). */ -function rev() { - return { rev: +(live.presence()?.rev ?? 0), version: VERSION }; -} - -/* - * The live meter (Overview): each call keeps the agent's watcher writing out - * the points it keeps for meter.WANT_FOR seconds more (a first call finds - * none yet: the watcher writes the last two minutes within a second) and - * returns them (dawnline.meter.read), those newer than `since` when given. Read-only users may look: server ids - * and bytes per second only, no keys or personal codes. - */ -function meter_points(a) { - meter.want(); - return meter.read(+a.since || 0); -} - -export const methods = { - rev: { call: wrap(rev) }, - meter: { args: { since: 0 }, call: wrap(meter_points) }, - status: { args: { days: 30 }, call: wrap(status) }, - events: { args: { limit: 300, person: '', since: 0 }, call: wrap(events_list) }, - logs_clear: { args: { person: '', device: '', category: '', older_days: '' }, call: wrap(logs_clear) }, - usage_clear: { args: { scope: '', id: '' }, call: wrap(usage_clear) }, - geo_clear: { call: wrap((a) => { geo.clear(); return { ok: true }; }) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc deleted file mode 100644 index 23ee438..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/rpc/updates.uc +++ /dev/null @@ -1,152 +0,0 @@ -// Dawnline rpcd methods for the Components tab: status, starting update jobs -// (the updater does the work in the background), releases, release notes -// and the changes between two releases. luci.dawnline merges `methods`. - -import { readfile } from 'fs'; -import { cursor } from 'uci'; -import { read_json, ensure_dir, VERSION, REPO, RUN_DIR } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as health from 'dawnline.health'; -import * as upd from 'dawnline.updates'; -import * as gh from 'dawnline.github'; -import * as builds from 'dawnline.awg_builds'; -import { NAMES as PKG_NAMES } from 'dawnline.upd_pkgs'; -import { langs } from 'dawnline.upd_app'; -import * as i18n from 'dawnline.i18n'; -import { _ } from 'dawnline.i18n'; - -const TAG = /^v?[0-9][0-9A-Za-z.+~-]{0,40}$/; -// check[:app|amneziawg|packages] | app[@tag|:reinstall|:rollback|:lang:|:nolang] -// | amneziawg[:auto|slava|grey[:ru]|:rollback] | pkgs: (only packages Dawnline manages) -const TARGET = /^(check(:(app|amneziawg|packages))?|app(@v?[0-9][0-9A-Za-z.+~-]{0,40}|:reinstall|:rollback|:lang:[a-z]{2,3}(_[A-Za-z]{2,4})?|:nolang)?|amneziawg(:rollback|:(auto|slava|grey)(:ru)?)?|pkgs:[a-z0-9][a-z0-9.+,-]*)$/; - -function wrap(fn) { - return function(req) { - try { - let r = fn(req.args ?? {}); - return type(r) == 'object' ? r : { result: r }; - } - catch (e) { - return { error: e.message ?? `${e}` }; - } - }; -} - -/** AmneziaWG interfaces by name: switching builds restarts them. */ -function awg_tunnels() { - let out = []; - let c = cursor(); - c.load('network'); - c.foreach('network', 'interface', (s) => { - if (s.proto == 'amneziawg' && s.disabled != '1') - push(out, s._dawnline_name ?? s['.name']); - }); - return out; -} - -// A line of /etc/openwrt_release. A module constant, compiled once, not for each line. -const RELEASE_LINE = /^DISTRIB_(RELEASE|TARGET|ARCH)='([^']*)'/; - -function status(a) { - let m = core.load(); - let rel = {}; - for (let line in split(readfile('/etc/openwrt_release') ?? '', '\n')) { - let x = match(line, RELEASE_LINE); - if (x) - rel[lc(x[1])] = x[2]; - } - return { - version: VERSION, - firmware: { version: rel.release ?? '', target: rel.target ?? '', arch: rel.arch ?? '' }, - portal: m.settings.portal_enabled, - home: length(filter(values(m.servers), (x) => x.lan_like)) > 0, - needs: health.needs(), - check: read_json(upd.CHECK_FILE, null), - job: upd.job(), - now: time(), - repo: REPO, - policy: m.settings.updates, - auto: upd.auto_state(), - kept: upd.kept_all(builds.firmware()?.postfix), - // The admin's translations installed (luci-i18n-dawnline-). - translations: langs(), - history: slice(upd.history(), 0, 12), - tunnels: awg_tunnels(), - }; -} - -/** Releases for the Versions list (Dawnline), five per page. */ -function releases(a) { - let page = +(a.page ?? 1); - if (page != int(page) || page < 1 || page > 50) - die(_('Unknown page.')); - return { releases: map(gh.releases(REPO, page), (x) => ({ ...x, body: null, digests: null, ids: null })), page }; -} - -/** Release notes for What's new: Dawnline by tag, or an AmneziaWG build's release. */ -function notes(a) { - let rp = a.component == 'amneziawg' ? builds.SOURCES[a.build || 'slava']?.repo : REPO; - let tag = a.tag ?? ''; - if (!rp || !match(tag, TAG)) - die(_('Unknown release.')); - let r = gh.release(rp, tag); - if (!r && a.component != 'amneziawg' && substr(tag, 0, 1) != 'v') - r = gh.release(rp, `v${tag}`); - if (!r) - die(sprintf(_('No release %s in %s.'), tag, rp)); - return { ...r, digests: null, ids: null, repo: rp }; -} - -/** What changed between the installed Dawnline and a release (points for the Components tab). */ -function changes(a) { - let to = a.to ?? '', from = a.from ?? ''; - if (!match(to, TAG) || (from != '' && !match(from, TAG))) - die(_('Unknown release.')); - // The installed version as a tag when it was released (a build ahead of the releases has none). - let base = null; - for (let t in (from != '' ? [ `v${replace(from, /^v/, '')}`, replace(from, /^v/, '') ] : [])) - if (!base && gh.release(REPO, t)) - base = t; - return { items: gh.changes(REPO, base, to) }; -} - -/** - * Start an update job. Returns the new job once its worker has written it - * (a quick check may be over by then), else null (the caller follows - * updates_status); never an older job. Waits two seconds at most: LuCI gives - * up on a call after twenty. - */ -function run(a) { - let what = a.what ?? 'check'; - if (length(what) > 400 || !match(what, TARGET)) - die(_('Unknown update target.')); - // Checked here too, so a wrong name never becomes a failed job in the history. - if (substr(what, 0, 5) == 'pkgs:') - for (let n in split(substr(what, 5), ',')) - if (index(PKG_NAMES, n) < 0) - die(n == '' ? _('Unknown update target.') : sprintf(_('%s is not a package Dawnline manages'), n)); - if (upd.busy()) - die(_('Another component action is already running')); - ensure_dir(RUN_DIR); - let t0 = time(), prev = read_json(upd.JOB_FILE, null)?.id; - let args = substr(what, 0, 5) == 'check' ? `check ${substr(what, 6)}` : `install ${what}`; - // The job speaks the admin's language (use() let only a plain language code through). - let lang = i18n.current(); - system(`${lang ? `DAWNLINE_LANG=${lang} ` : ''}start-stop-daemon -S -b -x /usr/libexec/dawnline/updater -- ${args}`); - for (let i = 0; i < 20; i++) { - let j = read_json(upd.JOB_FILE, null); - if (j && j.id != prev && j.started >= t0) - return { started: true, job: j }; - // ucode's own sleep: OpenWrt's BusyBox has no usleep. - sleep(100); - } - return { started: true, job: null }; -} - -export const methods = { - updates_status: { call: wrap(status) }, - updates_run: { args: { what: '' }, call: wrap(run) }, - updates_releases: { args: { page: 1 }, call: wrap(releases) }, - updates_notes: { args: { component: '', tag: '', build: '' }, call: wrap(notes) }, - updates_changes: { args: { from: '', to: '' }, call: wrap(changes) }, -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc deleted file mode 100644 index 436af89..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/schema.uc +++ /dev/null @@ -1,279 +0,0 @@ -// Dawnline — what the settings section may hold: one entry per option with -// its type, default and range, used to validate what the admin saves and to -// parse what is stored. Also the address checks the rest of the code shares. -// -// Booleans are stored as '1' / '0' only, and parsed the way the init script's -// config_get_bool does, so the service and the code never disagree. - -import { stat } from 'fs'; -import { ip2int, valid_host, ulength } from 'dawnline.util'; -import { INTERVALS, TARGETS } from 'dawnline.updates'; -import { _ } from 'dawnline.i18n'; - -/* ---------- addresses ---------- */ - -/** An IPv4 address in dotted form. */ -export function ipv4(s) { - return type(s) == 'string' && ip2int(s) != null; -}; - -/** - * An IPv6 address → its eight 16-bit groups, or null. Accepts '::' and an - * embedded IPv4 at the end (::ffff:192.0.2.1); no zone ids or prefixes. - */ -export function ipv6_groups(s) { - if (type(s) != 'string' || length(s) < 2 || length(s) > 45 || !match(s, /^[0-9A-Fa-f:.]+$/)) - return null; - let tail = []; - let v4 = match(s, /^(.*:)([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)$/); - if (v4) { - let n = ip2int(v4[2]); - if (n == null) - return null; - tail = [ (n >> 16) & 0xffff, n & 0xffff ]; - s = substr(v4[1], -2) == '::' ? v4[1] : substr(v4[1], 0, length(v4[1]) - 1); - } - else if (index(s, '.') >= 0) - return null; - let halves = split(s, '::'); - if (length(halves) > 2) - return null; - let groups = (part) => { - let out = []; - if (part == '') - return out; - for (let g in split(part, ':')) { - if (!match(g, /^[0-9A-Fa-f]{1,4}$/)) - return null; - push(out, hex(g)); - } - return out; - }; - let head = groups(halves[0]); - let rest = length(halves) == 2 ? groups(halves[1]) : []; - if (head == null || rest == null) - return null; - if (length(halves) == 1) { - push(head, ...tail); - return length(head) == 8 ? head : null; - } - push(rest, ...tail); - let gap = 8 - length(head) - length(rest); - if (gap < 1) - return null; - let out = [ ...head ]; - for (let i = 0; i < gap; i++) - push(out, 0); - push(out, ...rest); - return out; -}; - -/** An IPv6 address (any valid notation). */ -export function ipv6(s) { - return ipv6_groups(s) != null; -}; - -/** An IPv4 or IPv6 address. */ -export function ip(s) { - return ipv4(s) || ipv6(s); -}; - -/** A TCP/UDP port as typed: 1-5 digits, 1-65535. */ -export function valid_port(v) { - let s = trim(`${v ?? ''}`); - return match(s, /^[0-9]{1,5}$/) != null && +s >= 1 && +s <= 65535; -}; - -/* ---------- parsing stored values ---------- */ - -/** A stored boolean, as the init script's config_get_bool reads it. */ -export function bool(v, dflt) { - v = lc(trim(`${v ?? ''}`)); - if (index([ '1', 'on', 'true', 'yes', 'enabled' ], v) >= 0) - return true; - if (index([ '0', 'off', 'false', 'no', 'disabled' ], v) >= 0) - return false; - return dflt; -}; - -/** A stored whole number within [min, max], else the default. */ -export function to_int(v, dflt, lo, hi) { - let s = trim(`${v ?? ''}`); - if (!match(s, /^-?[0-9]{1,9}$/)) - return dflt; - let n = +s; - return (lo != null && n < lo) || (hi != null && n > hi) ? dflt : n; -}; - -/* ---------- the settings section ---------- */ - -/* - * type: bool | int | enum | host | hosts | url | file | domain | ipv4 | time | targets - * dflt: the parsed default; restart: the portal (uhttpd) must restart when it changes; - * min/max: ints; values: enums. The error for a bad value is in messages(). - */ -export const SETTINGS = { - portal_enabled: { type: 'bool', dflt: false, restart: true }, - portal_host: { type: 'host', dflt: '', restart: true }, - portal_alt: { type: 'hosts', dflt: [], restart: true }, - portal_port: { type: 'int', dflt: 8443, min: 1, max: 65535, restart: true }, - portal_redirect: { type: 'url', dflt: '' }, - portal_cert: { type: 'file', dflt: '', restart: true }, - portal_key: { type: 'file', dflt: '', restart: true }, - default_device_limit: { type: 'int', dflt: 3, min: 1, max: 32 }, - hostnames: { type: 'bool', dflt: true }, - domain: { type: 'domain', dflt: 'lan' }, - // Off until the admin turns it on: lookups send people's addresses to a third party. - geo_enabled: { type: 'bool', dflt: false }, - geo_provider: { type: 'enum', dflt: 'ipwho.is', values: [ 'ipwho.is', 'ipapi.co' ] }, - log_connections: { type: 'bool', dflt: true }, - // What goes to syslog (dawnline.util syslog): error | warn | info | debug (each step of a start or an apply). - log_level: { type: 'enum', dflt: 'info', values: [ 'error', 'warn', 'info', 'debug' ] }, - watchdog: { type: 'bool', dflt: true }, - log_keep_days: { type: 'int', dflt: 30, min: 0, max: 9999 }, - log_max: { type: 'int', dflt: 2000, min: 100, max: 20000 }, - log_persist: { type: 'enum', dflt: 'hourly', values: [ '10min', 'hourly', 'off' ] }, - usage_keep_days: { type: 'int', dflt: 62, min: 7, max: 1830 }, - usage_keep_months: { type: 'int', dflt: 24, min: 1, max: 120 }, - // Empty means "no fallback" (stored as 'none'); unset means the default. - home_dns_fallback: { type: 'ipv4', dflt: '1.1.1.1' }, - update_check: { type: 'bool', dflt: true }, - update_interval: { type: 'enum', dflt: '1d', values: keys(INTERVALS) }, - update_auto: { type: 'bool', dflt: true }, - update_mode: { type: 'enum', dflt: 'scheduled', values: [ 'immediate', 'scheduled' ] }, - update_time: { type: 'time', dflt: '04:00' }, - update_targets: { type: 'targets', dflt: [ 'app', 'packages' ] }, - update_keep: { type: 'bool', dflt: false }, - update_mirrors: { type: 'bool', dflt: true }, -}; - -/** Ports the portal never takes: SSH, DNS and the LuCI web server. */ -export const RESERVED_PORTS = [ 22, 53, 80, 443 ]; - -/** What the admin is told about a bad value, by setting (made per call: the language changes between calls). */ -function messages() { - return { - portal_host: _('Public address must be a hostname or IP address.'), - portal_alt: _('Other addresses must be hostnames or IP addresses.'), - portal_port: _('Choose a free port between 1 and 65535 (not 22, 53, 80 or 443).'), - portal_redirect: _('Redirect must be a full http:// or https:// address.'), - default_device_limit: _('Default device limit must be 1-32.'), - domain: _('Domain may use lowercase letters, digits, dashes and dots.'), - geo_provider: _('Unknown location service.'), - log_level: _('Choose a system log level: errors, warnings, normal or verbose.'), - log_keep_days: _('Keep activity for 0 (no age limit) to 9999 days.'), - log_max: _('Log size must be 100-20000 events.'), - log_persist: _('Save the log every 10min, hourly or off.'), - usage_keep_days: _('Daily traffic history must be 7-1830 days.'), - usage_keep_months: _('Monthly traffic history must be 1-120 months.'), - home_dns_fallback: _('Fallback DNS must be an IPv4 address (or empty for none).'), - update_interval: _('Check every 6h, 12h, 1d or 7d.'), - update_mode: _('Install updates immediately or scheduled.'), - update_time: _('Enter a time as HH:MM, 00:00 to 23:59.'), - }; -} - -function bad(key) { - die(messages()[key] ?? sprintf(_('Invalid value for %s.'), key)); -} - -/** - * Check a value the admin saves for setting `key`. Returns what to store: a - * string, a list, or null to remove the option (back to the default). Dies - * with a message for the admin when the value is not acceptable. - */ -export function validate(key, val) { - let spec = SETTINGS[key]; - if (!spec) - die(sprintf(_('Unknown setting %s.'), key)); - let t = spec.type; - if (t == 'hosts') { - let lst = []; - for (let x in (type(val) == 'array' ? val : [])) { - // A typo must not vanish on Save: refused, like the main address. - if (type(x) != 'string' || (trim(x) != '' && !valid_host(trim(x)))) - bad(key); - if (trim(x) != '' && index(lst, trim(x)) < 0) - push(lst, trim(x)); - } - return length(lst) ? lst : null; - } - if (t == 'targets') { - let lst = []; - for (let x in (type(val) == 'array' ? val : [])) - if (index(TARGETS, x) >= 0 && index(lst, x) < 0) - push(lst, x); - // An empty list is a choice too ("none"), unlike a missing option (the default). - return length(lst) ? lst : [ 'none' ]; - } - if (type(val) == 'bool') - val = val ? '1' : '0'; - val = trim(`${val ?? ''}`); - if (t == 'ipv4' && val == '') - return 'none'; - if (val == '') - return null; - if (t == 'bool') { - if (val != '0' && val != '1') - die(sprintf(_('%s is 0 or 1.'), key)); - } - else if (t == 'int') { - if (!match(val, /^[0-9]{1,9}$/) || +val < spec.min || +val > spec.max) - bad(key); - val = `${+val}`; - } - else if (t == 'enum') { - if (index(spec.values, val) < 0) - bad(key); - } - else if (t == 'host') { - if (!valid_host(val)) - bad(key); - } - else if (t == 'url') { - if (length(val) > 300 || !match(val, /^https?:\/\/[A-Za-z0-9.-]+(:[0-9]+)?(\/[^[:space:]"'<>]*)?$/)) - bad(key); - } - else if (t == 'file') { - if (substr(val, 0, 1) != '/' || !stat(val)) - die(sprintf(_('File %s does not exist.'), val)); - } - else if (t == 'domain') { - if (!match(val, /^[a-z0-9-]{1,32}(\.[a-z0-9-]{1,32})*$/)) - bad(key); - } - else if (t == 'ipv4') { - if (!ipv4(val)) - bad(key); - } - else if (t == 'time') { - if (!match(val, /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/)) - bad(key); - } - return val; -}; - -/** - * A stored setting parsed by its schema entry: the typed value, or the default - * when it is missing or invalid. For dawnline.core's load(). - */ -export function get(raw, key) { - let spec = SETTINGS[key]; - let v = raw?.[key]; - if (!spec) - return v; - let t = spec.type; - if (t == 'bool') - return bool(v, spec.dflt); - if (t == 'int') - return to_int(v, spec.dflt, spec.min, spec.max); - if (t == 'hosts' || t == 'targets') - return v == null ? spec.dflt : filter(type(v) == 'array' ? v : [ v ], (x) => x != ''); - if (v == null || v == '') - return spec.dflt; - if (t == 'enum') - return index(spec.values, v) >= 0 ? v : spec.dflt; - if (t == 'ipv4') - return v == 'none' ? '' : (ipv4(v) ? v : spec.dflt); - return v; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc deleted file mode 100644 index e00fb41..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/store.uc +++ /dev/null @@ -1,52 +0,0 @@ -// Dawnline — changes to /etc/config/dawnline, the one way: under the config -// lock, against a model loaded inside that lock, committed with the file kept -// private. rpcd, the portal, the CLI and the agent all go through here, so -// no change is made on a stale model and none is lost to another writer. - -import { lock, unlock } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import { _ } from 'dawnline.i18n'; - -/** Section names that are never ids of people, devices, servers, services or circles. */ -export const RESERVED_IDS = [ 'settings', 'main', 'global', 'defaults' ]; - -/** - * Commit the dawnline config and keep it readable by root only. A commit - * that did not reach flash (full or read-only overlay) is an error: the - * caller's change never happened, and nothing downstream may act on it. - */ -export function commit(c) { - if (!c.commit(core.CONFIG)) { - let why = c.error(); - die(why != null ? sprintf(_("Couldn't save /etc/config/dawnline: %s. Is the flash full?"), why) - : _("Couldn't save /etc/config/dawnline: the write failed. Is the flash full?")); - } - system('chmod 600 /etc/config/dawnline'); -}; - -/** - * Run fn(c, m) with the config lock held, on a fresh cursor and model; commit - * when fn returns (the return value is passed on). Anything fn throws aborts - * without committing and is rethrown with the same message. - */ -export function transact(fn) { - let l = lock('config'); - try { - let c = core.open_cursor(); - let m = core.load(c); - let r = fn(c, m); - commit(c); - unlock(l); - return r; - } - catch (e) { - unlock(l); - die(e.message ?? `${e}`); - } -}; - -/** Is `id` used by anything in the model (any kind of section), or reserved? */ -export function id_taken(m, id) { - return index(RESERVED_IDS, id) >= 0 || m.servers?.[id] != null || m.people?.[id] != null || m.devices?.[id] != null || - m.services?.[id] != null || m.circles?.[id] != null; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc deleted file mode 100644 index 350d489..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_app.uc +++ /dev/null @@ -1,202 +0,0 @@ -// Dawnline updater: Dawnline itself — check the latest release, install a -// release (latest, a tag, the same one again) or the kept previous version. -// The admin's translations installed on the router (luci-i18n-dawnline-) -// come from the same release and go in with it, in one transaction. -// ctx is the updater's job context (see usr/libexec/dawnline/updater). - -import { readfile, lsdir } from 'fs'; -import { VERSION, REPO } from 'dawnline.util'; -import * as upd from 'dawnline.updates'; -import * as gh from 'dawnline.github'; -import * as pkg from 'dawnline.pkg'; -import { _ } from 'dawnline.i18n'; - -function status(installed, latest) { - let c = upd.version_cmp(installed, latest); - return c < 0 ? 'outdated' : c > 0 ? 'dev' : 'latest'; -} - -export function check(ctx) { - let r = gh.latest(REPO); - if (!r) - return { installed: VERSION, latest: null, update: false, repo: REPO, status: '', note: sprintf(_('Cannot reach github.com/%s'), REPO) }; - let latest = replace(r.tag, /^v/, ''); - let st = status(VERSION, latest); - ctx.log(st == 'outdated' ? sprintf(_('Dawnline update is available: %s → %s'), VERSION, latest) - : st == 'dev' ? sprintf(_('Installed Dawnline %s is newer than the release %s'), VERSION, latest) - : sprintf(_('Dawnline is up to date (%s)'), VERSION)); - return { installed: VERSION, latest, tag: r.tag, repo: REPO, url: r.url, published: r.published, update: st == 'outdated', status: st }; -}; - -/** - * The sha256 a release publishes for a file: GitHub's own (API), else the - * release's sha256sums.txt fetched straight from GitHub (never a mirror). - */ -function want_sha(ctx, tag, asset, dir) { - let want = gh.asset_sha256(REPO, tag, asset); - if (want) - return want; - let sums = `${dir}/sha256sums-${replace(tag, /[^A-Za-z0-9.-]/g, '_')}.txt`; - if (!gh.download(`https://github.com/${REPO}/releases/download/${tag}/sha256sums.txt`, sums, { mirrors: false, log: ctx.log })) - return null; - for (let line in split(readfile(sums) ?? '', '\n')) { - let m = match(trim(line), /^([0-9a-f]{64})[ \t]+\*?(\S+)$/); - if (m && m[2] == asset) - return m[1]; - } - return null; -} - -/** The languages of the translations installed here, by their catalogs (dawnline..lmo). */ -export function langs() { - let out = []; - for (let f in lsdir('/usr/lib/lua/luci/i18n') ?? []) { - let m = match(f, /^dawnline\.([A-Za-z_-]+)\.lmo$/); - if (m) - push(out, m[1]); - } - return sort(out); -}; - -const i18n_pkg = (lang) => `luci-i18n-dawnline-${lang}`; - -/** - * Download one file of a release, verified against its sha256. `optional`: a - * release without it (one from before the translations) gives null. - */ -function fetch_file(ctx, tag, asset, dir, optional) { - ctx.phase(sprintf(_('Downloading %s'), asset)); - let want = want_sha(ctx, tag, asset, dir); - if (!want && optional) { - ctx.log(sprintf(_('Release %s has no %s: it stays as it is'), tag, asset)); - return null; - } - if (!want) - die(sprintf(_('Release %s publishes no checksum for %s: not installing an unverified package'), tag, asset)); - let f = `${dir}/${asset}`; - if (!gh.download(`https://github.com/${REPO}/releases/download/${tag}/${asset}`, f, { sha256: want, mirrors: ctx.pol.mirrors, log: ctx.log })) - die(sprintf(_('Download failed: %s'), asset)); - ctx.log(sprintf(_('sha256 matches the release (%s…)'), substr(want, 0, 12))); - return f; -} - -/** A release's package and the translations installed here, verified. */ -function fetch(ctx, tag, dir) { - let ver = replace(tag, /^v/, ''); - let files = [ fetch_file(ctx, tag, `luci-app-dawnline-${ver}.${pkg.ext()}`, dir) ]; - for (let l in langs()) { - let f = fetch_file(ctx, tag, `${i18n_pkg(l)}-${ver}.${pkg.ext()}`, dir, true); - if (f) - push(files, f); - } - return files; -} - -/** The release tag of a version: tags may or may not carry the v. */ -function tag_of(ver) { - for (let t in [ `v${ver}`, ver ]) { - try { - if (gh.release(REPO, t)) - return t; - } - catch (e) {} - } - return `v${ver}`; -} - -function backup(ctx) { - ctx.phase(_('Backing up configuration')); - system('/usr/bin/dawnline backup --reason pre-update >/dev/null 2>&1'); -} - -/** - * Add the translation `lang` of the installed version from its release, or - * (lang null) remove the installed ones. LuCI reads its catalogs once per web - * server process: it restarts after the job. - */ -function set_lang(ctx, lang) { - if (lang == null) { - let have = map(langs(), i18n_pkg); - if (length(have)) { - ctx.phase(_('Removing the translation')); - if (!pkg.remove(have, ctx.log)) - die(_('The translation could not be removed')); - } - } - else { - let tag = tag_of(VERSION); - let f = fetch_file(ctx, tag, `${i18n_pkg(lang)}-${VERSION}.${pkg.ext()}`, ctx.work, true); - if (!f) - die(sprintf(_('Release %s has no translation into %s: install a release that has one'), tag, lang)); - ctx.phase(_('Installing the translation')); - if (!pkg.install_files([ f ], false, ctx.log)) - die(_('Installation failed')); - } - ctx.after('luci'); - return { from: VERSION, to: VERSION, lang }; -} - -/** arg: null (latest) | @ | reinstall | rollback | lang: | nolang */ -export function install(ctx, arg) { - if (arg == 'nolang') - return set_lang(ctx, null); - if (substr(arg ?? '', 0, 5) == 'lang:') - return set_lang(ctx, substr(arg, 5)); - let out = { from: VERSION, to: null }; - if (arg == 'rollback') { - let k = upd.kept('app'); - if (!k) - die(_('No previous Dawnline version is kept on the router')); - out.to = k.version; - ctx.versions(VERSION, k.version); - backup(ctx); - ctx.phase(sprintf(_('Rolling back to %s'), k.version)); - if (!pkg.install_files(k.files, true, ctx.log)) - die(_('Installation failed')); - upd.forget('app'); - ctx.after('app'); - return out; - } - let tag, force = false; - if (arg == 'reinstall') { - tag = tag_of(VERSION); - force = true; - } - else if (arg && substr(arg, 0, 1) == '@') { - tag = substr(arg, 1); - force = upd.version_cmp(replace(tag, /^v/, ''), VERSION) <= 0; - } - else { - let c = check(ctx); - if (!c.latest) - die(c.note); - if (!c.update) { - out.to = VERSION; - return out; - } - tag = c.tag; - } - out.to = replace(tag, /^v/, ''); - ctx.versions(VERSION, out.to); - let files = fetch(ctx, tag, ctx.work); - // The version being replaced, for Roll back (downloaded again: opkg keeps - // no package files). Always for an automatic run: nobody is there to - // recover a router whose new version does not come up (postupdate rolls - // back to it on its own). - if ((ctx.pol.keep || ctx.auto?.()) && out.to != VERSION && upd.kept('app')?.version != VERSION) { - ctx.phase(sprintf(_('Keeping Dawnline %s for rollback'), VERSION)); - try { - system(`mkdir -p '${ctx.work}/keep'`); - upd.keep('app', VERSION, fetch(ctx, tag_of(VERSION), `${ctx.work}/keep`)); - } - catch (e) { - ctx.log(sprintf(_('Warning: could not keep %s: %s'), VERSION, e.message)); - } - } - backup(ctx); - ctx.phase(_('Installing package')); - if (!pkg.install_files(files, force, ctx.log)) - die(_('Installation failed')); - ctx.after('app'); - return out; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc deleted file mode 100644 index cfcf877..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_awg.uc +++ /dev/null @@ -1,274 +0,0 @@ -// Dawnline updater: AmneziaWG — the builds published for this firmware by -// each source, installing or switching a build (verified against GitHub's -// sha256), the Russian LuCI translation, and rolling back to a kept build. -// Every install and rollback is recorded (dawnline.awg_builds), with whether -// the new kernel module runs or waits for the next boot. -// ctx is the updater's job context (see usr/libexec/dawnline/updater). - -import { stat } from 'fs'; -import { cursor } from 'uci'; -import { iface_intent } from 'dawnline.util'; -import * as upd from 'dawnline.updates'; -import * as gh from 'dawnline.github'; -import * as pkg from 'dawnline.pkg'; -import * as builds from 'dawnline.awg_builds'; -import { _, N_ } from 'dawnline.i18n'; - -function sh(cmd) { - return system(`${cmd} >/dev/null 2>&1`); -} - -/** - * Download one package of a build to dir, verified when GitHub publishes its - * sha256 (then mirrors may serve it); without a sha256 only github.com itself. - * Returns the path or null. - */ -function fetch(ctx, fw, name, src, dir) { - let file = builds.asset(fw, name); - let dest = `${dir}/${src}_${file}`; - let want = gh.asset_sha256(builds.SOURCES[src].repo, fw.tag, file); - let url = `https://github.com/${builds.SOURCES[src].repo}/releases/download/${fw.tag}/${file}`; - return gh.download(url, dest, { sha256: want, mirrors: ctx.pol.mirrors, log: ctx.log }) ? dest : null; -} - -/** The newest tag of the same OpenWrt series (24.10.x) in a repository, if newer than ours. */ -function newer_series_tag(rp, tag) { - let series = match(tag, /^v([0-9]+\.[0-9]+)\./)?.[1]; - let best = null; - try { - for (let x in gh.releases(rp, 1)) { - let t = x.tag; - if (series && match(t, regexp(`^v${replace(series, '.', '\\.')}\\.`)) && pkg.cmp(substr(t, 1), substr(tag, 1)) > 0 && - (!best || pkg.cmp(substr(t, 1), substr(best, 1)) > 0)) - best = t; - } - } - catch (e) {} - return best; -} - -export function check(ctx) { - let installed = builds.installed(); - let ru = pkg.version(builds.RU) != null; - let cur = installed['amneziawg-tools']; - let fw = builds.firmware(); - if (!fw) - return { installed: cur, gen: builds.gen(cur), packages: installed, current: null, ru, sources: {}, update: false, status: '', - note: _('Cannot detect the firmware target') }; - if (fw.snapshot) - return { installed: cur, gen: builds.gen(cur), packages: installed, current: null, ru, sources: {}, update: false, status: '', - note: _('This is a SNAPSHOT firmware: the AmneziaWG projects publish builds for releases only') }; - let dir = `${ctx.work}/check`; - system(`mkdir -p '${dir}'`); - let sources = {}; - for (let id in builds.ORDER) { - let src = builds.SOURCES[id]; - ctx.log(sprintf(_('Looking for the %s build for OpenWrt %s'), src.label, substr(fw.tag, 1))); - let f = fetch(ctx, fw, 'amneziawg-tools', id, dir); - let v = f ? pkg.file_version(f) : null; - let date = null; - try { - date = f ? gh.release(src.repo, fw.tag)?.published : null; - } - catch (e) {} - let s = { label: src.label, repo: src.repo, tag: fw.tag, version: v, gen: builds.gen(v), date }; - // A newer firmware may already get 3.1 from this source. - if (s.gen != '3.1') { - let nt = newer_series_tag(src.repo, fw.tag); - if (nt) { - let nf = fetch(ctx, builds.for_tag(fw, nt), 'amneziawg-tools', id, dir); - if (builds.gen(nf ? pkg.file_version(nf) : null) == '3.1') - s.newer = { tag: nt, gen: '3.1' }; - } - } - sources[id] = s; - } - // The installed build: the source whose package matches. Unknown stays unknown - // (an automatic update never switches a build it could not identify). - let current = null; - for (let id, x in sources) - if (!current && cur && x.version == cur) - current = id; - let mine = current ? sources[current] : null; - let c = cur && mine?.version ? pkg.cmp(cur, mine.version) : null; - // An update that waits for a reboot: Components says so after a check. - let pending = builds.waits_for_reboot(); - let st = c == null ? '' : c < 0 ? 'outdated' : c > 0 ? 'dev' : 'latest'; - ctx.log(cur == null ? _('AmneziaWG is not installed') - : !current ? sprintf(_('AmneziaWG %s: no source publishes this build for this firmware any more'), cur) - : st == 'outdated' ? sprintf(_('AmneziaWG update is available: %s → %s'), cur, mine.version) - : sprintf(_('AmneziaWG is up to date (%s)'), cur)); - return { installed: cur, gen: builds.gen(cur), packages: installed, current, ru, release: fw.tag, sources, - latest: mine?.version ?? null, status: st, - update: cur == null || st == 'outdated', - // An update that changes the generation (2.0 → 3.1) breaks older apps: never automatic. - gen_change: cur != null && mine?.version != null && builds.gen(cur) != builds.gen(mine.version), - pending, - note: !length(filter(values(sources), (x) => x.version)) ? sprintf(_('No AmneziaWG build for OpenWrt %s yet'), substr(fw.tag, 1)) - : pending ? _('The AmneziaWG update is installed and starts after a reboot.') : null }; -}; - -/** - * Tunnels on a new kernel module: every AmneziaWG interface is brought down, - * the module swapped and the interfaces brought up again. False when the old - * module stays loaded: the tunnels come back on it (the tools talk to an - * older module at its own netlink version) and the installed one starts - * with the next boot, which caps() and Health then wait for. - */ -function reload_module(ctx) { - let ifaces = []; - let c = cursor(); - c.load('network'); - c.foreach('network', 'interface', (s) => { - if (s.proto == 'amneziawg' && s.disabled != '1') - push(ifaces, s['.name']); - }); - let n = length(ifaces); - ctx.phase(sprintf(N_(n, 'Reloading the kernel module (%d tunnel restarts)', 'Reloading the kernel module (%d tunnels restart)'), n)); - for (let i in ifaces) { - iface_intent(i, 'update', c.get('network', i, '_dawnline_name') ?? i); - sh(`ifdown '${i}'`); - } - if (stat('/sys/module/amneziawg')) - ctx.run('rmmod amneziawg'); - let swapped = !stat('/sys/module/amneziawg'); - if (swapped) { - ctx.run('modprobe amneziawg'); - if (!stat('/sys/module/amneziawg')) - die(_("The new AmneziaWG kernel module doesn't load on this firmware: the tunnels stay down until it does (see the log above)")); - } - for (let i in ifaces) - sh(`ifup '${i}'`); - return swapped; -} - -/** - * After packages changed: the module loaded, netifd knowing the protocol, - * Dawnline set up again. was: the module loaded before (builds.module_now()). - * Returns whether the module that runs is the installed one; false while the - * old one stays loaded until the next boot. - */ -function settle(ctx, before, after, was) { - let b = before['kmod-amneziawg'], a = after['kmod-amneziawg']; - let fresh = true; - // A new module package, one over a module loaded by hand, or an earlier - // update that still waits for a boot (Reinstall tries again). - if (a && (a != b || was.pending) && (b || was.core != null)) - fresh = reload_module(ctx); - else if (a && !b) { - ctx.phase(_('Loading the kernel module')); - if (ctx.run('modprobe amneziawg').code != 0 && !stat('/sys/module/amneziawg')) - die(_("AmneziaWG is installed, but its kernel module doesn't load on this firmware")); - } - // netifd reads its protocol handlers when it starts. - if (index(ctx.run('ubus call network get_proto_handlers').out, '"amneziawg"') < 0) { - ctx.phase(_('Restarting the network so it knows AmneziaWG (connections drop for a few seconds)')); - ctx.run('/etc/init.d/network restart'); - } - ctx.after('apply'); - return fresh; -} - -/** - * The packages are in: settle them and record the build (source, tag) with - * the module that ran before (was). An old module that stays loaded is no - * failure: the job says so, and Health until the next boot. - */ -function finish(ctx, out, source, tag, was) { - out.after = builds.installed(); - out.reloaded = settle(ctx, out.before, out.after, was); - builds.record(source, tag, out.after, { prev_gen: was.gen, prev_core: was.core, reloaded: out.reloaded }); - if (!out.reloaded) - ctx.log(_('The old kernel module stays loaded (another AmneziaWG interface may use it): the AmneziaWG update is installed and starts after a reboot.')); - return out; -} - -/** The first source that publishes every package for this firmware. */ -function pick(fw) { - for (let id in builds.ORDER) { - let r = null; - try { - r = gh.release(builds.SOURCES[id].repo, fw.tag); - } - catch (e) {} - if (r && length(filter(builds.PKGS, (p) => index(r.assets, builds.asset(fw, p)) >= 0)) == length(builds.PKGS)) - return id; - } - return null; -} - -/** arg: [auto|slava|grey][:ru] | rollback */ -export function install(ctx, arg) { - let before = builds.installed(); - let was = builds.module_now(before['kmod-amneziawg']); - let out = { from: before['amneziawg-tools'], to: null, before }; - let fw = builds.firmware(); - if (!fw) - die(_('Cannot detect the firmware target')); - if (arg == 'rollback') { - let k = upd.kept('amneziawg'); - if (!k) - die(_('No previous AmneziaWG build is kept on the router')); - if (k.firmware && k.firmware != fw.postfix) - die(_('The kept AmneziaWG build was made for another firmware: it would not load on this one')); - out.to = k.version; - out.build = k.build; - ctx.versions(out.from, out.to); - ctx.phase(sprintf(_('Rolling back to %s'), k.version)); - if (!pkg.install_files(k.files, true, ctx.log)) - die(_('Package installation failed')); - upd.forget('amneziawg'); - return finish(ctx, out, k.build, fw.tag, was); - } - let parts = split(arg ?? '', ':'); - let id = parts[0] || 'auto'; - let want_ru = parts[1] == 'ru'; - if (id == 'auto') { - id = pick(fw); - if (!id) - die(sprintf(_('No AmneziaWG build for OpenWrt %s (%s) yet'), substr(fw.tag, 1), fw.postfix)); - } - let src = builds.SOURCES[id]; - if (!src) - die(sprintf(_('Unknown AmneziaWG build %s'), id)); - out.build = id; - let files = []; - for (let p in [ ...builds.PKGS, ...(want_ru ? [ builds.RU ] : []) ]) { - ctx.phase(sprintf(_('Downloading %s from %s'), p, src.repo)); - let f = fetch(ctx, fw, p, id, ctx.work); - if (!f) - die(sprintf(_('No %s build for OpenWrt %s in %s, or it could not be verified'), p, substr(fw.tag, 1), src.repo)); - push(files, f); - } - out.to = pkg.file_version(files[1]); - ctx.versions(out.from, out.to); - // The build being replaced, for Roll back: from another source that still publishes it. - if (ctx.pol.keep && out.from && out.to != out.from) { - let dir = `${ctx.work}/keep`; - system(`mkdir -p '${dir}'`); - let kept = null; - for (let sid in builds.ORDER) { - if (sid == id || kept) - continue; - let f = fetch(ctx, fw, 'amneziawg-tools', sid, dir); - if (f && pkg.file_version(f) == out.from) - kept = sid; - } - if (kept) { - ctx.phase(sprintf(_('Keeping AmneziaWG %s for rollback'), out.from)); - let keepf = filter(map(builds.PKGS, (p) => fetch(ctx, fw, p, kept, dir)), (x) => x); - if (length(keepf) == length(builds.PKGS)) - upd.keep('amneziawg', out.from, keepf, kept, fw.postfix); - } - else - ctx.log(_('Warning: the installed build is no longer published, nothing to keep for rollback')); - } - ctx.phase(_('Refreshing package lists')); - pkg.refresh(ctx.log); - ctx.phase(sprintf(_('Installing the %s build'), src.label)); - if (!pkg.install_files(files, true, ctx.log)) - die(_('Package installation failed')); - if (!want_ru && pkg.version(builds.RU)) - pkg.remove([ builds.RU ], ctx.log); - return finish(ctx, out, id, fw.tag, was); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc deleted file mode 100644 index a868f4a..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/upd_pkgs.uc +++ /dev/null @@ -1,94 +0,0 @@ -// Dawnline updater: the OpenWrt packages Dawnline adds — the home-like link -// (ip-full, kmod-veth) and HTTPS plus certificates for the personal portal — -// checked against and updated from the OpenWrt feeds. -// ctx is the updater's job context (see usr/libexec/dawnline/updater). - -import * as pkg from 'dawnline.pkg'; -import { _, N_ } from 'dawnline.i18n'; - -/** What Dawnline itself adds to OpenWrt (the rest of LuCI, ucode, rpcd and uhttpd is the stock system). */ -export const NAMES = [ 'ip-full', 'kmod-veth', 'libustream-openssl', 'openssl-util', 'acme', 'acme-acmesh-dnsapi', 'luci-app-acme' ]; - -// Packages released together with each of the above, updated as a set so OpenSSL never ends up -// half old and half new. -const FAMILY = [ - [ /^ip-full$/, /^ip-/ ], - [ /^(libustream-openssl|openssl-util)$/, /^(libustream-openssl|libopenssl|openssl-util$)/ ], - [ /^(acme|luci-app-acme$)/, /^acme/ ], -]; - -function family(p) { - for (let f in FAMILY) - if (match(p, f[0])) - return f[1]; - return null; -} - -/** The packages to update for these names: each one plus its upgradable family. */ -function with_family(names, up) { - let set = {}; - for (let n in names) { - if (up[n]) - set[n] = true; - let f = family(n); - if (f) - for (let u in keys(up)) - if (match(u, f)) - set[u] = true; - } - return sort(keys(set)); -} - -/** refresh: update the package lists first (a check by hand or on schedule). */ -export function check(ctx, refresh) { - if (refresh ?? true) { - ctx.phase(_('Refreshing package lists')); - pkg.refresh(); - } - let up = pkg.upgradable(); - let res = {}, all = {}; - for (let p in NAMES) { - let v = pkg.version(p); - let set = v ? with_family([ p ], up) : []; - res[p] = { installed: v, latest: v && up[p] ? up[p] : null, with: filter(set, (x) => x != p) }; - for (let x in set) - all[x] = true; - } - let n = length(keys(all)); - ctx.log(n ? sprintf(N_(n, '%d package update in the feeds: %s', '%d package updates in the feeds: %s'), n, join(', ', sort(keys(all)))) - : _('System packages are up to date')); - return { pkgs: res, updates: n, status: n ? 'outdated' : 'latest' }; -}; - -/** arg: name,name,… (only names Dawnline manages): missing ones are installed, present ones updated with their family. */ -export function install(ctx, arg) { - let names = filter(split(arg ?? '', ','), (x) => x != ''); - for (let n in names) - if (index(NAMES, n) < 0) - die(sprintf(_('%s is not a package Dawnline manages'), n)); - if (!length(names)) - die(_('Nothing to install')); - ctx.phase(_('Refreshing package lists')); - pkg.refresh(ctx.log); - let missing = filter(names, (n) => pkg.version(n) == null); - let have = with_family(filter(names, (n) => pkg.version(n) != null), pkg.upgradable()); - if (length(have)) { - ctx.phase(sprintf(_('Updating %s'), join(', ', have))); - if (!pkg.upgrade(have, ctx.log)) - die(_('Update failed')); - } - if (length(missing)) { - ctx.phase(sprintf(_('Installing %s'), join(', ', missing))); - if (!pkg.add(missing, ctx.log)) - die(_('Installation failed')); - } - // The portal's HTTPS runs in uhttpd; a piece that just arrived lets the portal or the home-like link start. - let touched = [ ...missing, ...have ]; - if (length(filter(missing, (n) => match(n, /^(openssl-util|libustream|ip-full|kmod-veth)/)))) { - ctx.after('apply'); - ctx.after('uhttpd'); - } - else if (length(filter(touched, (n) => match(n, /^(libustream|libopenssl)/)))) - ctx.after('uhttpd'); - return { updated: have, installed: missing, check: check(ctx, false) }; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/updates.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/updates.uc deleted file mode 100644 index cddd7c4..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/updates.uc +++ /dev/null @@ -1,233 +0,0 @@ -// Dawnline — what the Components tab, the updater and the agent share: the -// update policy (Settings → Updates), when an automatic run is due, the one -// update job at a time (a kernel lock), the history for Activity, and the -// versions kept for rollback. GitHub and the package manager live in -// dawnline.github and dawnline.pkg. - -import { open, stat } from 'fs'; -import { q, read_json, write_json, ensure_dir, RUN_DIR, DATA_DIR } from 'dawnline.util'; -import { _ } from 'dawnline.i18n'; - -export const JOB_FILE = `${RUN_DIR}/update-job.json`; -export const CHECK_FILE = `${RUN_DIR}/update-check.json`; -/** Held (flock) by the updater for the whole job: busy() and stale jobs come from it, not from pids. */ -export const LOCK_FILE = `${RUN_DIR}/update.lock`; -/** Automatic runs: when the last check and the last scheduled install happened. */ -export const AUTO_FILE = `${DATA_DIR}/update-auto.json`; -/** What happened: updates (by hand or automatic), failures, checks that found something. */ -export const HISTORY_FILE = `${DATA_DIR}/update-history.json`; -/** The version each component had before its last update (Keep the previous version). */ -export const KEEP_DIR = `${DATA_DIR}/keep`; - -export const INTERVALS = { '6h': 6 * 3600, '12h': 12 * 3600, '1d': 86400, '7d': 7 * 86400 }; -export const TARGETS = [ 'app', 'amneziawg', 'packages' ]; - -function on(v, dflt) { - if (v == null || v == '') - return dflt; - return v == '1' || v == 'true' || v == 'on' || v == 'yes'; -} - -/** The update policy from raw UCI settings (core.load puts it in m.settings.updates). */ -export function policy(s) { - s ??= {}; - let t = type(s.update_targets) == 'array' ? s.update_targets : s.update_targets ? [ s.update_targets ] : null; - let time_ok = match(s.update_time ?? '', /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/); - return { - check: on(s.update_check, true), - interval: INTERVALS[s.update_interval] ? s.update_interval : '1d', - auto: on(s.update_auto, true), - mode: s.update_mode == 'immediate' ? 'immediate' : 'scheduled', - time: time_ok ? s.update_time : '04:00', - // AmneziaWG is left out by default: a new kernel module restarts every tunnel. - targets: t ? filter(t, (x) => index(TARGETS, x) >= 0) : [ 'app', 'packages' ], - keep: on(s.update_keep, false), - mirrors: on(s.update_mirrors, true), - }; -}; - -/* ---------- schedule ---------- */ - -/** The scheduled time on the day of `ts` (router local time), in seconds since the epoch. */ -function scheduled_on(pol, ts) { - let t = localtime(ts); - let hm = split(pol.time, ':'); - return ts - (t.hour * 3600 + t.min * 60 + t.sec) + int(hm[0]) * 3600 + int(hm[1]) * 60; -} - -function day_of(ts) { - let t = localtime(ts); - return sprintf('%04d-%02d-%02d', t.year, t.mon, t.mday); -} - -/** The scheduled slot `now` is in (up to an hour after the set time, also across midnight), or null. */ -function slot(pol, now) { - for (let at in [ scheduled_on(pol, now), scheduled_on(pol, now - 86400) ]) - if (now >= at && now - at < 3600) - return at; - return null; -} - -/** - * What an automatic run should do now: 'install' (the scheduled window, at - * most an hour after the set time, once per slot), 'check' (the interval has - * passed), or null. - */ -export function due(pol, st, now) { - now ??= time(); - st ??= {}; - if (pol.auto && pol.mode == 'scheduled' && length(pol.targets)) { - let at = slot(pol, now); - if (at != null && st.install_day != day_of(at)) - return 'install'; - } - if (pol.check && now - (st.check ?? 0) >= INTERVALS[pol.interval]) - return 'check'; - return null; -}; - -export function auto_state() { - return read_json(AUTO_FILE, {}); -}; - -export function auto_save(st) { - ensure_dir(DATA_DIR); - write_json(AUTO_FILE, st, 0o600); -}; - -/** Record that the scheduled slot `now` is in has run (the slot's own day, not today's after midnight). */ -export function mark_day(pol, st, now) { - now ??= time(); - st.install_day = day_of(slot(pol, now) ?? now); - return st; -}; - -/* ---------- one job at a time ---------- */ - -/** - * Take the update lock without waiting: the open file (keep it for the whole - * job; the kernel releases it when the process ends), or null when another - * job holds it. - */ -export function try_lock() { - ensure_dir(RUN_DIR); - let f = open(LOCK_FILE, 'a'); - if (f && f.lock('xn')) - return f; - f?.close(); - return null; -}; - -/** A job is running: someone holds the update lock. */ -export function busy() { - let f = try_lock(); - if (!f) - return true; - f.close(); - return false; -}; - -/** - * The last job; a "running" one whose worker is gone (the lock is free) reads - * as failed. Its phases, log and error are in the language of whoever started - * it (English for automatic runs); only the stopped-job error is made here. - */ -export function job() { - let j = read_json(JOB_FILE, null); - if (j?.state == 'running' && !busy()) { - j.state = 'failed'; - j.error = _('The update stopped unexpectedly.'); - j.finished = j.finished ?? time(); - } - return j; -}; - -/* ---------- history (Components → Activity) ---------- */ - -export function history() { - let h = read_json(HISTORY_FILE, []); - return type(h) == 'array' ? h : []; -}; - -/** Newest first, the last 30 kept on flash. */ -export function history_add(e) { - let h = history(); - unshift(h, { ts: time(), ...e }); - ensure_dir(DATA_DIR); - write_json(HISTORY_FILE, slice(h, 0, 30), 0o600); -}; - -/* ---------- Dawnline versions ---------- */ - -/** - * Compare Dawnline release versions (0.3.2, v0.4.0-rc1): -1, 0 or 1. Numbers - * compare as numbers; a pre-release (-rc1, -beta) comes before its release. - */ -export function version_cmp(a, b) { - let parse = (v) => { - let m = match(replace(`${v}`, /^v/, ''), /^([0-9.]+)([-~]([0-9A-Za-z.]+))?/); - return m ? { nums: map(split(m[1], '.'), (x) => int(x)), pre: m[3] } : { nums: [ 0 ], pre: `${v}` }; - }; - let x = parse(a), y = parse(b); - for (let i = 0; i < length(x.nums) || i < length(y.nums); i++) { - let p = x.nums[i] ?? 0, r = y.nums[i] ?? 0; - if (p != r) - return p < r ? -1 : 1; - } - if (x.pre == y.pre) - return 0; - if (x.pre == null) - return 1; - if (y.pre == null) - return -1; - // rc1 < rc2 < rc10: compare the number runs as numbers. - let px = match(x.pre, /^([^0-9]*)([0-9]*)/), py = match(y.pre, /^([^0-9]*)([0-9]*)/); - if (px[1] != py[1]) - return px[1] < py[1] ? -1 : 1; - return int(px[2] || 0) < int(py[2] || 0) ? -1 : int(px[2] || 0) > int(py[2] || 0) ? 1 : 0; -}; - -/* ---------- kept previous versions ---------- */ - -/** { version, build?, firmware?, files: [paths], saved } of the kept version, or null. */ -export function kept(component) { - let k = read_json(`${KEEP_DIR}/${component}/meta.json`, null); - if (!k?.version || !length(k.files ?? [])) - return null; - for (let f in k.files) - if (!stat(f)) - return null; - return k; -}; - -/** What the Components tab shows; firmware: the current one (a kept AmneziaWG build is for one firmware only). */ -export function kept_all(firmware) { - let out = {}; - for (let c in [ 'app', 'amneziawg' ]) { - let k = kept(c); - if (k && c == 'amneziawg' && k.firmware && firmware && k.firmware != firmware) - k = null; - out[c] = k ? { version: k.version, build: k.build ?? null, saved: k.saved ?? null } : null; - } - return out; -}; - -/** Replace the kept version of a component with these files (copied in). */ -export function keep(component, version, files, build, firmware) { - let dir = `${KEEP_DIR}/${component}`; - system(`rm -rf ${q(dir)}; mkdir -p ${q(dir)}; chmod 700 ${q(KEEP_DIR)} ${q(dir)}`); - let saved = []; - for (let f in files) { - let to = `${dir}/${replace(f, /^.*\//, '')}`; - if (system(`cp ${q(f)} ${q(to)}`) == 0) - push(saved, to); - } - if (length(saved) == length(files)) - write_json(`${dir}/meta.json`, { version, build, firmware, files: saved, saved: time() }, 0o600); - else - system(`rm -rf ${q(dir)}`); -}; - -export function forget(component) { - system(`rm -rf ${q(KEEP_DIR + '/' + component)}`); -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc deleted file mode 100644 index 4e77696..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/util.uc +++ /dev/null @@ -1,896 +0,0 @@ -// Dawnline — small helpers shared by the rpcd plugin, the CLI, the agent and -// the portal CGI. Nothing in here loads or commits configuration (the uci -// helpers work on a cursor the caller owns). - -import { open, readfile, writefile, rename, mkdir, stat, unlink, popen, lsdir } from 'fs'; -import { _ } from 'dawnline.i18n'; - -export const VERSION = '0.18.0'; -/** GitHub repository with Dawnline releases (updates and the installer). */ -export const REPO = 'tickcount/luci-app-dawnline'; -export const RUN_DIR = '/var/run/dawnline'; -export const DATA_DIR = '/etc/dawnline'; - -/* ---------- shell ---------- */ - -export function q(s) { - return "'" + replace(`${s}`, "'", "'\\''") + "'"; -}; - -/** Run a shell command; returns { code, out }. Stdout and stderr are merged. */ -export function sh(cmd) { - let p = popen(`${cmd} 2>&1`, 'r'); - if (!p) - return { code: -1, out: '' }; - let out = p.read('all') ?? ''; - let code = p.close(); - return { code: code ?? 0, out: out }; -}; - -/** Trimmed stdout of a command, or null when it failed. */ -export function sh_out(cmd) { - let r = sh(cmd); - return r.code == 0 ? trim(r.out) : null; -}; - -/** Fire-and-forget: run a shell snippet detached from the caller. */ -export function sh_bg(cmd) { - system(`( ${cmd} ) >/dev/null 2>&1 ": one logger for all of them. - */ -export function syslog_lines(level, src, text, prefix) { - if (!log_on(level) || trim(`${text ?? ''}`) == '') - return; - let p = popen(`logger -t dawnline -p daemon.${LOG_PRIO[level] ?? 'info'}`, 'w'); - if (!p) - return; - for (let l in split(`${text ?? ''}`, '\n')) - if (trim(l) != '') - p.write(syslog_line(level, src, `${prefix ?? ''}${trim(l)}`) + '\n'); - p.close(); -}; - -/** A list in a log line: the first `n` (10) and how many more ("a, b, c and 12 more"). */ -export function some_of(list, n) { - n ??= 10; - return length(list) <= n ? join(', ', list) : `${join(', ', slice(list, 0, n))} and ${length(list) - n} more`; -}; - -/* ---------- service log ---------- */ - -/* - * Tunnel and service starts and stops, watchdog repairs and errors: one JSON - * object per line in tmpfs (appends from several processes stay whole), a - * copy on flash that the agent refreshes hourly, and a line in syslog. - * src: awg | dawnline | portal; level: info | up | down | repair | error. - */ -export const SLOG = `${RUN_DIR}/service.log`; -export const SLOG_SAVED = `${DATA_DIR}/service.log`; -const SLOG_KEEP = 300; - -export function slog(src, level, msg, detail, who, extra) { - let e = { ts: time(), src, level, msg }; - // The subject, shown first and bold: a server's name, "Personal portal", "Dawnline". - if (who) - e.who = `${who}`; - // The admin's own changes: { by: 'admin', kind: 'server', note: 'port 50115' } - // read "You · ". - for (let k in [ 'by', 'kind', 'note' ]) - if (extra?.[k]) - e[k] = `${extra[k]}`; - if (detail) - e.detail = substr(trim(`${detail}`), 0, 2000); - ensure_dir(RUN_DIR); - let f = open(SLOG, 'a', 0o600); - if (f) { - f.write(sprintf('%J\n', e)); - f.close(); - } - let line = e.by == 'admin' ? join(' ', filter([ 'admin', msg, e.kind, who, e.note ? '· ' + e.note : null ], (x) => x)) : who ? `${who} ${msg}` : msg; - // Problems carry what went wrong (the service log's detail: an error's text, the syslog lines around a crash). - let lvl = { error: 'error', repair: 'warn', down: 'warn' }[level] ?? 'info'; - if (e.detail && lvl != 'info') - line += ` · ${substr(replace(e.detail, /[\r\n\t]+/g, ' | '), 0, 400)}`; - syslog(lvl, src, line); -}; - -/** A change the admin made in LuCI, for the service log. */ -export function admin_log(src, msg, kind, who, note, detail) { - slog(src, 'info', msg, detail, who, { by: 'admin', kind, note }); -}; - -/* - * Why Dawnline itself is about to take a tunnel down, so the hotplug log can - * tell that from a tunnel that stopped on its own. reason: settings | off | - * removed | update. Kept for two minutes. - */ -const INTENT = `${RUN_DIR}/iface-intent.json`; - -export function iface_intent(ifname, reason, name) { - let all = read_json(INTENT, {}); - let now = time(); - for (let k, v in all) - if (now - v.ts >= 120) - delete all[k]; - all[ifname] = { reason, name, ts: now }; - ensure_dir(RUN_DIR); - write_json(INTENT, all, 0o600); -}; - -/** - * The note for a stop of `ifname`, or null. netifd may report one stop more - * than once (the interface, then its device): the note covers every report - * within 15 s of the first, then it is spent. - */ -export function take_iface_intent(ifname) { - let all = read_json(INTENT, {}); - let it = all[ifname]; - let now = time(); - if (!it || now - it.ts >= 120 || (it.used && now - it.used >= 15)) - return null; - if (!it.used) { - it.used = now; - write_json(INTENT, all, 0o600); - } - return it; -}; - -/** Newest first. */ -export function slog_read(limit) { - let lines = split(readfile(SLOG) ?? readfile(SLOG_SAVED) ?? '', '\n'); - let out = []; - for (let i = length(lines) - 1; i >= 0 && length(out) < (limit ?? SLOG_KEEP); i--) { - if (lines[i] == '') - continue; - try { - let e = json(lines[i]); - if (type(e) == 'object' && e.ts) - push(out, e); - } - catch (err) {} - } - return out; -}; - -/** Keep the last entries only, and save them to flash when asked. */ -export function slog_trim(save) { - let lines = filter(split(readfile(SLOG) ?? '', '\n'), (l) => l != ''); - if (length(lines) > SLOG_KEEP + 50) { - lines = slice(lines, -SLOG_KEEP); - write_file(SLOG, join('\n', lines) + '\n'); - } - if (save && length(lines) && stat(SLOG)?.mtime > (stat(SLOG_SAVED)?.mtime ?? 0)) { - ensure_dir(DATA_DIR, 0o700); - write_file(SLOG_SAVED, join('\n', lines) + '\n'); - } -}; - -/** Remove entries (all, or older than `days`); returns how many went. */ -export function slog_clear(days) { - let keep = [], removed = 0, cut = days > 0 ? time() - days * 86400 : null; - for (let l in split(readfile(SLOG) ?? readfile(SLOG_SAVED) ?? '', '\n')) { - if (l == '') - continue; - let e = null; - try { - e = json(l); - } - catch (err) {} - if (cut != null && e?.ts >= cut) - push(keep, l); - else - removed++; - } - let data = length(keep) ? join('\n', keep) + '\n' : ''; - ensure_dir(RUN_DIR); - write_file(SLOG, data); - if (stat(SLOG_SAVED)) - write_file(SLOG_SAVED, data); - return removed; -}; - -/** After a reboot tmpfs is empty: continue the log saved on flash. */ -export function slog_restore() { - if (!stat(SLOG) && stat(SLOG_SAVED)) { - ensure_dir(RUN_DIR); - write_file(SLOG, readfile(SLOG_SAVED) ?? ''); - } -}; - -/* ---------- IPv4 ---------- */ - -// Module constants, compiled once: a regex literal is compiled again each -// time it runs (rules/backend.md), and these run for every address and every -// network in a list (status, the portal, the agent's checks). -const IPV4 = /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/; -const CIDR = /^([0-9.]+)(\/([0-9]+))?$/; - -export function ip2int(ip) { - let m = match(ip, IPV4); - if (!m) - return null; - let n = 0; - for (let i = 1; i <= 4; i++) { - let o = +m[i]; - if (o > 255) - return null; - n = n * 256 + o; - } - return n; -}; - -export function int2ip(n) { - return sprintf('%d.%d.%d.%d', (n >> 24) & 255, (n >> 16) & 255, (n >> 8) & 255, n & 255); -}; - -/** - * "a.b.c.d[/len]" with any prefix 0-32 (a bare address is a /32) → - * { net, prefix, size, ip }; null for anything else. Routes, rules and - * allowed networks use this; parse_cidr is the stricter one for subnets. - */ -export function cidr_any(s) { - let m = match(s ?? '', CIDR); - if (!m) - return null; - let ip = ip2int(m[1]), prefix = m[3] != null ? +m[3] : 32; - if (ip == null || prefix > 32) - return null; - let size = 1 << (32 - prefix); - return { net: ip - ip % size, prefix, size, ip }; -}; - -/** The first of `nets` (CIDR strings, any prefix) that holds `ip` (a string or an int), or null. */ -export function in_nets(ip, nets) { - let n = type(ip) == 'int' ? ip : ip2int(ip); - if (n == null) - return null; - for (let s in nets) { - let c = cidr_any(s); - if (c && n >= c.net && n < c.net + c.size) - return s; - } - return null; -}; - -// Cloudflare's published ranges (https://www.cloudflare.com/ips/). -const CF_V4 = [ '173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', '141.101.64.0/18', - '108.162.192.0/18', '190.93.240.0/20', '188.114.96.0/20', '197.234.240.0/22', '198.41.128.0/17', - '162.158.0.0/15', '104.16.0.0/13', '104.24.0.0/14', '172.64.0.0/13', '131.0.72.0/22' ]; -const CF_V6 = [ /^2400:cb00:/i, /^2606:4700:/i, /^2803:f800:/i, /^2405:b500:/i, /^2405:8100:/i, /^2a06:98c[0-7]:/i, /^2c0f:f248:/i ]; - -/** True for an address in Cloudflare's network (its proxies and edge). */ -export function cloudflare_ip(a) { - let n = ip2int(a); - if (n == null) { - for (let r in CF_V6) - if (match(a ?? '', r)) - return true; - return false; - } - return in_nets(n, CF_V4) != null; -}; - -/** Parse "a.b.c.d/len" → { net, prefix, first, last, size } (net is the masked base). */ -export function parse_cidr(cidr) { - let m = match(cidr ?? '', CIDR); - if (!m || m[3] == null) - return null; - let ip = ip2int(m[1]), prefix = +m[3]; - if (ip == null || prefix < 8 || prefix > 30) - return null; - let size = 1 << (32 - prefix); - let net = ip - ip % size; - return { net, prefix, size, first: net + 1, last: net + size - 2, ip }; -}; - -export function cidr_str(c) { - return `${int2ip(c.net)}/${c.prefix}`; -}; - -export function cidr_overlaps(a, b) { - return a.net < b.net + b.size && b.net < a.net + a.size; -}; - -export function in_cidr(ip, c) { - let n = type(ip) == 'int' ? ip : ip2int(ip); - return n != null && n >= c.net && n < c.net + c.size; -}; - -/* ---------- text ---------- */ - -/** Characters in a UTF-8 string (length() counts bytes: "Мама" is 8 of them). */ -export function ulength(s) { - let n = 0; - for (let i = 0; i < length(s); i++) - if ((ord(s, i) & 0xc0) != 0x80) - n++; - return n; -}; - -/** The first `n` characters of a UTF-8 string, never cut inside one. */ -export function ucut(s, n) { - let i = 0, c = 0; - while (i < length(s)) { - if ((ord(s, i) & 0xc0) != 0x80) { - if (c == n) - break; - c++; - } - i++; - } - return substr(s, 0, i); -}; - -// Cyrillic (Russian, Ukrainian) to Latin: а-я by code point from U+0430, then -// ё, і, ї, є, ґ; the rest of a string passes as it is. -const CYR_A = 0x430; -const CYRILLIC = [ 'a', 'b', 'v', 'g', 'd', 'e', 'zh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', - 'f', 'kh', 'ts', 'ch', 'sh', 'shch', '', 'y', '', 'e', 'yu', 'ya' ]; -const CYRILLIC_MORE = { '1105': 'yo', '1110': 'i', '1111': 'yi', '1108': 'ye', '1169': 'g' }; - -/** - * Cyrillic letters written in Latin ("Мама" → "mama", "Юля" → "yulya"): - * ids, hostnames and file names are ASCII, and a person should recognise - * their own in them. Other characters are left alone. - */ -export function translit(s) { - let out = '', i = 0, n = length(s); - while (i < n) { - let b = ord(s, i); - if (b < 0x80) { - out += substr(s, i, 1); - i++; - continue; - } - let cp = 0, len = 1; - if ((b & 0xe0) == 0xc0 && i + 1 < n) { - cp = ((b & 0x1f) << 6) | (ord(s, i + 1) & 0x3f); - len = 2; - } - else if ((b & 0xf0) == 0xe0 && i + 2 < n) { - cp = ((b & 0x0f) << 12) | ((ord(s, i + 1) & 0x3f) << 6) | (ord(s, i + 2) & 0x3f); - len = 3; - } - else if ((b & 0xf8) == 0xf0 && i + 3 < n) - len = 4; - // Upper case to lower: А-Я, Ё, І, Ї, Є, Ґ. - if (cp >= 0x410 && cp <= 0x42f) - cp += 0x20; - else if (cp == 0x401) - cp = 0x451; - else if (cp == 0x406) - cp = 0x456; - else if (cp == 0x407) - cp = 0x457; - else if (cp == 0x404) - cp = 0x454; - else if (cp == 0x490) - cp = 0x491; - let t = cp >= CYR_A && cp < CYR_A + length(CYRILLIC) ? CYRILLIC[cp - CYR_A] : CYRILLIC_MORE[`${cp}`]; - out += t != null ? t : substr(s, i, len); - i += len; - } - return out; -}; - -/* ---------- validation ---------- */ - -export function valid_slug(s) { - return type(s) == 'string' && match(s, /^[a-z0-9][a-z0-9-]{0,30}[a-z0-9]$|^[a-z0-9]$/) != null; -}; - -/** A name people see: 1-48 characters (not bytes), none of < > " \ or control characters. */ -export function valid_name(s) { - return type(s) == 'string' && ulength(trim(s)) > 0 && ulength(s) <= 48 && match(s, /[<>"\\[:cntrl:]]/) == null; -}; - -/** What valid_name wants, for the admin (in the admin's language). */ -export function name_rule() { - return _('Enter a name: up to 48 characters, without < > " or \\.'); -}; - -// Character sets for checks written without a regex: ucode compiles a regex -// literal each time it runs, and musl's regcomp takes milliseconds for a -// bounded repeat (rules/backend.md). ltrim stops at a NUL byte, so a string -// with one fails these checks (a regex looks only up to it). -const ASCII_ALNUM = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; -const B64 = `${ASCII_ALNUM}+/`; - -/** - * The longest name a device takes, in characters: ordinary words fill a portal card's line about as far as its - * status ("Return to save, Esc to cancel"), and fit the server list in the AmneziaVPN app. Names set before the rule stay as they are; it holds when a name is set. - */ -export const DEVICE_NAME_MAX = 20; -// What a device's name may hold of ASCII: letters, digits, spaces and - _ . It goes into configurations, file -// names and the AmneziaVPN key: nothing there to escape. -const DEVICE_NAME_CHARS = `${ASCII_ALNUM} ._-`; -// Past ASCII, letters of any language are welcome; these blocks are not: symbols, punctuation, arrows, maths, -// emoji and invisibles (code point ranges, both ends in; web/src/shared/format.ts NAME_SYMBOLS is the same list, -// and the page asks Unicode besides that a character is a letter or a digit). -const NAME_SYMBOLS = [ - [ 0x80, 0xbf ], [ 0xd7, 0xd7 ], [ 0xf7, 0xf7 ], [ 0x2000, 0x2bff ], [ 0x3000, 0x303f ], [ 0xd800, 0xf8ff ], - [ 0xfe00, 0xfe0f ], [ 0xfe30, 0xfe4f ], [ 0xfeff, 0xfeff ], [ 0xfff0, 0xffff ], [ 0x1f000, 0x1fbff ], - [ 0xe0000, 0xe007f ] -]; - -function name_symbol(cp) { - for (let r in NAME_SYMBOLS) - if (cp >= r[0] && cp <= r[1]) - return true; - return false; -} - -/** - * A device's name (trimmed by the caller): 1-DEVICE_NAME_MAX characters, not blank, each one of - * DEVICE_NAME_CHARS or past ASCII outside NAME_SYMBOLS. Read by code points: broken UTF-8, and an - * ASCII character spelled long (0xC0 0xAF for "/"), are refused. - */ -export function valid_device_name(s) { - if (type(s) != 'string' || length(trim(s)) == 0 || ulength(s) > DEVICE_NAME_MAX) - return false; - let i = 0, n = length(s); - while (i < n) { - let b = ord(s, i), cp, len; - if (b < 0x80) { - if (index(DEVICE_NAME_CHARS, substr(s, i, 1)) < 0) - return false; - i++; - continue; - } - if ((b & 0xe0) == 0xc0) { - len = 2; - cp = b & 0x1f; - } - else if ((b & 0xf0) == 0xe0) { - len = 3; - cp = b & 0x0f; - } - else if ((b & 0xf8) == 0xf0) { - len = 4; - cp = b & 0x07; - } - else - return false; - if (i + len > n) - return false; - for (let k = 1; k < len; k++) { - let c = ord(s, i + k); - if ((c & 0xc0) != 0x80) - return false; - cp = (cp << 6) | (c & 0x3f); - } - if (cp < 0xc0 || cp > 0x10ffff || name_symbol(cp)) - return false; - i += len; - } - return true; -}; -// 32 bytes are 43 base64 characters: the last holds four bits of the key and two zero bits. -const KEY_LAST = 'AEIMQUYcgkosw048'; - -/** - * A (Amnezia)WireGuard key: 32 bytes in base64, 43 characters and "=", the - * same as /^[A-Za-z0-9+\/]{42}[AEIMQUYcgkosw048]=$/ without its 1.7 ms - * compile on the WR3000P: the agent's watcher checks two keys per line of - * `awg show dump` every second. This takes about 0.03 ms. - */ -export function valid_key(s) { - return type(s) == 'string' && length(s) == 44 && substr(s, 43) == '=' && - index(KEY_LAST, substr(s, 42, 1)) >= 0 && ltrim(substr(s, 0, 42), B64) == ''; -}; - -/** An IPv6 address in its usual spelling (no zone, no brackets). */ -export function is_ip6(s) { - return type(s) == 'string' && match(s, /^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/) != null && match(s, /:::/) == null; -}; - -const LABEL = `${ASCII_ALNUM}-`; - -/** - * Dot-separated labels of 1-63 letters, digits and dashes, none starting or - * ending with a dash: the same as - * /^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/ - * without its 10 ms compile on the WR3000P. - */ -function host_name(s) { - for (let l in split(s, '.')) - if (length(l) < 1 || length(l) > 63 || ltrim(l, LABEL) != '' || - index(ASCII_ALNUM, substr(l, 0, 1)) < 0 || index(ASCII_ALNUM, substr(l, -1)) < 0) - return false; - return true; -} - -/** A host name or an IP address, as a public address or the portal's name may be given. */ -export function valid_host(s) { - return type(s) == 'string' && length(s) <= 253 && (host_name(s) || ip2int(s) != null || is_ip6(s)); -}; - -/** YYYY-MM-DD, and a day that exists (2026-02-30 does not). */ -export function valid_date(s) { - let m = type(s) == 'string' ? match(s, /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/) : null; - if (!m) - return false; - let l = localtime(timelocal({ year: +m[1], mon: +m[2], mday: +m[3], hour: 12, min: 0, sec: 0 })); - return l.year == +m[1] && l.mon == +m[2] && l.mday == +m[3]; -}; - -// Runs of other characters become one dash. Module constants: host_label and -// tunnel_name run for every device of a status or a portal answer. -const NOT_LC_ALNUM = /[^a-z0-9]+/g, NOT_ALNUM = /[^A-Za-z0-9]+/g; -// Names Windows keeps for devices: no file may be called that, whatever the case. -const WIN_DEVICES = [ 'con', 'prn', 'aux', 'nul', 'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9', - 'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9' ]; - -/** Turn a display name into a portal slug candidate ("Мама Таня" → "mama-tanya"). */ -export function slugify(s) { - let out = lc(translit(trim(`${s ?? ''}`))); - out = replace(out, NOT_LC_ALNUM, '-'); - out = trim(out, '-'); - return substr(out, 0, 32) || 'user'; -}; - -/** - * A device's name as a DNS label ("Galaxy S24" → "galaxy-s24", "Телефон" → - * "telefon"): at most 40 characters, "device" when nothing is left. - */ -export function host_label(s) { - let l = replace(lc(translit(`${s ?? ''}`)), NOT_LC_ALNUM, '-'); - l = rtrim(substr(trim(l, '-'), 0, 40), '-'); - return l || 'device'; -}; - -/** - * A server's name as a tunnel name ("Outline Home" → "Outline-Home"): the - * AmneziaWG and WireGuard apps name the tunnel after the file, and Android and - * wg-quick refuse anything but [a-zA-Z0-9_=+.-] up to 15 characters; Windows - * refuses its device names (CON, NUL, COM1…). "dawnline" when nothing is left. - */ -export function tunnel_name(s) { - let l = replace(translit(`${s ?? ''}`), NOT_ALNUM, '-'); - l = rtrim(substr(trim(l, '-'), 0, 15), '-'); - return l && index(WIN_DEVICES, lc(l)) < 0 ? l : 'dawnline'; -}; - -/* ---------- time ---------- */ - -/** "YYYY-MM-DD" → epoch of the end of that local day (23:59:59). */ -export function date_end(s) { - let m = match(s ?? '', /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/); - if (!m) - return null; - return timelocal({ sec: 59, min: 59, hour: 23, mday: +m[3], mon: +m[2], year: +m[1] }); -}; - -export function today() { - let t = localtime(); - return sprintf('%04d-%02d-%02d', t.year, t.mon, t.mday); -}; - -export function month_key(ts) { - let t = localtime(ts ?? time()); - return sprintf('%04d-%02d', t.year, t.mon); -}; - -export function day_key(ts) { - let t = localtime(ts ?? time()); - return sprintf('%04d-%02d-%02d', t.year, t.mon, t.mday); -}; - -/** - * The day key `days` days before `ts` (default now). Counted from local noon, - * so a 23- or 25-hour day around a DST change neither skips nor repeats a day. - */ -export function day_key_ago(days, ts) { - let t = localtime(ts ?? time()); - let noon = timelocal({ year: t.year, mon: t.mon, mday: t.mday, hour: 12, min: 0, sec: 0 }); - return day_key(noon - (days ?? 0) * 86400); -}; - -export function uniq(arr) { - let seen = {}, out = []; - for (let v in arr) - if (!seen[v]) { - seen[v] = true; - push(out, v); - } - return out; -}; - -export function list_dir(path) { - return lsdir(path) ?? []; -}; - -export function remove(path) { - return unlink(path); -}; - -export function now() { - return time(); -}; - -const IFACE = `${ASCII_ALNUM}_.@-`; - -/** - * A netifd interface name (network.interface., a person's home network): - * 1-32 letters, digits and _ . @ -, the same as /^[A-Za-z0-9_.@-]{1,32}$/ - * without its 3 ms compile on the WR3000P (iface_status runs several times for - * the Overview's status, and in the agent's minute checks). - */ -export function valid_iface(s) { - return type(s) == 'string' && length(s) >= 1 && length(s) <= 32 && ltrim(s, IFACE) == ''; -}; - -/** netifd's view of an interface (ubus network.interface. status), or null. */ -export function iface_status(ifname) { - if (!valid_iface(ifname)) - return null; - let s = sh_out(`ubus call network.interface.${ifname} status 2>/dev/null`); - if (!s) - return null; - try { - return json(s); - } - catch (e) { - return null; - } -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/view.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/view.uc deleted file mode 100644 index 5e8d29c..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/view.uc +++ /dev/null @@ -1,162 +0,0 @@ -// Dawnline — read models shared by the admin RPC and the portal: people and -// devices merged with live peer state and usage. - -import * as core from 'dawnline.core'; -import * as live from 'dawnline.live'; -import * as awg from 'dawnline.awg'; -import { day_key_ago, month_key } from 'dawnline.util'; - -/** Each day's [rx, tx] for the last `n` days, oldest first: the charts draw what came and what went apart. */ -export function spark(rec, n) { - let out = []; - for (let i = n - 1; i >= 0; i--) { - let v = rec?.days?.[day_key_ago(i)]; - push(out, v ? [ v[0], v[1] ] : [ 0, 0 ]); - } - return out; -}; - -/** Each day's [rx, tx] from the 1st of this month to today, oldest first (the portal's month chart). */ -export function month_days(rec) { - return spark(rec, +substr(day_key_ago(0), 8, 2)); -}; - -/** The device holds an older configuration than the one it would get now. */ -function config_stale(m, d) { - m._issued ??= awg.issued(); - let was = m._issued[d.id]; - return was != null && was != awg.config_fingerprint(m, d); -} - -/** - * The device a page request came from (`devs`: one person's device views): - * through the tunnel, by its tunnel address; outside it, the one online device - * whose tunnel comes from the request's address. The apps route the VPN's own - * address around their tunnel, and the portal shares it, so a device on the VPN - * opens the page from where its tunnel comes from. Two such devices behind one - * address (one NAT): neither. - */ -export function device_here(devs, peer) { - peer = replace(peer ?? '', /^::ffff:/, ''); - if (!peer) - return null; - let near = []; - for (let d in devs) { - if (d.address == peer) - return d.id; - if (d.online && d.endpoint == peer) - push(near, d.id); - } - return length(near) == 1 ? near[0] : null; -}; - -export function device_view(m, d, usage, dmp) { - let u = usage.devices?.[d.id]; - let peer = dmp.peers[d.public_key]; - let ts = time(); - // Set up again (Reconnect): a handshake from before it does not count. - m._reconnect ??= awg.reconnects(); - let hs = awg.handshake_since(peer?.handshake || u?.handshake || 0, m._reconnect[d.id]); - let p = m.people[d.person]; - let srv = m.servers[p?.server]; - // The same label /tmp/hosts carries (core.device_labels), so what is shown resolves. - let label = ''; - if (m.settings.hostnames && p) { - m._labels ??= {}; - m._labels[p.id] ??= core.device_labels(m, p); - label = m._labels[p.id][d.id] ?? 'device'; - } - let online = hs > 0 && live.online(dmp, d.id, peer); - let v = { - id: d.id, - name: d.name, - kind: d.kind, - address: d.address, - disabled: d.disabled, - created: d.created, - created_by: d.created_by, - online, - handshake: hs, - endpoint: live.endpoint_ip(peer?.endpoint) || u?.endpoint || '', - active: !!peer, - month: live.month(u), - total: u?.total ?? [ 0, 0 ], - spark: spark(u, 7), - hostname: label ? `${label}.${p.id}.${m.settings.domain}` : '', - browser_key: d.private_key == '', - // Its configuration changed since it was last shown or downloaded. - config_stale: config_stale(m, d), - // How it connects: its own local network outside the tunnel, its own MTU - // and keep-alive (0 / null: the server's) and what its configuration carries. - lan_bypass: d.lan_bypass, - mtu: d.mtu, - keepalive: d.keepalive, - mtu_used: srv ? core.device_mtu(srv, d) : null, - keepalive_used: srv ? core.device_keepalive(srv, d) : null, - // Its link failing in a named way, as the agent's watcher shows it - // (dawnline.link): { state, since }, or null. - link: dmp.link?.[d.id] ?? null, - // What its link does right now, for the set-up sheet (dawnline.link - // setup_state): { state: 'trying' | 'flowing' | 'nodata', since }, or null. - // Without the agent nobody tells data from a bare handshake: a session - // that lives counts as data flowing, so the sheet still sees it arrive. - setup: dmp.setup != null ? (dmp.setup[d.id] ?? null) : online ? { state: 'flowing', since: hs } : null, - }; - return v; -}; - -export function person_view(m, p, usage, dmp, states, opts) { - opts ??= {}; - let u = usage.people?.[p.id]; - let devs = []; - for (let id in p.devices) - push(devs, device_view(m, m.devices[id], usage, dmp)); - devs = sort(devs, (a, b) => a.created - b.created); - let used = core.person_usage(p, usage); - let v = { - id: p.id, - name: p.name, - server: p.server, - access: p.access, - device_limit: p.device_limit, - expires: p.expires, - quota_gb: p.quota_gb, - quota_period: p.quota_period, - quota_used: used, - quota_limit: core.person_quota(p), - bonus_gb: (p.bonus_gb > 0 && p.bonus_month == month_key()) ? p.bonus_gb : 0, - expire_action: p.expire_action, - dns_mode: p.dns_mode, - expire_warn: p.expire_warn, - paused: p.paused, - hours: p.hours, - state: states[p.id] ?? core.person_state(m, p, usage), - month: live.month(u), - total: u?.total ?? [ 0, 0 ], - online: length(filter(devs, (d) => d.online)), - last_seen: 0, - devices: devs, - }; - for (let d in devs) - if (d.handshake > v.last_seen) - v.last_seen = d.handshake; - if (opts.admin) { - // The code and links themselves are person_links' (admins only): the - // code opens the person's portal and their devices' configurations. - v.has_link = core.portal_url(m, p) != null; - v.note = p.note; - v.services = p.services; - v.home_nets = p.home_nets; - v.circle = p.circle; - v.created = p.created; - v.code_set = p.code_set; - } - return v; -}; - -export function states(m, usage) { - let out = {}; - for (let id, p in m.people) - out[id] = core.person_state(m, p, usage); - return out; -}; diff --git a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc b/package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc deleted file mode 100644 index 5c88706..0000000 --- a/package/luci-app-dawnline/root/usr/share/ucode/dawnline/watchdog.uc +++ /dev/null @@ -1,230 +0,0 @@ -// Dawnline — watchdog. The agent runs it every minute: it checks what keeps -// people connected and repairs what it can, waiting longer after each repair -// that did not help. What it finds goes to the service log (English, as -// logged); its state to RUN_DIR for the Health page, whose chip names are put -// in the admin's language when they are read (view()). A cron job -// (libexec/dawnline/heartbeat) looks after the agent itself. - -import { stat } from 'fs'; -import { _, L_ } from 'dawnline.i18n'; -import { sh_out, q, read_json, write_json, slog, slog_read, RUN_DIR } from 'dawnline.util'; -import * as apply from 'dawnline.apply'; -import * as loop from 'dawnline.loop'; -import * as health from 'dawnline.health'; -import * as awg from 'dawnline.awg'; -import * as nft from 'dawnline.nft'; -import * as netifd from 'dawnline.netifd'; -import * as upd from 'dawnline.updates'; - -export const STATE = `${RUN_DIR}/watchdog.json`; -/** The agent writes the time here on every tick. */ -export const BEAT = `${RUN_DIR}/agent.beat`; -// Seconds before the next repair, by the number of repairs so far. -const WAIT = [ 0, 120, 600, 1800, 3600 ]; -// Good minutes in a row before a repaired target's count of repairs is -// forgotten: one good minute between two failures is still flapping. -const SETTLED = 10; - -/** Why a tunnel is down (AmneziaWG; kept here for older callers). */ -export function iface_errors(ifname) { - return awg.iface_errors(ifname); -}; - -function restart_services() { - // procd keeps unchanged instances (the agent running this) and starts missing ones. - system('/etc/init.d/dawnline start >/dev/null 2>&1'); -} - -/** - * What to look at: { id (= the Health check id), src, name (chip, stored in English: view() - * shows names() by id), who (the log's subject), ok, - * problem, back, detail?, repair: { what, run }? }. The log reads " - "; its - * words are L_(): English in the log, translated where it is shown. - */ -function probes(m) { - let out = []; - // The tunnels check themselves: AmneziaWG (packages, kernel module, netifd) and each server's interface. - let tunnels = awg.probes(m, { udp_listening: health.udp_listening, reapply: () => apply.apply(), owner: (ifn) => netifd.owner(ifn) }); - push(out, ...tunnels); - // A tunnel's interface edited outside Dawnline (LuCI, uci) keeps that until - // the next apply: set up again with Dawnline's settings. Only while - // AmneziaWG itself works (its target comes first, and is fixed first). - if (filter(tunnels, (p) => p.id == 'awg')[0]?.ok) - for (let id, diff in netifd.drift(m)) { - let srv = m.servers[id]; - push(out, { - id: `cfg_${id}`, src: 'awg', name: `${srv.name} · interface settings`, who: srv.name, ok: !length(diff), - problem: sprintf(L_('interface %s was changed outside Dawnline'), srv.ifname), - back: sprintf(L_("interface %s has Dawnline's settings again"), srv.ifname), - // Option names only: their values hold the server's private key. - detail: () => sprintf(L_('Changed: %s.'), join(', ', diff)), - repair: { what: L_('setting it up again'), run: () => apply.apply() }, - }); - } - if (length(m.servers)) - push(out, { - id: 'nft', src: 'dawnline', name: 'Access rules', who: L_('Access rules'), ok: nft.present(), - problem: L_('are missing'), back: L_('are loaded again'), - repair: { what: L_('loading them again'), run: () => apply.apply() }, - }); - - if (length(filter(values(m.servers), (x) => x.private_key))) { - let fw = apply.firewall_drift(m); - push(out, { - id: 'fw', src: 'dawnline', name: 'Firewall', who: L_('Firewall'), ok: fw == null, - problem: fw == 'off' ? L_("isn't running on this router (fw4): tunnels and the portal are closed") - : fw == 'changed' ? L_("rules for Dawnline were changed or removed") : L_("rules for Dawnline aren't loaded"), - back: L_('rules for Dawnline are in place again'), - // fw4 stopped on purpose is the admin's call: report it, do not start it. - repair: fw == 'off' ? null : { what: L_('restoring them'), run: () => { apply.apply(); system('fw4 -q reload'); } }, - }); - } - - let s = m.settings; - if (s.portal_enabled && !length(health.needs().https) && !length(health.tcp_port_owners(s.portal_port))) - push(out, { - id: 'portal', src: 'portal', name: 'Portal', who: L_('Personal portal'), ok: health.tcp_listening(s.portal_port), - problem: sprintf(L_("isn't answering on port %d"), s.portal_port), back: L_('answers again'), - detail: () => sh_out("logread -l 400 2>/dev/null | grep 'uhttpd' | grep -iE 'error|fail|cert|key|bind|address' | tail -n 4"), - repair: { what: L_('restarting it'), run: restart_services }, - }); - - // Only while a server is on: with all of them off it idles on loopback. - if (stat(loop.RESOLVER.conf) && length(filter(values(m.servers), (x) => x.enabled && x.private_key))) - push(out, { - id: 'resolver', src: 'dawnline', name: 'Resolver', who: L_('DNS for Home-only devices'), ok: loop.resolver_running(), - problem: L_("isn't running"), back: L_('runs again'), - repair: { what: L_('restarting it'), run: restart_services }, - }); - - push(out, { - id: 'rpc', src: 'dawnline', name: 'LuCI link', who: 'LuCI', ok: system('ubus list luci.dawnline >/dev/null 2>&1') == 0, - problem: L_("can't reach Dawnline (luci.dawnline is missing in rpcd)"), back: L_('reaches Dawnline again'), - detail: () => sh_out('logread -l 400 2>/dev/null | grep rpcd | tail -n 4'), - // A reload keeps LuCI logins; a restart (second try) signs everyone out — - // and after three it stops: restarting rpcd every hour for good would - // sign every admin out for good. - repair: { what: L_('reloading rpcd'), max: 3, run: (n) => system(n > 1 ? '/etc/init.d/rpcd restart >/dev/null 2>&1' : '/etc/init.d/rpcd reload >/dev/null 2>&1') }, - }); - return out; -} - -/** One pass. With repairs off it only reports. */ -export function run(m) { - let now = time(); - let fix = m.settings.watchdog; - // An update is replacing packages or restarting tunnels: what looks broken - // meanwhile is being worked on; repairs would only get in its way. - let busy = upd.busy(); - let st = read_json(STATE, {}); - let t = type(st.targets) == 'object' ? st.targets : {}; - let repairs = filter(st.repairs ?? [], (r) => now - r.ts < 86400); - let seen = {}; - for (let p in probes(m)) { - seen[p.id] = true; - let x = t[p.id] ??= { bad: 0, tries: 0, next: 0 }; - x.name = p.name; - x.ok = p.ok; - if (p.ok) { - if (x.reported) - slog(p.src, 'up', x.stuck ? sprintf(L_('%s · restored'), p.back) - : x.tries ? sprintf(x.tries > 1 ? L_('%s (after %d repairs)') : L_('%s (after %d repair)'), p.back, x.tries) : p.back, null, p.who); - x.bad = 0; - x.next = 0; - x.reported = false; - x.stuck = false; - // The repairs so far are forgotten only once it has stayed up a while: - // a target that fails every other minute keeps its back-off. - x.good = (x.good ?? 0) + 1; - if (x.good >= SETTLED) { - x.tries = 0; - x.good = 0; - } - continue; - } - x.good = 0; - // One bad minute can be a restart in progress. - if (++x.bad < 2) - continue; - if (busy) - continue; - if (p.repair?.max && x.tries >= p.repair.max && !x.reported) { - slog(p.src, 'error', sprintf(L_("%s - not repaired again (%d repairs didn't help)"), p.problem, p.repair.max), p.detail?.(), p.who); - x.reported = true; - continue; - } - if (!fix || !p.repair || (p.repair.max && x.tries >= p.repair.max)) { - if (!x.reported) - slog(p.src, 'error', p.problem, p.detail?.(), p.who); - x.reported = true; - continue; - } - // Three repairs did not help: say so once, in red, and from then on keep - // trying quietly until it works again (that is logged). - if (x.tries >= 3 && !x.stuck && now - (x.last ?? 0) >= 50) { - x.stuck = true; - slog(p.src, 'error', sprintf(L_("%s - %d repairs didn't help"), p.problem, x.tries), p.detail?.(), p.who); - } - if (now < x.next) - continue; - x.tries++; - x.last = now; - x.next = now + WAIT[min(x.tries, length(WAIT) - 1)]; - x.reported = true; - if (!x.stuck) - slog(p.src, 'repair', sprintf(L_('%s - %s'), p.problem, p.repair.what), p.detail?.(), p.who); - try { - p.repair.run(x.tries); - } - catch (e) { - if (!x.stuck) - slog(p.src, 'error', sprintf(L_("couldn't be repaired: %s"), e.message), null, p.who); - } - if (!x.stuck) - push(repairs, { ts: now, id: p.id, name: p.name }); - } - for (let id in keys(t)) - if (!seen[id]) - delete t[id]; - write_json(STATE, { last: now, targets: t, repairs }, 0o644); -}; - -/** - * The chip names of probes() by target id, in the language of the call. The - * others (AmneziaWG's, "Home · AmneziaWG") are names only and stay as stored. - */ -function names() { - return { - agent: _('Agent'), nft: _('Access rules'), fw: _('Firewall'), portal: _('Portal'), - resolver: _('Resolver'), rpc: _('LuCI link'), - }; -} - -/** A target's chip name in the language of the call: names(), a server's interface settings, else as stored. */ -function chip_name(m, n, id, stored) { - if (n[id]) - return n[id]; - let srv = substr(id, 0, 4) == 'cfg_' ? m.servers[substr(id, 4)] : null; - return srv ? sprintf(_('%s · interface settings'), srv.name) : stored; -} - -/** - * For the Health page: the watchdog's state and the newest log entries. Target - * and repair names in the language of the call; the log as it was written. - */ -export function view(m) { - let st = read_json(STATE, {}); - let beat = +(read_json(BEAT, 0) ?? 0); - let n = names(); - // The agent itself: fine while it ticks (cron restarts it after 5 minutes without). - let targets = [ { id: 'agent', name: n.agent, ok: beat > 0 && time() - beat < 180, tries: 0 } ]; - for (let id, x in (type(st.targets) == 'object' ? st.targets : {})) - push(targets, { id, name: chip_name(m, n, id, x.name), ok: !!x.ok, tries: x.tries ?? 0 }); - return { - watchdog: { - enabled: m.settings.watchdog, last: st.last ?? null, beat: beat || null, now: time(), - targets, repairs: map(st.repairs ?? [], (r) => ({ ...r, name: chip_name(m, n, r.id, r.name) })), - }, - log: slog_read(200), - }; -}; diff --git a/rules/backend-go.md b/rules/backend-go.md new file mode 100644 index 0000000..25082c8 --- /dev/null +++ b/rules/backend-go.md @@ -0,0 +1,37 @@ +# Backend (Go: `backend/`) + +Read with `code-standards.md` (it applies whole: one job per package, layers one way, validate at the boundary, one writer, fail closed) and `docs/backend.md` (where the backend is going and the stream's protocol). + +## Packages + +- One package, one job, named after it, with a package comment that says what it owns, what it does not and what callers rely on. `backend/version.go` lists them and the layers. +- **Layers:** `ubus` and `hub` know nothing of Dawnline or of each other; `api`, `bridge` (and later the producers) join them; `daemon` runs them; only `cmd/dawnlined` knows the router's paths. +- **One door per outside system.** Only `ubus` speaks ubus; when they come, only one package runs `awg`, one talks nftables, one writes UCI. A new version of the thing behind a door is one package to change. +- **Seams are interfaces declared by the user** (`bridge.Caller`, `api.Notifier`), so a test hands in a stand-in. No package-level state. +- **No dependency without a reason written in the change that adds it.** The standard library covers the stream; nftables and netlink will need libraries. +- **Not copied from podkop-exp** (GPL; Dawnline is MIT): its patterns, never its code. + +## The stream + +- A producer **puts whole documents** (`hub.Put`) and never builds a patch; it may put as often as it likes. +- Documents hold **no `null`** and publish lists of things with ids as **keyed lists** (`{ order, items }`). +- What costs something to produce runs **only under a lease** (`Audience.Wants`). +- A new topic or method is added to `docs/backend.md`, and a method to the rpcd ACL (`acl.d/luci-app-dawnline.json`) in the same change. +- Text people read is not put into topics: the page translates (`i18n.md`). A topic carries codes and values. + +## Failures + +- **A refusal is a sentence for a person, capital first**, in English through the catalog (`access.Said`, `said`, `github.Failure`, `w.die`), listed in `i18n/messages.js`. An error Go or a library wrote for programmers (lower-case first, by Go's convention: «open /etc/config/dawnline: no such file») is never sent to a page: `methods.wordsOf` sends the plain sentence (`methods.Unworded`) and puts the error itself in the system log. The page holds the same line (`web/src/admin/failure.ts`). + +## Cost on the router + +- Nothing periodic without a measurement on the router. What was measured there: `nft` reads the router's whole ruleset to change a set in place (0.9 s beside a proxy's lists) and nothing to replace our own table (0.06 s), so a sync replaces the table; `auto-merge` on an interval set costs the same 0.9 s, so networks are collapsed before they are written. +- A goroutine per job, not per event; channels that can fill say what happens when they do (the hub lets a slow follower go). + +## Checks + +- **The goldens are the ucode backend's own answers.** `backend/*/testdata/*.json` were made by the ucode backend (0.18.0) from the fixtures beside them, before it was removed; nothing regenerates them. A test that compares with one holds Go to what that backend did. Changing behaviour on purpose means editing the golden by hand in the same change, and saying why in it. +- `scripts/backend-container.sh` (needs docker): gofmt, `go vet` (all build tags), the unit tests, then the tests against a real `ubusd`, `rpcd` and `uhttpd` in the OpenWrt 24.10 and 25.12 rootfs images. +- A pure function gets a table test beside it; what speaks to the router gets a case in a tagged test (`ubusd`, `e2e`) that the script runs. +- **Local time is the router's, asked of `zone.Local()`**, never `time.Local`: OpenWrt keeps the zone in `/etc/TZ`, where Go does not look, so a Go program there is in UTC unless told (`backend/zone`). A golden made with `TZ=UTC` cannot see a mistake here: test what counts days or hours in a zone east of Greenwich. +- **There is no second backend to fall back to.** What changes how the router is kept is tried first where it changes nothing (`ubus call dawnline apply_plan` and `sync_plan` say what an apply or a sync would do), and on the real router only on objects made for the try. A person's link code is never logged, printed or put in an error. diff --git a/rules/backend.md b/rules/backend.md deleted file mode 100644 index a7826e3..0000000 --- a/rules/backend.md +++ /dev/null @@ -1,33 +0,0 @@ -# Backend (ucode on the router) - -Read with `code-standards.md`. Everything here runs on a small router (2 × Cortex-A53 on the reference Cudy WR3000P): cost is part of correctness. - -## Layers - -- `util`, `schema` (validation) → `core` (model, allocation) → `store` (the only writer of `/etc/config/dawnline`) → domain modules (`net`, `nft`, `fw`, `netifd`, `awg`, `loop`, `resolver`, `live`, `health`, `backup`, …) → `apply` (reconciliation) → entry points (`rpc/*`, `portal`, the `dawnline` CLI, the agent, the updater). -- Read models for the UI live in `view`; RPC modules translate arguments and call down, they hold no business logic. -- The updater is a thin dispatcher over `upd_app` / `upd_awg` / `upd_pkgs`, with GitHub in `github`, the package manager in `pkg`, policy/locks/history in `updates`. -- Live state: the agent's watcher owns who is online (`live.PRESENCE`); readers ask `live.online()`, never re-derive it from handshake ages. Online means the WireGuard session lives (`live.online_window()`: 190 s, longer for a device with a long keep-alive): traffic silence is no signal, a phone asleep is silent too. A device's link trouble (trying, shared, dropped, unstable) is the watcher's too (`dawnline.link`, `live.LINK`). - -## ucode - -- `'use strict'` in entry points; modules `import { … } from 'fs'` / `'dawnline.x'`. Subdirectories map to dots (`dawnline.rpc.status` → `dawnline/rpc/status.uc`). -- Exported functions end with `};` (the compiler requires it). No destructuring. Regexes are POSIX (no `(?:)`, `\s\S` classes, lazy quantifiers); anchor them. -- Modules with `export` cannot be loaded with `require()`: imports are static and compiled on every start of the script. -- Doc comments (`/** … */`) on every export: what it returns, including the null/empty case. -- Shell out through one small helper per module (`run()`/`sh()`), with `2>&1` captured and the exit code checked. -- Messages people read (`die()` texts, check titles and details, phases) go through `_()` / `N_()` of `dawnline.i18n`, inside functions, with `sprintf()` for values (`i18n.md`). -- nft changes load as one script (`nft.load()`, a transaction); tables Dawnline owns are named `dawnline*` and rebuilt whole (`table X` + `delete table X` + the table). - -## Cost on the router - -- **The portal is CGI:** every request starts ucode and compiles the module graph, about 140 ms of CPU before any work (a full `state` answer about 180 ms). No periodic polling from the portal; one request per user action. A person's answers read only their server's tunnel (`live.dump(m, sid)`: one `awg` process, however many servers). -- **rpcd keeps the admin backend loaded:** LuCI RPC calls are cheap, so the admin UI may poll small methods often (`rev`), and the heavy ones (`status`) only on change or rarely. -- **Code on the agent's 1-second watcher stays in the low milliseconds:** one `awg show dump` per Dawnline tunnel, never `all` (another AmneziaWG interface's peers are not Dawnline's; about 4 ms with process start, 1 ms to parse), the model cached by the config file's mtime/inode (`core.load()` is about 4 ms), files written only when something changed. Slow work (geo lookups, apply) runs only on a transition. -- **A regex literal is compiled every time it runs:** ucode calls regcomp for `/…/` each time the expression is evaluated, and musl's regcomp grows with the pattern. Bounded repeats are copied out (`{42}` about 1.7 ms on the WR3000P, `[A-Za-z0-9_.@-]{1,32}` 3 ms, two `{0,61}` 10 ms), alternations and classes add up (`/^(PrivateKey|Jc|Jmin|Jmax) /` 0.11 ms, `/^[0-9]+$/` 0.02 ms); matching a compiled regex takes 0.01–0.1 ms. In a loop or on a hot path, hoist the regex into a module `const` (compiled once, when the module loads — every portal request pays that too) or check with `length`/`substr`/`ltrim` (`util.valid_key`, `valid_host`, `valid_iface`). -- Measure before and after on the router (a loop of 20–200 calls, `/proc/self/stat` CPU ticks, system busy from `/proc/stat`) when adding anything periodic. - -## Checks - -- `scripts/lint-ucode.py` and `scripts/ucode-container.sh` (compiles and runs `tests/ucode` in the OpenWrt rootfs containers; `scripts/check-ucode.sh` compiles on the router instead) pass before any deploy; new directories and entry points are added to `lint-ucode.py` and `scripts/compile-ucode.sh`, and executables to the mode check in `.github/workflows/ci.yml`. -- Pure functions get a case in `tests/ucode/.test.uc`; what reads the clock takes an optional `ts` so a test can pass one. diff --git a/rules/code-standards.md b/rules/code-standards.md index cb0bd76..cb1f094 100644 --- a/rules/code-standards.md +++ b/rules/code-standards.md @@ -2,7 +2,7 @@ How code in our own projects (Dawnline first, the same spirit for Tachyon, liminal and the rest) is written. This file holds what applies everywhere; per area: -- `backend.md` — ucode on the router: layers, conventions, what things cost there. +- `backend-go.md` — the backend (Go): packages, the stream, what things cost on the router. - `frontend.md` — TypeScript admin UI and portal: layout, live data. - `shell.md` — install, uninstall, init and CI scripts. - `ui-design.md` — how anything visible looks and how it gets approved. @@ -13,7 +13,7 @@ Match the code around you: its naming, comment density and idiom win over person - **One module, one job, named after it.** A file you cannot describe in one sentence is two files. Starting points: ~300–400 lines for a ucode/TS module, ~60 lines for a function. Past that, split by responsibility, not by line count. - **Every module opens with a header comment**: what it owns, what it deliberately does not (and where that lives), and any invariant callers rely on (locks, files it writes, who may call it). -- **Layers point one way.** Pure helpers and the data model know nothing about the router or the UI; orchestration calls them, never the reverse. Dawnline's layers are in `backend.md`. +- **Layers point one way.** Pure helpers and the data model know nothing about the router or the UI; orchestration calls them, never the reverse. Dawnline's layers are in `backend-go.md` and `backend/version.go`. - **No god files, no grab-bag `ops`/`misc`/`kit` modules.** When a helper is used by one module, it stays private in that module. - **Delete, don't deprecate.** When something is replaced, move every caller and remove the old code in the same change; no shims, no commented-out blocks. The same goes for its strings: new text is translated in the same change, removed text leaves the catalogs (`i18n.md`). diff --git a/rules/frontend.md b/rules/frontend.md index 82151d6..df1841c 100644 --- a/rules/frontend.md +++ b/rules/frontend.md @@ -5,14 +5,38 @@ Read with `code-standards.md` and, for anything visible, `ui-design.md` and `i18 ## Code - Strict TS, no `any` without a comment; types for RPC answers live in `shared/types.ts` / `admin/api.ts` and mirror the backend's shapes. -- Layout of `web/src/admin`: `ui/` generic components (button, menu, modal, drawer, tooltip, toast, controls), `widgets/` composite house widgets, `state/` polling and scoping, `events/` the activity vocabulary (model without DOM, render separate), `updater/` the Components data layer, `cores/` per-protocol bits, `pages//` one folder per page split by section, `styles/*.css` one file per feature joined in `styles/index.ts`. Shared with the portal: `src/shared/`. +- Layout of `web/src/admin`: `main.ts` (the LuCI module `dawnline.app`: one factory per view), `pages//` one folder per page split by part (overview; people with its cards, the notices over them, a person's and a device's page `person/` and `device/`, and its map view; log; settings with the server's path in the folder itself and the router's own sections in `router/`), `ui/` generic components (toast, files, glass, icons, tabs, page head and block head, edit rows, the choice row of the Updates block, stepper, and the kit below), `widgets/` composite house widgets (the rollout strip, timeline, line chart, live line, map box, the event feed, the address row, the disguise presets, and a panel's parts below), `flows/` sheets that do one thing in steps (a device's set-up, adding a device, new keys, a question, a close-up, a new server, the one question before a server's staged changes, a Health check's fix, an updater job as an operation and a restore or import on the job's stage (`job-stage.ts`: one view from a job's start to its end), Dawnline's versions, a release's notes, removing Dawnline), `shell/` the pages' frame inside LuCI (below), `state/` polling, the live revision and the live meter, `events/` the activity vocabulary (model without DOM, render separate; `scope.ts`: the Log's filters as its address says them), `updater/` the updater's jobs, release notes and automatic-update policy as data (pure), and the pure models of what pages say: `people/` (people and devices, the diagnosis; `card.ts` the parts of a person's card by state, its group and its order, the one source of every count of people; `presence.ts` since when someone is online and their week's hours, from the log), `servers/` (a server's path by Health check ids, its state, the rollout and ⟳N counts, the changes that wait to be applied, who reaches what, the disguise's parameters), `places/` (places and their replay; `places/render.ts` draws a device's places, or all of a person's devices), `system/` (the router sections' words), `overview/` (Overview's: the state line, the checks as a list and where each is fixed, who waits, the servers' numbers, today by the hour, the watchdog's news). `map.ts` is the admin's map (MapLibre). `demo/` is the admin outside LuCI over a made-up router in the page (LuCI's globals, the backend's answers from a fixed cast, the Outline theme's shell): what `scripts/capture-screenshots.mjs` takes the README's pictures from, built by `npm run build:demo` beside the portal's demo, never into a package; it answers questions only, and a page that asks it something new gets that answer added to `demo/router.ts`. Shared with the portal: `src/shared/`. +- **Three sections and a server's page, pages inside a view instead of LuCI pages.** The row is Overview · Log · Settings (`shell/routes.ts`), each a LuCI view of its own. A server is a page behind Overview (`pages/server`), drawn by two views inside one frame (the way back, the server's head, the track Overview · People · Places · Settings): `server?server=&p=general|core|network` is its own Overview and the three parts of its settings (`&s=` brings a section into view; `serverUrl()`, and `settingsUrl(stage, server)` for «where this is set»), `people` is the People page scoped to it (`pages/server/people.ts` extends `PeoplePage` through its `scope()` and `chrome()`): a person's page takes the list's place (`ui/subpage.ts`; the list waits with its scroll and filters), Places is its map view, a device opens as a dialog over its person's page (`pages/server/device-dialog.ts`): `people?id=`, `people?device=`, `people?view=map` (`people/route.ts`, pure: the route, its query, and what a link inside the page leads to). Which server a People address means: the one its person or device is on, else the one this tab looked at last (`sessionStorage`), else the first. Settings keeps the router's own sections, one at a time behind a rail (`settings?p=updates|portal|defaults|history|backups|remove`, `pages/settings/route.ts`, pure). A page moves inside itself without a load: a pick that changes what is on screen is `pushState` (a person's page, a part of the server's page, Settings' section: Back returns; a page's own way back steps back in history when the entry before is where it leads), a filter or the order `replaceState`; a plain click on any link to the view is taken by the page, and code goes there with `visit()` (`shell/visit.ts`), never `location.href`. The old `person`, `device`, `places`, `system`, `health`, `diagnostics`, `updates` and `activity` nodes only send the browser on, and `settings` and `server` send on their own old queries (a stage of a server's path was Settings' `?p=`; `shell/redirects.ts`). A server's settings are keyed parts (`pages/settings/parts.ts`): a section is built again only when what it shows moved, and never while it is typed in. +- **The kit** (`ui/`, classes `kt-*` in `styles/shadow/kit.css`): `filter-bar.ts` (the search, chips with counts, Reset, the count), `list-drop.ts` (a list of choices under its button: the picked one checked, a long list scrolling inside the glass), `subpage.ts` (a list and the page of one thing in it, in its place: the way back and ×, the list back where it was with the opened item ringed), `tip.ts` (the tooltip of a thing without words, above it or under it), `rail.ts` and `section.ts` (a page of sections: the rail with its highlight and jump pill, a section's head, cards, captions and notes), `option-tiles.ts` (a choice of two or three drawn, not described: a picture, a name, facts as pills, a round mark on the one in use), `range.ts` (a value on a scale with its named marks), `combo.ts` (a field that picks from its list as it is typed in), `measure.ts` (a measure with its limit; a value picked from a few), `inline-edit.ts` (a value edited where it stands), `comp-row.ts` (a row of a list of things with a state, its actions in sight), `empty.ts`, `face.ts`, `meter.ts`, `split.ts` (a map with its inspector as one stage: side by side as high as the window leaves, the inspector's body scrolling inside; narrower, the map over it), `page-head.ts` `blockHead`, and the glass dock at the window's foot (`.kt-dock`: People's selection, Settings' waiting changes). A page's parts (`widgets/`, `styles/shadow/widgets.css`): `term.ts`, `limit-meter.ts`, `reach.ts` (what they reach: two switch rows), `config-card.ts` (a device's set-up), `place-rows.ts` (place rows with strips), `feed.ts` (the feed's rows and their short form). They read `people/ctx.ts` (what a page's parts are given) and act through `flows/person-acts.ts`; a page's own classes are `pp-*` (`people.css`: the cards, the notices, picking; `panel.css`: a person's and a device's page; a person's is two columns, the main one and the access stack that stays in sight, one column under 760 with the stack first), `st-*` (`settings.css`, `settings-router.css`), `lg-*` (`log.css`), `ov-*` (`overview.css`). +- **A server's changes wait.** In Settings no change of how a server works is made on the spot, whether devices fetch their configuration again after it (⟳N on its field) or not: it is staged (`servers/pending.ts`, pure: one staged change a kind, one `server_update` patch of every field, one `server_interfaces` patch of the home networks, the route and the WAN, what applying means for devices), its field shows the new value as not applied, the dock at the window's foot counts the changes and the devices, and «Apply» makes them (`pages/settings/changes.ts`): after one question that names them all (`flows/server-change.ts`) and one rollout when devices fetch again, at once when none does. Leaving the page while changes wait is asked about first (`pages/settings/pending-dock.ts`). +- **Pick from a list as it is typed in: `ui/combo.ts`**, never a `` (its popup and arrow are the system's). A list picked without typing is `ui/list-drop.ts` under its button. +- **⟳N goes at the right end** of its row, head or caption (`reMark`; DESIGN.md › ⟳N): a builder that takes `re` places it there itself. +- **The router-wide settings wait in the same dock.** A router section never calls `settings_update`: it hands values to `RouterCtx.save` (or `router/save.ts put`), `pages/settings/changes.ts` stages them (`system/draft.ts`, pure: what equals the router's value stops waiting, `withDraft` puts each staged value where its section reads it: `settings`, `effective`, `logs.policy`, `effective.updates`), and «Apply» sends them in ONE call before the server's own. A new setting key that a section reads from somewhere else gets its place in `system/draft.ts`. +- **A person's changes wait too.** On a person's page what they reach, their limit and its period and their device limit go through `people/draft.ts` (pure: what waits and what is saved at once, the person as they would be, the devices that fetch again): the page draws `preview(person, draft)`, marks the parts with «not applied», and the same dock applies the draft in ONE `person_update` (a question first when devices fetch again). A widget keeps calling `PersonCtx.patch`; the page decides what waits. +- **A fix stands where the problem is.** A Settings section shows the Health checks that are about it (`servers/path.ts` for a stage, the portal's by id) with the fix as a button or the advice (`pages/settings/health.ts`, `flows/health-fix.ts`); Overview lists the same check as a link to that section, and keeps a fix button only for a check no section is about (`overview/model.ts` `fixPlace`, `ownFix`). +- **Four LuCI modules**, built by one tsup entry list with `splitting: false` (one self-contained file per module, `patchForLuci` on each), each refused by the build over 576 KiB (uhttpd sends them uncompressed; 512 until 2026-11-12, when the owner raised it for the networks behind routers rather than split the pages' module): + - `dawnline.app` (`main.ts`): every page; the thin files in `view/dawnline/*.js` do `return view.extend(app.())` with `'require dawnline.app as app'`. The old addresses' views are factories here too, each sending the browser on at once (`shell/redirects.ts`, pure and tested). + - `dawnline.style` (`style-module.ts`): the pages' stylesheet as text; each view loads it with its data (`shell/style.ts`). It also brings the pictures a page draws as soon as it stands, which the pages' module has no room for: the admin's glass shapes (`ui/glass-shapes.ts`), its line icons (`ui/line-icons.ts`) and the products' marks; a new shape or line icon goes into those files, not into `ui/glass.ts` or `ui/icons.ts` (a shape that carries a mark is the exception: `ui/glass.ts`). + - `dawnline.map` (`map-module.ts`): `map.ts`, `places/render.ts` and their sheet (`styles/shadow/maps.css`), loaded with `L.require` the first time a page draws a map (`shell/maps.ts`): the map box holds its place meanwhile (`widgets/map-box.ts`), the close-up opens once it is in. The app module imports the map's **types only**; the build fails if `app.js` bundles MapLibre's loader or the stylesheet. + - `dawnline.qr` (`qr-module.ts`): the QR generator (`shared/qr.ts` with its library), loaded with `L.require` when a sheet draws a code (`shell/qr.ts`: `loadQr()` beside the sheet's request to the router, `qrBox()` holds the code's place). It is pure; the build fails if `app.js` bundles the generator. + - A module loaded on demand has its own copy of what it shares with the pages, so it must not depend on their state: what it needs (the layer) is handed in (`bind`). Put there only what a page rarely needs and what keeps a module under its budget. +- `shell/` is the pages' frame inside LuCI: `host.ts` (a Shadow DOM host adopting the constructed stylesheets, the page's and those added later by a module loaded on demand, theme from `html[data-darkmode]`, focus rings), `layer.ts` (the second host on `` for the sheet, menus, toasts and the map's marker card; the portal's modules draw there through `portal/ui/layer.ts`), `nav.ts` (the page's own section row), `routes.ts` (addresses and sections), `redirects.ts` and `moved.ts` (old addresses), `role.ts` (read-only logins), `toast.ts` (the portal's toast in the layer, with undo; `ui/toast.ts` `notify()` goes there), `style.ts` and `maps.ts` (the modules loaded with a view or on demand). +- `styles/shadow/*.css` are the stylesheets: `index.css` (the pages': the portal's `styles/index.css`, then the admin's parts, which only add classes on the portal's tokens) and `maps.css` (the map's module: `map.css`, `closeup.css`). The build bundles each, runs `build/shadow-css.ts` (`:root`/`html`/`body` → `:host`, the colour scheme → `:host([data-theme=…])`) and imports the result as text. +- The pages use the portal's own modules (`portal/dom`, `motion`, `ui/sheet`, `ui/menu`, `ui/feedback`, `ui/glass`; and the small parts both sides need, which live there for that reason: `ui/tip`, `ui/inline-edit`, `ui/carry`, `ui/grown`, `ui/chips-motion`, `ui/fold`, styled in `portal/styles/kit.css` and `behind.css`; the rules of a typed network are `shared/nets.ts`; the portal never imports from `admin/`) and the admin's portal-style parts in `ui/` (`tabs`, `page-head`, `glass`, `icons`); their strings are in the admin's catalog (the extractor follows the admin's imports into `src/portal`). Inside a Shadow DOM `document.activeElement` is the host: read the focus from the element's root (`focusInside`), find elements from the host's root, and route keys through `composedPath()`. +- **A region drawn again swaps its children with `portal/ui/put.ts` `putChildren`, never `replaceChildren`.** `replaceChildren` empties the box first. WebKit lays the page out when the node that holds the focus leaves it (the switch just pressed), finds the page shorter than its scroll position and clamps it: on an iPhone every press in Settings sent the page to its top (the owner, 2026-11-12: «кликая на разные кнопки у меня слетает в самый верх»). `putChildren` puts the new nodes in before it takes the old ones out and leaves alone what stays, so the page is never shorter than it was or will be. It also holds the scroll position of every box around the one it fills (read before, put back after, in the same task): a section on screen swapped for a newly built one of the same height still put the page at its top, with nothing emptied (the chips of «What it installs», the owner the same day: «все еще телепортируют вью вверх»); it takes a new node whose styles answer the page's container queries, and what WebKit does there is not known. So a part that is pressed is better kept than built again (`carryOn`), and the hold is what stands when it is not. A redraw that takes nodes out before it comes to `putChildren` (the people's cards build their next groups around the cards they keep) runs inside `keepPlace(box, fn)`, the same hold around a whole function. Chromium does not show any of it: such a change is checked in WebKit (Playwright's, with an iPhone profile), not only in Chrome. +- Enter in a text field with its own key handler does nothing while a word is being composed (`shared/keys.ts` `composing`): an input method's Enter picks a candidate. A field in a `
` that is submitted needs none of it. - Pages build from `ui/` and `widgets/`; a page never defines a generic component. Logic that does not touch the DOM (formatting, models, CSV, sorting) lives outside the render code and gets tests. ## Live data - Admin pages use `createPoller` (`state/poller.ts`): newest answer wins, no repaint of a region that holds focus, every RPC failure shows a toast or an inline error, never a blank section. -- Changes reach open pages through the revision (`state/live.ts`): one small `rev` call every 2 s while the page is visible; pollers that opt in (`live: true`) refresh when it moves. Their own `every` stays as a slow fallback. -- The portal does not poll (each request is a CGI process on the router, see `backend.md`): it loads once, after the visitor's own changes, and while it waits for a new device's first connection. +- **A failure reaches the page only as words for a person** (`admin/failure.ts`; the owner, 2026-11-12: «нужно как-то правильно показывать их по всей админке»). What is thrown goes through `errorText(e)` (`ui/toast.ts`): the backend's refusals and the page's own `new Error(_('…'))` are sentences and are shown as they came; LuCI's reports of the bus and the network («RPC call to … failed with ubus code 4») are told by their code (restarting, too slow, session ended, may not, page and router disagree, unreachable); the engine's errors and a program's text (lower-case first) get one plain sentence, and the original goes to the console. A failure the router keeps in its state (a component's check, an update job, the updates' history) goes through `routerSaid(text)` the same way. Never put `e.message`, `String(e)` or a state's `error` on the page directly. Throw your own failures as sentences, capital first, in `_()`. +- Changes reach open pages through the revision (`state/live.ts`): one small `rev` call every 2 s while the page is visible; pollers that opt in (`live: true`) refresh when it moves. Their own `every` stays as a slow fallback (30 s for the status). +- What costs the router more is asked for only while it is seen: the live meter once a second only while a speed is on screen (an IntersectionObserver on its tile; the agent writes the meter out each second someone asks), `health` when a page that shows it opens and then at most every 2 minutes, never on the revision (Overview and Settings run it in the background after drawing), `updates_status` every 10 s only while Settings' Updates is on screen, the portal's addresses (`portal_info`) once its section is, a server's interfaces when Settings opens and after a change made there. Overview reads 60 days of status (its line and the 30 before). A part of Settings is built again only when what it shows changed (a key of its data), and never while a value is typed in it. +- **Opening a page never waits under LuCI's spinner, and comes in as the portal's page does: no skeleton** (the owner, 2026-11-12, after skullet: «убрать скелетон загрузку с админки и сделать анимацию появления и перехода по страницам как на портале»). A view's LuCI `load` ends with the stylesheet (`shell/view.ts`); the page's own `load()` asks the router then, and only then (no answer is kept between visits or shared between pages, and no sample stands in for it). Until it answers the view is its section row (`shell/waiting.ts`), and after 600 ms the reason it waits under it (the backend starting, the router slow, a failed question asked again every 3 s): never a black page; then the page is drawn whole and its blocks rise (`ui/entrance.ts enter`, the portal's `portal/ui/rise.ts`). A view a page swaps in on its own (a server's part, a Settings section, People's cards and map, a person's page and the list back) is put in place and given to `enter` too, once it is drawn. Nothing else on a page moves on a repaint (DESIGN.md › Motion › 16). **A move between Dawnline's own pages does not go through LuCI** (`shell/pages.ts`): a link or `visit()` to another section pushes the address and changes the page under the section row in place (`stagePage`), so the row never blinks; the page that goes is told through `onNavigate` (`ui/nav.ts`: it fires for the theme's navigation and for this), and the listeners it put on the window and the document while it was made and drawn are taken off. So a page cleans up through `onNavigate`, never by listening for `luci-navigate` itself, and reads its address from `location` when it is made. A view is whole when it is handed to a sheet (`go`, `openSheet`): what it draws later goes through the sheet's `glide`. +- **The portal follows its stream where the router offers one.** With the Go backend serving the portal, the page's shell carries `data-live` and `portal/live.ts` follows `GET /api/live` (`put` the whole state, `patch` a merge patch, `gone`): `main.ts took()` lays each state over the last and draws in place, as after a visitor's own change. Without it the page asks once (`refresh()`), as before; flows that ask for themselves (`flows/wait.ts`) are unchanged. Nothing is asked on a timer either way. Before its first state the page stands as its breadcrumb over its last shape (`page/waiting.ts`). +- **Being replaced** (`docs/backend.md`): pages follow the backend's stream through `shared/live` (signals, a store of topics, `follow.ts`) and bind each node to the place it shows, instead of fetching `status` and rebuilding. New live code is written against `shared/live`; the pollers and the revision go when the last page has moved. +- The portal does not poll: it follows its page's stream (`//api/live`, `web/src/portal/live.ts`) and asks again only after the visitor's own changes. ## Checks diff --git a/rules/i18n.md b/rules/i18n.md index cb86188..4b23d99 100644 --- a/rules/i18n.md +++ b/rules/i18n.md @@ -1,6 +1,6 @@ # Translations (admin UI, portal, backend messages) -Dawnline is written in English and translated through gettext catalogs. Russian is the first translation. Read with `frontend.md` (and `backend.md` for messages the router sends). +Dawnline is written in English and translated through gettext catalogs. Russian is the first translation. Read with `frontend.md` (and `backend-go.md` for messages the router sends). ## The rule @@ -13,7 +13,7 @@ Dawnline is written in English and translated through gettext catalogs. Russian - **Admin UI (LuCI).** Every visible string goes through LuCI's globals `_()` and `N_()`. The catalog is `package/luci-app-dawnline/po/ru/dawnline.po`; luci.mk compiles it with po2lmo into the separate package `luci-i18n-dawnline-ru` (`/usr/lib/lua/luci/i18n/dawnline.ru.lmo`, plus the uci-defaults that adds Russian to LuCI's languages). LuCI loads it when the page language is Russian (`luci.main.lang`, or `auto` with a Russian browser). Without the package everything stays English. The LuCI menu titles (`menu.d`) are in the same catalog. - **Portal.** Not LuCI: it carries its own catalog (`web/src/portal/i18n/ru.po`, made into a lookup table at build time and bundled into `portal.js`), so it speaks Russian on every router, with or without the admin's package. `portal/i18n.ts` installs `_()`/`N_()` with LuCI's meaning, opens in the visitor's kept choice or the browser's language, and the language menu in the breadcrumb switches it in place. The demo's own strings are in `web/src/portal/demo/i18n/`. - **Shared code** (`web/src/shared`) runs in both and is in both catalogs. -- **Backend messages** (ucode: `die()` texts, health checks, endpoint verdicts, the updater's phases) go through `_()` / `N_()` from `dawnline.i18n` and are in the `dawnline` catalog too. The admin page sends its language with every RPC call (`lang`, added by `web/src/admin/api.ts` and stripped by `rpcd/ucode/luci.dawnline`), the updater gets it from the job's start (`DAWNLINE_LANG`), the portal's CGI from `Accept-Language` (the portal's fetch sends the visitor's choice). `dawnline.i18n` reads LuCI's catalog through `luci.core`, so the backend speaks Russian where `luci-i18n-dawnline-ru` is installed; the portal page translates what reaches it in English from `portal.uc`, `devices.uc`, `core.uc` and `awg.uc` with its own catalog. The agent's and the CLI's terminal output stay English. Text the backend stores and shows later is stored as a code (or, for service log lines, as `L_()` templates) and put into words when it is read. +- **Backend messages** (refusals, health checks, endpoint verdicts, the updater's phases, the portal's answers) are English sentences in the Go code, put into the reader's language by the catalog (`i18n.Catalog.T`, `N`) and listed in `backend/i18n/messages.js` (and `portal-messages.js` for what reaches the portal's visitors): the extractor reads those two files, not Go. **A sentence the backend says that is not listed there has no translation**: add or change it there in the same change, then `npm run i18n` and translate. `L_()` there marks a line of the service log (written in English, translated where it is shown). The admin page sends its language with every call (`lang`, added by `web/src/admin/api.ts`), the updater gets it from the job's start (`DAWNLINE_LANG`), the portal from `Accept-Language`. - **Delivery.** The release has `luci-i18n-dawnline-ru-.{ipk,apk}` next to the app. `install.sh` adds it when LuCI is in Russian (its setting, or `luci-i18n-base-ru` installed) or with `--lang ru`; the updater installs it with every Dawnline update when it is installed; Components → Dawnline → Translation adds or removes it. LuCI reads a language's catalogs once per web server process, so each of these restarts uhttpd afterwards. - **Collecting.** `npm run i18n` (in `web/`) reads the code and rewrites the `.pot` templates and the `.po` files: new strings are added untranslated, gone ones removed, translations kept (and reused across catalogs). `npm run i18n:check` (CI) fails when a catalog is out of date, a string is untranslated, or a translation lost a placeholder. After changing visible text: run `npm run i18n`, translate the new entries in each `ru.po`, commit the catalogs with the code. @@ -70,7 +70,6 @@ Write like a careful Russian product (Telegram, Яндекс), not a word-for-wo | data limit | лимит трафика | | usage, traffic | трафик | | end date; ends in 3 days | дата окончания; закончится через 3 дня | -| allowed hours; outside allowed hours | часы доступа; вне часов доступа | | pause / resume; paused | приостановить / возобновить; на паузе | | online / offline; last seen 12 min ago | в сети / не в сети; «В сети 12 мин назад» (not «Было в сети») | | set up a device; setup | настроить устройство; настройка | diff --git a/rules/release-notes.md b/rules/release-notes.md new file mode 100644 index 0000000..9d53217 --- /dev/null +++ b/rules/release-notes.md @@ -0,0 +1,19 @@ +# Release notes: how the list of changes is collected + +A release's `- ` points (`AGENTS.md` › Releases) and any list of «what changed» asked for along the way are collected the same way. The owner set it on 2026-11-12, after a list made from commit messages came out long, mixed trivia with what matters and missed whole features: «в будущем мне нужно чтобы ты так всегда логи собирал». + +## The rule + +- **From the code, against production.** Production is the last release: the tip of `origin/main`, the last tag `vX.Y.Z`. Go through the difference itself (`git diff vX.Y.Z..HEAD`), not only the commits' titles and bodies: the backend's methods that came and went (`backend/methods`), the settings (`backend/model`), the admin's pages, flows and widgets (`web/src/admin`), the portal (`web/src/portal`), the package's dependencies, the scripts. The commit messages are where to start, never the source: the list made from them alone missed bulk actions on people, the rollout of a new configuration, «Waiting for a decision», Undo and the simplified expiry. +- **Key changes only.** What somebody who runs Dawnline wants to know: what was rebuilt (the backend in Go), what is faster and by how much, what can be done now that could not, what is gone, what behaves differently. One short line each, the thing first. +- **Not the trivia.** The owner's own examples of what does not belong: «Show speeds in bytes per second (KB/s, MB/s), the measure the traffic beside them is counted in» («околобесполезная инфа») and «New README screenshots of the redesigned admin» («юзелесс»). A unit, a label, a picture, a move of code nobody sees: left out. +- **A rework is told whole.** What it was, what it is now, and what happens to what people had before the update. One line for the limits counted by a person's own month was not enough (the owner: «а как же реворк системы юседжа и времени старта отсчета»): it takes the rule (the month begins with their first traffic, the next only when they connect again), what follows from it (extra data, «Reset usage», the charts) and what an update does to the month that was running. +- **A number says where it is from.** Measured for this list, or taken from `docs/` or a commit's message (and on which router). Nothing is called checked that was only read in the code. +- **In English.** The points are English whatever language they were asked for in: what the owner writes in Russian is what he means, not how to write it («то что я пишу на русском это то что я имею ввиду а не как написать»). The talk around the list stays in his language. + +## How + +1. Find production: `git fetch`, then the default branch's tip and its tag. +2. Size the difference by area (`git diff --numstat`), then read each area for what came, went and changed: names that exist on one side only are the quickest lead (methods, options, files added and deleted), and each lead is checked in the code before it is written down, since a thing drawn again is not a thing added. +3. Read the commits' bodies for the reasons and the measurements. +4. Write the short list; expand the reworks; say what was left out on purpose only if asked. diff --git a/rules/ui-design.md b/rules/ui-design.md index 21c313d..5458539 100644 --- a/rules/ui-design.md +++ b/rules/ui-design.md @@ -2,33 +2,51 @@ The bar is a modern product UI (Linear / Vercel / Raycast level), not a "native" LuCI form. A plain label + input row, a bare radio list, three columns of check marks or a text dump is a first draft, never the result. -**The portal has its own design system, `DESIGN.md`** (repo root): read it before any portal work, mocks included. Build from its tokens, components and spring tokens, follow its Do's and Don'ts, and update it in the same change when the portal's look or motion changes. The admin follows this file and the LuCI theme. +**One design system, `DESIGN.md`** (repo root): the personal portal's, and the admin's too. Read it before any work on either, mocks included. Build from its tokens, components and spring tokens, follow its Do's and Don'ts, and update it in the same change when the look or motion changes. + +## The admin on the portal's design system + +Every admin page is drawn on `DESIGN.md` inside LuCI (the concept: `dawnline-admin-concept`; the structure: its `docs/ia2/`, decisions in `06-decisions.md`). Three sections answer three questions: **Overview** (does everything work now: «now» in numbers, the servers, Health), **Log** (what happened: the feed with its filters) and **Settings** (how the router, the portal and Dawnline itself are set up: a rail of sections shown one at a time). Everything of one server stands behind one door (the owner's structure, 2026-11-11): a server's card on Overview opens **the server's page**, whose track across the page is Overview (does this server work, who on it waits for a decision, its rollout, its checks, the path check) · People (their cards grouped by state; a person's page takes the list's place) · Places (the map of where they connect from) · Settings (General: its name, whether it runs, its address, removing it; Core: what is the tunnel core's own; Network: where the tunnel leads; a rail names the three, a jump pill on a phone). A device is not a page: it opens from its person as a dialog in two columns (what it does on the left, what it is set up with on the right), and «Map and replay» and «Show set-up» are steps of that dialog. A person, a device and Places are not LuCI pages: they are People's `?id=`, `?device=` and `?view=map` inside the server's frame. One fact, one place holds across the frame: the server's state is its head's, who waits is its Overview's (the main Overview only counts them on the server's card), a device's state is said once in its dialog. The old addresses (Person, Device, Places, System, Activity, Health, Diagnostics, Updates, the old Settings, Server and Servers pages' sections) lead to their places now. + +- **A card says only what is true now and changes something.** A person's card on People has its parts by their state (`people/card.ts`, DESIGN.md › Person card): a decision is its line and its button, someone fine is presence and traffic, a quiet state is one line. What stops many people at once (a server turned off, a rollout) is one notice over the list, not a part of each card. Counts of people (chips, group heads, Overview's «Waiting for a decision») come from the same matrix. +- **No page of accordion rows.** An object's page is not a stack of «name — value» rows that fold: each thing it has gets a form of its own that shows its state and is edited on itself (a term with its calendar, a measure with its limit, switches of what is reached, a file card). A fold is allowed inside such a part for what is read always and changed rarely (the interfaces a server does not offer as home networks), never as the page's skeleton. +- **Run the padding lint before showing or shipping a look change:** `node tools/ia3-pads.mjs` in the concept repo (`SHEETS=` walks the sheets too, `W=390` the phone), DESIGN.md › «Paddings, checked». It must print «0 findings»; a finding is fixed in the stylesheet, not silenced in the tool, unless the tool misread a clipped or pinned element. +- **A name and a note never look alike, and a note sits with what it explains** (DESIGN.md › «A name, a value, a note»): a label or caption in the text's colour with a weight, a note in the second tone 6 px under its thing and well clear of the next name, one note a thing. Before adding a line of grey text, say which thing it explains and put it there; if it explains nothing in particular, it is a lead or it goes. +- **One home per fact and control**; elsewhere only a pointer to it (a number or a phrase that leads there). +- **A fix stands where the problem is.** A check that did not pass is shown in the Settings section it is about, with its fix as a button or its advice; Overview shows the same signal as a link to that section, without a second button (it keeps a button only for a check no section is about). +- **Settings wait for «Apply».** Nothing that changes how a server works or what a person may do is made by one press (the owner, 2026-11-11: «половина настроек не имеет подтверждения»): the edit waits, its place shows the new value as not applied, a dock at the window's foot says «N changes · M devices will fetch the configuration · Apply / Cancel». «Apply» makes them all: when devices must fetch their configuration again it asks one question naming every change first and starts one rollout, which the page then shows open; when none must, «Apply» is the whole confirmation. This holds for a server's Settings (every field, the disguise, the home networks, how internet traffic leaves, the WAN, who sees whom), for the router-wide sections (the portal with its addresses, port, certificate files and unknown links; new people's defaults; the update policy; history and what is recorded: one dock with the server's changes, «not applied» at the end of the section's head) and for a person's page (what they reach, the limit and its period, the device limit). Not settings, so made at once: a name or a note typed and confirmed with Return; the one-tap actions with Undo in their toast (pause and resume, extend, more data this month, a device or a server turned on or off as before); what destroys or cannot be undone asks its own question (remove, new keys, reset). Leaving with changes waiting is asked about. +- **The rollout is open on the page**, not behind a pill: how many fetched, the change it follows, a cell a device, who still waits with their links (no «Remind everyone»: the owner removed it, a person is reminded with their own link). +- **Inside LuCI, in a Shadow DOM.** The theme's rules stop at the page's host and ours never reach the theme. What floats (the sheet, ⋯ menus, toasts, the map's marker card) is in a second host on ``, above Outline's header and sidebar, below LuCI's own modal. +- **No ground of our own.** The page stands on the theme's background: dark keeps the portal's ladder on the theme's black; light steps raised → field → knob down in tone from the theme's near-white (`styles/shadow/ground.css`). +- **Theme from LuCI** (`html[data-darkmode]`, Outline's button switches it in place), else the system's. **The system font**, as the portal. +- **Own navigation, no LuCI tabs.** LuCI's menu keeps one Dawnline item (an alias of Overview); every section is a view of its own (Back and bookmarks work) and the page draws its own row: Overview · Log · Settings, the portal's segmented track with words (`shell/nav.ts`); a server's page keeps Overview lit and draws its own track under its head. What is picked inside a section (a panel, a view, a filter) is in its address too. +- **Layout by the page's width**, not the window's (container `dlpage`: inside LuCI the column is ~910 px on a 1440 screen). +- **Admin-only parts on the portal's tokens:** the page head (glass, name, facts after dots, ⋯ on the right), a labelled segmented track with counts or icons (narrow: icons, the picked one with its word), the kit (`rules/frontend.md`: a person's card by state with its device tiles, the filter bar with its search and chips, a list of choices under its button, a list and the page of one thing in it (the way back and ×), a tooltip for a thing without words, a rail of sections with a jump pill on a phone, a section with its cards, option tiles that draw their choice, a measure with its limit, a server's way in as two named cells and the router's verdicts as rows, a row of a thing with its actions in sight, the empty state, a map with its list, and a panel's parts: term, traffic measure, what-they-reach switch rows, set-up card, place rows with strips, the short feed), rows of a feed in a raised card under day heads, the way back (‹ parent), charts in the map's language (`--live`, `--past`: the line of days with the period before it dashed, the live line under a speed, today by the hour as bars). +- **Approved deviations from the portal:** an undo beside a toast's words for a reversible one-tap action (5 s, held under the pointer or focus); toasts wrap (the admin's sentences are longer); the portal's buttons, sheet and menus as they are, nothing restyled. +- **Read-only logins** see values without the controls that would fail (`shell/role.ts`), and a «View only» fact in the head. +- **Four LuCI modules, each under 576 KiB** (uhttpd sends them uncompressed; the build refuses more): the pages (`dawnline.app`), their stylesheet (`dawnline.style`), the map (`dawnline.map`, loaded when a page draws one) and the QR generator (`dawnline.qr`, loaded when a sheet draws a code). Something a page rarely needs and that would push a module over goes into a module of its own, loaded on demand (`rules/frontend.md`). ## Approach - **Mock first.** Any visible change beyond a one-line fix: show a mockup (2–4 genuinely different options when the direction is open) with a recommendation, then build the chosen one. Do not start coding a layout the user has not seen. - **Think past the obvious.** When an option is rejected as "not it", propose new concepts, not variations of the same layout. -- **Structure over text.** Tiles, segmented controls, pills, round icon buttons, inline status, folded "Advanced" sections. Summaries first ("All 6 checks passed"), details on demand. -- **No duplication.** One place per fact (usage, device count, links). Remove what is repeated elsewhere on the page. -- **Reuse the house patterns** before inventing new ones: `dl-params` folded details with a rotating chevron, `dl-tile2` tiles, round icon buttons with tooltips, `⋯` menus (destructive and Pause inside, Pause in warn colour, "Delete" without an ellipsis), bottom toasts instead of LuCI banners, the same tiles on server and person pages. -- **Alignment and spacing are part of the design.** Shared margins and edges, equal heights in a row, controls pinned consistently (top, not centred, when the user says so), nothing clipped or overflowing, single-line labels where they fit. -- **No ellipsis on buttons or menu items** ("Remove", not "Remove…"), even when they open a dialog. "…" only for progress ("Loading…") and truncated values. -- **Colour means something:** ok = green, warn/pause = orange, danger = red, accent = blue. Icons for states instead of words where obvious. +- **Structure over text.** Tiles, segmented tracks, pills, round knobs, inline status, folded rows. Summaries first ("All 6 checks passed"), details on demand. +- **No duplication.** One place per fact (usage, device count, links), a state said once (DESIGN.md › Principles). Remove what is repeated elsewhere on the page. +- **Reuse the house parts** before inventing new ones: the portal's components (DESIGN.md) and the admin's `ui/` and `widgets/` (page head, tabs, the kit, edit rows, stepper, the rows of checks and components, the rollout strip, line chart, live line, map box). An edit row is for a number without a picture of its own (MTU, keep-alive), at most four in a card, never a page of them. A new class only when nothing fits, and then on the portal's tokens. +- **Alignment and spacing are part of the design.** Shared margins and edges, equal heights in a row, controls pinned consistently, nothing clipped or overflowing, single-line labels where they fit. +- **No ellipsis on buttons or menu items** ("Remove", not "Remove…"), even when they open a sheet. "…" only for progress ("Loading…") and truncated values. +- **Colour means something:** ok = green, warn/pause = orange, danger = red, accent = blue; on charts and the map, live = blue, the past = grey. Icons for states instead of words where obvious. - **Honest warnings** belong in the UI (e.g. plain HTTP, Cloudflare throttling), shown where the choice is made. ## Mocks look like the real product A mock is judged against the page it will live on, so it must already look like it. Hand-drawn look-alikes with invented styles get rejected ("выбивается из дизайна"). -- **Study the existing pages first** (the section being changed and its neighbours) and build only from their components: `dl-setsec` cards with `dl-setsec-foot`, `dl-setrow` rows with a `dl-need-ic` icon tile and `dl-switch`, `dl-seg` (`sm`, `wide`), `dl-chip` / `dl-chipbtn`, `dl-list` + `dl-row`, `dl-table`, `dl-checks` (the Health check list), `dl-tile2` tiles, `dl-panel`. A new class only when nothing fits, and then in the same tokens (`--dl-*`). -- **Buttons are `cbi-button`**: actions like Edit, Change, Rescan are `neutral` pills (as "Edit in Settings", "+ Add device"); Save and Install are `positive`. No blue text links for actions. -- **Show only what changes.** Do not add existing, unrelated controls (e.g. Devices or Access ends tiles) to a mock; say in the caption that the rest of the page stays. -- **Build it from the real code and CSS**, not from a copy: - - theme: `scp root@outline.lan:/www/luci-static/outline/{main.css,geist-*.woff2}` into the mock folder, strip `/luci-static/outline/` from the font URLs, ``; - - Dawnline CSS: the files in `web/src/admin/styles/*.css` concatenated in the order of `styles/index.ts` into `dl.css`; - - markup: a small `mock.ts` that imports the real `admin/e`, `shared/icons`, `admin/ui/*` and `admin/widgets/*` (stub the LuCI globals `window.E`, `dom.content`, `L.url`), bundled with `web/node_modules/.bin/esbuild --bundle --format=iife`. -- Keep mocks outside the product repo, serve them with `python3 -m http.server` started from Bash (the preview server cannot read `~/Documents` on macOS), open them in the built-in browser, and delete the folder when the feature ships. +- **Study the existing pages first** (the section being changed and its neighbours) and build only from their parts: the portal's components and tokens (DESIGN.md), the admin's `ui/` and `widgets/`. +- **Build it from the real code and CSS**, not from a copy: the concept repo's mock pages run the real `web/src` modules (the portal's, the admin's) on demo data; a change to an existing page is mocked in a LuCI stand-in (Outline's shell and `main.css`, LuCI's globals stubbed, the RPC answered from fixtures) that loads the built `app.js`, `style.js` and `map.js`. +- **Show only what changes.** Do not add existing, unrelated controls to a mock; say in the caption that the rest of the page stays. +- Keep mocks outside the product repo, serve them with `python3 -m http.server` started from Bash (the preview server cannot read `~/Documents` on macOS), and delete the folder when the feature ships. ## Done means seen -Deploy, then look at it in the browser (desktop width, and narrow when layout changes) before reporting. Check modals and drawers stack correctly and long values do not overflow. Look at it in Russian too: a visible change is localized in the same change (`i18n.md`), and Russian text is longer. +Look at it in the browser before reporting (a LuCI stand-in, or the router after a deploy): 1440 and 390 (touch), both themes switched from Outline's button, read-only too. Look at whole screens, not crops alone, and measure overflow at 390 inside the shadow roots (the page's and the layer's). Check sheets and menus stack correctly and long values do not overflow. Look at it in Russian too: a visible change is localized in the same change (`i18n.md`), and Russian text is longer. diff --git a/scripts/backend-container.sh b/scripts/backend-container.sh new file mode 100755 index 0000000..6b11768 --- /dev/null +++ b/scripts/backend-container.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# The Go backend's checks, in containers (needs docker): +# scripts/backend-container.sh +# gofmt, go vet and the unit tests with the Go toolchain image, then the tests +# that need a real ubusd in the OpenWrt rootfs containers CI uses. +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +GO_IMAGE="${GO_IMAGE:-golang:1.27-alpine}" +ROOTFS="${ROOTFS:-openwrt/rootfs:x86-64-24.10.6 openwrt/rootfs:x86-64-25.12.3}" +OUT="$ROOT/dist/backend-test" + +mkdir -p "$OUT" +# The whole repository is mounted: the e2e tests read the package's files. +docker run --rm -v "$ROOT":/repo:ro -v "$OUT":/out -w /repo/backend \ + -v dawnline-gocache:/root/.cache/go-build -v dawnline-gomod:/go/pkg/mod \ + -e CGO_ENABLED=0 "$GO_IMAGE" sh -ec ' + unformatted="$(gofmt -l .)" + [ -z "$unformatted" ] || { echo "gofmt: $unformatted" >&2; exit 1; } + go vet ./... + go vet -tags ubusd ./... + go test ./... + go vet -tags e2e ./... + GOARCH=amd64 go test -c -tags ubusd -o /out/ubus.test ./ubus + GOARCH=amd64 go test -c -tags e2e -o /out/e2e.test ./daemon +' + +for image in $ROOTFS; do + echo "== ubusd tests on $image" + docker run --rm --platform linux/amd64 -v "$OUT":/out:ro \ + -v "$ROOT/package/luci-app-dawnline/root/usr/share/rpcd/acl.d/luci-app-dawnline.json":/usr/share/rpcd/acl.d/luci-app-dawnline.json:ro \ + "$image" sh -ec ' + mkdir -p /var/run/ubus + ubusd & + # BusyBox sleep takes whole seconds there. + i=0 + while [ ! -S /var/run/ubus/ubus.sock ] && [ "$i" -lt 10 ]; do sleep 1; i=$((i + 1)); done + /out/ubus.test -test.run RealBus -test.v + # The whole path of a page: rpcd with the ACL of the package, and /ubus of uhttpd. + rpcd & + uhttpd -f -p 127.0.0.1:8099 -h /www -u /ubus -t 60 -T 30 & + i=0 + while ! ubus list session >/dev/null 2>&1 && [ "$i" -lt 10 ]; do sleep 1; i=$((i + 1)); done + /out/e2e.test -test.run ThroughUhttpd -test.v + ' +done diff --git a/scripts/build-backend.sh b/scripts/build-backend.sh new file mode 100755 index 0000000..d62127c --- /dev/null +++ b/scripts/build-backend.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Build the Go backend (backend/, the program dawnlined) for one router architecture: +# scripts/build-backend.sh arch: what `uname -m` says on the router (aarch64, armv7l, mips, +# mipsel, x86_64), or a Go name (arm64, arm, mips, mipsle, amd64) +# Output: dist/backend/dawnlined-, and its path as the last line. Needs docker (the Go toolchain +# image); nothing of Go is installed here. A static binary: it runs on any OpenWrt of that architecture. +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +GO_IMAGE="${GO_IMAGE:-golang:1.27-alpine}" +VERSION="$(cat "$ROOT/package/luci-app-dawnline/root/usr/share/dawnline/version")" + +case "${1:-}" in +aarch64 | arm64) GOARCH=arm64 ;; +armv7l | armv7 | arm) GOARCH=arm ;; +mips) GOARCH=mips ;; +mipsel | mipsle) GOARCH=mipsle ;; +x86_64 | amd64) GOARCH=amd64 ;; +*) echo "usage: $0 " >&2; exit 2 ;; +esac + +OUT="$ROOT/dist/backend" +mkdir -p "$OUT" +# Routers' MIPS and ARMv7 have no FPU to count on: soft float, and ARMv7's own instructions. +docker run --rm -v "$ROOT/backend":/src:ro -v "$OUT":/out -w /src \ + -v dawnline-gocache:/root/.cache/go-build -v dawnline-gomod:/go/pkg/mod \ + -e CGO_ENABLED=0 -e GOOS=linux -e "GOARCH=$GOARCH" -e GOMIPS=softfloat -e GOARM=7 "$GO_IMAGE" \ + go build -trimpath -ldflags "-s -w -X github.com/tickcount/luci-app-dawnline/backend.Version=$VERSION" \ + -o "/out/dawnlined-$GOARCH" ./cmd/dawnlined +echo "$OUT/dawnlined-$GOARCH" diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 62f0cfe..6f4b2f9 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -14,11 +14,11 @@ IPK_SDK="${IPK_SDK:-itdoginfo/openwrt-sdk-ipk:24.10.6}" APK_SDK="${APK_SDK:-itdoginfo/openwrt-sdk-apk:25.12.3}" # One version everywhere: the Makefile, the ucode library and the web package. -grep -q "^export const VERSION = '$VERSION';" "$APP/root/usr/share/ucode/dawnline/util.uc" || { echo "util.uc VERSION != $VERSION" >&2; exit 1; } +[ "$(cat "$APP/root/usr/share/dawnline/version")" = "$VERSION" ] || { echo "usr/share/dawnline/version != $VERSION" >&2; exit 1; } grep -q "\"version\": \"$VERSION\"" "$ROOT/web/package.json" || { echo "web/package.json version != $VERSION" >&2; exit 1; } # The web bundles are not committed: web/ builds them (npm run build). -for f in htdocs/luci-static/resources/dawnline/app.js root/usr/share/dawnline/portal/assets/portal.js root/usr/share/dawnline/portal/assets/portal.css; do +for f in htdocs/luci-static/resources/dawnline/app.js htdocs/luci-static/resources/dawnline/style.js htdocs/luci-static/resources/dawnline/map.js htdocs/luci-static/resources/dawnline/qr.js root/usr/share/dawnline/portal/assets/portal.js root/usr/share/dawnline/portal/assets/portal.css; do [ -f "$APP/$f" ] || { echo "$APP/$f is missing: run 'npm run build' in web/" >&2; exit 1; } done diff --git a/scripts/build-release.sh b/scripts/build-release.sh index beb249b..ef38a56 100755 --- a/scripts/build-release.sh +++ b/scripts/build-release.sh @@ -9,7 +9,7 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" APP="$ROOT/package/luci-app-dawnline" -VERSION="$(sed -n "s/^export const VERSION = '\(.*\)';/\1/p" "$APP/root/usr/share/ucode/dawnline/util.uc")" +VERSION="$(cat "$APP/root/usr/share/dawnline/version")" OUT="$ROOT/dist" STAGE="$(mktemp -d)" trap 'rm -rf "$STAGE"' EXIT @@ -19,13 +19,21 @@ grep -q "\"version\": \"$VERSION\"" "$ROOT/web/package.json" || { echo "web/pack [ "${SKIP_WEB:-0}" = 1 ] || (cd "$ROOT/web" && npm run --silent ci) # With SKIP_WEB=1 the bundles come from an earlier build (they are not committed). -for f in htdocs/luci-static/resources/dawnline/app.js root/usr/share/dawnline/portal/assets/portal.js root/usr/share/dawnline/portal/assets/portal.css; do +for f in htdocs/luci-static/resources/dawnline/app.js htdocs/luci-static/resources/dawnline/style.js htdocs/luci-static/resources/dawnline/map.js htdocs/luci-static/resources/dawnline/qr.js root/usr/share/dawnline/portal/assets/portal.js root/usr/share/dawnline/portal/assets/portal.css; do [ -f "$APP/$f" ] || { echo "$APP/$f is missing: run 'npm run build' in web/" >&2; exit 1; } done mkdir -p "$STAGE/www" "$OUT" cp -R "$APP/root/." "$STAGE/" cp -R "$APP/htdocs/." "$STAGE/www/" +# The Go backend, for the one router this tarball goes to (BACKEND_ARCH: its `uname -m`; deploy.sh asks it). +# Without it the tarball has none and the pages ask the router themselves, as a release package does +# until the backend is built for every architecture (docs/backend.md). +if [ -n "${BACKEND_ARCH:-}" ]; then + BIN="$("$ROOT/scripts/build-backend.sh" "$BACKEND_ARCH" | tail -n1)" + cp "$BIN" "$STAGE/usr/libexec/dawnline/dawnlined" + chmod 755 "$STAGE/usr/libexec/dawnline/dawnlined" +fi for po in "$APP"/po/*/dawnline.po; do l="$(basename "$(dirname "$po")")" [ "$l" = templates ] && continue @@ -35,9 +43,8 @@ for po in "$APP"/po/*/dawnline.po; do case "$l" in ru) name='Русский (Russian)' ;; *) name="$l" ;; esac printf "uci set luci.languages.%s='%s'; uci commit luci\n" "$l" "$name" > "$STAGE/etc/uci-defaults/luci-i18n-dawnline-$l" done -chmod 755 "$STAGE/usr/bin/dawnline" "$STAGE/usr/libexec/dawnline/agent" "$STAGE/usr/libexec/dawnline/updater" "$STAGE/usr/libexec/dawnline/resolver" "$STAGE/usr/libexec/dawnline/postupdate" \ - "$STAGE/etc/init.d/dawnline" "$STAGE/etc/uci-defaults/90_dawnline" "$STAGE/etc/hotplug.d/iface/95-dawnline" \ - "$STAGE/usr/share/dawnline/portal/www/cgi-bin/portal" "$STAGE/usr/share/dawnline/portal/cgi.uc" +chmod 755 "$STAGE/usr/bin/dawnline" "$STAGE/usr/libexec/dawnline/updater" "$STAGE/usr/libexec/dawnline/fetch-backend" "$STAGE/usr/libexec/dawnline/resolver" "$STAGE/usr/libexec/dawnline/postupdate" \ + "$STAGE/etc/init.d/dawnline" "$STAGE/etc/uci-defaults/90_dawnline" "$STAGE/etc/hotplug.d/iface/95-dawnline" find "$STAGE" -name '.DS_Store' -delete TAR="$OUT/luci-app-dawnline-$VERSION.tar.gz" diff --git a/scripts/capture-screenshots.mjs b/scripts/capture-screenshots.mjs index 06b8860..ba65dd5 100755 --- a/scripts/capture-screenshots.mjs +++ b/scripts/capture-screenshots.mjs @@ -1,294 +1,200 @@ #!/usr/bin/env node -// Capture the raw README screenshots of the admin pages from a live router into -// docs/screenshots/raw/.png (2x PNG); scripts/frame-screenshots.py then -// frames them for the README. The portal's come from its demo instead -// (scripts/capture-portal.mjs): no one's real page, and adding a device there adds none. +// Capture the raw README screenshots of the admin into docs/screenshots/raw/ (2x PNG): People (people.png), a +// person's page (person.png), Places (places.png), a server's core settings (core.png), each cut to the content +// column, and a device's dialog alone on a transparent page (device.png). The Russian ones take a -ru suffix. +// scripts/frame-screenshots.py then frames them for the README. // -// Drives a headless Chromium (BROWSER=/path/to/chrome, default: Brave or Chrome -// on macOS) over the DevTools protocol (scripts/cdp.mjs). Signs in to LuCI with -// the password from LUCI_PASSWORD or asked on the terminal; the session lives -// only in a throwaway profile (LUCI_USER picks another user than root). Nothing on the router is changed. +// No router is involved, and nothing real can be in a picture: the admin is its demo build (web/dist/admin-demo, +// `npm run build:demo`, built first unless --no-build), the real pages over a router that lives in the page with a +// made-up cast (web/src/admin/demo: eight people, fifteen devices, one fixed day). It is opened at LuCI's own +// addresses on https://router.example and every file is answered over the DevTools protocol (scripts/cdp.mjs). // -// scripts/capture-screenshots.mjs [--router https://router.lan] [--person id] -// [--mask real=shown ...] [--name real=shown ...] -// [--only overview,people] [--demo] [--lang ru] +// The Outline theme around the pages is not this repository's: its built files (main.css, icons, fonts) are read +// from --theme, by default the luci-theme-outline checkout beside this one (run `pnpm build` in its .dev/ first). +// The theme is shown with its navbar on top. The Places map draws its tiles from the network, as it does on a +// router, so that one shot needs the internet. // -// --lang asks LuCI for the pages in that language (its catalog, po//dawnline.po; -// the router's LuCI language left on auto) and names the captures -.png -// for that README (README_ru.md); English (the default) keeps .png. -// --mask replaces text on every page before the capture (a domain, a name); -// --name does the same for a person's name in any case, and for their initials. -// Public IPv4 addresses are always swapped for documentation ones (203.0.113.x). -// --demo shows a made-up cast instead of the router's people (scripts/screenshot-demo.mjs): -// the router's answers are rewritten in the headless browser on their way to the page. +// scripts/capture-screenshots.mjs [--lang en,ru] [--only people,core] [--theme ] [--no-build] import { execFileSync } from 'node:child_process'; -import { readFileSync, writeFileSync } from 'node:fs'; -import { dirname, join, resolve } from 'node:path'; +import { existsSync, readFileSync, writeFileSync } from 'node:fs'; +import { dirname, extname, join, resolve, sep } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { createInterface } from 'node:readline'; import { die, launch, sleep } from './cdp.mjs'; -import { demoRpc } from './screenshot-demo.mjs'; const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const WEB = join(ROOT, 'web'); +const DEMO = join(WEB, 'dist', 'admin-demo'); const RAW = join(ROOT, 'docs', 'screenshots', 'raw'); const SCALE = 2; +/** The window: wide enough for the theme's content column, and tall, since Outline scrolls #maincontent, not the page. */ +const WIDTH = 1400; +const HEIGHT = 2600; +/** Either side of the content column in a page's capture, and under the last thing it shows. */ +const SIDE = 48; +const FOOT = 40; +/** Around the dialog in its capture: left, top, right, bottom (frame-screenshots.py FLOW_MARGIN). */ +const MARGIN = [56, 40, 56, 72]; +const ORIGIN = 'https://router.example'; +const LUCI = `${ORIGIN}/cgi-bin/luci/admin/services/dawnline`; +/** The cast's server, the person whose page is shown and the device whose dialog is (web/src/admin/demo/cast.ts). */ +const SERVER = 's_home'; +const PERSON = 'p_artem'; +const DEVICE = 'd_a1'; const args = { - router: 'https://outline.lan', - person: '', - mask: [], - names: [], + langs: ['en', 'ru'], only: [], - demo: false, - lang: 'en', + build: true, + theme: resolve(ROOT, '..', 'luci-theme-outline', 'htdocs', 'luci-static', 'outline'), }; for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; const v = () => process.argv[++i] ?? die(`${a} needs a value`); - if (a === '--router') args.router = v().replace(/\/+$/, ''); - else if (a === '--person') args.person = v(); - else if (a === '--mask') args.mask.push(v().split('=', 2)); - else if (a === '--name') args.names.push(v().split('=', 2)); + if (a === '--lang') args.langs = v().split(','); else if (a === '--only') args.only = v().split(','); - else if (a === '--demo') args.demo = true; - else if (a === '--lang') args.lang = v(); + else if (a === '--theme') args.theme = resolve(v()); + else if (a === '--no-build') args.build = false; else die(`unknown argument ${a}`); } -const SUFFIX = args.lang === 'en' ? '' : `-${args.lang}`; -/** The admin's catalog for --lang: msgid -> msgstr, the entries without a context (English: none). */ -const CATALOG = (() => { - const out = new Map(); - if (args.lang === 'en') return out; - let po; - try { - po = readFileSync(join(ROOT, 'package', 'luci-app-dawnline', 'po', args.lang, 'dawnline.po'), 'utf8'); - } catch { - die(`no admin catalog for --lang ${args.lang}`); - } - for (const m of po.matchAll(/^(msgctxt .*\n)?msgid "(.*)"\nmsgstr "(.*)"$/gm)) if (!m[1] && m[3]) out.set(m[2], m[3]); - return out; -})(); -/** A button's words as the page shows them in --lang (the pages are clicked by what they say). */ -const tr = (id) => CATALOG.get(id) ?? id; -if ([...args.mask, ...args.names].some((m) => m.length !== 2 || !m[0])) die('--mask and --name take real=shown'); - -/** As shared/format initials(): first letters of the first and last word, or the first two of one word. */ -const initials = (name) => { - const p = name.trim().split(/\s+/); - return (p[0][0] + (p.length > 1 ? p[p.length - 1][0] : (p[0][1] ?? ''))).toUpperCase(); -}; -for (const [real, shown] of args.names) - args.mask.push([real, shown], [real.toLowerCase(), shown.toLowerCase()], [real.toUpperCase(), shown.toUpperCase()]); -const INITIALS = args.names.map(([real, shown]) => [initials(real), initials(shown)]); - -const LUCI = `${args.router}/cgi-bin/luci/admin/services/dawnline`; -const USER = process.env.LUCI_USER || 'root'; - -/* - * Each shot: the page, what must be on it before the capture, what to do - * first (in the page), and the area to keep (in the page, CSS pixels). - * Admin pages keep the theme's header and the content column, 48px either side. - */ -const column = `(() => { - const r = document.querySelector('.dl-root').getBoundingClientRect(); - return { x: r.left - 48, w: r.width + 96 }; -})()`; -// From the top down to an element; whatever follows it is hidden, not cut through. -const below = (sel) => `(() => { - const c = ${column}, el = document.querySelector(${JSON.stringify(sel)}); - for (let e = el; e && !e.classList.contains('dl-root'); e = e.parentElement) - for (let n = e.nextElementSibling; n; n = n.nextElementSibling) n.style.visibility = 'hidden'; - return { x: c.x, y: 0, width: c.w, height: el.getBoundingClientRect().bottom + 40 }; -})()`; +// In the page: the pages' shadow root and the layer's (what floats: a dialog), and whether the page has been drawn. +const HOST = `document.querySelector('.dl-host')?.shadowRoot`; +const LAYER = `document.querySelector('.dl-layer')?.shadowRoot`; +const has = (sel) => `${HOST}?.querySelector(${JSON.stringify(sel)})`; +/** Each shot: its address, what must stand before it is taken, and how long what it draws takes to come to rest. */ const SHOTS = [ - { - name: 'overview', - url: () => `${LUCI}/server`, - width: 1400, - ready: '.dl-srvov .dl-panel.flush .maplibregl-canvas', - // The map shows the last 30 days, not only who is online now. - prep: `(() => { - const b = [...document.querySelectorAll('.dl-srvov .dl-panel.flush button')].find((x) => x.textContent.trim() === ${JSON.stringify(tr('30 days'))}); - b?.click(); - })()`, - settle: 6000, - clip: below('.dl-srvov .dl-panel.flush'), - }, - { - name: 'people', - url: () => `${LUCI}/server?section=people`, - width: 1400, - ready: '.dl-srvbody a[href*="dawnline/person"]', - clip: below('.dl-srvbody'), - }, - { - name: 'person', - url: (s) => `${LUCI}/person?id=${encodeURIComponent(s.person)}`, - width: 1400, - ready: '.dl-grid-person .dl-row', - // Where they connected from, on the map. - prep: `(() => { - const b = [...document.querySelectorAll('.dl-grid-person button')].find((x) => x.textContent.trim() === ${JSON.stringify(tr('Show map'))}); - b?.click(); - })()`, - settle: 6000, - // Down to the end of Access & limits or of the map, whichever is lower; activity rows that would be cut are hidden. - clip: `(() => { - const c = ${column}, cols = document.querySelectorAll('.dl-grid-person > .dl-col'); - const places = cols[0].children[2]; - const cut = Math.max(cols[1].getBoundingClientRect().bottom, places ? places.getBoundingClientRect().bottom : 0) + 40; - document.querySelectorAll('.dl-grid-person .dl-row').forEach((r) => { - if (r.getBoundingClientRect().bottom > cut - 8) r.style.visibility = 'hidden'; - }); - // Activity that would start right at the cut goes too, its heading with it. - const act = cols[0].children[3]; - if (act && act.getBoundingClientRect().top > cut - 120) act.style.visibility = 'hidden'; - return { x: c.x, y: 0, width: c.w, height: cut }; - })()`, - }, + { name: 'people', at: `people?server=${SERVER}`, ready: has('.pp-card') }, + { name: 'person', at: `people?server=${SERVER}&id=${PERSON}`, ready: has('.pp-cols') }, + // the map's module, then its tiles from the network + { name: 'places', at: `people?server=${SERVER}&view=map`, ready: has('.maplibregl-canvas'), settle: 7000 }, + { name: 'core', at: `server?server=${SERVER}&p=core`, ready: has('.sv-core') }, + { name: 'device', at: `people?device=${DEVICE}`, ready: `${LAYER}?.querySelector('.sheet[role=dialog]')`, dialog: true }, ]; +const unknown = args.only.filter((n) => !SHOTS.some((s) => s.name === n)); +if (unknown.length) die(`unknown shot ${unknown.join(', ')} (one of ${SHOTS.map((s) => s.name).join(', ')})`); +if (!existsSync(join(args.theme, 'main.css'))) + die( + `No build of the Outline theme in ${args.theme}: run \`pnpm build\` in luci-theme-outline/.dev, or point --theme at its luci-static/outline`, + ); -const MASK = `((pairs, inits) => { - const doc = new Map(); - const isPrivate = (a) => a[0] === 10 || a[0] === 127 || (a[0] === 172 && a[1] >= 16 && a[1] < 32) || - (a[0] === 192 && a[1] === 168) || (a[0] === 100 && a[1] >= 64 && a[1] < 128) || a[0] === 0 || a[0] >= 224; - const ip = (m) => { - const a = m.split('.').map(Number); - if (a.some((x) => x > 255) || isPrivate(a)) return m; - if (!doc.has(m)) doc.set(m, '203.0.113.' + (24 + doc.size)); - return doc.get(m); - }; - // IPv6 too, unless link-local or private (fe80::, fc00::/7). - const ip6 = (m) => { - if (/^(fe8|fe9|fea|feb|fc|fd)/i.test(m)) return m; - if (!doc.has(m)) doc.set(m, '2001:db8::' + (24 + doc.size)); - return doc.get(m); - }; - const swap = (s) => - pairs - .reduce((t, [a, b]) => t.split(a).join(b), s) - .replace(/\\b\\d{1,3}(?:\\.\\d{1,3}){3}\\b/g, ip) - .replace(/\\b(?:[0-9a-f]{1,4}:){3,7}[0-9a-f]{1,4}\\b/gi, ip6); - const w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); - for (let n; (n = w.nextNode()); ) { - const ini = inits.find(([a]) => n.nodeValue.trim() === a); - const v = ini ? n.nodeValue.replace(ini[0], ini[1]) : swap(n.nodeValue); - if (v !== n.nodeValue) n.nodeValue = v; - } - document.querySelectorAll('input').forEach((i) => { const v = swap(i.value); if (v !== i.value) i.value = v; }); -})(${JSON.stringify(args.mask)}, ${JSON.stringify(INITIALS)})`; +// The content column: the page's host, SIDE either side, from the top of the window (the theme's navbar) down to +// the last thing the page shows (the room it keeps under itself for a dock is not shown). +const PAGE_CLIP = `(() => { + const host = document.querySelector('.dl-host'); + const r = host.getBoundingClientRect(); + let end = 0; + for (const e of host.shadowRoot.querySelectorAll('*')) + if (!e.firstElementChild && e.getClientRects().length) end = Math.max(end, e.getBoundingClientRect().bottom); + return { x: r.left - ${SIDE}, y: 0, width: r.width + ${2 * SIDE}, height: Math.min(r.bottom, end + 24) + ${FOOT} }; +})()`; -async function password() { - if (process.env.LUCI_PASSWORD) return process.env.LUCI_PASSWORD; - if (!process.stdin.isTTY) die('Set LUCI_PASSWORD or run on a terminal'); - process.stdout.write(`LuCI password for ${USER}: `); - execFileSync('stty', ['-echo'], { stdio: 'inherit' }); - try { - const rl = createInterface({ input: process.stdin }); - const line = await new Promise((ok) => rl.once('line', ok)); - rl.close(); - return line.replace(/\r$/, ''); - } finally { - execFileSync('stty', ['echo'], { stdio: 'inherit' }); - process.stdout.write('\n'); - } +// The dialog alone: the page under it, its scrim and the theme's ground are not drawn, MARGIN around the dialog. +const DIALOG_CLIP = `(() => { + const layer = document.querySelector('.dl-layer'); + for (const k of document.body.children) if (k !== layer) k.style.opacity = '0'; + document.documentElement.style.background = 'transparent'; + document.body.style.background = 'transparent'; + const s = document.createElement('style'); + s.textContent = '.sheet-root, .sheet-root::before, .sheet-root::after { background: transparent !important; backdrop-filter: none !important; }' + + ' .sheet-root > *:not(.sheet) { visibility: hidden !important; }'; + layer.shadowRoot.append(s); + const r = layer.shadowRoot.querySelector('.sheet[role=dialog]').getBoundingClientRect(); + const [l, t, rr, b] = ${JSON.stringify(MARGIN)}; + return { x: r.left - l, y: r.top - t, width: r.width + l + rr, height: r.height + t + b }; +})()`; + +const TYPES = { + '.html': 'text/html; charset=utf-8', + '.js': 'text/javascript', + '.css': 'text/css', + '.svg': 'image/svg+xml', + '.png': 'image/png', + '.ico': 'image/x-icon', + '.woff2': 'font/woff2', +}; + +/** The file an address of the made-up router stands for: the demo's page at any LuCI address, its script, the theme's files. */ +function fileFor(path, lang) { + if (path.startsWith('/cgi-bin/luci/')) + // the page's language is its , which LuCI's server sets + return { + type: TYPES['.html'], + body: Buffer.from(readFileSync(join(DEMO, 'index.html'), 'utf8').replace(' path.startsWith(prefix)); + if (!from) return null; + const file = resolve(from[1], path.slice(from[0].length)); + if (!file.startsWith(from[1] + sep) || !existsSync(file)) return null; + return { type: TYPES[extname(file)] ?? 'application/octet-stream', body: readFileSync(file) }; } -async function main() { - const pass = await password(); - // The router's certificate is usually for its public name, not router.lan. - const b = await launch(['--ignore-certificate-errors', `--lang=${args.lang}`]); - const { page, evaluate, go, waitSel } = b; +/** Answer everything the page asks of the router's origin; the rest (the map's tiles) goes to the network. */ +async function serve(page, lang) { + page.on('Fetch.requestPaused', async (e) => { + const f = fileFor(decodeURIComponent(new URL(e.request.url).pathname), lang); + await page + .send('Fetch.fulfillRequest', { + requestId: e.requestId, + responseCode: f ? 200 : 404, + responseHeaders: f ? [{ name: 'Content-Type', value: f.type }] : [], + body: f ? f.body.toString('base64') : '', + }) + .catch(() => {}); + }); + await page.send('Fetch.enable', { patterns: [{ urlPattern: `${ORIGIN}/*`, requestStage: 'Request' }] }); +} + +/** What the page complains of goes to the terminal: a question the demo's router does not answer, an error. */ +async function listen(page, problems) { + page.on('Runtime.consoleAPICalled', (e) => { + if (e.type === 'warning' || e.type === 'error') problems.push(e.args.map((a) => a.value ?? a.description ?? '').join(' ')); + }); + page.on('Runtime.exceptionThrown', (e) => problems.push(e.exceptionDetails.exception?.description ?? e.exceptionDetails.text)); + await page.send('Runtime.enable'); +} + +async function capture(lang) { + const suffix = lang === 'en' ? '' : `-${lang}`; + const b = await launch([`--lang=${lang}`]); + const { page, evaluate, go, waitFor } = b; + const problems = []; try { - // LuCI on auto speaks the browser's language: this one, whatever this computer's is. - await page.send('Network.enable'); - await page.send('Network.setExtraHTTPHeaders', { headers: { 'Accept-Language': args.lang } }); - await page.send('Emulation.setEmulatedMedia', { - features: [{ name: 'prefers-color-scheme', value: 'dark' }], - }); - // The person shown on the Person page; known once People has loaded (or from --person). - const s = { person: args.person }; - if (args.demo) { - page.on('Fetch.requestPaused', async (e) => { - try { - const r = await page.send('Fetch.getResponseBody', { - requestId: e.requestId, - }); - const body = r.base64Encoded ? Buffer.from(r.body, 'base64').toString('utf8') : r.body; - const out = demoRpc(e.request.postData ?? '', body, s.person); - await page.send('Fetch.fulfillRequest', { - requestId: e.requestId, - responseCode: e.responseStatusCode ?? 200, - responseHeaders: e.responseHeaders ?? [], - body: Buffer.from(out, 'utf8').toString('base64'), - }); - } catch { - await page.send('Fetch.continueRequest', { requestId: e.requestId }).catch(() => {}); - } - }); - await page.send('Fetch.enable', { - patterns: [{ urlPattern: '*ubus*', requestStage: 'Response' }], - }); - } - - // A tall window: Outline scrolls #maincontent, not the page, so it must hold everything. - const viewport = (width, height = 2600) => - page.send('Emulation.setDeviceMetricsOverride', { - width, - height, - deviceScaleFactor: SCALE, - mobile: false, - }); - - await viewport(1400); - await go(`${args.router}/cgi-bin/luci/`); - if (await evaluate(`!!document.querySelector('input[name=luci_password]')`)) { - await evaluate(`(() => { - document.querySelector('input[name=luci_username]').value = ${JSON.stringify(USER)}; - document.querySelector('input[name=luci_password]').value = ${JSON.stringify(pass)}; - })()`); - const loaded = page.waitFor('Page.loadEventFired'); - await evaluate(`document.querySelector('form.login-form, form').submit()`); - await loaded; - if (await evaluate(`!!document.querySelector('input[name=luci_password]')`)) - die( - (await evaluate(`!!document.querySelector('.login-error')`)) - ? `LuCI login failed: wrong password for ${USER} (LUCI_USER sets the user)` - : `LuCI login failed: still on the login page (${await evaluate('location.href')})`, - ); - } - - // The person to show: the first one on People unless --person. - await go(`${LUCI}/server?section=people`); - await waitSel('.dl-srvbody a[href*="dawnline/person"]'); - if (!s.person) - s.person = await evaluate(`new URL(document.querySelector('.dl-srvbody a[href*="dawnline/person"]').href).searchParams.get('id')`); - + await page.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: 'dark' }] }); + await page.send('Emulation.setDeviceMetricsOverride', { width: WIDTH, height: HEIGHT, deviceScaleFactor: SCALE, mobile: false }); + await listen(page, problems); + await serve(page, lang); for (const shot of SHOTS) { if (args.only.length && !args.only.includes(shot.name)) continue; - await viewport(shot.width); - await go(shot.url(s)); - await waitSel(shot.ready); - await sleep(2000); - if (shot.prep) await evaluate(shot.prep); - await sleep(shot.settle ?? 1500); - await evaluate(MASK); - const clip = await evaluate(shot.clip); + // Where the page paints nothing (around a dialog taken alone), the capture is transparent. + await page.send('Emulation.setDefaultBackgroundColorOverride', shot.dialog ? { color: { r: 0, g: 0, b: 0, a: 0 } } : {}); + await go(`${LUCI}/${shot.at}`); + await waitFor(shot.ready, `the ${shot.name} page`); + await sleep(shot.settle ?? 3000); + const clip = await evaluate(shot.dialog ? DIALOG_CLIP : PAGE_CLIP); + if (shot.dialog) await sleep(400); const { data } = await page.send('Page.captureScreenshot', { format: 'png', clip: { ...clip, scale: 1 }, captureBeyondViewport: true, }); - writeFileSync(join(RAW, `${shot.name}${SUFFIX}.png`), Buffer.from(data, 'base64')); - console.log(`${shot.name}${SUFFIX}: ${Math.round(clip.width)}x${Math.round(clip.height)} (x${SCALE})`); + writeFileSync(join(RAW, `${shot.name}${suffix}.png`), Buffer.from(data, 'base64')); + console.log(`${shot.name}${suffix}: ${Math.round(clip.width)}x${Math.round(clip.height)} (x${SCALE})`); } page.close(); } finally { await b.close(); } + for (const p of new Set(problems)) console.error(` the page (${lang}): ${p}`); +} + +async function main() { + if (args.build) execFileSync('npm', ['run', '--silent', 'build:demo'], { cwd: WEB, stdio: 'inherit' }); + for (const lang of args.langs) await capture(lang); } main().catch((e) => die(e.message)); diff --git a/scripts/cdp.mjs b/scripts/cdp.mjs index 6866cfc..8331d96 100644 --- a/scripts/cdp.mjs +++ b/scripts/cdp.mjs @@ -1,6 +1,6 @@ // A headless Chromium driven over the DevTools protocol, no npm packages: what -// the README screenshot scripts share (capture-screenshots.mjs from a router, -// capture-portal.mjs from the portal demo). BROWSER=/path/to/chrome picks the +// the README screenshot scripts share (capture-screenshots.mjs from the admin's +// demo, capture-portal.mjs from the portal's). BROWSER=/path/to/chrome picks the // browser (default: Brave or Chrome on macOS); its profile is a throwaway one. import { spawn } from 'node:child_process'; @@ -63,8 +63,7 @@ export async function connect(wsUrl) { /** * Start the browser headless on a fresh profile and connect to its first page. `flags` go on its command line - * (a language, certificate errors). Returns the page, its helpers, and close() that ends the browser and removes - * the profile. + * (a language). Returns the page, its helpers, and close() that ends the browser and removes the profile. */ export async function launch(flags = []) { const profile = mkdtempSync(join(tmpdir(), 'dawnline-shots-')); @@ -107,14 +106,16 @@ export async function launch(flags = []) { await page.send('Page.navigate', { url }); await loaded; }; - const waitSel = async (sel, ms = 20000) => { + // Until an expression is true in the page (what a selector cannot say: something inside a shadow root). + const waitFor = async (expression, what = expression, ms = 20000) => { for (let t = 0; t < ms; t += 250) { - if (await evaluate(`!!document.querySelector(${JSON.stringify(sel)})`)) return; + if (await evaluate(`!!(${expression})`)) return; await sleep(250); } - throw new Error(`timed out waiting for ${sel}`); + throw new Error(`timed out waiting for ${what}`); }; - return { page, evaluate, go, waitSel, close }; + const waitSel = (sel, ms) => waitFor(`document.querySelector(${JSON.stringify(sel)})`, sel, ms); + return { page, evaluate, go, waitFor, waitSel, close }; } catch (e) { await close(); throw e; diff --git a/scripts/check-ucode.sh b/scripts/check-ucode.sh deleted file mode 100755 index ac1ab3c..0000000 --- a/scripts/check-ucode.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Compile-check every ucode file on a router without installing anything: -# the tree is unpacked under /tmp/dlc and scripts/compile-ucode.sh runs there -# (the same check CI runs in an OpenWrt rootfs container, scripts/ucode-container.sh). -# scripts/check-ucode.sh [root@host] -set -euo pipefail -HOST="${1:-root@outline.lan}" -ROOT="$(cd "$(dirname "$0")/.." && pwd)/package/luci-app-dawnline/root" -TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT - -# ucode resolves names at compile time: calling a function declared further -# down a file fails at runtime ("access to undeclared variable"). Catch it here. -python3 "$(dirname "$0")/lint-ucode.py" "$ROOT" -( cd "$ROOT" && COPYFILE_DISABLE=1 tar -czf "$TMP/t.tgz" usr etc ) -scp -q "$TMP/t.tgz" "$HOST:/tmp/dl-check.tgz" -ssh "$HOST" 'rm -rf /tmp/dlc && mkdir -p /tmp/dlc && tar -xzf /tmp/dl-check.tgz -C /tmp/dlc && rm /tmp/dl-check.tgz' -# The script goes over stdin (`sh -s`), nothing of it stays on the router. -ssh "$HOST" 'sh -s /tmp/dlc; rc=$?; rm -rf /tmp/dlc; exit $rc' < "$(dirname "$0")/compile-ucode.sh" diff --git a/scripts/compile-ucode.sh b/scripts/compile-ucode.sh deleted file mode 100755 index 4ef1914..0000000 --- a/scripts/compile-ucode.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# Compile-check every ucode file of a Dawnline tree without installing it: -# modules are imported by name (dawnline/x.uc is dawnline.x, dawnline/rpc/x.uc -# dawnline.rpc.x) and entry points compiled with `ucode -c`. Needs ucode with -# its fs, uci, ubus and uloop modules, which is any OpenWrt box or an -# openwrt/rootfs container (scripts/ucode-container.sh); check-ucode.sh pipes -# this script to a router. -# scripts/compile-ucode.sh [ROOT] ROOT holds usr/ and etc/ (default: .) -# -# ucode resolves names at compile time and imports are static, so this catches -# a syntax error, a missing module and a named import that nothing exports. -set -eu -ROOT="$(cd "${1:-.}" && pwd)" -cd "$ROOT" -LIB="$ROOT/usr/share/ucode/*.uc" -rc=0 -for f in usr/share/ucode/dawnline/*.uc usr/share/ucode/dawnline/rpc/*.uc; do - [ -f "$f" ] || continue - n=$(echo "${f#usr/share/ucode/}" | sed 's/\.uc$//; s#/#.#g') - out=$(ucode -L "$LIB" -e "import * as x from '$n';" 2>&1) || { echo "FAIL $f"; echo "$out" | head -8; rc=1; } -done -# Entry points (ucode scripts outside the module tree); the shell ones live in -# the ShellCheck list of .github/workflows/ci.yml instead. -for f in usr/share/rpcd/ucode/luci.dawnline usr/libexec/dawnline/agent usr/libexec/dawnline/updater usr/bin/dawnline \ - usr/share/dawnline/portal/cgi.uc; do - [ -f "$f" ] || { echo "FAIL $f: missing"; rc=1; continue; } - out=$(ucode -L "$LIB" -c -o /dev/null "$f" 2>&1) || { echo "FAIL $f"; echo "$out" | head -8; rc=1; } -done -[ $rc = 0 ] && echo "all ucode files compile" -exit $rc diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 97ea64f..1236b7e 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,14 +1,21 @@ #!/usr/bin/env bash # Dev deploy: build the release tarball and install it on a router over SSH. # scripts/deploy.sh [root@host] +# PORT=51005 scripts/deploy.sh root@host when its SSH is not on port 22 (from outside the LAN) # Backs up the configs Dawnline touches to /root/dawnline-predeploy-/ first. set -euo pipefail HOST="${1:-root@outline.lan}" +# ssh and scp name the port each in its own way +SSH=(ssh ${PORT:+-p "$PORT"}) +SCP=(scp ${PORT:+-P "$PORT"}) +# The Go backend is built for this router's processor. +BACKEND_ARCH="$("${SSH[@]}" "$HOST" uname -m)" +export BACKEND_ARCH TAR="$("$(dirname "$0")/build-release.sh" | tail -n1)" -scp -q "$TAR" "$HOST:/tmp/luci-app-dawnline.tar.gz" -ssh "$HOST" sh <<'REMOTE' +"${SCP[@]}" -q "$TAR" "$HOST:/tmp/luci-app-dawnline.tar.gz" +"${SSH[@]}" "$HOST" sh <<'REMOTE' set -e ts="$(date +%Y%m%d-%H%M%S)" mkdir -p "/root/dawnline-predeploy-$ts" @@ -17,14 +24,23 @@ for c in network firewall dhcp dawnline; do done # Keep only the five most recent pre-deploy backups. ls -d /root/dawnline-predeploy-* 2>/dev/null | sort | head -n -5 | xargs -r rm -rf +# The backend that runs is the old file: taken out of procd, so the start below runs the new one. +ubus call service delete '{"name":"dawnline","instance":"backend"}' >/dev/null 2>&1 || true tar -xozf /tmp/luci-app-dawnline.tar.gz -C / rm -f /tmp/luci-app-dawnline.tar.gz sh /etc/uci-defaults/90_dawnline && rm -f /etc/uci-defaults/90_dawnline for f in /etc/uci-defaults/luci-i18n-dawnline-*; do if [ -f "$f" ]; then sh "$f" && rm -f "$f"; fi done +# rpcd reads the access lists once: the backend's object is in the new one. +/etc/init.d/rpcd reload +# The service's instances as the new init script has them (what runs unchanged is left running). +/etc/init.d/dawnline start # LuCI reads a language's catalogs once per web server: the new ones need a fresh one. /etc/init.d/uhttpd restart sleep 1 -ubus list luci.dawnline >/dev/null && echo "luci.dawnline registered (backup: /root/dawnline-predeploy-$ts)" +echo "backup: /root/dawnline-predeploy-$ts" +i=0 +while ! ubus list dawnline >/dev/null 2>&1 && [ "$i" -lt 10 ]; do sleep 1; i=$((i + 1)); done +ubus list dawnline >/dev/null 2>&1 && echo "backend: $(ubus call dawnline hello | jsonfilter -e '@.version') · pages follow by $(ubus call dawnline hello | jsonfilter -e '@.stream')" REMOTE diff --git a/scripts/frame-screenshots.py b/scripts/frame-screenshots.py index ca3d7d1..a750f88 100755 --- a/scripts/frame-screenshots.py +++ b/scripts/frame-screenshots.py @@ -2,11 +2,13 @@ """Frame the README screenshots the way the portal draws its own surfaces. Raw captures live in docs/screenshots/raw/.png at SCALE device pixels -per CSS pixel (scripts/capture-screenshots.mjs takes the admin's from a router, -scripts/capture-portal.mjs the portal's from its demo); the framed images +per CSS pixel (the admin's taken from its pages over made-up answers, in the +Outline theme with its navbar on top; scripts/capture-portal.mjs takes the +portal's from its demo); the framed images are written to docs/screenshots/.png at the same scale. Each page sits on a panel like the portal's sheets (#121212, radius 36, 16px around it, the page -inside at radius 20) on the portal's own black. A shot in FLOWS gets its steps +inside at radius 20) on the portal's own black. A shot in ALONE is a dialog +captured by itself: it stands on that black with no panel. A shot in FLOWS gets its steps in a row in front of the page's lower edge, numbered: sheets captured alone on a transparent page (raw/.png, FLOW_MARGIN around each). Needs a Chromium-based browser for the headless render (BROWSER=/path/to/chrome, @@ -24,13 +26,17 @@ ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) RAW = os.path.join(ROOT, 'docs', 'screenshots', 'raw') OUT = os.path.join(ROOT, 'docs', 'screenshots') -SHOTS = ['overview', 'people', 'person', 'portal', 'overview-ru', 'people-ru', 'person-ru', 'portal-ru'] +SHOTS = ['people', 'person', 'places', 'core', 'device', 'portal', + 'people-ru', 'person-ru', 'places-ru', 'core-ru', 'device-ru', 'portal-ru'] # name -> the steps in front of its page, in order (raw captures). The portal's come from its demo # (scripts/capture-portal.mjs), not a router: adding a device there would add one. -ru: README_ru's. FLOWS = { 'portal': ['portal-add-1', 'portal-add-2', 'portal-add-3'], 'portal-ru': ['portal-add-1-ru', 'portal-add-2-ru', 'portal-add-3-ru'], } +# A dialog captured alone (transparent around it, FLOW_MARGIN on each side, as a step is): it stands on the canvas +# as it is, with no panel under it. +ALONE = {'device', 'device-ru'} PAD_X, PAD_Y, INSET = 96, 80, 16 # canvas around the panel; panel around the page FLOW_MARGIN = (56, 40, 56, 72) # around a step's sheet in its capture: left, top, right, bottom STEP_GAP, STEP_OVER, STEP_PAD = 28, 150, 120 # between steps; how far they reach over the page; canvas beside them @@ -47,15 +53,17 @@ CANDIDATES = [ TEMPLATE = """
{steps}""" +{body}""" +PAGE = '
{steps}' +SHEET = '' def png_size(path): @@ -106,11 +114,17 @@ def main(): if not all(os.path.exists(p) for p in flow): print(f'{name}: a step is missing, the page alone') flow = [] - w, h, x, y, steps = layout(iw, ih, flow) + if name in ALONE: + ml, mt, mr, mb = FLOW_MARGIN + w, h = iw - ml - mr + 2 * PAD_X, ih - mt - mb + 2 * PAD_Y + body = SHEET.format(x=PAD_X - ml, y=PAD_Y - mt, iw=iw, ih=ih, src=src) + else: + w, h, x, y, steps = layout(iw, ih, flow) + body = PAGE.format(x=x, y=y, iw=iw, ih=ih, px=x - INSET, py=y - INSET, pw=iw + 2 * INSET, ph=ih + 2 * INSET, + src=src, steps=steps) html = os.path.join(tmp, f'{name}.html') with open(html, 'w', encoding='utf-8') as f: - f.write(TEMPLATE.format(w=w, h=h, x=x, y=y, iw=iw, ih=ih, px=x - INSET, py=y - INSET, pw=iw + 2 * INSET, - ph=ih + 2 * INSET, src=src, steps=steps)) + f.write(TEMPLATE.format(w=w, h=h, body=body)) out = os.path.join(OUT, f'{name}.png') subprocess.run([browser, '--headless=new', '--disable-gpu', '--hide-scrollbars', '--allow-file-access-from-files', f'--force-device-scale-factor={SCALE}', f'--window-size={w},{h}', f'--screenshot={out}', f'file://{html}'], diff --git a/scripts/lint-ucode.py b/scripts/lint-ucode.py deleted file mode 100755 index 32cb308..0000000 --- a/scripts/lint-ucode.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python3 -"""Static checks for the ucode sources that need no router. - -ucode resolves names where they are used: calling a function that is declared -further down the same file fails at runtime ("access to undeclared variable"). -Also: calls and named imports must match what a Dawnline module exports, the -rpcd methods (dawnline.rpc.*) must match the plugin and its ACL, and regexes -stay POSIX (rules/backend.md). Imports against the module layering are -reported as notes, not failures. -Run: scripts/lint-ucode.py [package root] -""" -import glob -import json -import os -import re -import sys - -root = sys.argv[1] if len(sys.argv) > 1 else os.path.join(os.path.dirname(__file__), '..', 'package', 'luci-app-dawnline', 'root') -MODDIR = f"{root}/usr/share/ucode/dawnline" -PLUGIN = f"{root}/usr/share/rpcd/ucode/luci.dawnline" -ACL = f"{root}/usr/share/rpcd/acl.d/luci-app-dawnline.json" -modules = sorted(glob.glob(f"{MODDIR}/*.uc") + glob.glob(f"{MODDIR}/rpc/*.uc")) -files = modules + [ - PLUGIN, - f"{root}/usr/libexec/dawnline/agent", - f"{root}/usr/libexec/dawnline/updater", - f"{root}/usr/bin/dawnline", - f"{root}/usr/share/dawnline/portal/cgi.uc", -] -files = [f for f in files if os.path.exists(f)] -bad = 0 - - -def problem(msg): - global bad - print(msg) - bad = 1 - - -def strip_comments(text): - return re.sub(r'//[^\n]*|/\*.*?\*/', '', text, flags=re.S) - - -def blank_comments_templates(text): - """Comments and template literals replaced by their newlines, strings kept: - line numbers stay, and a `}` that starts a line of a template (nft rules) - ends no function. A template inside another one's `${…}` reads as code: - good enough for how Dawnline writes them.""" - return re.sub(r"//[^\n]*|/\*.*?\*/|'(?:\\.|[^'\\\n])*'|\"(?:\\.|[^\"\\\n])*\"|`(?:\\.|[^`\\])*`", - lambda m: m.group(0) if m.group(0)[0] in '\'"' else '\n' * m.group(0).count('\n'), text, flags=re.S) - - -# A regex literal on one line: `/…/` with no slash inside, followed by flags or -# a delimiter (so a division keeps out). Good enough for how Dawnline writes them. -REGEX_LITERAL = re.compile(r'(? mine or (theirs == mine and mine < 4 and dep != mod): - print(f"note: {f}: {mod} ({LAYER_NAME[mine]}) imports dawnline.{dep} ({LAYER_NAME[theirs]}), a layer above it") - notes += 1 -if notes: - print(f"lint-ucode: {notes} layering notes (not failures)") - -print(f"lint-ucode: {len(files)} files checked" + (", problems found" if bad else ", ok")) -sys.exit(bad) diff --git a/scripts/screenshot-demo.mjs b/scripts/screenshot-demo.mjs deleted file mode 100644 index a28183b..0000000 --- a/scripts/screenshot-demo.mjs +++ /dev/null @@ -1,429 +0,0 @@ -// Demo data for the README screenshots (scripts/capture-screenshots.mjs --demo): -// the router's own answers (luci.dawnline status, events) with a made-up cast in -// place of its people, devices, places and activity, in the states the -// screenshots should show (online, ending soon, over the limit, paused, ended, -// outside their hours). The router's ids stay, so every page keeps working; it -// is only ever read. - -// The admin counts in binary units: "100 GB" is 100 GiB. -const GB = 2 ** 30; -const MIN = 60; -const HOUR = 3600; -const DAY = 86400; - -/** Where the cast connects from: [lat, lon, country, cc, network]. */ -const CITIES = { - Lisbon: [38.7223, -9.1393, 'Portugal', 'PT', 'MEO'], - Porto: [41.1579, -8.6291, 'Portugal', 'PT', 'NOS'], - Sintra: [38.8029, -9.3817, 'Portugal', 'PT', 'Vodafone Portugal'], - Madrid: [40.4168, -3.7038, 'Spain', 'ES', 'Telefonica de Espana'], - Barcelona: [41.3874, 2.1686, 'Spain', 'ES', 'Orange Espagne'], - Berlin: [52.52, 13.405, 'Germany', 'DE', 'Deutsche Telekom'], - Milan: [45.4642, 9.19, 'Italy', 'IT', 'TIM'], - Amsterdam: [52.3676, 4.9041, 'Netherlands', 'NL', 'KPN'], - Paris: [48.8566, 2.3522, 'France', 'FR', 'Orange'], - London: [51.5072, -0.1276, 'United Kingdom', 'GB', 'BT'], - Stockholm: [59.3293, 18.0686, 'Sweden', 'SE', 'Telia'], -}; -/** The router's own place. */ -const HOME = 'Lisbon'; -/** Shared at home (Access): what a Home-only person can be limited to. */ -const SERVICES = [ - { id: 'demo-nas', name: 'NAS', address: '10.0.1.20', ports: ['445', '5000'] }, - { - id: 'demo-ha', - name: 'Home Assistant', - address: '10.0.1.30', - ports: ['8123'], - }, -]; -/** How busy each day of the week is, Monday first. */ -const WEEK = [0.9, 1.15, 0.8, 1.05, 1.3, 0.75, 1.1]; - -/** - * Who the screenshots show, the --person first (the Person page), each with - * their city. A device: [name, kind, when it was last seen, GB this month, - * earlier places as 'City:days ago']; when: 'online', 'mins:N', 'hours:N', - * 'days:N', 'never', 'stale' (settings changed since), 'disabled'. Its last - * place is the person's city unless `at` names another. - */ -export const CAST = [ - { - name: 'Lena Ortiz', - city: 'Lisbon', - limit: 4, - quota: 100, - used: 38.6, - note: 'Family', - devices: [ - ['iPhone 16', 'phone', 'online', 14.2, ['Sintra:3', 'Porto:9', 'Madrid:16']], - ['MacBook Pro', 'computer', 'hours:3', 21.9, ['Berlin:12']], - ['iPad Air', 'tablet', 'never', 0], - ], - added: [['iPad Air', 2, 'portal']], - }, - { - name: 'Marco Rossi', - city: 'Milan', - ends: 4, - devices: [ - ['Pixel 9', 'phone', 'online', 6.4, ['Barcelona:8']], - ['ThinkPad X1', 'computer', 'days:1', 12.8], - ], - }, - { - name: 'Yuki Tanaka', - city: 'Amsterdam', - state: 'quota', - quota: 20, - used: 20.4, - devices: [ - ['Galaxy S24', 'phone', 'hours:6', 14.1, ['Paris:5']], - ['Living room TV', 'other', 'stale', 6.3], - ], - }, - { - name: 'Sam Okafor', - city: 'London', - state: 'paused', - paused: 3, - devices: [ - ['Gaming PC', 'computer', 'days:9', 3.1], - ['Steam Deck', 'other', 'disabled', 0], - ], - }, - { - name: 'Nora Lindqvist', - city: 'Stockholm', - state: 'expired', - ends: -3, - devices: [['iPhone 13 mini', 'phone', 'days:4', 1.2]], - }, - { - name: 'Mia Ortiz', - city: 'Lisbon', - state: 'hours', - hours: '07:00-21:00', - limit: 1, - devices: [['Fire HD 10', 'tablet', 'hours:11', 2.6]], - }, -]; - -const slug = (s) => - s - .toLowerCase() - .replace(/[^a-z0-9]+/g, '-') - .replace(/^-|-$/g, ''); -const date = (t) => new Date(t * 1000).toISOString().slice(0, 10); -const seen = (when, now) => { - const [k, n] = when.split(':'); - const v = +n || 0; - return ( - { - online: now - 40, - mins: now - v * MIN, - hours: now - v * HOUR, - days: now - v * DAY, - stale: now - 2 * DAY, - disabled: now - 41 * DAY, - }[k] ?? 0 - ); -}; -/** - * A week of daily [rx, tx] that adds up to about a quarter of the month, today last (nothing before it was first - * seen), rx (from the device) about an eighth. - */ -const week = (gb, last, now) => - [0.8, 1.3, 0.6, 1.1, 1.6, 0.9, 1].map((f, i) => { - const b = !gb || now - (6 - i) * DAY < last - DAY ? 0 : Math.round(((gb / 4) * f * GB) / 7); - return [Math.round(b * 0.12), b - Math.round(b * 0.12)]; - }); -/** - * One second of the cast's traffic through a server (the k-th), [rx, tx] in bytes/s: a few devices streaming, - * their uploads small. The same for a second whichever call asks, so the live chart keeps its shape. - */ -const meterRate = (ts, k) => { - const wave = (a, b) => Math.sin(ts / a + k) * 0.45 + Math.sin(ts / b + 2 * k) * 0.25; - const noise = (((ts * 7919 + k * 104729) % 1000) / 1000 - 0.5) * 0.35; - return [Math.round(Math.max(0, 1.8e5 * (1 + wave(7, 17) + noise))), Math.round(Math.max(0, 1.6e6 * (1 + wave(9, 23) + noise)))]; -}; -let ipN = 10; -/** A documentation address (the capture swaps public addresses for these anyway). */ -const ip = () => `203.0.113.${ipN++}`; -const where = (city) => `${city} · ${CITIES[city][4]}`; - -/** What the last status made of the router's ids, for the calls that come after it (events, usage, the meter). */ -const demo = { events: [], people: new Map(), days: [], now: 0, servers: [] }; - -/** - * Daily traffic over `days` (oldest first) for `gb` this month: busier some days of the week, today - * only partly gone. Each day's [rx, tx] in bytes, rx (from the devices) about an eighth. - */ -function daily(days, gb, now) { - const month = days[days.length - 1].slice(0, 7); - const w = days.map((d, i) => { - const wd = (new Date(`${d}T12:00:00Z`).getUTCDay() + 6) % 7; - const today = i === days.length - 1 ? ((now % DAY) / DAY) * 0.9 + 0.1 : 1; - return WEEK[wd] * (0.85 + ((i * 37) % 11) / 30) * today; - }); - const inMonth = w.reduce((s, x, i) => s + (days[i].startsWith(month) ? x : 0), 0) || 1; - return w.map((x) => { - const b = (x / inMonth) * gb * GB; - return [Math.round(b * 0.12), Math.round(b * 0.88)]; - }); -} -const usage = (days, pairs) => days.map((day, i) => ({ day, rx: pairs[i][0], tx: pairs[i][1] })); - -/** The places a device was at, oldest first: [city, ts, ip]. */ -function trail(c, d, hs, now) { - if (!hs) return []; - const earlier = (d[4] ?? []).map((s) => { - const [city, ago] = s.split(':'); - return [city, now - +ago * DAY - 5 * HOUR, ip()]; - }); - return [...earlier.reverse(), [c.city, hs, ip()]]; -} - -function demoStatus(st, first) { - const now = st.now; - ipN = 10; - const real = [...st.people].sort((a, b) => (a.id === first ? -1 : b.id === first ? 1 : a.id < b.id ? -1 : 1)); - const spare = real.flatMap((p) => p.devices); - const points = []; - const events = []; - const people = CAST.map((c, i) => { - const base = real[i] ?? { - ...real[real.length - 1], - id: `demo-${i}`, - devices: [], - }; - const state = c.state ?? 'active'; - const devices = c.devices.map((cd, j) => { - const [name, kind, when, gb] = cd; - const tpl = base.devices[j] ?? { - ...spare[j % spare.length], - id: `${base.id}-demo-${j}`, - address: `10.8.0.${200 + i * 8 + j}`, - }; - const hs = when === 'never' ? 0 : seen(when, now); - const online = when === 'online' && !['paused', 'expired', 'hours'].includes(state); - const places = trail(c, cd, hs, now); - places.forEach(([city, ts, addr], k) => { - const [lat, lon, country, cc, org] = CITIES[city]; - const current = online && k === places.length - 1; - points.push({ - person: base.id, - device: tpl.id, - ip: addr, - ts, - online: current, - lat, - lon, - city, - country, - cc, - asn: 0, - org, - }); - const ev = { - person: base.id, - device: tpl.id, - pname: c.name, - dname: name, - dkind: kind, - }; - // Online now: connected a while ago (the handshake renews every few minutes); otherwise on for a couple of hours. - events.push({ - ...ev, - type: 'connect', - detail: addr, - where: where(city), - ts: current ? now - 95 * MIN - j * 13 * MIN : ts - 2 * HOUR, - }); - if (!current) events.push({ ...ev, type: 'disconnect', ts }); - }); - // A phone in hand switches between Wi-Fi and mobile data. - if (online && kind === 'phone') { - const [, , addr] = places[places.length - 1]; - events.push({ - person: base.id, - device: tpl.id, - pname: c.name, - dname: name, - dkind: kind, - type: 'roam', - detail: `${ip()} → ${addr}`, - ts: now - 25 * MIN, - }); - } - return { - ...tpl, - name, - kind, - online, - active: online, - handshake: hs, - endpoint: places.length ? places[places.length - 1][2] : '', - config_stale: when === 'stale', - disabled: when === 'disabled', - month: [Math.round(gb * 0.12 * GB), Math.round(gb * 0.88 * GB)], - total: [Math.round(gb * 0.3 * GB), Math.round(gb * 2.2 * GB)], - spark: week(gb, hs, now), - hostname: hs ? `${slug(name)}.${slug(c.name.split(' ')[0])}.lan` : '', - // As set up: nothing failing, its own link values the server's, its data flowing while online. - link: null, - setup: online ? { state: 'flowing', since: hs } : null, - lan_bypass: false, - mtu: 0, - keepalive: null, - }; - }); - for (const [name, ago, by] of c.added ?? []) { - const d = devices.find((x) => x.name === name); - if (d) - events.push({ - person: base.id, - device: d.id, - pname: c.name, - dname: name, - dkind: d.kind, - type: 'device_added', - detail: name, - by, - ts: now - ago * DAY, - }); - } - if (c.paused) - events.push({ - person: base.id, - pname: c.name, - type: 'paused', - by: 'admin', - ts: now - c.paused * DAY, - }); - const month = devices.reduce((s, d) => [s[0] + d.month[0], s[1] + d.month[1]], [0, 0]); - const live = devices.some((d) => d.online); - demo.people.set(base.id, { - devices: devices.map((d, j) => [d.id, c.devices[j][3]]), - }); - return { - ...base, - name: c.name, - state, - paused: state === 'paused', - hours: c.hours ?? '', - note: c.note ?? '', - expires: c.ends !== undefined ? date(now + c.ends * DAY) : '', - device_limit: c.limit ?? Math.max(3, devices.length), - quota_gb: c.quota ?? 0, - quota_period: 'month', - quota_limit: (c.quota ?? 0) * GB, - quota_used: Math.round((c.used ?? (month[0] + month[1]) / GB) * GB), - bonus_gb: 0, - month, - total: [month[0] * 3, month[1] * 3], - online: devices.filter((d) => d.online).length, - last_seen: Math.max(0, ...devices.map((d) => d.handshake)), - rate: (base.rate ?? []).map(([t], k) => [t, live ? 12000 + ((k * 7919) % 9000) : 0, live ? 120000 + ((k * 104729) % 90000) : 0]), - devices, - }; - }); - const devices = people.flatMap((p) => p.devices); - const month = people.reduce((s, p) => [s[0] + p.month[0], s[1] + p.month[1]], [0, 0]); - events.sort((a, b) => a.ts - b.ts); - demo.events = events; - points.sort((a, b) => b.ts - a.ts); - demo.now = now; - demo.servers = (st.servers ?? []).map((x) => x.id); - demo.days = (st.series ?? []).map((x) => x.day); - if (!demo.days.length) for (let k = 29; k >= 0; k--) demo.days.push(date(now - k * DAY)); - const all = CAST.reduce((s, c) => s + c.devices.reduce((t, d) => t + d[3], 0), 0); - const series = usage(demo.days, daily(demo.days, all, now)); - const today = series[series.length - 1]; - const [lat, lon, country, cc, org] = CITIES[HOME]; - return { - ...st, - people, - totals: { - ...st.totals, - people: people.length, - devices: devices.length, - online: devices.filter((d) => d.online).length, - active: people.filter((p) => p.state === 'active').length, - today: [today.rx, today.tx], - month, - }, - series, - servers: st.servers.map((x) => ({ ...x, series })), - services: st.services?.length ? st.services : SERVICES, - geo: st.geo && { - ...st.geo, - home: { lat, lon, city: HOME, country, cc, asn: 0, org }, - points, - }, - events: events.slice(-60), - }; -} - -/** - * A ubus JSON-RPC exchange (LuCI batches calls into one request) with the - * luci.dawnline answers made into the demo; anything else as it came. - */ -export function demoRpc(request, response, first) { - let req; - let res; - try { - req = JSON.parse(request); - res = JSON.parse(response); - } catch { - return response; - } - const calls = new Map((Array.isArray(req) ? req : [req]).map((c) => [c.id, c.params ?? []])); - const fix = (r) => { - const [, object, method, args] = calls.get(r?.id) ?? []; - const data = r?.result?.[1]; - if (object !== 'luci.dawnline' || !data || typeof data !== 'object') return r; - if (method === 'status' && Array.isArray(data.people)) return { ...r, result: [r.result[0], demoStatus(data, first)] }; - if (method === 'person_usage' && demo.people.has(args?.id) && demo.days.length) { - const devs = demo.people.get(args.id).devices ?? []; - const per = Object.fromEntries(devs.map(([id, gb]) => [id, daily(demo.days, gb, demo.now)])); - const sum = demo.days.map((_, i) => devs.reduce((s, [id]) => [s[0] + per[id][i][0], s[1] + per[id][i][1]], [0, 0])); - const devices = Object.fromEntries(devs.map(([id]) => [id, usage(demo.days, per[id])])); - return { - ...r, - result: [r.result[0], { ...data, person: usage(demo.days, sum), devices }], - }; - } - // Every check passes: the screenshots show Dawnline, not this router's own setup. - if (method === 'health' && Array.isArray(data.checks)) - return { - ...r, - result: [ - r.result[0], - { - ...data, - checks: data.checks.map((c) => (c.status === 'warn' || c.status === 'error' ? { ...c, status: 'ok', problem: null } : c)), - }, - ], - }; - // Speed now, live: the last two minutes of the cast's traffic, not the router's. - if (method === 'meter' && Array.isArray(data.points)) { - const ids = demo.servers.length ? demo.servers : [...new Set(data.points.flatMap((p) => Object.keys(p.servers ?? {})))]; - const keep = data.keep > 1 ? data.keep : 120; - const since = +args?.since || 0; - const points = []; - for (let ts = data.now - keep + 1; ts <= data.now; ts++) - if (ts > since) points.push({ ts, servers: Object.fromEntries(ids.map((id, k) => [id, meterRate(ts, k)])) }); - return { ...r, result: [r.result[0], { ...data, ts: data.now, points }] }; - } - if (method === 'events' && Array.isArray(data.events)) { - const mine = demo.events.filter((e) => !args?.person || e.person === args.person); - return { - ...r, - result: [r.result[0], { ...data, events: mine, total: mine.length }], - }; - } - return r; - }; - return JSON.stringify(Array.isArray(res) ? res.map(fix) : fix(res)); -} diff --git a/scripts/ucode-container.sh b/scripts/ucode-container.sh deleted file mode 100755 index a3b5599..0000000 --- a/scripts/ucode-container.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# Run the ucode checks the way CI does: in an OpenWrt rootfs container with the -# release's own ucode and libuci — compile every file (compile-ucode.sh), then -# the unit tests (tests/ucode/run.sh). Needs docker; the repository is mounted -# read-only at /src, the container is thrown away. -# scripts/ucode-container.sh [24.10|25.12|all] [test name filter] -# -# Images are the x86-64 rootfs of the OpenWrt releases the packages are built -# for (build/Dockerfile, scripts/build-packages.sh), pinned by digest so a -# retagged image cannot change what CI runs. To move to a new release change -# the tag and the digest together (docker buildx imagetools inspect ). -set -euo pipefail -REPO="$(cd "$(dirname "$0")/.." && pwd)" -image_for() { - case "$1" in - 24.10) echo 'openwrt/rootfs:x86-64-24.10.6@sha256:fd76f3afb9c390ef2915618b6e3d7187698c03ecc6c23d3a13f12b62d9c6209e' ;; - 25.12) echo 'openwrt/rootfs:x86-64-25.12.3@sha256:af882e0583954fc2ceac6b081a9d214fc739cfea36a29b48795a5f15563aa3b5' ;; - *) echo "unknown release $1 (24.10 or 25.12)" >&2; exit 2 ;; - esac -} -releases="${1:-all}" -[ "$releases" = all ] && releases='24.10 25.12' -rc=0 -for rel in $releases; do - image="$(image_for "$rel")" - echo "== OpenWrt $rel ($image)" - # The checks run from this stdin script (`sh -s`): ucode-mod-uloop is not in - # the 24.10 rootfs, so what is missing is installed from the release's feeds. - docker run --rm -i --platform linux/amd64 -v "$REPO:/src:ro" -e "FILTER=${2:-}" "$image" sh -s <<-'INNER' || rc=1 - set -eu - missing='' - command -v ucode >/dev/null || missing='ucode' - for m in fs uci ubus uloop; do - [ -e "/usr/lib/ucode/$m.so" ] || missing="$missing ucode-mod-$m" - done - if [ -n "$missing" ]; then - echo "installing:$missing" - if command -v apk >/dev/null; then - # shellcheck disable=SC2086 - apk add --quiet $missing - else - mkdir -p /var/lock - # shellcheck disable=SC2086 - opkg update >/dev/null && opkg install $missing >/dev/null - fi - fi - sh /src/scripts/compile-ucode.sh /src/package/luci-app-dawnline/root - sh /src/tests/ucode/run.sh /src "$FILTER" - INNER -done -exit $rc diff --git a/tests/ucode/access.test.uc b/tests/ucode/access.test.uc deleted file mode 100644 index 7cc745a..0000000 --- a/tests/ucode/access.test.uc +++ /dev/null @@ -1,67 +0,0 @@ -// dawnline.access: the Check access walk for a device that keeps its own -// local network out of the tunnel (lan_bypass), and the way its internet -// leaves, on a model and a network snapshot of the test's own (nothing read -// from the container). -import * as access from 'dawnline.access'; - -const KEY_TV = 'a8Z2wq0b8rQx3mN6kYyQ2G3bQm2kq5tY5m7Q0yq3m3c=', KEY_PHONE = 'b8Z2wq0b8rQx3mN6kYyQ2G3bQm2kq5tY5m7Q0yq3m3c='; - -/** Bob (Internet only) on a server that sends everyone direct: a TV with lan_bypass and a phone without. */ -function model() { - return { - settings: { portal_enabled: false }, - servers: { - home: { id: 'home', name: 'Home', ifname: 'awghome', subnet: '10.9.0.0/29', private_key: 'k', enabled: true, lan_like: false, - auto_wan: false, wan_device: 'eth1', auto_lan: false, lan_devices: [ 'br-lan' ], mesh: 'all', device_mesh: true, dns: [] }, - }, - people: { bob: { id: 'bob', name: 'Bob', server: 'home', access: 'internet', services: [], devices: [ 'tv', 'phone' ] } }, - devices: { - tv: { id: 'tv', person: 'bob', name: 'TV', address: '10.9.0.2', public_key: KEY_TV, lan_bypass: true }, - phone: { id: 'phone', person: 'bob', name: 'Phone', address: '10.9.0.3', public_key: KEY_PHONE, lan_bypass: false }, - }, - services: {}, - circles: {}, - }; -} - -const CTX = { - states: { bob: 'active' }, - dmp: { peers: {}, windows: {} }, - snap: { - devices: { - 'br-lan': { nets: [ '192.168.1.0/24' ], zone: 'lan', addrs: [ '192.168.1.1/24' ] }, - eth1: { nets: [ '203.0.113.0/24' ], zone: 'wan', addrs: [ '203.0.113.7/24' ] }, - awghome: { nets: [ '10.9.0.0/29' ], addrs: [ '10.9.0.1/29' ] }, - }, - lan: 'br-lan', - wan: 'eth1', - }, -}; - -function last(r) { - return r.steps[length(r.steps) - 1]; -} - -test('check: a device with its local network outside the tunnel', () => { - let m = model(); - let r = access.check(m, 'tv', '192.168.1.20', CTX); - eq([ r.ok, last(r).ok, last(r).title ], [ false, false, "Its configuration doesn't send it to the router" ], - 'a home address: on its own network, not blocked in the tunnel'); - ok(index(last(r).detail, "the device's own network handles it") >= 0, 'says where it goes'); - r = access.check(m, 'tv', '192.168.1.1:80', CTX); - eq(last(r).title, "Its configuration doesn't send it to the router", 'the router\'s LAN address is on its own network too'); - r = access.check(m, 'tv', '10.9.0.1:53', CTX); - eq([ r.ok, r.steps[1].title ], [ true, '10.9.0.1 is this router: DNS is open to everyone' ], 'its DNS stays in the tunnel'); - r = access.check(m, 'tv', '8.8.8.8', CTX); - eq([ r.ok, last(r).title, last(r).detail ], [ true, '8.8.8.8 is on the internet', 'It leaves through eth1.' ], 'the internet through the tunnel'); - - r = access.check(m, 'phone', '192.168.1.20', CTX); - eq([ r.ok, last(r).title ], [ false, '192.168.1.20 is at home (br-lan)' ], 'without it: into the tunnel, and blocked there'); -}); - -test('check: the way out is the server\'s', () => { - let m = model(); - eq(last(access.check(m, 'phone', '8.8.8.8', CTX)).detail, 'It leaves through eth1.', 'direct'); - m.servers.home.lan_like = true; - eq(last(access.check(m, 'phone', '8.8.8.8', CTX)).detail, 'It leaves like a home device would.', 'like a home device'); -}); diff --git a/tests/ucode/awg.test.uc b/tests/ucode/awg.test.uc deleted file mode 100644 index 9dafa53..0000000 --- a/tests/ucode/awg.test.uc +++ /dev/null @@ -1,556 +0,0 @@ -// dawnline.awg: disguise presets against their own validation, the values -// AmneziaWG refuses (obf_unsafe, one case per rule), the parser of `awg show -// dump` on the output formats of AmneziaWG 1.0, 2.0 and 3.1 and how -// each tunnel's read went (the stand-in awg in fixtures/bin prints the -// fixture put at AWG_DUMP), the devices a tunnel should hold, Reconnect, a -// device's configuration from the fixture model, what the server's interface -// and the read-only status get of it. -import { readfile, writefile, unlink } from 'fs'; -import { cursor } from 'uci'; -import { valid_key, cidr_any } from 'dawnline.util'; -import * as awg from 'dawnline.awg'; -import * as core from 'dawnline.core'; -import * as backup from 'dawnline.backup'; -import * as rpc_status from 'dawnline.rpc.status'; -import * as nft from 'dawnline.nft'; - -const AWG_DUMP = '/tmp/dawnline-tests/awg-dump'; -let fixtures = sourcepath(0, true) + '/fixtures'; - -test('obf_preset off', () => { - let o = awg.obf_preset('off'); - eq(o, { jc: '0', jmin: '0', jmax: '0', s1: '0', s2: '0', h1: '1', h2: '2', h3: '3', h4: '4' }, 'plain WireGuard headers'); - eq(awg.obf_errors(o), [], 'valid'); -}); - -test('obf_preset balanced', () => { - for (let i = 0; i < 25; i++) { - let o = awg.obf_preset('balanced'); - eq(awg.obf_errors(o), [], 'balanced is valid'); - ok(+o.jc >= 4 && +o.jc <= 8, `jc=${o.jc}`); - let jmin = +o.jmin, jmax = +o.jmax; - ok(jmin >= 64 && jmax > jmin && jmax <= 1024, `junk sizes ${o.jmin}-${o.jmax}`); - ok(+o.s1 + 56 != +o.s2, 's1 + 56 != s2'); - eq(length(uniq([ o.h1, o.h2, o.h3, o.h4 ])), 4, 'distinct headers'); - for (let k in [ 'h1', 'h2', 'h3', 'h4' ]) - ok(+o[k] >= 5, `${k} above the reserved values`); - ok(+o.s3 >= 8 && +o.s3 <= 48 && +o.s4 >= 4 && +o.s4 <= 16, `padding ${o.s3}/${o.s4}`); - ok(substr(o.i1, 0, 3) == ' { - let o = awg.obf_preset('max'); - ok(valid_key(o.header_protection_key), 'a header protection key'); - ok(o.header_protection_key != awg.obf_preset('max').header_protection_key, 'made for each server, without awg genkey'); - ok(+o.jc >= 4 && +o.jc <= 6, 'jc'); - ok(substr(o.i1, 0, 3) == ' 1, 'signature packets differ between servers'); - // The preset passes the server's own validation (jmin/jmax may be small: 0.5.2). - for (let i = 0; i < 25; i++) - eq(awg.obf_errors(awg.obf_preset('max')), [], 'max is valid'); -}); - -test('obf_errors: Dawnline\'s own bounds on top of obf_unsafe', () => { - eq(awg.obf_errors({}), [], 'nothing set'); - eq(awg.obf_errors(null), [], 'no values'); - eq(awg.obf_errors({ jc: '11' }), [ 'Jc must be from 0 to 10.' ], 'jc range'); - eq(awg.obf_errors({ jmin: '0', jmax: '0' }), [], 'zero junk sizes are allowed'); - eq(awg.obf_errors({ jmin: '2000', jmax: '3000' }), [ 'Jmin must be from 0 to 1024.', 'Jmax must be from 0 to 1024.' ], 'junk sizes'); - eq(awg.obf_errors({ s1: '5', s2: '61' }), [ 'S2 must not be S1 + 56: the handshake initiation and response would have the same size.' ], - 'the handshake size clash'); - eq(awg.obf_errors({ s4: '33' }), [ 'S4 must be from 0 to 32.' ], 's4 range'); - // What AmneziaWG refuses comes first, said once. - eq(awg.obf_errors({ jc: 'x' }), [ 'Jc must be a whole number from 0 to 65535.' ], 'not a number'); - eq(awg.obf_errors({ jmin: '200', jmax: '100' }), [ 'Jmin must not be larger than Jmax.' ], 'order'); - eq(awg.obf_errors({ h1: '7', h2: '7' }), [ 'H1 and H2 overlap: each packet type needs values of its own.' ], 'duplicate headers'); - eq(awg.obf_neutral({ jc: '0', jmin: '0', jmax: '0', s1: '0', s2: '0', h1: '1', h2: '2', h3: '3', h4: '4' }), true, 'off is neutral'); - eq(awg.obf_neutral({ jc: '4', jmin: '64', jmax: '128' }), false, 'junk is not neutral'); -}); - -// One case per rule of obf_unsafe: what an import, a restore or a hand edit must never hand to the kernel. -const HPK = 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='; -const MAX = { s1: '12', s2: '12', s3: '12', s4: '12', header_protection_key: HPK }; - -test('obf_unsafe: what the presets and older servers hold passes', () => { - eq(awg.obf_unsafe(null), [], 'no values'); - eq(awg.obf_unsafe(awg.obf_preset('off')), [], 'off'); - for (let i = 0; i < 25; i++) { - eq(awg.obf_unsafe(awg.obf_preset('balanced')), [], 'balanced'); - eq(awg.obf_unsafe(awg.obf_preset('max')), [], 'max'); - } - // Values from before 0.8 and hand-tuned ones the kernel takes: none of Dawnline's own bounds here. - let old = { jc: '12', jmin: '50', jmax: '1400', s1: '100', s2: '156', h1: '1234567', h2: '2345678', h3: '3456789', h4: '4567890' }; - eq(awg.obf_unsafe(old), [], 'older and hand-tuned values'); - ok(length(awg.obf_errors(old)) > 0, 'which a new server would not get'); -}); - -test('obf_unsafe: 16-bit numbers', () => { - eq(awg.obf_unsafe({ jc: '65535', s4: '0' }), [], 'the ends'); - eq(awg.obf_unsafe({ jc: '65536' }), [ 'Jc must be a whole number from 0 to 65535.' ], 'too large'); - eq(awg.obf_unsafe({ s3: '-1' }), [ 'S3 must be a whole number from 0 to 65535.' ], 'negative'); - eq(awg.obf_unsafe({ jmax: '1e3' }), [ 'Jmax must be a whole number from 0 to 65535.' ], 'not digits'); -}); - -test('obf_unsafe: Jmin not above Jmax', () => { - eq(awg.obf_unsafe({ jmin: '50', jmax: '50' }), [], 'equal'); - eq(awg.obf_unsafe({ jmin: '51', jmax: '50' }), [ 'Jmin must not be larger than Jmax.' ], 'the kernel would write past its junk buffer'); - eq(awg.obf_unsafe({ jmin: '51' }), [], 'Jmax not given'); -}); - -test('obf_unsafe: header values are numbers or ranges', () => { - eq(awg.obf_unsafe({ h1: '100-200', h2: '300', h3: '4294967295', h4: '0' }), [], 'numbers and ranges'); - eq(awg.obf_unsafe({ h1: '200-100' }), [ 'H1 must be a number or a range like 100-200, up to 4294967295.' ], 'reversed'); - eq(awg.obf_unsafe({ h2: '4294967296' }), [ 'H2 must be a number or a range like 100-200, up to 4294967295.' ], 'past 32 bits'); - eq(awg.obf_unsafe({ h3: '5-6-7' }), [ 'H3 must be a number or a range like 100-200, up to 4294967295.' ], 'two dashes'); - eq(awg.obf_unsafe({ h4: 'abc' }), [ 'H4 must be a number or a range like 100-200, up to 4294967295.' ], 'not a number'); -}); - -test('obf_unsafe: header values do not overlap', () => { - eq(awg.obf_unsafe({ h1: '10-20', h2: '20-30', h3: '40', h4: '50' }), [ 'H1 and H2 overlap: each packet type needs values of its own.' ], 'a shared end'); - eq(awg.obf_unsafe({ h1: '10-20', h2: '30', h3: '15', h4: '50' }), [ 'H1 and H3 overlap: each packet type needs values of its own.' ], 'one inside a range'); - // One not given keeps WireGuard's type: 1-4. - eq(awg.obf_unsafe({ h1: '1-10' }), [ 'H1 and H2 overlap: each packet type needs values of its own.', 'H1 and H3 overlap: each packet type needs values of its own.', - 'H1 and H4 overlap: each packet type needs values of its own.' ], 'over the default types'); - eq(awg.obf_unsafe({ h1: '5-10' }), [], 'clear of them'); -}); - -test('obf_unsafe: header protection needs a key and 12-byte padding', () => { - eq(awg.obf_unsafe(MAX), [], 'the 3.1 values'); - eq(awg.obf_unsafe({ ...MAX, header_protection_key: 'abc' }), [ 'The header protection key is not a key.' ], 'not a key'); - eq(awg.obf_unsafe({ ...MAX, s3: '11' }), [ 'S3 must be at least 12 with header protection.' ], 'too little padding'); - eq(awg.obf_unsafe({ ...MAX, s4: null }), [ 'S4 must be at least 12 with header protection.' ], 'no padding'); - eq(awg.obf_unsafe({ s1: '0', s2: '0' }), [], 'none needed without the key'); -}); - -test('obf_unsafe: 3.1 timers and counts', () => { - eq(awg.obf_unsafe({ rekey_after_time: '100-120', rekey_timeout: '3', keepalive_timeout: '0', max_handshake_attempts: '0-0' }), [], - 'numbers, ranges and 0 (the default)'); - eq(awg.obf_unsafe({ rekey_timeout: '0-7' }), [ 'RekeyTimeout must be a number or a range like 5-15, from 1 to 65535.' ], 'a 0 in a range'); - eq(awg.obf_unsafe({ keepalive_timeout: '15-5' }), [ 'KeepaliveTimeout must be a number or a range like 5-15, from 1 to 65535.' ], 'reversed'); - eq(awg.obf_unsafe({ max_handshake_attempts: '70000' }), [ 'MaxHandshakeAttempts must be a number or a range like 5-15, from 1 to 65535.' ], 'past 16 bits'); - eq(awg.obf_unsafe({ content_padding_addition: '0-100' }), [], 'padding may start at 0'); - eq(awg.obf_unsafe({ content_padding_addition: '10-x' }), [ 'ContentPaddingAddition must be a number or a range like 10-100, up to 65535.' ], 'padding'); -}); - -test('obf_unsafe: RejectAfterTime up to 180 seconds', () => { - eq(awg.obf_unsafe({ reject_after_time: '150-180' }), [], 'the preset'); - eq(awg.obf_unsafe({ reject_after_time: '150-181' }), [ 'RejectAfterTime must be at most 180 seconds.' ], 'the kernel drops keys after 180 seconds'); -}); - -test('obf_unsafe: switches', () => { - eq(awg.obf_unsafe({ random_trailers: 'on', disable_cookies: '0' }), [], 'on, off, 1, 0'); - eq(awg.obf_unsafe({ random_trailers: 'yes' }), [ 'RandomTrailers must be on or off.' ], 'what the .conf parser refuses'); - eq(awg.obf_unsafe({ disable_cookies: 'true' }), [ 'DisableCookies must be on or off.' ], 'the same for cookies'); -}); - -test('obf_unsafe: signature packet tags', () => { - let bad = (name, tag) => `${name}: <${tag}> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .`; - eq(awg.obf_unsafe({ i1: '', i2: 'text between tags is skipped' }), [], 'every tag both parsers know'); - eq(awg.obf_unsafe({ i1: '' }), [ bad('I1', 'b 0xabc') ], 'an odd number of hex digits'); - eq(awg.obf_unsafe({ i1: '' }), [ bad('I1', 'b 0x') ], 'no bytes'); - eq(awg.obf_unsafe({ i1: '' }), [ bad('I1', 'b ff00') ], 'no 0x (the kernel needs it)'); - eq(awg.obf_unsafe({ i1: '' }), [ bad('I1', 'b 0xzz') ], 'not hex'); - eq(awg.obf_unsafe({ i2: '' }), [ bad('I2', 'r -5') ], 'a negative length writes past the packet'); - eq(awg.obf_unsafe({ i2: '' }), [ bad('I2', 'rc 0') ], 'no length'); - eq(awg.obf_unsafe({ i2: '' }), [ bad('I2', 'rd 1001') ], 'too long'); - eq(awg.obf_unsafe({ i3: '' }), [ bad('I3', 'r 5') ], 'two spaces'); - eq(awg.obf_unsafe({ i3: '' }), [ bad('I3', 't ') ], 'a space after t'); - eq(awg.obf_unsafe({ i4: '' }), [ bad('I4', 'c') ], 'the kernel\'s counter, which amneziawg-go refuses'); - for (let t in [ 'd', 'ds', 'dz' ]) - eq(awg.obf_unsafe({ i4: `<${t}>` }), [ bad('I4', t) ], `amneziawg-go's <${t}>, which the kernel refuses`); - eq(awg.obf_unsafe({ i5: '<>' }), [ bad('I5', '') ], 'an empty tag'); - eq(awg.obf_unsafe({ i5: '' }), [ bad('I5', 'r <5') ], 'a tag inside a tag'); - eq(awg.obf_unsafe({ i5: '' }), [], 'long tags are fine'); - eq(awg.obf_unsafe({ i5: '' }), [ bad('I5', 'x 0x0102030405060708090a…') ], 'shown cut short'); - eq(awg.obf_unsafe({ i1: '.' ], 'not closed'); - eq(awg.obf_unsafe({ i1: ' # note' }), [ 'I1 may not contain # or a line break.' ], 'a comment in a .conf'); - eq(awg.obf_unsafe({ i1: '\n' }), [ 'I1 may not contain # or a line break.' ], 'a line break'); -}); - -test('obf_unsafe: I1-I5 fit one configuration', () => { - // A tag of 100 characters. - let tag = ' { - let out = ''; - for (let k = 0; k < n; k++) - out += tag; - return out; - }; - let four = many(4); - eq(awg.obf_unsafe({ i1: four, i2: four, i3: four, i4: four, i5: four }), [], '2000 characters'); - eq(awg.obf_unsafe({ i1: four, i2: four, i3: four, i4: four, i5: many(5) }), [ 'I1-I5 together must be at most 2000 characters, not 2100.' ], 'over 2000'); -}); - -test('obf_unsafe: an import or restore with such values is refused', () => { - let dir = '/tmp/dawnline-tests/import'; - let errs = (text) => { - system(`rm -rf ${dir}; mkdir -p ${dir}/.delta`); - writefile(`${dir}/dawnline`, text); - let c = cursor(dir, `${dir}/.delta`); - c.load('dawnline'); - let out = backup.config_errors(c); - system(`rm -rf ${dir}`); - return out; - }; - let fixture = readfile('/etc/config/dawnline'); - let bad = errs(replace(fixture, "option jmax '128'", "option jmax '32'")); - ok(index(bad, 'Server Main: Jmin must not be larger than Jmax.') >= 0, `refused: ${join(' ', bad)}`); - eq(filter(errs(fixture), (e) => index(e, 'Jmin') >= 0), [], 'the fixture as it is'); -}); - -// The stand-in's call log and failures (fixtures/bin/awg). -const AWG_CALLS = '/tmp/dawnline-tests/awg-calls'; -const AWG_FAIL = '/tmp/dawnline-tests/awg-fail-'; -const SERVER_KEY = 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg='; -const PEER_ON = 'HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=', PEER_NEW = 'TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0='; - -// A fixture's lines as another interface's (`show all` prints the ifname first). -function lines_as(name, ifname) { - let out = ''; - for (let l in split(readfile(`${fixtures}/awg-dump-${name}.txt`), '\n')) - if (l != '') - out += `${ifname}${substr(l, length('awgmain'))}\n`; - return out; -} - -// lo is in every container's /sys/class/net (index 1), and is no AmneziaWG -// interface: the stand-in prints the fixture's lines for it, as for a tunnel. -function dump_of(name) { - writefile(AWG_DUMP, lines_as(name, 'lo')); - return awg.dump([ 'lo' ]); -} - -test('dump: AmneziaWG 1.0 (14 interface fields)', () => { - let d = dump_of('1.0'); - eq(d.ok, true, 'ok'); - eq(d.reads, { lo: 'read' }, 'read'); - eq(d.ifaces, { lo: { public_key: SERVER_KEY, port: 51820, ifindex: 1 } }, 'interface; its index is the epoch of its counters'); - eq(d.peers[PEER_ON], { ifname: 'lo', endpoint: '203.0.113.7:41821', handshake: 1760000000, rx: 123456, tx: 654321 }, - 'peer with a session, with the ifname the lines leave out'); - eq(d.peers[PEER_NEW], { ifname: 'lo', endpoint: '', handshake: 0, rx: 0, tx: 0 }, 'peer that never connected'); -}); - -test('dump: AmneziaWG 2.0 (33 interface fields)', () => { - let d = dump_of('2.0'); - eq(d.ifaces, { lo: { public_key: SERVER_KEY, port: 51820, ifindex: 1 } }, 'interface'); - eq(keys(d.peers), [ PEER_ON ], 'one peer'); -}); - -test('dump: AmneziaWG 3.1 (33 interface fields, protection on)', () => { - let d = dump_of('3.1'); - eq(d.ifaces, { lo: { public_key: SERVER_KEY, port: 51820, ifindex: 1 } }, 'interface'); - eq(length(d.peers), 2, 'two peers'); -}); - -// awgmain is not in the container's /sys/class/net, as a tunnel netifd could not bring up. -test('dump: a tunnel that is not there is down, without a process', () => { - writefile(AWG_DUMP, readfile(`${fixtures}/awg-dump-1.0.txt`)); - unlink(AWG_CALLS); - eq(awg.dump([ 'awgmain' ]), { ok: true, reads: { awgmain: 'down' }, ifaces: {}, peers: {} }, 'its counters are gone'); - eq(readfile(AWG_CALLS), null, 'awg is not asked about a link the kernel does not have'); - eq(awg.dump([]), { ok: true, reads: {}, ifaces: {}, peers: {} }, 'no tunnel runs'); -}); - -test('dump: each tunnel on its own', () => { - writefile(AWG_DUMP, readfile(`${fixtures}/awg-dump-1.0.txt`) + lines_as('2.0', 'lo')); - let d = awg.dump([ 'awgmain', 'lo' ]); - eq([ d.ok, d.reads ], [ true, { awgmain: 'down', lo: 'read' } ], 'one down, one read'); - eq(keys(d.ifaces), [ 'lo' ], 'only what was read'); - eq(filter(values(d.peers), (p) => p.ifname != 'lo'), [], 'no peers of the one that is down'); -}); - -// The tool says "Operation not supported" for lo on a real system. -test('dump: a tunnel that exists but cannot be read', () => { - writefile(AWG_DUMP, lines_as('2.0', 'lo')); - writefile(`${AWG_FAIL}lo`, 'Unable to access interface: Operation not supported\n'); - let d = awg.dump([ 'awgmain', 'lo' ]); - unlink(`${AWG_FAIL}lo`); - eq(d.ok, false, 'not every tunnel was read'); - eq(d.reads, { awgmain: 'down', lo: 'error' }, 'each on its own'); - eq([ d.ifaces, d.peers ], [ {}, {} ], 'nothing of the failed one'); -}); - -// The agent's watcher reads every second: with one server, one process. -test('dump: only the tunnels asked for, one process each', () => { - writefile(AWG_DUMP, lines_as('1.0', 'lo') + lines_as('2.0', 'wgclient')); - unlink(AWG_CALLS); - let d = awg.dump([ 'lo' ]); - // The tests after these find no tunnel, as on a router without AmneziaWG running. - unlink(AWG_DUMP); - eq(readfile(AWG_CALLS), 'show lo dump\n', 'one call, never `all`'); - eq(keys(d.ifaces), [ 'lo' ], 'the other tunnel is not read'); - eq(d.peers[PEER_ON].ifname, 'lo', 'its peers stand in for none of ours'); -}); - -test('tunnel_devices: what sync_peers loads', () => { - let m = { - servers: { s: { public_key: SERVER_KEY } }, - people: { a: { id: 'a', server: 's' }, b: { id: 'b', server: 's' }, c: { id: 'c', server: 'other' } }, - devices: { - on: { person: 'a', public_key: PEER_ON, address: '10.9.0.2' }, - own: { person: 'a', public_key: SERVER_KEY, address: '10.9.0.8' }, - off: { person: 'a', public_key: PEER_NEW, address: '10.9.0.3', disabled: true }, - paused: { person: 'b', public_key: SERVER_KEY, address: '10.9.0.4' }, - elsewhere: { person: 'c', public_key: PEER_NEW, address: '10.9.0.5' }, - badkey: { person: 'a', public_key: 'not a key', address: '10.9.0.6' }, - badaddr: { person: 'a', public_key: PEER_NEW, address: '' }, - nobody: { person: 'gone', public_key: PEER_NEW, address: '10.9.0.7' }, - }, - }; - let st = { a: 'quota', b: 'paused', c: 'active' }; - eq(map(awg.tunnel_devices(m, 's', st), (d) => d.address), [ '10.9.0.2' ], - 'over the limit stays; off, paused, other servers, lines syncconf would refuse and the server\'s own key (ignored by the kernel) do not'); - eq(map(awg.tunnel_devices(m, 'other', st), (d) => d.address), [ '10.9.0.5' ], 'the other server'); - eq(awg.tunnel_devices(m, 'none', st), [], 'none'); -}); - -test('peer_diff: by key, per tunnel', () => { - let dmp = { peers: {} }; - dmp.peers[PEER_ON] = { ifname: 'awgmain' }; - dmp.peers[SERVER_KEY] = { ifname: 'awgmain' }; - dmp.peers[PEER_NEW] = { ifname: 'awgother' }; - let devs = (...ks) => map(ks, (k) => ({ public_key: k })); - eq(awg.peer_diff(devs(PEER_ON, SERVER_KEY), dmp, 'awgmain'), { loaded: 2, missing: 0, extra: 0 }, 'the same'); - eq(awg.peer_diff(devs(PEER_ON, PEER_NEW), dmp, 'awgmain'), { loaded: 2, missing: 1, extra: 1 }, - 'a stale peer standing in for a missing one'); - eq(awg.peer_diff(devs(PEER_ON), dmp, 'awgmain'), { loaded: 2, missing: 0, extra: 1 }, 'one too many'); - eq(awg.peer_diff(devs(PEER_NEW), dmp, 'awgdown'), { loaded: 0, missing: 1, extra: 0 }, 'a tunnel with no peers read'); - eq(awg.peer_diff([], { peers: {} }, 'awgmain'), { loaded: 0, missing: 0, extra: 0 }, 'nothing either way'); -}); - -test('handshake_since: Reconnect hides older handshakes', () => { - eq(awg.handshake_since(1000, null), 1000, 'never set up again'); - eq(awg.handshake_since(1000, 0), 1000, 'no time'); - eq(awg.handshake_since(1000, 1500), 0, 'connected before: not set up yet'); - eq(awg.handshake_since(1500, 1500), 0, 'the same second does not count'); - eq(awg.handshake_since(1600, 1500), 1600, 'connected after'); - eq(awg.handshake_since(0, 1500), 0, 'never connected'); -}); - -test('blocked reasons', () => { - let srv = (b) => ({ name: 'Home', blocked: b }); - eq(awg.blocked_text(srv(null)), null, 'not kept down'); - eq(awg.blocked_text(srv({ code: 'ifname', ifname: 'bad name' })), 'Home has an invalid interface name "bad name".', 'interface name'); - eq(awg.blocked_text(srv({ code: 'taken', ifname: 'wg0' })), "Home can't use the network interface wg0: it exists and isn't Dawnline's.", 'foreign interface'); - eq(awg.blocked_text(srv({ code: 'disguise', need: '3.1', installed: '2.0' })), 'Home is kept down: its disguise needs AmneziaWG 3.1 (installed: 2.0).', 'disguise'); - eq(awg.blocked_text(srv({ code: 'disguise', need: '3.1' })), 'Home is kept down: its disguise needs AmneziaWG 3.1 (installed: none).', 'disguise, none installed'); - // Files of older versions hold the English fragment after the name. - eq(awg.blocked_text(srv('has an invalid interface name "x"')), 'Home has an invalid interface name "x".', 'old fragment'); - eq(awg.blocked_note({ code: 'ifname', ifname: 'x' }), 'has an invalid interface name "x"', 'the log keeps the fragment'); - // Values AmneziaWG refuses: which ones, from the server's own when read. - let bad = { name: 'Home', obf: { jmin: '60', jmax: '50' }, blocked: { code: 'disguise_invalid' } }; - eq(awg.blocked_text(bad), 'Home is kept down: its disguise has values AmneziaWG cannot take. Jmin must not be larger than Jmax.', 'invalid values'); - eq(awg.blocked_text({ ...bad, obf: {} }), 'Home is kept down: its disguise has values AmneziaWG cannot take.', 'fixed since'); - eq(awg.blocked_note(bad.blocked), 'is kept down: its disguise has values AmneziaWG cannot take', 'the log'); - eq(awg.blocked_fix(bad.blocked), 'Choose a disguise on the Server page: it replaces the values set by hand.', 'what to do about it'); - eq(awg.blocked_fix({ code: 'taken', ifname: 'wg0' }), 'Choose another interface name in the server settings.', 'what to do about a name'); -}); - -test('netifd_options: the server keeps its defence against handshake floods', () => { - let m = core.load(); - let srv = m.servers.main; - srv.obf = awg.obf_preset('max'); - let o = awg.netifd_options(srv); - ok('awg_disable_cookies' in o, 'named, so netifd.sync takes it off an interface that had it'); - eq(o.awg_disable_cookies, null, 'no DisableCookies on the server'); - eq([ o.awg_header_protection_key, o.awg_jc, o.awg_i1, o.awg_random_trailers ], [ srv.obf.header_protection_key, srv.obf.jc, srv.obf.i1, 'on' ], - 'the rest of the disguise stays'); - ok(index(split(awg.client_config(m, m.devices.alice_phone).conf, '\n'), 'DisableCookies = on') >= 0, 'devices keep it'); -}); - -test('client_config: one keep-alive for the .conf and the AmneziaVPN key', () => { - let m = core.load(); - let srv = m.servers.main, dev = m.devices.alice_phone; - let ka = () => { - let c = awg.client_config(m, dev); - return [ match(c.conf, /\nPersistentKeepalive = ([^\n]*)\n/)?.[1], c.amnezia.persistent_keep_alive ]; - }; - eq(ka(), [ '25', '25' ], 'a number without header protection'); - srv.obf = awg.obf_preset('max'); - eq(ka(), [ '25-35', '25-35' ], 'jittered with 3.1'); - srv.keepalive = 0; - eq(ka(), [ null, '0' ], 'off'); -}); - -test('status: the header protection key stays out of what read-only users get', () => { - eq(awg.obf_public({ jc: '4', header_protection_key: HPK }), { jc: '4' }, 'obf_public'); - eq(awg.obf_public(null), {}, 'no values'); - // Server main on Maximum, as a uci change not committed (the fixture file stays as it is). - let c = cursor(); - c.load('dawnline'); - let o = awg.obf_preset('max'); - for (let k, v in o) - c.set('dawnline', 'main', k, v); - c.save('dawnline'); - let out = rpc_status.methods.status.call({ args: { days: 30 } }); - c.revert('dawnline'); - eq(out.error, null, 'status answers'); - let srv = filter(out.servers ?? [], (x) => x.id == 'main')[0]; - eq([ srv?.hpk, srv?.obf?.header_protection_key, srv?.obf?.disable_cookies ], [ true, null, 'on' ], 'whether there is a key, not which'); - let text = sprintf('%J', out); - ok(index(text, o.header_protection_key) < 0, 'the key is nowhere in the answer'); - let found = uniq(map(match(text, /[A-Za-z0-9+\/]{43}=/g) ?? [], (x) => x[0])); - eq(found, [ srv.public_key ], 'no key but the server\'s public one'); -}); - -test('client_config: an IPv6 endpoint in brackets, without a regex', () => { - let m = core.load(); - let srv = m.servers.main, dev = m.devices.alice_phone; - let ep = (h) => { - srv.endpoint = h; - return match(awg.client_config(m, dev).conf, /\nEndpoint = ([^\n]*)\n/)?.[1]; - }; - eq(ep('vpn.example.com'), 'vpn.example.com:51820', 'a name'); - eq(ep('203.0.113.7'), '203.0.113.7:51820', 'IPv4'); - eq(ep('2001:db8::1'), '[2001:db8::1]:51820', 'IPv6'); - eq(ep('[2001:db8::1]'), '[2001:db8::1]:51820', 'IPv6 in brackets already'); - eq(ep(''), 'vpn.example.com:51820', 'the portal name when the server has none'); - // The regexes it stands for, on hosts changed at each character. - for (let h in [ '2001:db8::1', '[::1]', 'a.b' ]) - for (let i = 0; i <= length(h); i++) - for (let c in [ ':', '[', ']', 'a', '' ]) { - let s = `${substr(h, 0, i)}${c}${substr(h, i + 1)}`; - let want = match(s, /:/) && !match(s, /^\[/) ? `[${s}]` : s; - eq(ep(s), `${want || 'vpn.example.com'}:51820`, s); - } -}); - -test('config_fingerprint leaves out the private key and the junk', () => { - let m = core.load(); - let dev = m.devices.alice_phone; - let f = awg.config_fingerprint(m, dev); - ok(match(f, /^[0-9a-f]{8}$/), 'eight hex digits'); - dev.private_key = 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='; - eq(awg.config_fingerprint(m, dev), f, 'a private key'); - m.servers.main.obf.jc = '7'; - eq(awg.config_fingerprint(m, dev), f, 'another junk count'); - m.servers.main.port = 51821; - ok(awg.config_fingerprint(m, dev) != f, 'another port'); - eq(awg.config_fingerprint(m, null), null, 'no device'); -}); - -/* ---------- a device's local network, MTU and keep-alive ---------- */ - -// Exactly the complement: aligned prefixes, none overlapping another or a -// private range, and all of them together the whole address space. -test('BYPASS4: every IPv4 address outside the private ranges, once', () => { - let nets = [ ...map(awg.BYPASS4, (n) => [ n, false ]), ...map(nft.PRIVATE4, (n) => [ n, true ]) ]; - let total = 0; - for (let i = 0; i < length(nets); i++) { - let a = cidr_any(nets[i][0]); - ok(a && a.ip == a.net, `${nets[i][0]}: a prefix`); - total += a.size; - for (let j = i + 1; j < length(nets); j++) { - let b = cidr_any(nets[j][0]); - ok(a.net + a.size <= b.net || b.net + b.size <= a.net, `${nets[i][0]} and ${nets[j][0]} apart`); - } - } - eq(total, 4294967296, 'together: every address'); -}); - -test('BYPASS6: every IPv6 address outside fc00::/7, fe80::/10 and ff00::/8, once', () => { - // Each of them is /16 or wider: the first 16 bits decide. - let span = (n) => { - let p = split(n, '/'), len = +p[1]; - ok(len >= 1 && len <= 16 && substr(p[0], -2) == '::', `${n}: a prefix of the first 16 bits`); - let g = substr(p[0], 0, length(p[0]) - 2); - let start = g == '' ? 0 : hex(g), size = 1 << (16 - len); - ok(start % size == 0, `${n}: aligned`); - return [ start, size ]; - }; - let nets = map([ ...awg.BYPASS6, 'fc00::/7', 'fe80::/10', 'ff00::/8' ], span); - let total = 0; - for (let i = 0; i < length(nets); i++) { - total += nets[i][1]; - for (let j = i + 1; j < length(nets); j++) - ok(nets[i][0] + nets[i][1] <= nets[j][0] || nets[j][0] + nets[j][1] <= nets[i][0], `${i} and ${j} apart`); - } - eq(total, 65536, 'together: every address'); -}); - -test('allowed_ips: the local network outside the tunnel', () => { - let m = core.load(); - let srv = m.servers.main; - // No home network from the container's own interfaces. - srv.auto_lan = false; - srv.lan_devices = []; - let alice = m.people.alice, bob = m.people.bob; - eq(awg.allowed_ips(m, srv, bob), [ '0.0.0.0/0', '::/0' ], 'no device: everything'); - eq(awg.allowed_ips(m, srv, bob, { lan_bypass: false }), [ '0.0.0.0/0', '::/0' ], 'as before'); - let dns = (list) => [ ...slice(list, 0, 2), '10.9.0.1/32', ...slice(list, 2) ]; - eq(awg.allowed_ips(m, srv, bob, { lan_bypass: true }), [ ...dns(awg.BYPASS4), ...awg.BYPASS6 ], 'internet: the rest, and its DNS'); - eq(awg.allowed_ips(m, srv, alice, { lan_bypass: true }), [ ...slice(awg.BYPASS4, 0, 2), '10.9.0.0/29', ...slice(awg.BYPASS4, 2), ...awg.BYPASS6 ], - 'home too: the tunnel network with the other devices (the DNS is in it)'); - srv.mesh = 'off'; - srv.device_mesh = false; - eq(awg.allowed_ips(m, srv, alice, { lan_bypass: true }), [ ...dns(awg.BYPASS4), ...awg.BYPASS6 ], 'no mesh: the router'); - srv.dns = [ '192.168.1.1', '192.168.1.53', 'fd00::53', '2001:4860:4860::8888', 'fe80::1' ]; - let all = awg.allowed_ips(m, srv, bob, { lan_bypass: true }); - ok(index(all, '192.168.1.1/32') >= 0 && index(all, '192.168.1.53/32') >= 0, 'every private IPv4 DNS server stays in the tunnel, not only the first'); - eq(slice(all, length(all) - length(awg.BYPASS6) - 2), [ ...awg.BYPASS6, 'fd00::53/128', 'fe80::1/128' ], - 'a private IPv6 one too; a public IPv6 one is in the rest already'); - eq(length(all), length(awg.BYPASS4) + 2 + length(awg.BYPASS6) + 2, 'nothing else'); - srv.dns = [ '1.1.1.1' ]; - eq(awg.allowed_ips(m, srv, bob, { lan_bypass: true }), [ ...awg.BYPASS4, ...awg.BYPASS6 ], 'a public DNS is in the rest already'); - alice.access = 'lan'; - alice.dns_mode = 'home'; - let lan = awg.allowed_ips(m, srv, alice, { lan_bypass: true }); - eq(lan, awg.allowed_ips(m, srv, alice), 'Home only: the same either way'); - let c = awg.client_config(m, { ...m.devices.alice_phone, person: 'bob', lan_bypass: true }); - eq(c.amnezia.allowed_ips, [ ...awg.BYPASS4, ...awg.BYPASS6 ], 'in the AmneziaVPN key'); - ok(index(c.conf, `AllowedIPs = ${join(', ', [ ...awg.BYPASS4, ...awg.BYPASS6 ])}\n`) >= 0, 'in the .conf'); -}); - -test('keepalive_range and idle_handshake', () => { - let srv = { keepalive: 25, obf: {} }; - eq(awg.keepalive_range(srv, {}), [ 25, 25 ], 'the server\'s, no range'); - eq(awg.keepalive_range(srv, { keepalive: 120 }), [ 120, 120 ], 'the device\'s own'); - eq(awg.keepalive_range(srv, { keepalive: 0 }), null, 'off for the device'); - eq(awg.keepalive_range({ keepalive: 0, obf: {} }, {}), null, 'off on the server'); - let max = { keepalive: 25, obf: awg.obf_preset('max') }; - eq(awg.keepalive_range(max, {}), [ 25, 35 ], 'jittered with 3.1'); - eq(awg.keepalive_range(max, { keepalive: 60 }), [ 60, 70 ], 'the device\'s own, jittered'); - // The first keep-alive after the rekey time (120 s; RekeyAfterTime's upper end) starts a handshake. - eq(awg.idle_handshake(srv, {}), 145, 'within the rekey time: up to one keep-alive past it'); - eq(awg.idle_handshake(max, {}), 155, 'Maximum: RekeyAfterTime 100-120, keep-alive up to 35'); - eq(awg.idle_handshake(srv, { keepalive: 100 }), 220, 'every second keep-alive'); - eq(awg.idle_handshake(srv, { keepalive: 300 }), 300, 'every keep-alive once they are further apart'); - eq(awg.idle_handshake({ keepalive: 25, obf: { rekey_after_time: '200-400' } }, {}), 205, 'past 180 s the key is refused anyway'); - eq(awg.idle_handshake(srv, { keepalive: 0 }), null, 'no keep-alive: none'); -}); - -test('client_config: the device\'s own MTU and keep-alive', () => { - let m = core.load(); - let dev = m.devices.alice_phone; - let line = (c, k) => match(c.conf, regexp(`\n${k} = ([^\n]*)\n`))?.[1]; - let c = awg.client_config(m, dev); - eq([ line(c, 'MTU'), line(c, 'PersistentKeepalive'), c.amnezia.mtu ], [ '1280', '25', '1280' ], 'the server\'s (a phone)'); - let fp = awg.config_fingerprint(m, dev); - let old = { ...dev }; - delete old.mtu; - delete old.keepalive; - delete old.lan_bypass; - eq(awg.config_fingerprint(m, old), fp, 'a device without values of its own keeps its fingerprint (as before the options)'); - dev.mtu = 1420; - dev.keepalive = 0; - c = awg.client_config(m, dev); - eq([ line(c, 'MTU'), line(c, 'PersistentKeepalive'), c.amnezia.mtu, c.amnezia.persistent_keep_alive ], [ '1420', null, '1420', '0' ], - 'its own; keep-alive off'); - ok(awg.config_fingerprint(m, dev) != fp, 'a change asks it to import again'); - m.servers.main.obf = awg.obf_preset('max'); - dev.keepalive = 120; - c = awg.client_config(m, dev); - eq([ line(c, 'PersistentKeepalive'), c.amnezia.persistent_keep_alive ], [ '120-130', '120-130' ], 'jittered with 3.1'); -}); diff --git a/tests/ucode/awg_builds.test.uc b/tests/ucode/awg_builds.test.uc deleted file mode 100644 index 4da2e5d..0000000 --- a/tests/ucode/awg_builds.test.uc +++ /dev/null @@ -1,59 +0,0 @@ -// dawnline.awg_builds: the AmneziaWG generation of package and kernel module -// versions, whether an installed update waits for a reboot (its old module -// stayed loaded) and the generation that really runs meanwhile, which is -// what caps() reports. -import * as builds from 'dawnline.awg_builds'; -import * as awg from 'dawnline.awg'; - -// The live router's module (3.1) after an update from a 2.0 one that could not be swapped. -const KMOD_31 = '6.12.94.3.1.20260906-r1'; -const WAITING = { reloaded: false, boot: 'boot-1', prev_gen: '2.0', prev_core: 98304 }; - -test('gen of package versions', () => { - eq(builds.gen(null), null, 'not installed'); - eq(builds.gen('3.1.20260812-r1'), '3.1', 'amneziawg-tools 3.1'); - eq(builds.gen('3.1.0-r1'), '3.1', 'luci-proto-amneziawg 3.1'); - eq(builds.gen('1.0.20250722-r1'), '2.0', 'July 2025 on: 2.0'); - eq(builds.gen('1.0.20250901'), '2.0', 'no release suffix'); - eq(builds.gen('1.0.20250610-r1'), '1.0', 'before July 2025'); - eq(builds.gen('1.0.20241112-r2'), '1.0', '2024'); -}); - -test('gen of kernel module versions', () => { - eq(builds.gen(KMOD_31), '3.1', 'kernel release in front'); - eq(builds.gen('6.12.94.3.1.20260906'), '3.1', 'no release suffix'); - eq(builds.gen('6.6.73.1.0.20250722-r1'), '2.0', '2.0 module'); - eq(builds.gen('6.6.73.1.0.20250612-r1'), '1.0', 'first generation module'); - eq(builds.gen('5.15.150.1.0.20240711-r3'), '1.0', '2024 module on an older kernel'); - eq(builds.gen('3.1.20260812'), '3.1', 'the version.h string of a 3.1 module'); -}); - -test('pending: an update waits for a reboot', () => { - ok(builds.pending(WAITING, 'boot-1', 98304), 'the old module still loaded, same boot'); - ok(!builds.pending(WAITING, 'boot-2', 98304), 'rebooted'); - ok(!builds.pending(WAITING, 'boot-1', null), 'no module loaded: the next one is the new one'); - ok(!builds.pending(WAITING, 'boot-1', 110592), 'another module loaded (reloaded by hand)'); - ok(!builds.pending({ ...WAITING, reloaded: true }, 'boot-1', 98304), 'the install swapped it'); - ok(!builds.pending({ ...WAITING, reloaded: null }, 'boot-1', 98304), 'a record of a module Dawnline did not install'); - ok(!builds.pending({ osrelease: '6.12.94', source: 'slava', tag: 'v25.12.5', installed: 1 }, 'boot-1', 98304), - 'a record from before boots were kept'); - ok(!builds.pending({ ...WAITING, boot: null }, null, 98304), 'the kernel gave no boot id'); - ok(!builds.pending(null, 'boot-1', 98304), 'no record'); -}); - -test('caps: the generation that runs while a reboot is pending', () => { - eq(builds.running_gen(WAITING, 'boot-1', 98304, KMOD_31), '2.0', 'the 2.0 module runs, not the 3.1 package'); - eq(builds.running_gen(WAITING, 'boot-2', 98304, KMOD_31), '3.1', 'after the reboot: the package'); - eq(builds.running_gen(WAITING, 'boot-1', null, KMOD_31), '3.1', 'nothing loaded: the package loads'); - eq(builds.running_gen(null, 'boot-1', 98304, KMOD_31), '3.1', 'no record: the package'); - eq(builds.running_gen({ ...WAITING, prev_gen: null }, 'boot-1', 98304, KMOD_31), null, - 'a module installed by hand before: unknown, the tools are believed'); - eq(builds.running_gen(null, null, null, null), null, 'nothing installed'); -}); - -test('caps in a container without AmneziaWG', () => { - let c = awg.caps(); - eq(c.kmod, null, 'no module package'); - eq(c.pending, false, 'nothing waits for a reboot'); - eq(builds.module_core(), null, 'no module loaded'); -}); diff --git a/tests/ucode/core.test.uc b/tests/ucode/core.test.uc deleted file mode 100644 index a7fdc6c..0000000 --- a/tests/ucode/core.test.uc +++ /dev/null @@ -1,284 +0,0 @@ -// dawnline.core: the model read from the fixture config (real libuci), access -// hours, quotas and the derived person state at an explicit time, address -// allocation, the automatic MTU, a device's own MTU, keep-alive and local -// network, and other packages' port forwards. -import { readfile, writefile, unlink } from 'fs'; -import * as core from 'dawnline.core'; - -// A local time that no time zone turns into another day. -function at(y, mo, d, h, mi) { - return timelocal({ year: y, mon: mo, mday: d, hour: h, min: mi, sec: 0 }); -} - -let m = core.load(); - -test('load reads the fixture', () => { - eq(keys(m.servers), [ 'main' ], 'servers'); - eq(sort(keys(m.people)), [ 'alice', 'bob' ], 'people'); - eq(m.servers.main.subnet, '10.9.0.0/29', 'subnet'); - eq(m.servers.main.mtu, 1380, 'stored MTU'); - eq(m.servers.main.obf, { jc: '4', jmin: '64', jmax: '128', s4: '12' }, 'disguise values as strings'); - eq(m.servers.main.mesh, 'all', 'mesh default'); - eq(m.people.alice.devices, [ 'alice_phone' ], 'devices attached to their person'); - eq(m.people.alice.access, 'both', 'access'); - eq(m.people.bob.access, 'internet', 'access default'); - eq(m.people.bob.quota_gb, 2, 'quota as a number'); - eq(m.people.bob.device_limit, 3, 'device limit from the settings default'); - eq(m.devices.alice_phone.kind, 'phone', 'kind'); - eq(m.settings.portal_enabled, true, 'bool setting'); - eq(m.settings.updates.interval, '7d', 'update policy from the same section'); - eq(m.settings.updates.targets, [ 'app' ], 'update targets list'); - eq(m.settings.retention.log_connections, '0', 'raw retention values'); - let d = m.devices.alice_phone; - eq([ d.mtu, d.keepalive, d.lan_bypass ], [ 0, null, false ], 'a device without link values of its own'); -}); - -test('parse_hours', () => { - eq(core.parse_hours('07:00-23:00'), [ 420, 1380 ], 'day window'); - eq(core.parse_hours('23:00-07:00'), [ 1380, 420 ], 'overnight window'); - eq(core.parse_hours('7:00-23:00'), [ 420, 1380 ], 'one-digit hour'); - eq(core.parse_hours('00:00-24:00'), [ 0, 1440 ], 'whole day'); - eq(core.parse_hours('24:00-01:00'), null, 'start at 24:00'); - eq(core.parse_hours('10:00-10:00'), null, 'empty window'); - eq(core.parse_hours('always'), null, 'words'); - eq(core.parse_hours(''), null, 'empty'); - eq(core.parse_hours(null), null, 'null'); -}); - -test('person_quota', () => { - let march = at(2026, 3, 10, 12, 0); - eq(core.person_quota({ quota_gb: 0 }, march), 0, 'unlimited'); - eq(core.person_quota({ quota_gb: 2 }, march), 2147483648, '2 GiB'); - eq(core.person_quota({ quota_gb: 2, bonus_gb: 1, bonus_month: '2026-03' }, march), 3221225472, 'bonus this month'); - eq(core.person_quota({ quota_gb: 2, bonus_gb: 1, bonus_month: '2026-02' }, march), 2147483648, 'bonus of another month'); - eq(core.person_quota({ quota_gb: -1 }, march), 0, 'negative is unlimited'); -}); - -test('person_usage', () => { - let march = at(2026, 3, 10, 12, 0); - let usage = { people: { bob: { total: [ 100, 50 ], months: { '2026-03': [ 10, 5 ], '2026-02': [ 1000, 1000 ] } } } }; - eq(core.person_usage({ id: 'bob', quota_period: 'month' }, usage, march), 15, 'this month'); - eq(core.person_usage({ id: 'bob', quota_period: 'month' }, usage, at(2026, 4, 1, 0, 0)), 0, 'a month without traffic'); - eq(core.person_usage({ id: 'bob', quota_period: 'total' }, usage, march), 150, 'total'); - eq(core.person_usage({ id: 'nobody', quota_period: 'month' }, usage, march), 0, 'unknown person'); - eq(core.person_usage({ id: 'bob' }, null, march), 0, 'no usage data'); -}); - -test('own_state', () => { - let base = { id: 'p', paused: false, expires: '', expire_action: 'pause', quota_gb: 0, hours: '' }; - let noon = at(2026, 3, 10, 12, 0); - eq(core.own_state(m, base, null, noon), 'active', 'nothing set'); - eq(core.own_state(m, { ...base, paused: true }, null, noon), 'paused', 'paused'); - eq(core.own_state(m, { ...base, expires: '2026-03-09' }, null, noon), 'expired', 'expired yesterday'); - eq(core.own_state(m, { ...base, expires: '2026-03-10' }, null, noon), 'active', 'expires at the end of today'); - eq(core.own_state(m, { ...base, expires: '2026-03-09', expire_action: 'notify' }, null, noon), 'active', 'notify keeps access'); - let usage = { people: { p: { months: { '2026-03': [ 600000000, 600000000 ] } } } }; - eq(core.own_state(m, { ...base, quota_gb: 1 }, usage, noon), 'quota', 'over quota'); - eq(core.own_state(m, { ...base, quota_gb: 1, bonus_gb: 1, bonus_month: '2026-03' }, usage, noon), 'active', 'bonus lifts the quota'); - eq(core.own_state(m, { ...base, quota_gb: 1 }, usage, at(2026, 4, 1, 0, 0)), 'active', 'a new month resets the usage'); - eq(core.own_state(m, { ...base, hours: '09:00-17:00' }, null, noon), 'active', 'inside the hours'); - eq(core.own_state(m, { ...base, hours: '09:00-17:00' }, null, at(2026, 3, 10, 20, 0)), 'hours', 'outside the hours'); - eq(core.own_state(m, { ...base, hours: '22:00-06:00' }, null, at(2026, 3, 10, 23, 0)), 'active', 'overnight, before midnight'); - eq(core.own_state(m, { ...base, hours: '22:00-06:00' }, null, at(2026, 3, 10, 5, 59)), 'active', 'overnight, after midnight'); - eq(core.own_state(m, { ...base, hours: '22:00-06:00' }, null, noon), 'hours', 'overnight, daytime'); - eq(core.own_state(m, { ...base, paused: true, expires: '2000-01-01' }, null, noon), 'paused', 'paused wins over expired'); - eq(core.own_state(m, { ...base, expires: '2000-01-01', quota_gb: 1 }, usage, noon), 'expired', 'expired wins over quota'); -}); - -test('person_state', () => { - let noon = at(2026, 3, 10, 12, 0); - let p = { id: 'p', server: 'main', paused: false, expires: '', expire_action: 'pause', quota_gb: 0, hours: '' }; - eq(core.person_state(m, p, null, noon), 'active', 'server on'); - eq(core.person_state(m, { ...p, server: 'gone' }, null, noon), 'no_server', 'no server'); - let off = { servers: { main: { ...m.servers.main, enabled: false } } }; - eq(core.person_state(off, p, null, noon), 'server_off', 'server off'); - eq(core.person_state(off, { ...p, paused: true }, null, noon), 'server_off', 'server off is about the server'); - ok(core.person_expired({ expires: '2000-01-01' }, noon), 'person_expired'); - ok(!core.person_expired({ expires: '' }, noon), 'no end date'); - ok(!core.person_expired({ expires: 'garbage' }, noon), 'bad date is not expired'); -}); - -test('alloc_address', () => { - let srv = { id: 'main', subnet: '10.9.0.0/29' }; - let other = { id: 'other', subnet: '10.9.1.0/29' }; - let model = (addrs) => { - let mm = { servers: { main: srv, other }, people: { a: { server: 'main' }, o: { server: 'other' } }, devices: {} }; - for (let i, a in addrs) - mm.devices[`d${i}`] = { person: 'a', address: a }; - return mm; - }; - eq(core.alloc_address(model([]), srv), '10.9.0.2', 'router has the first host'); - eq(core.alloc_address(model([ '10.9.0.2', '10.9.0.3' ]), srv), '10.9.0.4', 'next free'); - eq(core.alloc_address(model([ '10.9.0.2', '10.9.0.4' ]), srv), '10.9.0.3', 'lowest gap'); - eq(core.alloc_address(model([ '10.9.0.2', '10.9.0.3', '10.9.0.4', '10.9.0.5', '10.9.0.6' ]), srv), null, 'exhausted (.7 is broadcast)'); - eq(core.alloc_address(model([ '10.9.0.2', 'garbage' ]), srv), '10.9.0.3', 'a broken address is ignored'); - let mm = model([]); - mm.devices.x = { person: 'o', address: '10.9.0.2' }; - eq(core.alloc_address(mm, srv), '10.9.0.2', 'another server\'s devices do not count'); - eq(core.alloc_address(model([]), { id: 'main', subnet: 'nonsense' }), null, 'no subnet'); - eq(core.server_address(srv), '10.9.0.1', 'server_address'); - eq(core.tunnels({ ...srv, ifname: 'awgmain', private_key: 'k' }), [ { ifname: 'awgmain', subnet: '10.9.0.0/29', address: '10.9.0.1' } ], 'tunnels'); - eq(core.tunnels({ ...srv, ifname: 'awgmain' }), [], 'no key, no tunnel'); - eq(core.tunnels({ ...srv, ifname: 'awgmain', private_key: 'k', blocked: 'taken' }), [], 'blocked interface'); - eq(core.tunnels({ ...srv, ifname: 'awg-main', private_key: 'k' }), [], 'bad interface name'); -}); - -test('tunnel_mtu / device_mtu', () => { - eq(core.tunnel_mtu({ mtu: 1420 }), 1420, 'set by hand'); - eq(core.tunnel_mtu({ mtu: 0, obf: {} }), 1380, 'automatic'); - eq(core.tunnel_mtu({ mtu: 0 }), 1380, 'automatic without disguise'); - eq(core.tunnel_mtu({ mtu: 0, obf: { s4: '12' } }), 1368, 'S4 taken off'); - eq(core.tunnel_mtu({ mtu: 0, obf: { s4: '100' } }), 1280, 'never below 1280'); - eq(core.device_mtu({ mtu: 0, obf: {} }, { kind: 'phone' }), 1280, 'phone'); - eq(core.device_mtu({ mtu: 0, obf: {} }, { kind: 'computer' }), 1380, 'computer'); - eq(core.device_mtu({ mtu: 1200 }, { kind: 'tablet' }), 1200, 'a smaller tunnel MTU stays'); - eq(core.device_mtu({ mtu: 0, obf: {} }, { kind: 'phone', mtu: 1420 }), 1420, 'the device\'s own, also above 1280 on a phone'); - eq(core.device_mtu({ mtu: 1420 }, { kind: 'computer', mtu: 1280 }), 1280, 'the device\'s own below the tunnel\'s'); - eq(core.device_mtu({ mtu: 0, obf: {} }, { kind: 'computer', mtu: 9000 }), 1380, 'out of range (a hand edit): the automatic one'); - eq(core.device_mtu({ mtu: 0, obf: {} }, { kind: 'phone', mtu: 0 }), 1280, '0: as before'); -}); - -test('device_keepalive', () => { - let srv = { keepalive: 25 }; - eq(core.device_keepalive(srv, { keepalive: null }), 25, 'the server\'s'); - eq(core.device_keepalive(srv, {}), 25, 'none read'); - eq(core.device_keepalive(srv, { keepalive: 0 }), 0, 'off for this device'); - eq(core.device_keepalive(srv, { keepalive: 120 }), 120, 'its own'); - eq(core.device_keepalive(srv, { keepalive: 700 }), 25, 'out of range: the server\'s'); - eq(core.device_keepalive({ keepalive: 0 }, { keepalive: 15 }), 15, 'its own on a server without keep-alive'); -}); - -/** A uci cursor that records what is written: { 'section.option': value or null (deleted) }. */ -function recorder() { - let w = {}; - return { w, c: { set: (cfg, s, k, v) => { w[`${s}.${k}`] = v; }, delete: (cfg, s, k) => { w[`${s}.${k}`] = null; } } }; -} - -test('set_device_kind', () => { - let mm = { devices: { d: { id: 'd', kind: 'phone' } } }; - let r = recorder(); - eq(core.set_device_kind(r.c, mm, 'd', 'tablet'), true, 'changed'); - eq([ r.w, mm.devices.d.kind ], [ { 'd.kind': 'tablet' }, 'tablet' ], 'written, and the model follows'); - r = recorder(); - eq(core.set_device_kind(r.c, mm, 'd', 'tablet'), false, 'the same kind changes nothing'); - eq(r.w, {}, 'nothing written'); - throws(() => core.set_device_kind(r.c, mm, 'd', 'toaster'), /^Unknown device type\.$/, 'not a kind'); - throws(() => core.set_device_kind(r.c, mm, 'x', 'phone'), /^Unknown device\.$/, 'unknown device'); -}); - -test('set_device_link', () => { - let mm = { devices: { d: { id: 'd', mtu: 0, keepalive: null, lan_bypass: false } } }; - let r = recorder(); - eq(core.set_device_link(r.c, mm, 'd', { mtu: '1400', keepalive: '0', lan_bypass: true }), [ 'mtu', 'keepalive', 'lan_bypass' ], 'what changed'); - eq(r.w, { 'd.mtu': '1400', 'd.keepalive': '0', 'd.lan_bypass': '1' }, 'written'); - r = recorder(); - mm.devices.d = { id: 'd', mtu: 1400, keepalive: 0, lan_bypass: true }; - eq(core.set_device_link(r.c, mm, 'd', { mtu: '', keepalive: '', lan_bypass: false }), [ 'mtu', 'keepalive', 'lan_bypass' ], 'back'); - eq(r.w, { 'd.mtu': null, 'd.keepalive': null, 'd.lan_bypass': null }, 'removed: the server\'s again'); - r = recorder(); - eq(core.set_device_link(r.c, mm, 'd', { mtu: '1400', keepalive: ' 0 ' }), [], 'the same values change nothing'); - eq(r.w, {}, 'nothing written'); - eq(core.set_device_link(r.c, mm, 'd', {}), [], 'nothing asked'); - throws(() => core.set_device_link(r.c, mm, 'd', { mtu: '1279' }), /^MTU must be 1280-1500\.$/, 'MTU too small'); - throws(() => core.set_device_link(r.c, mm, 'd', { mtu: '1501' }), /^MTU must be 1280-1500\.$/, 'MTU too large'); - throws(() => core.set_device_link(r.c, mm, 'd', { mtu: '1400.5' }), /^MTU/, 'not a whole number'); - throws(() => core.set_device_link(r.c, mm, 'd', { keepalive: '601' }), /^Keep-alive must be 0-600 seconds\.$/, 'keep-alive too long'); - throws(() => core.set_device_link(r.c, mm, 'd', { keepalive: '-1' }), /^Keep-alive/, 'negative'); - throws(() => core.set_device_link(r.c, mm, 'x', { mtu: '' }), /^Unknown device\.$/, 'unknown device'); -}); - -test('create_device: the local network outside the tunnel', () => { - let mm = core.load(); - let r = recorder(); - let keys = { public_key: 'a8Z2wq0b8rQx3mN6kYyQ2G3bQm2kq5tY5m7Q0yq3m3c=', preshared_key: '' }; - let id = core.create_device(r.c, mm, 'bob', 'Laptop', 'computer', { keys, lan_bypass: true }); - eq([ r.w[`${id}.lan_bypass`], mm.devices[id].lan_bypass, mm.devices[id].mtu, mm.devices[id].keepalive ], [ '1', true, 0, null ], 'set'); - r = recorder(); - id = core.create_device(r.c, mm, 'bob', 'Tablet', 'tablet', { keys: { ...keys, public_key: 'b8Z2wq0b8rQx3mN6kYyQ2G3bQm2kq5tY5m7Q0yq3m3c=' } }); - ok(!(`${id}.lan_bypass` in r.w) && !mm.devices[id].lan_bypass, 'off unless asked'); -}); - -test('create_device: not with the server\'s own key', () => { - let mm = core.load(); - let keys = { public_key: mm.servers.main.public_key, preshared_key: '' }; - throws(() => core.create_device(recorder().c, mm, 'bob', 'Laptop', 'computer', { keys }), /^This key is already in use\.$/, - 'it is in every configuration of the server'); - mm.devices.alice_phone.public_key = mm.servers.main.public_key; - eq(core.model_errors(mm), [ "Device Phone of Alice: the public key is the server's own." ], 'one set by hand is named'); -}); - -test('model_errors: a device\'s own MTU and keep-alive', () => { - let mm = core.load(); - eq(core.model_errors(mm), [], 'the fixture is consistent'); - let d = mm.devices.alice_phone; - d.mtu = 1400; - d.keepalive = 0; - eq(core.model_errors(mm), [], 'values of its own in range'); - d.mtu = 9000; - d.keepalive = 601; - eq(core.model_errors(mm), [ - 'Device Phone of Alice: MTU 9000 is not between 1280 and 1500.', - 'Device Phone of Alice: keep-alive 601 is not between 0 and 600 seconds.', - ], 'named'); -}); - -test('names and codes', () => { - ok(core.valid_ifname('awgmain') && core.valid_ifname('a') && core.valid_ifname('awg_1'), 'interface names'); - ok(!core.valid_ifname('Awg') && !core.valid_ifname('1awg') && !core.valid_ifname('awg-main') && !core.valid_ifname('awgmain123456'), 'bad interface names'); - for (let i = 0; i < 20; i++) - ok(match(core.new_code(), core.WORD_CODE), 'new_code is a word code'); -}); - -test('renumber_server', () => { - let srv = { id: 'main', name: 'Main', subnet: '10.9.0.0/29' }; - let mm = { - servers: { main: srv, other: { id: 'other', subnet: '10.9.1.0/29' } }, - people: { a: { server: 'main', devices: [ 'a1', 'a2' ] }, o: { server: 'other', devices: [ 'o1' ] } }, - devices: { a1: { person: 'a', address: '10.9.0.5' }, a2: { person: 'a', address: '10.9.0.3' }, o1: { person: 'o', address: '10.9.1.2' } }, - }; - let set = {}; - let c = { set: (cfg, s, k, v) => { set[`${s}.${k}`] = v; }, delete: () => {} }; - core.renumber_server(c, mm, srv, '10.77.0.0/24'); - eq(srv.subnet, '10.77.0.0/24', 'the server moves'); - eq([ mm.devices.a1.address, mm.devices.a2.address ], [ '10.77.0.2', '10.77.0.3' ], 'devices renumbered lowest first'); - eq(mm.devices.o1.address, '10.9.1.2', 'another server untouched'); - eq(set, { 'a1.address': '10.77.0.2', 'a2.address': '10.77.0.3', 'main.subnet': '10.77.0.0/24' }, 'written to uci'); - let err = null; - try { core.renumber_server(c, mm, srv, '10.9.2.0/30'); } catch (e) { err = e; } - ok(err != null, 'refuses a subnet too small for the devices'); -}); - -test('device_labels', () => { - let mm = { devices: { - a: { id: 'a', name: 'iPhone', created: 1 }, b: { id: 'b', name: 'iPhone!', created: 2 }, - c: { id: 'c', name: 'Телефон', created: 3 }, d: { id: 'd', name: 'телефон', created: 4 }, - } }; - let p = { id: 'p', devices: [ 'd', 'c', 'b', 'a' ] }; - eq(core.device_labels(mm, p), { a: 'iphone', b: 'iphone-2', c: 'telefon', d: 'telefon-2' }, 'unique by age'); -}); - -test('wan_forwards leaves out Dawnline\'s own, without a regex', () => { - // A firewall config for this case only (the container's own is put back). - let path = '/etc/config/firewall', saved = readfile(path); - let names = [ 'dawnline_portal', 'dawnline_', 'dawnline', 'Dawnline_x', 'xdawnline_y', 'dawnlinex_1', 'web' ]; - let conf = ''; - for (let i = 0; i < length(names); i++) - conf += sprintf("config redirect '%s'\n\toption src 'wan'\n\toption proto 'udp'\n\toption src_dport '%d'\n\n", names[i], 6000 + i); - writefile(path, conf); - let got = null, err = null; - try { - got = core.wan_forwards('wan', 'udp'); - } - catch (e) { - err = e; - } - if (saved != null) - writefile(path, saved); - else - unlink(path); - if (err) - die(err.message); - // The names the pattern it stands for let through. - eq(map(got, (f) => f.name), filter(names, (n) => !match(n, /^dawnline_/)), 'names'); - eq(got[0], { from: 6002, to: 6002, name: 'dawnline' }, 'a forward'); -}); diff --git a/tests/ucode/devices.test.uc b/tests/ucode/devices.test.uc deleted file mode 100644 index 2aa7c2d..0000000 --- a/tests/ucode/devices.test.uc +++ /dev/null @@ -1,86 +0,0 @@ -// The admin's device methods (dawnline.rpc.people over dawnline.devices): what -// counts as handing a configuration out, and New keys as setting the device up -// again. The real calls on the fixture: the stand-in awg makes the keys, the -// sync's nft and awg steps fail harmlessly in the container. /etc/config/dawnline -// and the issued and reconnect marks are put back after. -import { readfile, writefile, unlink } from 'fs'; -import { DATA_DIR, RUN_DIR, ensure_dir } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as people from 'dawnline.rpc.people'; -import * as devices from 'dawnline.devices'; - -const CONFIG = '/etc/config/dawnline'; -const ISSUED = `${DATA_DIR}/issued.json`; -const RECONNECT = `${DATA_DIR}/reconnect.json`; -const EVENTS = `${RUN_DIR}/events.json`; - -// fn(), then the files as they were, whatever fn did. -function kept(paths, fn) { - let had = map(paths, (p) => readfile(p)); - let err = null; - try { - fn(); - } - catch (e) { - err = e; - } - for (let i = 0; i < length(paths); i++) - had[i] == null ? unlink(paths[i]) : writefile(paths[i], had[i]); - if (err) - die(err.message ?? `${err}`); -} - -function call(name, args) { - return people.methods[name].call({ args }); -} - -test('device_config: a look marks nothing, a delivery does', () => { - ensure_dir(DATA_DIR, 0o700); - kept([ ISSUED ], () => { - let old = sprintf('%J', { alice_phone: '00000000' }); - writefile(ISSUED, old); - ok(index(call('device_config', { id: 'alice_phone' }).conf ?? '', '[Peer]') >= 0, 'the configuration comes back'); - eq(readfile(ISSUED), old, 'without issue: issued.json left alone'); - call('device_config', { id: 'alice_phone', issue: false }); - eq(readfile(ISSUED), old, 'issue false: the same'); - call('device_config', { id: 'alice_phone', issue: true }); - let m = core.load(); - eq(awg.issued().alice_phone, awg.config_fingerprint(m, m.devices.alice_phone), 'issue: what it holds now counts as handed out'); - eq(call('device_config', { id: 'nobody', issue: true }).error, 'Unknown device.', 'an unknown device'); - }); -}); - -test('device_rotate: New keys set the device up again', () => { - kept([ CONFIG, ISSUED, RECONNECT ], () => { - unlink(RECONNECT); - let before = core.load().devices.alice_phone; - let t0 = time(); - let c = call('device_rotate', { id: 'alice_phone' }); - ok(c.error == null && index(c.conf ?? '', '[Peer]') >= 0, `the new configuration comes back (${c.error})`); - let m = core.load(); - ok(m.devices.alice_phone.preshared_key != before.preshared_key, 'new keys'); - let at = awg.reconnects().alice_phone; - ok(at >= t0 && at <= time(), `a reconnect mark at the rotation (${at})`); - eq(awg.handshake_since(t0 - 30, at), 0, "the old keys' last handshake no longer counts: Not set up yet, with Connect"); - eq(awg.issued().alice_phone, awg.config_fingerprint(m, m.devices.alice_phone), 'its new configuration is the one handed out'); - }); - eq(core.load().devices.alice_phone.private_key, '', 'the fixture is back'); -}); - -test('portal: Reconnect changes what it is and LAN Bypass with the keys; LAN Bypass alone keeps them', () => { - ensure_dir(RUN_DIR); - kept([ CONFIG, ISSUED, RECONNECT, EVENTS ], () => { - let mine = { by: 'portal', person: 'alice' }; - devices.reconnect('alice_phone', { ...mine, kind: 'tablet', lan_bypass: true }); - let d = core.load().devices.alice_phone; - eq([ d.kind, d.lan_bypass ], [ 'tablet', true ], 'changed in the same write as the keys'); - let keys = d.public_key; - devices.update('alice_phone', { lan_bypass: false }, mine); - d = core.load().devices.alice_phone; - eq([ d.lan_bypass, d.public_key ], [ false, keys ], 'LAN Bypass off, the keys as they were'); - throws(() => devices.update('alice_phone', { mtu: '1400' }, mine), /^Only the admin can change how a device connects\.$/, "the MTU stays the admin's"); - throws(() => devices.reconnect('alice_phone', { ...mine, kind: 'toaster' }), /^Unknown device type\.$/, 'not a kind'); - throws(() => devices.update('alice_phone', { lan_bypass: true }, { by: 'portal', person: 'bob' }), /^Device not found\.$/, "another person's device"); - }); -}); diff --git a/tests/ucode/fixtures/bin/awg b/tests/ucode/fixtures/bin/awg deleted file mode 100755 index 559fdee..0000000 --- a/tests/ucode/fixtures/bin/awg +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Stand-in for amneziawg-tools in the ucode tests (no kernel module in a -# container): `genkey` prints one fixed key, `pubkey` (a key on stdin) the -# fixture server's public key, its pair; `show dump` prints that -# interface's lines of the fixture a test has put at /tmp/dawnline-tests/awg-dump -# (written as `awg show all dump` prints them: the ifname first, left out here, -# as the tool does), fails as the tool does for an interface that is not there, -# and fails with the text of /tmp/dawnline-tests/awg-fail- when a test -# put one. Every call is appended to /tmp/dawnline-tests/awg-calls. Anything -# else fails. -T=/tmp/dawnline-tests -echo "$*" >> "$T/awg-calls" -case "$1 ${2:-} ${3:-}" in - 'genkey ') echo 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=' ;; - 'pubkey ') cat >/dev/null; echo 'xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=' ;; - 'show '*' dump') - if [ -e "$T/awg-fail-$2" ]; then - cat "$T/awg-fail-$2" >&2 - exit 1 - fi - out="$(awk -F '\t' -v i="$2" '$1 == i { sub(/^[^\t]*\t/, ""); print }' "$T/awg-dump" 2>/dev/null)" - if [ -z "$out" ]; then - echo 'Unable to access interface: No such device' >&2 - exit 1 - fi - printf '%s\n' "$out" - ;; - *) echo "awg stand-in: unsupported arguments: $*" >&2; exit 1 ;; -esac diff --git a/tests/ucode/fixtures/config/uhttpd b/tests/ucode/fixtures/config/uhttpd deleted file mode 100644 index 8df773a..0000000 --- a/tests/ucode/fixtures/config/uhttpd +++ /dev/null @@ -1,8 +0,0 @@ -# Test fixture: LuCI's web server as versions before 0.4 left it, with the -# portal as its error page (migrate.uhttpd removes that). - -config uhttpd 'main' - list listen_http '0.0.0.0:80' - list listen_https '0.0.0.0:443' - option home '/www' - option error_page '/cgi-bin/dawnline-portal' diff --git a/tests/ucode/fixtures/nft-table.txt b/tests/ucode/fixtures/nft-table.txt deleted file mode 100644 index 67bc890..0000000 --- a/tests/ucode/fixtures/nft-table.txt +++ /dev/null @@ -1,60 +0,0 @@ -table inet dawnline { - set home_home { type ipv4_addr; flags interval; auto-merge; elements = { 192.168.1.0/24 } } - set home_work { type ipv4_addr; flags interval; auto-merge; elements = { 192.168.1.0/24 } } - set tun_nets { type ipv4_addr; flags interval; auto-merge; elements = { 10.9.0.0/29, 10.9.1.0/29 } } - set lan_ok { type ipv4_addr; elements = { 10.9.0.2, 10.9.0.3, 10.9.1.3 } } - set lan_all { type ipv4_addr; elements = { 10.9.0.2, 10.9.0.3, 10.9.1.3 } } - set lan_part { type ipv4_addr . ipv4_addr; flags interval; } - set mesh_pairs { type ipv4_addr . ipv4_addr; } - set inet_ok { type ipv4_addr; elements = { 10.9.0.2, 10.9.1.2, 10.9.0.4, 10.9.0.5, 10.9.1.3 } } - set svc_ok { type ipv4_addr . ipv4_addr . inet_service; } - set svc_host { type ipv4_addr . ipv4_addr; } - set dns_real { type ipv4_addr; elements = { 10.9.0.3 } } - chain pre { - type filter hook prerouting priority -160; policy accept; - iifname { "awghome", "awgwork" } jump guard - } - chain guard { - meta nfproto ipv6 drop - ct state related accept - ct status dnat accept - icmp type { echo-request, echo-reply } fib daddr type local accept - fib daddr type local meta l4proto { tcp, udp } th dport 53 accept - fib daddr type local tcp dport { 8443 } accept - fib daddr type local ip saddr @lan_all accept - fib daddr type local ip saddr . ip daddr @lan_part accept - fib daddr type local counter drop - ip daddr 192.168.1.250 meta l4proto { tcp, udp } th dport 53 accept - iifname "awghome" ip daddr @home_home ip daddr != @tun_nets ip saddr @lan_all accept - iifname "awgwork" ip daddr @home_work ip daddr != @tun_nets ip saddr @lan_all accept - ip saddr . ip daddr @lan_part ip daddr != @tun_nets accept - iifname "awghome" ip saddr @lan_ok ip daddr @lan_ok accept - iifname "awgwork" ip saddr . ip daddr @mesh_pairs accept - meta l4proto { tcp, udp } ip saddr . ip daddr . th dport @svc_ok accept - ip saddr . ip daddr @svc_host accept - ip daddr { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 169.254.0.0/16, 224.0.0.0/3 } counter drop - ip saddr @inet_ok accept - counter drop - } - chain inbound { - type filter hook forward priority filter - 5; policy accept; - oifname { "awghome", "awgwork" } iifname != { "awghome", "awgwork" } ct state new jump to_device - } - chain to_device { - meta nfproto ipv6 drop - ct status dnat accept - oifname "awghome" ip saddr @home_home ip saddr != @tun_nets ip daddr @lan_all accept - oifname "awgwork" ip saddr @home_work ip saddr != @tun_nets ip daddr @lan_all accept - ip daddr . ip saddr @lan_part ip saddr != @tun_nets accept - counter reject with icmpx admin-prohibited - } - chain dns { - type nat hook prerouting priority dstnat - 5; policy accept; - iifname { "awghome", "awgwork" } ip saddr @dns_real meta l4proto { tcp, udp } th dport 53 dnat ip to 169.254.77.2:53 - } - chain dns_lan { - type nat hook prerouting priority dstnat + 5; policy accept; - iifname "awghome" ip daddr 10.9.0.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.1.250:53 - iifname "awgwork" ip daddr 10.9.1.1 meta l4proto { tcp, udp } th dport 53 dnat ip to 192.168.1.1:53 - } -} diff --git a/tests/ucode/geo.test.uc b/tests/ucode/geo.test.uc deleted file mode 100644 index e0d1eb7..0000000 --- a/tests/ucode/geo.test.uc +++ /dev/null @@ -1,52 +0,0 @@ -// dawnline.geo: which addresses need a lookup, how results go into the cache -// (bounded, never pushing out what is still shown) and the activity-log label. -import * as geo from 'dawnline.geo'; - -const NOW = 1790000000; -const PLACE = { lat: 45.04, lon: 38.98, city: 'Krasnodar', country: 'Russia', cc: 'RU', asn: 12389, org: 'Rostelecom' }; - -test('stale', () => { - let cache = { ips: { - '37.78.36.76': { ...PLACE, ts: NOW - 86400 }, - '212.233.85.1': { ...PLACE, ts: NOW - 31 * 86400 }, - '185.135.150.35': { fail: NOW - 3600 }, - '185.135.150.28': { fail: NOW - 2 * 86400 }, - '83.239.111.148': { lat: 1, lon: 2, city: 'Old', ts: NOW }, - }, home: null }; - eq(geo.stale(cache, [ '37.78.36.76' ], NOW), [], 'fresh: known'); - eq(geo.stale(cache, [ '212.233.85.1' ], NOW), [ '212.233.85.1' ], 'older than the TTL'); - eq(geo.stale(cache, [ '185.135.150.35' ], NOW), [], 'failed today: not again yet'); - eq(geo.stale(cache, [ '185.135.150.28' ], NOW), [ '185.135.150.28' ], 'failed two days ago: retried'); - eq(geo.stale(cache, [ '83.239.111.148' ], NOW), [ '83.239.111.148' ], 'an entry from before ASNs were kept'); - eq(geo.stale(cache, [ '10.0.1.164', '100.64.1.1', '', null, 'fe80::1' ], NOW), [], 'local addresses never'); - eq(geo.stale(cache, [ '1.1.1.1', '8.8.8.8', '1.1.1.1' ], NOW), [ '1.1.1.1', '8.8.8.8' ], 'once each, in order'); -}); - -test('merge', () => { - let cache = { ips: {}, home: null }; - ok(geo.merge(cache, { '1.1.1.1': { ...PLACE }, '8.8.8.8': false }, [], NOW), 'changed'); - eq(cache.ips['1.1.1.1'], { ...PLACE, ts: NOW }, 'a place, stamped'); - eq(cache.ips['8.8.8.8'], { fail: NOW }, 'nothing found: a failure, retried later'); - ok(!geo.merge(cache, {}, [], NOW), 'no results: unchanged'); - ok(!geo.merge(cache, { '10.0.0.1': PLACE }, [], NOW) && !cache.ips['10.0.0.1'], 'a local address is not kept'); - eq(geo.place(cache, '1.1.1.1')?.city, 'Krasnodar', 'place'); - eq(geo.place(cache, '8.8.8.8'), null, 'no place for a failure'); -}); - -test('merge keeps the cache bounded, what is shown stays', () => { - let cache = { ips: {}, home: null }; - for (let i = 0; i < 500; i++) - cache.ips[`1.0.${int(i / 250)}.${i % 250 + 1}`] = { ...PLACE, ts: NOW - 1000 + i }; - let oldest = '1.0.0.1', second = '1.0.0.2'; - ok(geo.merge(cache, { '9.9.9.9': PLACE }, [ oldest ], NOW), 'changed'); - eq(length(keys(cache.ips)), 500, 'back to the cap'); - ok(cache.ips[oldest] != null, 'the oldest is still shown: kept'); - ok(cache.ips[second] == null, 'the oldest not shown went'); - ok(cache.ips['9.9.9.9'] != null, 'the new one is in'); -}); - -test('label', () => { - eq(geo.label(PLACE), 'Krasnodar · Rostelecom', 'city and ISP'); - eq(geo.label({ city: '', org: 'Rostelecom' }), 'Rostelecom', 'no city'); - eq(geo.label(null), null, 'no place'); -}); diff --git a/tests/ucode/github.test.uc b/tests/ucode/github.test.uc deleted file mode 100644 index eacf87b..0000000 --- a/tests/ucode/github.test.uc +++ /dev/null @@ -1,25 +0,0 @@ -// dawnline.github: which URLs are a release's files (those can come through -// the API instead of github.com's redirect) and the points of a commit message. -import * as gh from 'dawnline.github'; - -test('release_file', () => { - eq(gh.release_file('https://github.com/tickcount/luci-app-dawnline/releases/download/v0.16.0/sha256sums.txt'), - { repo: 'tickcount/luci-app-dawnline', tag: 'v0.16.0', name: 'sha256sums.txt' }, 'a Dawnline release file'); - eq(gh.release_file('https://github.com/Slava-Shchipunov/awg-openwrt/releases/download/v24.10.4/kmod-amneziawg_v24.10.4_aarch64_cortex-a53_mediatek_filogic.ipk'), - { repo: 'Slava-Shchipunov/awg-openwrt', tag: 'v24.10.4', name: 'kmod-amneziawg_v24.10.4_aarch64_cortex-a53_mediatek_filogic.ipk' }, - 'an AmneziaWG build'); - eq(gh.release_file('https://ghfast.top/https://github.com/tickcount/luci-app-dawnline/releases/download/v0.16.0/a.ipk'), null, 'a mirror'); - eq(gh.release_file('https://raw.githubusercontent.com/tickcount/luci-app-dawnline/main/install.sh'), null, 'not a release file'); - eq(gh.release_file('https://github.com/tickcount/luci-app-dawnline/releases/latest'), null, 'the latest redirect'); - eq(gh.release_file('https://github.com/a/b/releases/download/v1/x.ipk?raw=1'), null, 'a query'); - eq(gh.release_file('https://github.com/a/b/releases/download/v1/sub/x.ipk'), null, 'a deeper path'); - eq(gh.release_file(null), null, 'nothing'); -}); - -test('points', () => { - eq(gh.points('Dawnline 0.16.0\n\n- Check no longer times out\n- Downloads without curl\n go through the API'), - [ 'Check no longer times out', 'Downloads without curl go through the API' ], 'a release commit, a wrapped point'); - eq(gh.points('Fix the portal'), [ 'Fix the portal' ], 'another commit: its title'); - eq(gh.points('Dawnline 0.16.0'), [], 'a bare release title'); - eq(gh.points('Merge branch x\n\n- y'), [], 'a merge'); -}); diff --git a/tests/ucode/health.test.uc b/tests/ucode/health.test.uc deleted file mode 100644 index 0ef38e4..0000000 --- a/tests/ucode/health.test.uc +++ /dev/null @@ -1,109 +0,0 @@ -// dawnline.health: where a public address points, in words. The name's AAAA -// records are checked against the router's public IPv6 addresses as well as -// its A records against the WAN. The facts take a test's reads instead of -// DNS, the WAN and `ip`. -import * as health from 'dawnline.health'; - -const HOST = 'vpn.example.com'; -const WAN = '203.0.113.7'; -// The WAN's own address and the LAN's from the delegated prefix: both reach the router. -const ROUTER6 = [ '2001:db8:1::1', '2001:db8:2::1' ]; - -function facts(ips, router6, wan) { - return health.endpoint_facts(null, HOST, { ips, wan, router6 }); -} - -function words(ips, router6, wan) { - return health.endpoint_words(facts(ips, router6, wan), 'UDP 51820'); -} - -test('own_ipv6: public addresses on any interface', () => { - let links = [ - { ifname: 'wan', addr_info: [ { family: 'inet6', local: '2001:db8:1::1', prefixlen: 128, scope: 'global' } ] }, - { ifname: 'br-lan', addr_info: [ - { family: 'inet6', local: '2001:db8:2::1', prefixlen: 64, scope: 'global' }, - { family: 'inet6', local: 'fd12:3456:789a::1', prefixlen: 60, scope: 'global' }, - { family: 'inet6', local: '2001:db8:2::99', prefixlen: 64, scope: 'global', dadfailed: true }, - ] }, - { ifname: 'lan2', addr_info: [ { family: 'inet6', local: 'FC00::1', prefixlen: 64, scope: 'global' } ] }, - { ifname: 'lo' }, - ]; - eq(health.own_ipv6(links), ROUTER6, 'the WAN and the LAN prefix; no ULA, no failed duplicate'); - eq(health.own_ipv6([ links[1] ]), [ '2001:db8:2::1' ], 'only the LAN has one'); - eq(health.own_ipv6([ { ifname: 'br-lan', addr_info: [ links[1].addr_info[1] ] } ]), [], 'only a ULA: none'); - eq(health.own_ipv6(null), [], 'nothing read'); -}); - -test('endpoint_facts: AAAA records against the router', () => { - let f = facts([ WAN, '2001:db8:2::1' ], ROUTER6, WAN); - eq([ f.here, f.here6, f.foreign6 ], [ true, true, [] ], 'both records are the router'); - eq(facts([ WAN, '2001:DB8:2:0:0::1' ], ROUTER6, WAN).here6, true, 'another spelling of the same address'); - f = facts([ WAN, '2001:db8:2::1', '2001:db8:9::5' ], ROUTER6, WAN); - eq([ f.here6, f.foreign6 ], [ false, [ '2001:db8:9::5' ] ], 'one of two is not'); - f = facts([ WAN, '2001:db8:9::5' ], [], WAN); - eq([ f.here6, f.foreign6, f.router6 ], [ false, [ '2001:db8:9::5' ], [] ], 'the router has no IPv6: none is'); - f = facts([ WAN, '2001:db8:9::5' ], null, WAN); - eq([ f.here6, f.foreign6, f.router6 ], [ false, null, null ], 'unknown: no verdict'); - eq(facts([ WAN ], ROUTER6, WAN).here6, false, 'no AAAA'); -}); - -test('endpoint_words: IPv4 and IPv6 both at the router', () => { - eq(words([ WAN, '2001:db8:2::1' ], ROUTER6, WAN), - { status: 'ok', text: 'vpn.example.com points at this router (203.0.113.7, 2001:db8:2::1).' }, 'A and AAAA'); - eq(words([ WAN ], null, WAN), { status: 'ok', text: 'vpn.example.com points at this router (203.0.113.7).' }, 'A only, as before'); - eq(words([ WAN, '2001:db8:9::5' ], null, WAN).status, 'ok', 'the router\'s IPv6 unknown: the AAAA gets no verdict'); -}); - -test('endpoint_words: an AAAA record that is not the router', () => { - eq(words([ WAN, '2001:db8:9::5' ], ROUTER6, WAN), { status: 'warn', - text: 'vpn.example.com AAAA → 2001:db8:9::5 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.' }, - 'a stale prefix'); - eq(words([ WAN, '2001:db8:9::5', '2001:db8:9::6' ], ROUTER6, WAN).text, - 'vpn.example.com AAAA → 2001:db8:9::5, 2001:db8:9::6 are not public addresses of this router: devices that prefer IPv6 will fail to connect. Fix or remove these AAAA records.', - 'two of them'); - eq(words([ WAN, '2001:db8:2::1', 'fd12:3456:789a::1' ], ROUTER6, WAN).text, - 'vpn.example.com AAAA → fd12:3456:789a::1 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.', - 'a ULA beside the right one'); - eq(words([ WAN, '2001:db8:9::5' ], [], WAN), { status: 'warn', - text: 'vpn.example.com AAAA → 2001:db8:9::5, but this router has no public IPv6 address: devices that prefer IPv6 will fail to connect. Remove this AAAA record or set up IPv6 on the router.' }, - 'the router has no IPv6'); - eq(words([ '198.51.100.4', '2001:db8:9::5' ], ROUTER6, WAN), { status: 'warn', - text: 'vpn.example.com points at 198.51.100.4, not this router (WAN 203.0.113.7). Check your DNS / DDNS. ' + - 'vpn.example.com AAAA → 2001:db8:9::5 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.' }, - 'both wrong: two sentences, IPv4 first'); - eq(words([ '198.51.100.4', '2001:db8:2::1' ], ROUTER6, WAN).text, - 'vpn.example.com points at 198.51.100.4, not this router (WAN 203.0.113.7). Check your DNS / DDNS.', 'only the A record wrong: as before'); - eq(words([ '198.51.100.4', '2001:db8:9::5' ], ROUTER6, null).text, - 'vpn.example.com AAAA → 2001:db8:9::5 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.', - 'no WAN address: the AAAA alone'); -}); - -test('endpoint_words: IPv6 only', () => { - eq(words([ '2001:db8:2::1' ], ROUTER6, WAN), { status: 'warn', - text: "vpn.example.com → 2001:db8:2::1: IPv6 only, so only devices with IPv6 connect (the router's IPv4 203.0.113.7 has no name)." }, - 'the v6_only wording stays'); - eq(words([ '2001:db8:2::1' ], ROUTER6, '100.64.1.2'), - { status: 'ok', text: 'vpn.example.com → 2001:db8:2::1: IPv6 only, so only devices with IPv6 connect.' }, 'behind CGNAT, as before'); - eq(words([ '2001:db8:9::5' ], ROUTER6, WAN), { status: 'warn', - text: 'vpn.example.com → 2001:db8:9::5: IPv6 only, and not a public address of this router: no device can connect. Check your DNS / DDNS.' }, - 'not the router'); - eq(words([ '2001:db8:9::5', '2001:db8:9::6' ], ROUTER6, WAN).text, - 'vpn.example.com → 2001:db8:9::5, 2001:db8:9::6: IPv6 only, and not public addresses of this router: no device can connect. Check your DNS / DDNS.', - 'two, neither the router'); - eq(words([ '2001:db8:9::5' ], [], '100.64.1.2'), { status: 'warn', - text: 'vpn.example.com → 2001:db8:9::5: IPv6 only, but this router has no public IPv6 address: no device can connect. Check your DNS / DDNS, or set up IPv6 on the router.' }, - 'the router has no IPv6'); - eq(words([ '2001:db8:2::1', '2001:db8:9::5' ], ROUTER6, WAN).text, - 'vpn.example.com AAAA → 2001:db8:9::5 is not a public address of this router: devices that prefer IPv6 will fail to connect. Fix or remove this AAAA record.', - 'one right, one wrong'); - eq(words([ '2001:db8:9::5' ], null, WAN).text, - "vpn.example.com → 2001:db8:9::5: IPv6 only, so only devices with IPv6 connect (the router's IPv4 203.0.113.7 has no name).", - 'the router\'s IPv6 unknown: as before'); -}); - -test('common home subnets', () => { - eq(health.common_home([ '192.168.1.0/24', '10.0.1.0/24' ]), [ '192.168.1.0/24' ], 'the out-of-the-box /24 only'); - eq(health.common_home([ '192.168.0.0/16' ]), [ '192.168.0.0/16' ], 'a wider network that holds one'); - eq(health.common_home([ '10.37.12.0/24', '172.20.0.0/24' ]), [], 'rare ones'); - eq(health.common_home(null), [], 'none'); -}); diff --git a/tests/ucode/i18n.test.uc b/tests/ucode/i18n.test.uc deleted file mode 100644 index 3598e70..0000000 --- a/tests/ucode/i18n.test.uc +++ /dev/null @@ -1,20 +0,0 @@ -// dawnline.i18n: without LuCI's catalogs (this rootfs has no luci-base) every -// message stays English, whatever language is asked for; plural forms pick -// by the count. -import * as i18n from 'dawnline.i18n'; - -test('English without a catalog', () => { - i18n.use('ru'); - eq(i18n.current(), null, 'no Russian catalog here'); - eq(i18n._('Backup not found.'), 'Backup not found.', 'as written'); - eq(sprintf(i18n.N_(1, '%d device', '%d devices'), 1), '1 device', 'singular'); - eq(sprintf(i18n.N_(5, '%d device', '%d devices'), 5), '5 devices', 'plural'); - eq(i18n.N_(0, 'a', 'b'), 'b', 'zero takes the plural in English'); -}); - -test('only plain language codes', () => { - for (let l in [ null, '', 'en', 'ru; rm -rf /', '../../etc', 'russian', 42 ]) { - i18n.use(l); - eq(i18n.current(), null, `${l}`); - } -}); diff --git a/tests/ucode/link.test.uc b/tests/ucode/link.test.uc deleted file mode 100644 index 85e207b..0000000 --- a/tests/ucode/link.test.uc +++ /dev/null @@ -1,332 +0,0 @@ -// dawnline.link: what a device's counters say about its link, on synthetic -// sequences of one read a second, run the way the agent's watcher runs them -// (observe, the set-up state at once, then classify and settle when -// something happened or CHECK_EVERY passed); and the pieces on their own. -import * as link from 'dawnline.link'; - -const T0 = 1800000000; -const A = '203.0.113.7:41821', B = '198.51.100.4:50123'; - -/* - * `seconds` reads from T0. `at(s)` gives what happened in second s: { drx, - * dtx (bytes in, out), hs (a handshake completed), ep (the endpoint now), - * gone (the peer is not in the tunnel) }. Returns the history, the changes - * of what is shown: [ { s, from, to, since (seconds from T0), ev } ], those of - * the set-up state: [ { s, state } ], and the seconds where the set-up state - * kept by setup() was not what setup_state() gives then (it should never be). - */ -function run(seconds, at, opts) { - opts ??= {}; - let ka = opts.ka ?? link.KEEPALIVE, window = opts.window ?? 190; - let h = link.fresh(T0); - let peer = { endpoint: opts.ep ?? A, handshake: opts.hs0 ?? 0, rx: 1000, tx: 1000 }; - let changes = [], raws = {}, setups = [], lag = []; - for (let s = 0; s < seconds; s++) { - let t = T0 + s, x = at(s) ?? {}; - peer.rx += x.drx ?? 0; - peer.tx += x.dtx ?? 0; - if (x.hs) - peer.handshake = t; - if (x.ep) - peer.endpoint = x.ep; - let on = peer.handshake > 0 && t - peer.handshake < window; - let moved = false; - if (x.gone) - link.gone(h); - else - moved = link.observe(h, peer, t, ka); - if (link.setup(h, t, on, moved)) - push(setups, { s, state: h.setup?.state ?? null }); - if (link.setup_state(h, t, on).state != (h.setup?.state ?? null)) - push(lag, s); - if (!moved && t - h.checked < link.CHECK_EVERY) - continue; - h.checked = t; - link.prune(h, t); - h.raw = link.classify(h, t, on); - if (h.raw) - raws[h.raw] ??= s; - let ch = link.settle(h, h.raw, t, on); - if (ch) - push(changes, { s, from: ch.from, to: ch.to, since: h.since ? h.since - T0 : 0, - ev: link.event_for(ch, { id: 'd_1', person: 'p_1' }, on)?.type ?? null }); - } - return { h, changes, raws, setups, lag }; -} - -// A phone in use: keep-alive 25 s, new keys every ~125 s (the initiation in -// one second, the packet that confirms it in the next), something sent or -// received now and then. -function phone(s, busy) { - let x = {}; - if (s % 125 == 3) - x = { drx: 148, dtx: 92 }; - else if (s % 125 == 4) - x = { hs: true, drx: 32 }; - else if (s % 25 == 0) - x = { drx: 32 }; - if (busy && s % 30 < 4) - x = { ...x, drx: (x.drx ?? 0) + 1400, dtx: (x.dtx ?? 0) + 9000 }; - return x; -} - -test('no state for a phone in use', () => { - let r = run(1800, (s) => phone(s, true)); - eq(r.changes, [], 'half an hour of normal use'); - eq(r.raws, {}, 'not even for a moment'); -}); - -test('no state for a sleeping phone', () => { - eq(run(1800, (s) => phone(s, false)).changes, [], 'keep-alives and new keys only'); - // Then it stops sending at all (deep sleep, out of range): it goes offline, nothing else. - let r = run(1200, (s) => s < 300 ? phone(s, false) : {}); - eq(r.changes, [], 'silent after five minutes'); - eq(r.raws, {}, 'silence is no failure'); - // The same with the disguise's content padding: keep-alives of 42-132 bytes. - eq(run(1800, (s) => s % 25 == 0 ? { drx: 42 + (s % 90) } : phone(s, false), { ka: 132 }).changes, [], 'padded keep-alives'); -}); - -test('no state for a phone that left with traffic still coming', () => { - // Online and busy until 100 s, then gone; the internet keeps sending to it for a while. - let at = (s) => s < 100 ? phone(s, true) : (s % 3 == 0 ? { dtx: 1400 } : {}); - eq(run(900, at).changes, [], 'the online window ends it'); - eq(run(900, at, { window: 400 }).changes, [], 'a long keep-alive window: no handshake within DROP_HS ends it'); -}); - -test('trying: knocks that never finish connecting', () => { - // Never connected: an initiation every 5 s for 90 s, then a pause, again and again. - let knocking = (s) => (s % 120 < 90 && s % 5 == 0) ? { drx: 148, dtx: 92 } : {}; - let r = run(600, knocking); - // The first read is the baseline: the knocks count from 5 s. - eq(r.raws.trying, 15, 'from the third accepted initiation'); - eq(r.changes[0], { s: 195, from: null, to: 'trying', since: 15, ev: 'device_failing' }, 'shown once it held 3 minutes'); - eq(length(r.changes), 1, 'and kept through the pauses'); - // It gets through at 400 s: working again at once. - let r2 = run(600, (s) => s < 400 ? knocking(s) : (s == 400 ? { hs: true, drx: 148 + 1400, dtx: 4000 } : phone(s, true))); - eq(r2.changes[1], { s: 400, from: 'trying', to: null, since: 0, ev: 'device_recovered' }, 'connected: recovered'); - // It gives up (the app was turned off): the state goes without a "recovered". - let r3 = run(1200, (s) => s < 300 ? knocking(s) : {}); - eq(r3.changes[1].to, null, 'cleared'); - eq(r3.changes[1].ev, null, 'nobody saw it work'); - // The last knock at 295 s: it ages out of TRY_SPAN by 415 s, and HOLD passes by 595 s. - eq(r3.changes[1].s, 595, 'only after the knocks aged out and HOLD passed'); -}); - -test('trying after a session that ran out', () => { - // Online until 200 s; then its new keys never complete (the answers are lost). - let at = (s) => s < 200 ? phone(s, true) : (s % 5 == 0 ? { drx: 148, dtx: 92 } : {}); - let r = run(900, at); - eq(r.changes[0].to, 'trying', 'after the online window'); - ok(r.changes[0].s > 129 + 190, 'not while the old session still counted'); -}); - -test('shared: one configuration on two devices', () => { - // Each takes the session from the other every 20 s; the endpoint flips with every packet. - let r = run(600, (s) => ({ hs: s % 20 == 0, drx: 2000, dtx: 6000, ep: s % 2 ? B : A })); - eq(r.raws.shared, 60, 'from the fourth handshake'); - eq(r.changes[0], { s: 240, from: null, to: 'shared', since: 60, ev: 'device_failing' }, 'shown once it held'); - eq(r.raws.unstable, null, 'never taken for a breaking connection'); - // Two devices behind one NAT: one address, two ports. - let r2 = run(600, (s) => ({ hs: s % 20 == 0, drx: 2000, dtx: 6000, ep: s % 2 ? '203.0.113.7:1111' : '203.0.113.7:2222' })); - eq(r2.changes[0]?.to, 'shared', 'told apart by port'); -}); - -test('unstable: connecting over and over from one place', () => { - let r = run(600, (s) => ({ hs: s % 20 == 0, drx: s % 20 < 5 ? 3000 : 0, dtx: s % 20 < 5 ? 9000 : 0 })); - eq(r.raws.unstable, 60, 'from the fourth quick handshake'); - eq(r.changes[0], { s: 240, from: null, to: 'unstable', since: 60, ev: 'device_failing' }, 'shown once it held'); - // Moving once (wifi to mobile) while it breaks is still the connection, not a second device. - let r2 = run(600, (s) => ({ hs: s % 20 == 0, drx: 3000, dtx: 9000, ep: s < 100 ? A : B })); - eq(r2.changes[0]?.to, 'unstable', 'one move is no alternation'); - // It settles down: working again once the quick handshakes left the span. - let r3 = run(1200, (s) => s < 300 ? { hs: s % 20 == 0, drx: 3000, dtx: 9000 } : phone(s, true)); - eq(r3.changes[1]?.to, null, 'cleared'); - eq(r3.changes[1]?.ev, 'device_recovered', 'online: recovered'); - // Normal key renewals never churn, even at RekeyAfterTime's shortest (100 s). - eq(run(1800, (s) => ({ hs: s % 100 == 0, drx: s % 25 == 0 ? 32 : 0 })).changes, [], '3.1 timers'); -}); - -/* - * An old address after renumbering: every packet it sends is dropped after - * decryption (not counted in rx), the router answers with a keepalive every - * ~10 s, the device renews its keys every ~125 s (the first packet under them - * is data, so only the initiation shows in rx). - */ -function renumbered(s) { - if (s % 125 == 3) - return { drx: 148, dtx: 92 }; - if (s % 125 == 4) - return { hs: true }; - return s % 10 == 7 ? { dtx: 32 } : {}; -} - -test('dropped: connected, but nothing it sends gets through', () => { - let r = run(900, renumbered, { hs0: T0 - 30 }); - // Classified on the router's next answer after DROP_SPAN (187 s). - eq(r.raws.dropped, 187, 'once DROP_SPAN passed without data'); - eq(r.changes[0], { s: 367, from: null, to: 'dropped', since: 187, ev: 'device_failing' }, 'shown once it held'); - // Imported again at 500 s: data flows, working at once. - let r2 = run(900, (s) => s < 500 ? renumbered(s) : (s == 500 ? { hs: true, drx: 3000, dtx: 9000 } : phone(s, true)), { hs0: T0 - 30 }); - eq(r2.changes[1], { s: 500, from: 'dropped', to: null, since: 0, ev: 'device_recovered' }, 'recovered'); - // With the disguise's padding the router's answers are bigger; still under DROP_TX. - let r3 = run(900, (s) => { let x = renumbered(s); if (x.dtx == 32) x.dtx = 32 + 1400; return x; }, { hs0: T0 - 30, ka: 132 }); - eq(r3.changes[0]?.to, 'dropped', 'padded answers'); - // Not before the history covers DROP_SPAN (the agent just started). - eq(run(170, renumbered, { hs0: T0 - 30 }).raws, {}, 'too early to tell'); -}); - -test('counters that restart are a new baseline', () => { - let h = link.fresh(T0); - let peer = { endpoint: A, handshake: T0, rx: 50000, tx: 90000 }; - link.observe(h, peer, T0, 32); - peer.rx = 148; - peer.tx = 92; - link.observe(h, peer, T0 + 1, 32); - eq([ h.rx, h.tx, length(h.knocks), h.data ], [ 148, 92, 0, 0 ], 'the peer was added again: no knock, no data'); - link.gone(h); - eq(h.rx, null, 'not in the tunnel'); - eq(link.observe(h, { ...peer, rx: 5000 }, T0 + 2, 32), false, 'back: a baseline, nothing counted'); - eq(h.data, 0, 'no data from the jump'); -}); - -test('knock and bare', () => { - eq([ link.knock(148), link.knock(296), link.knock(444) ], [ true, true, true ], 'one to three initiations'); - eq([ link.knock(592), link.knock(180), link.knock(0) ], [ false, false, false ], 'too many, with something else, nothing'); - eq([ link.bare(32, 32, false), link.bare(0, 32, false), link.bare(180, 32, true), link.bare(124, 32, true), link.bare(92, 32, true) ], - [ true, true, true, true, true ], 'keepalive, nothing; in a handshake\'s second: initiation + keepalive, response + keepalive, response'); - // Plain data is 32 + a multiple of 16: an IPv4 header alone is 64, a TCP ACK 80 or 96. - eq([ link.bare(64, 32, false), link.bare(80, 32, true), link.bare(96, 32, false), link.bare(1480, 32, true), link.bare(5000, 32, false) ], - [ false, false, false, false, false ], 'data'); - eq([ link.bare(180, 32, false), link.bare(124, 32, false), link.bare(92, 32, false) ], [ false, false, false ], - 'handshake messages only count in the second a handshake completed'); - // Padding makes it fuzzy: in a handshake's second anything up to three initiations, a response and a - // padded keepalive; in any other second one padded keepalive, never more. - eq([ link.bare(100, 132, false), link.bare(148 + 132, 132, true), link.bare(3 * 148 + 92 + 132, 132, true), link.bare(3 * 148 + 92 + 133, 132, true) ], - [ true, true, true, false ], 'padded keepalives'); - eq([ link.bare(133, 132, false), link.bare(148 + 52, 132, false), link.bare(668, 132, false) ], [ false, false, false ], - 'small packets on Maximum: data'); -}); - -test('keepalive_max', () => { - eq(link.keepalive_max(null), 32, 'no server'); - eq(link.keepalive_max({ obf: {} }), 32, 'no disguise'); - eq(link.keepalive_max({ obf: { content_padding_addition: '10-100' } }), 132, 'content padding'); - eq(link.keepalive_max({ obf: { content_padding_addition: '40' } }), 72, 'a fixed padding'); - eq(link.keepalive_max({ obf: { content_padding_addition: '10-100', random_trailers: 'on' } }), 132, 'content padding wins over trailers'); - eq(link.keepalive_max({ obf: { random_trailers: 'on' } }), 1532, 'random trailers: up to a full packet'); - let m = { servers: { s_1: { obf: { content_padding_addition: '10-100' } } }, people: { p_1: { server: 's_1' } }, - devices: { d_1: { person: 'p_1' }, d_2: { person: 'p_gone' } } }; - eq(link.keepalive_sizes(m), { d_1: 132, d_2: 32 }, 'per device'); -}); - -test('settle holds a state before it shows', () => { - let h = link.fresh(T0); - eq(link.settle(h, 'trying', T0, false), null, 'new: waits'); - eq(link.settle(h, 'trying', T0 + link.HOLD - 1, false), null, 'still waits'); - eq(link.settle(h, 'trying', T0 + link.HOLD, false), { from: null, to: 'trying' }, 'held: shown'); - eq([ h.state, h.since ], [ 'trying', T0 ], 'since it began'); - eq(link.settle(h, 'unstable', T0 + 200, true), null, 'another state waits too'); - eq(link.settle(h, 'trying', T0 + 210, true), null, 'and is forgotten when the first comes back'); - eq(h.pend, null, 'nothing pending'); - eq(link.settle(h, null, T0 + 220, true), { from: 'trying', to: null }, 'online and fine: at once'); - eq([ h.state, h.since ], [ null, 0 ], 'nothing shown'); - eq(link.shown({ d_1: h, d_2: { state: 'shared', since: 5 } }), { d_2: { state: 'shared', since: 5 } }, 'only what shows'); - eq(link.event_for({ from: 'shared', to: null }, { id: 'd_2', person: 'p_1' }, true), - { type: 'device_recovered', person: 'p_1', device: 'd_2', detail: 'shared' }, 'recovered event'); - eq(link.event_for({ from: null, to: 'dropped' }, { id: 'd_2', person: 'p_1' }, true), - { type: 'device_failing', person: 'p_1', device: 'd_2', detail: 'dropped' }, 'failing event'); - eq(link.event_for(null, { id: 'd_2' }, true), null, 'no change'); -}); - -// The agent moves the person's revision on every change settle() makes, so a -// state that clears while the device is away (no event) still leaves the page. -test('settle clears a state silently while the device is away', () => { - let h = link.fresh(T0); - link.settle(h, 'trying', T0, false); - link.settle(h, 'trying', T0 + link.HOLD, false); - eq(link.settle(h, null, T0 + 300, false), null, 'it stopped trying: waits'); - let ch = link.settle(h, null, T0 + 300 + link.HOLD, false); - eq(ch, { from: 'trying', to: null }, 'then a change: nothing shown'); - eq(link.event_for(ch, { id: 'd_1', person: 'p_1' }, false), null, 'without an activity event'); -}); - -/* - * The set-up sheet's states: at once, no HOLD. Each run also checks that the - * state setup() keeps, worked out only when something happened, is what - * setup_state() gives on every read. - */ -test('setup: knocks that never finish connecting', () => { - let knocking = (s) => (s % 120 < 90 && s % 5 == 0) ? { drx: 148, dtx: 92 } : {}; - let r = run(300, knocking); - // The first read is the baseline: the knocks count from 5 s. - eq(slice(r.setups, 0, 3), [ { s: 10, state: 'trying' }, { s: 100, state: null }, { s: 125, state: 'trying' } ], - 'with the second initiation; gone 15 s after the last one (85 s); back with the next two'); - eq(run(130, knocking).h.setup, { state: 'trying', since: T0 + 125 }, 'since it began again'); - eq(r.lag, [], 'never behind'); - // One initiation that the next second confirms is a connection, not a knock. - let ok1 = run(60, (s) => s == 10 ? { drx: 148, dtx: 92 } : s == 11 ? { hs: true, drx: 32 } : {}); - eq(ok1.setups, [], 'one knock, then the handshake: nothing to tell (idle)'); - // Knocking again while an older session still counts as online: it is trying now. - let late = run(300, (s) => s < 200 ? phone(s, true) : (s % 5 == 0 ? { drx: 148, dtx: 92 } : {})); - eq(late.setups[length(late.setups) - 1], { s: 205, state: 'trying' }, 'its new keys never complete'); - eq(late.lag, [], 'never behind'); -}); - -test('setup: a new device that connects and passes data', () => { - // It knocks at 10 s, the next second its first packets under the new keys carry data. - let at = (s) => s < 10 ? {} : s == 10 ? { drx: 148, dtx: 92 } : s == 11 ? { hs: true, drx: 32 + 1400, dtx: 4000 } : phone(s, true); - let r = run(900, at); - eq(r.setups, [ { s: 11, state: 'flowing' } ], 'flowing with the handshake, and through every new key after'); - eq(r.h.setup, { state: 'flowing', since: T0 + 11 }, 'since then'); - eq(r.lag, [], 'never behind'); - // A first keepalive only, data a few seconds later. - let r2 = run(60, (s) => s == 11 ? { hs: true, drx: 32 } : s == 14 ? { drx: 1400, dtx: 9000 } : {}); - eq(r2.setups, [ { s: 14, state: 'flowing' } ], 'with the first data'); - // Busy until 300 s, then gone: its session ends 190 s after its last handshake (254 s). - let r3 = run(600, (s) => s < 300 ? phone(s, true) : {}); - eq(r3.setups, [ { s: 30, state: 'flowing' }, { s: 444, state: null } ], 'data from 30 s (what came before the handshake does not count); away: nothing'); - eq(r3.lag, [], 'never behind'); -}); - -test('setup: idle is not "no data"', () => { - // Connected, keepalives only: the router sends nothing back, nothing to tell. - let r = run(900, (s) => phone(s, false)); - eq(r.setups, [], 'a sleeping phone'); - eq(r.lag, [], 'never behind'); - // The router sends it something now and then, and it answers: data flows. - eq(run(120, (s) => s == 4 ? { hs: true, drx: 32 } : s == 30 ? { dtx: 300, drx: 96 } : {}).setups, - [ { s: 30, state: 'flowing' } ], 'an answer is data'); -}); - -test('setup: connected, but nothing it sends comes through', () => { - // An old address: its first handshake at 4 s, the router's answers to what it drops at 7, 17, 27 s... - let r = run(400, renumbered); - eq(r.setups, [ { s: 19, state: 'nodata' } ], 'SETUP_QUIET after the handshake, with an answer in it'); - eq(r.lag, [], 'never behind, through its new keys at 128 s'); - // Imported again at 300 s: data flows at once. - let r2 = run(400, (s) => s < 300 ? renumbered(s) : s == 300 ? { hs: true, drx: 3000, dtx: 9000 } : phone(s, true)); - eq(r2.setups, [ { s: 19, state: 'nodata' }, { s: 300, state: 'flowing' } ], 'then flowing'); - // The router answers only after the quiet span: shown with the answer. - let slow = run(60, (s) => s == 4 ? { hs: true } : s == 25 ? { dtx: 32 } : {}); - eq(slow.setups, [ { s: 25, state: 'nodata' } ], 'with the first answer'); - eq(slow.lag, [], 'never behind'); -}); - -test('setup: light traffic on Maximum is data', () => { - // Content padding of 10-100: keep-alives of 42-132 bytes. A phone that only sends small packets (a DNS - // query, a SYN, ACKs: 150-600 bytes a second), and an answer now and then in a second it sent nothing. - let at = (s) => s == 3 ? { drx: 148, dtx: 92 } : s == 4 ? { hs: true, drx: 42 } : - s > 4 && s % 3 == 0 ? { drx: 150 + (s % 5) * 100, dtx: 1200 } : s % 7 == 0 ? { dtx: 600 } : {}; - let r = run(60, at, { ka: 132 }); - eq(r.setups, [ { s: 6, state: 'flowing' } ], 'flowing with its first small packets, never "no data"'); - eq(r.lag, [], 'never behind'); - // A keep-alive alone in a second is still no data: an idle phone on Maximum stays idle. - eq(run(120, (s) => s == 4 ? { hs: true, drx: 42 } : s % 25 == 0 ? { drx: 42 + (s % 90) } : {}, { ka: 132 }).setups, [], - 'padded keep-alives'); -}); - -test('setups', () => { - let h = link.fresh(T0); - eq(link.setups({ d_1: h, d_2: { setup: { state: 'trying', since: 5 } } }), { d_2: { state: 'trying', since: 5 } }, 'only devices with one'); - eq(link.setup_state(h, T0, false), { state: null, due: 0 }, 'nothing seen: nothing'); -}); diff --git a/tests/ucode/live.test.uc b/tests/ucode/live.test.uc deleted file mode 100644 index fbd46a5..0000000 --- a/tests/ucode/live.test.uc +++ /dev/null @@ -1,194 +0,0 @@ -// dawnline.live: event categories and the retention policy, from a settings -// object and from the fixture config (real libuci); which tunnels are read, -// the counters folded from a read, how long a device counts as online, and -// what of the agent's files a read takes (RUN_DIR, put back after). -import * as live from 'dawnline.live'; -import { RUN_DIR } from 'dawnline.util'; -import { readfile, writefile, unlink } from 'fs'; - -test('category_of', () => { - eq(live.category_of('connect'), 'connections', 'connect'); - eq(live.category_of('roam'), 'connections', 'roam'); - eq(live.category_of('device_added'), 'people', 'device events are people events'); - eq(live.category_of('person_changed'), 'people', 'person'); - eq(live.category_of('server_down'), 'problems', 'server'); - eq(live.category_of('something_new'), 'problems', 'unknown types are problems'); -}); - -test('policy defaults', () => { - eq(live.policy({}), { keep_days: 30, max: 2000, categories: [ 'connections', 'people', 'problems' ], - persist: 'hourly', usage_days: 62, usage_months: 24 }, 'empty settings'); -}); - -test('policy categories', () => { - eq(live.policy({ log_connections: '0' }).categories, [ 'people', 'problems' ], 'old switch'); - eq(live.policy({ log_category: 'devices, problems' }).categories, [ 'people', 'problems' ], 'string list, devices renamed'); - eq(live.policy({ log_category: [ 'connections', 'bogus', 'connections' ] }).categories, [ 'connections' ], 'list, unknown and repeats dropped'); - eq(live.policy({ log_category: [], log_connections: '0' }).categories, [], 'explicit empty list wins'); -}); - -// Ranges come from dawnline.schema: a stored value outside them (an older -// version, a hand edit) reads as the default, as settings_update would have refused it. -test('policy ranges', () => { - eq(live.policy({ log_max: '50' }).max, 2000, 'max below the floor: default'); - eq(live.policy({ log_max: '99999' }).max, 2000, 'max above the ceiling: default'); - eq(live.policy({ log_max: '150' }).max, 150, 'max in range'); - eq(live.policy({ log_max: 'abc' }).max, 2000, 'bad max'); - eq(live.policy({ log_keep_days: '0' }).keep_days, 0, 'keep forever'); - eq(live.policy({ log_keep_days: '-3' }).keep_days, 30, 'negative days'); - eq(live.policy({ log_persist: '10min' }).persist, '10min', 'persist'); - eq(live.policy({ log_persist: 'daily' }).persist, 'hourly', 'bad persist'); - eq(live.policy({ usage_keep_days: '1' }).usage_days, 62, 'usage days below the floor: default'); - eq(live.policy({ usage_keep_months: '500' }).usage_months, 24, 'usage months above the ceiling: default'); -}); - -test('policy from the config', () => { - eq(live.policy(null).categories, [ 'people', 'problems' ], 'fixture turns connections off'); - eq(live.policy(null).max, 2000, 'default where the fixture says nothing'); -}); - -test('endpoint_ip', () => { - eq(live.endpoint_ip('203.0.113.7:41821'), '203.0.113.7', 'v4'); - eq(live.endpoint_ip('[2001:db8::1]:41821'), '2001:db8::1', 'v6'); - eq(live.endpoint_ip(''), '', 'none'); -}); - -// A connect is logged before its new address is located; the place comes later. -test('fill_places', () => { - let ev = [ - { type: 'connect', detail: '1.1.1.1', where: null, ts: 100 }, - { type: 'connect', detail: '1.1.1.1', where: null, ts: 200 }, - { type: 'disconnect', detail: null, ts: 210 }, - { type: 'connect', detail: '8.8.8.8', where: 'Mountain View · Google', ts: 220 }, - { type: 'connect', detail: '9.9.9.9', where: null, ts: 230 }, - ]; - ok(live.fill_places(ev, { '1.1.1.1': 'Sydney · Cloudflare', '8.8.8.8': 'Elsewhere' }, 150), 'changed'); - eq(ev[1].where, 'Sydney · Cloudflare', 'the waiting connect gets its place'); - eq(ev[0].where, null, 'older than `since`: left alone'); - eq(ev[3].where, 'Mountain View · Google', 'a place already there stays'); - eq(ev[4].where, null, 'another address'); - ok(!live.fill_places(ev, { '7.7.7.7': 'X' }, 0), 'nothing to fill: unchanged'); - ok(!live.fill_places([], { '1.1.1.1': 'X' }, 0), 'empty log'); -}); - -test('tunnel_ifnames: the servers that run, on interfaces of their own', () => { - let srv = (ifname, more) => ({ enabled: true, private_key: 'k', ifname, subnet: '10.9.0.0/29', ...(more ?? {}) }); - let m = { servers: { - a: srv('awga'), off: srv('awgoff', { enabled: false }), keyless: srv('awgk', { private_key: '' }), - taken: srv('lan', { blocked: { code: 'taken', ifname: 'lan' } }), bad: srv('Bad Name'), - } }; - eq(live.tunnel_ifnames(m), [ 'awga' ], 'not turned off, without keys, kept down or misnamed'); - eq(live.tunnel_ifnames({ servers: {} }), [], 'none'); - m.servers.b = srv('awgb'); - eq(live.tunnel_ifnames(m, 'b'), [ 'awgb' ], 'one server\'s (a person\'s page)'); - eq([ live.tunnel_ifnames(m, 'off'), live.tunnel_ifnames(m, ''), live.tunnel_ifnames(m, 'gone') ], [ [], [], [] ], - 'one that does not run, no server, an unknown one: nothing'); -}); - -// What a read that failed, a tunnel that is down and a new link do to the counters. -test('collect: counters per tunnel read', () => { - let m = { - servers: { a: { ifname: 'awga' }, b: { ifname: 'awgb' } }, - people: { pa: { server: 'a' }, pb: { server: 'b' } }, - devices: { da: { person: 'pa', public_key: 'KA' }, db: { person: 'pb', public_key: 'KB' } }, - settings: { retention: {} }, - }; - let usage = { devices: { da: { raw: [ 40, 10 ], ifindex: 7 }, db: { raw: [ 500, 500 ] } }, people: {} }; - let peer = (rx, tx) => ({ KA: { ifname: 'awga', endpoint: '', handshake: 0, rx, tx } }); - live.collect(m, usage, { ok: false, reads: { awga: 'read', awgb: 'error' }, ifaces: { awga: { ifindex: 7 } }, peers: peer(100, 50) }); - eq(usage.devices.da.total, [ 60, 40 ], 'the difference since the last read'); - eq(usage.people.pa.total, [ 60, 40 ], 'their person'); - eq(usage.devices.db.raw, [ 500, 500 ], 'a tunnel that could not be read keeps its counters'); - live.collect(m, usage, { ok: true, reads: { awga: 'read', awgb: 'down' }, ifaces: { awga: { ifindex: 7 } }, peers: peer(100, 50) }); - eq(usage.devices.db.raw, [ 0, 0 ], 'a tunnel that is down starts again from zero'); - eq(usage.devices.da.total, [ 60, 40 ], 'nothing new'); - // Set up again: a new link whose counters already passed the old ones. - live.collect(m, usage, { ok: true, reads: { awga: 'read' }, ifaces: { awga: { ifindex: 8 } }, peers: peer(150, 80) }); - eq(usage.devices.da.total, [ 210, 120 ], 'a new link counts from zero'); - eq(usage.devices.da.ifindex, 8, 'the record follows its link'); - // A link whose index is unknown changes nothing about the epoch. - live.collect(m, usage, { ok: true, reads: { awga: 'read' }, ifaces: { awga: { ifindex: null } }, peers: peer(160, 90) }); - eq([ usage.devices.da.total, usage.devices.da.ifindex ], [ [ 220, 130 ], 8 ], 'counted on'); -}); - -// The window follows the keep-alive the device's configuration carries -// (awg.idle_handshake): 190 s for every default, longer only where the -// handshakes of an idle device are further apart. -test('online_window', () => { - let srv = { keepalive: 25, obf: {} }; - eq(live.online_window(srv, {}), 190, 'the default keep-alive'); - eq(live.online_window({ keepalive: 25, obf: { header_protection_key: 'k', rekey_after_time: '100-120' } }, {}), 190, 'Maximum'); - eq(live.online_window(srv, { keepalive: 0 }), 190, 'keep-alive off: the session alone'); - eq(live.online_window(srv, { keepalive: 100 }), 250, 'a handshake every second keep-alive'); - eq(live.online_window(srv, { keepalive: 300 }), 330, 'one every keep-alive'); - eq(live.online_window({ keepalive: 300, obf: {} }, {}), 330, 'the server\'s keep-alive'); - eq(live.online_window(null, {}), 190, 'no server'); - let m = { servers: { a: srv }, people: { p: { server: 'a' } }, devices: { d: { person: 'p', keepalive: 300 }, e: { person: 'x' } } }; - eq(live.online_windows(m), { d: 330, e: 190 }, 'per device'); - eq(live.online_windows(m, 'a'), { d: 330 }, 'one server\'s devices'); -}); - -test('online: without the agent, by the device\'s window', () => { - let peer = { handshake: time() - 300 }; - eq(live.online({ presence: null, windows: { d: 330 } }, 'd', peer), true, 'within its window'); - eq(live.online({ presence: null }, 'd', peer), false, 'the shortest window'); - eq(live.online({ presence: { online: { d: false } }, windows: { d: 330 } }, 'd', peer), false, 'the agent\'s word first'); -}); - -test('collect: online by the device\'s window', () => { - let m = { - servers: { a: { ifname: 'awga', keepalive: 300, obf: {} } }, - people: { pa: { server: 'a' } }, - devices: { da: { person: 'pa', public_key: 'KA' }, db: { person: 'pa', public_key: 'KB', keepalive: 25 } }, - settings: { retention: {} }, - }; - let hs = time() - 300; - let peers = { KA: { ifname: 'awga', endpoint: '', handshake: hs, rx: 0, tx: 0 }, KB: { ifname: 'awga', endpoint: '', handshake: hs, rx: 0, tx: 0 } }; - let v = live.collect(m, { devices: {}, people: {} }, { ok: true, reads: { awga: 'read' }, ifaces: { awga: { ifindex: 1 } }, peers }); - eq([ v.da.online, v.db.online ], [ true, false ], 'the server\'s keep-alive of 300 s, and a device\'s own of 25 s'); -}); - -// What the agent's watcher shows of each link (dawnline.link) reaches the -// read models through dump(), only while the agent runs. -test('dump: link and set-up states while the agent runs', () => { - let beat = `${RUN_DIR}/agent.beat`; - let had_beat = readfile(beat), had_link = readfile(live.LINK), had_setup = readfile(live.SETUP); - let shown = { d_1: { state: 'trying', since: 1800000000 } }, setups = { d_1: { state: 'trying', since: 1800000000 } }; - writefile(live.LINK, sprintf('%J', shown)); - writefile(live.SETUP, sprintf('%J', setups)); - writefile(beat, `${time()}`); - let m = { servers: {}, people: {}, devices: {} }; - eq(live.dump(m).link, shown, 'the watcher\'s states'); - eq(live.dump(m).setup, setups, 'and its set-up states'); - writefile(beat, `${time() - 600}`); - eq(live.dump(m).link, {}, 'a stopped agent\'s states are stale'); - eq(live.dump(m).setup, null, 'and nobody tells the set-up states'); - for (let f in [ [ beat, had_beat ], [ live.LINK, had_link ], [ live.SETUP, had_setup ] ]) - f[1] == null ? unlink(f[0]) : writefile(f[0], f[1]); -}); - -// A link that keeps failing is one line per device (add_event_merged), not one per device and person. -test('add_event_merged: per device', () => { - let path = `${RUN_DIR}/events.json`, had = readfile(path); - writefile(path, '[]'); - live.add_event_merged({ type: 'device_failing', person: 'p_x', device: 'd_x1', detail: 'trying' }, 3600); - live.add_event_merged({ type: 'device_failing', person: 'p_x', device: 'd_x1', detail: 'unstable' }, 3600); - live.add_event_merged({ type: 'device_failing', person: 'p_x', device: 'd_x2', detail: 'shared' }, 3600); - let ev = live.load_events(); - eq(map(ev, (e) => [ e.device, e.detail ]), [ [ 'd_x1', 'trying, unstable' ], [ 'd_x2', 'shared' ] ], 'merged per device'); - eq(live.category_of('device_failing'), 'problems', 'a problem'); - eq(live.category_of('device_recovered'), 'problems', 'and so is its end'); - had == null ? unlink(path) : writefile(path, had); -}); - -test('event_level and event_line: the system\'s events in syslog', () => { - eq(live.event_level({ type: 'connect' }), null, 'a connection stays out of syslog'); - eq(live.event_level({ type: 'roam' }), null, 'so does a device moving networks'); - eq(live.event_level({ type: 'device_failing' }), null, "and a device's link trouble"); - eq(live.event_level({ type: 'device_changed' }), 'info', 'people and devices are info'); - eq(live.event_level({ type: 'server_down' }), 'warn', 'a problem is warn'); - eq(live.event_level({ type: 'server_up' }), 'info', 'its end is info'); - eq(live.event_line({ type: 'device_changed', pname: 'Myata', dname: 'Phone', detail: 'kind=phone, lan_bypass=on', by: 'portal' }), - 'Myata · Phone device changed · kind=phone, lan_bypass=on (portal)', 'names, what, detail, by whom'); - eq(live.event_line({ type: 'paused', person: 'p1' }), 'p1 paused', 'the id where there is no name'); -}); diff --git a/tests/ucode/loop.test.uc b/tests/ucode/loop.test.uc deleted file mode 100644 index e59f244..0000000 --- a/tests/ucode/loop.test.uc +++ /dev/null @@ -1,109 +0,0 @@ -// dawnline.loop: the "like a home device" link's errors, stored as codes and -// put into words when read; the netns's MAC and which LAN address it may use; -// the policy rules for the servers that send their devices this way, and the -// commands that bring the rules the kernel shows to them. -import * as loop from 'dawnline.loop'; -import { ip2int, parse_cidr } from 'dawnline.util'; - -test('error_text', () => { - eq(loop.error_text(null), null, 'no error'); - eq(loop.error_text({ code: 'no_lan' }), 'No LAN detected.', 'no LAN'); - eq(loop.error_text({ code: 'not_bridge', dev: 'eth1' }), 'eth1 is not a bridge, so Dawnline cannot join the LAN as a device.', 'not a bridge'); - eq(loop.error_text({ code: 'no_address', net: 'lan' }), 'No free address on lan.', 'no address'); - eq(loop.error_text({ code: 'setup', detail: 'ip: RTNETLINK answers: File exists' }), 'Setup failed: ip: RTNETLINK answers: File exists', 'setup'); - eq(loop.error_text('an old message'), 'an old message', 'older files: as written'); -}); - -test('lan_mac', () => { - let mac = loop.lan_mac('d4:0d:ab:06:94:aa\n'); - // Pinned: another MAC after an update would make the netns look like someone else once. - eq(mac, '7a:4e:71:7a:e0:83', 'hashed from the bridge MAC, as sysfs gives it'); - eq(loop.lan_mac('D4:0D:AB:06:94:AA'), mac, 'the same however it is written'); - ok(loop.lan_mac('d4:0d:ab:06:94:ab') != mac, 'another bridge, another MAC'); - for (let b in [ 'd4:0d:ab:06:94:aa', 'd4:0d:ab:06:94:ab', '00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff' ]) { - let m = loop.lan_mac(b); - ok(match(m, /^[0-9a-f]{2}(:[0-9a-f]{2}){5}$/), `${b}: a MAC`); - let first = hex(substr(m, 0, 2)); - eq([ first & 1, first & 2 ], [ 0, 2 ], `${b}: unicast, locally administered`); - } -}); - -test('address_free', () => { - let lan = parse_cidr('10.0.1.1/24'); - let facts = { pool: [ ip2int('10.0.1.100'), ip2int('10.0.1.249') ], statics: [ ip2int('10.0.1.50') ] }; - let ours = '7a:4e:71:7a:e0:83', old = '7e:8b:31:7d:04:ba', other = '3c:22:fb:01:02:03'; - let free = (ip, used, mine) => loop.address_free(ip2int(ip), lan, facts, used ?? {}, mine ?? [ ours, null ]); - ok(free('10.0.1.254'), 'nobody on it'); - ok(free('10.0.1.254', { '10.0.1.254': ours }), 'the neighbour entry of the netns before it was created again'); - ok(free('10.0.1.254', { '10.0.1.254': old }, [ ours, old ]), 'the netns as it is now (an older version gave it a random MAC)'); - ok(!free('10.0.1.254', { '10.0.1.254': old }), 'a MAC that is not the netns\'s: someone else'); - ok(!free('10.0.1.254', { '10.0.1.254': other }, [ ours, null ]), 'another device'); - ok(!free('10.0.1.254', { '10.0.1.254': true }), 'an entry without a MAC'); - ok(!free('10.0.1.1'), 'the router'); - ok(!free('10.0.1.50'), 'a static lease'); - ok(!free('10.0.1.100') && !free('10.0.1.249'), 'the DHCP pool'); - ok(free('10.0.1.99') && free('10.0.1.250'), 'next to the pool'); - ok(!free('10.0.1.0') && !free('10.0.1.255'), 'the network and broadcast addresses'); - ok(loop.address_free(ip2int('10.0.1.120'), lan, { pool: null, statics: [] }, {}, [ ours ]), 'no DHCP on the LAN: the pool is free'); -}); - -// The netns's rules: the flowtable only on the netns's own links, never on -// the root namespace's (the guard on dawn0 must see every packet). -test('ns_rules', () => { - let p = { address: '10.0.1.250', dns: '10.0.1.1' }; - let fast = loop.ns_rules(p, true), plain = loop.ns_rules(p, false); - eq(map(match(fast, /devices = \{ ([^}]*) \}/g), (m) => m[1]), [ '"dlx1", "dll1"' ], 'one flowtable, on dlx1 and dll1 only'); - ok(!match(fast, /dlx0|dll0/), 'no root namespace link'); - ok(index(fast, 'ct state established meta l4proto { tcp, udp } flow add @ft') >= 0, 'established flows added'); - ok(index(plain, 'flowtable') < 0 && index(plain, 'flow add') < 0, 'plain: no flowtable'); - eq(replace(fast, /\n\tflowtable ft \{(\n\t\t[^\n]*)*\n\t\}|\n\t\tct state established meta l4proto \{ tcp, udp \} flow add @ft/g, ''), plain, 'otherwise the same rules'); -}); - -// A plan with one server sending its devices like a home device (plan() makes -// it, from the server's interface, its tunnel and its home networks). -const PLAN = { address: '192.168.1.250', table: 2077, - servers: [ { ifname: 'awghome', subnet: '10.9.0.0/29', direct: [ '10.9.0.0/29', '192.168.1.0/24' ] } ] }; - -test('rules', () => { - eq(loop.rules(PLAN), [ - { pref: 5205, iif: 'awghome', to: '192.168.1.250/32', table: '2077' }, - { pref: 5210, iif: 'awghome', to: '10.9.0.0/29', table: 'main' }, - { pref: 5210, iif: 'awghome', to: '192.168.1.0/24', table: 'main' }, - { pref: 5290, iif: 'awghome', to: null, table: '2077' }, - ], 'DNS into the netns, home and the tunnel by main, the rest into the netns'); - eq(loop.rules({ servers: [] }), [], 'no server sends anyone'); - eq(loop.rules(null), [], 'no plan'); -}); - -// What `ip -j -4 rule show` prints for the rules of PLAN: "src": "all" for a -// rule without a source, a /32 without its length (iproute2 iprule.c). -const HOME_SHOWN = [ - { priority: 5205, src: 'all', iif: 'awghome', dst: '192.168.1.250', table: '2077' }, - { priority: 5210, src: 'all', iif: 'awghome', dst: '10.9.0.0', dstlen: 29, table: 'main' }, - { priority: 5210, src: 'all', iif: 'awghome', dst: '192.168.1.0', dstlen: 24, table: 'main' }, - { priority: 5290, src: 'all', iif: 'awghome', table: '2077' }, -]; - -test('rule_cmds: the rules the kernel shows, against the plan', () => { - eq(loop.rule_cmds(PLAN, HOME_SHOWN), [], 'as wanted: nothing to do (no rule added again, none removed)'); - eq(loop.rule_cmds(PLAN, slice(HOME_SHOWN, 0, 3)), [ "ip -4 rule add priority 5290 iif 'awghome' lookup 2077" ], 'one gone: only it comes back'); - eq(loop.rule_cmds(PLAN, [ ...HOME_SHOWN, HOME_SHOWN[3] ]), [ "ip -4 rule del priority 5290 iif 'awghome' lookup 2077" ], 'one twice: one of them goes'); - eq(loop.rule_cmds(PLAN, []), [ - "ip -4 rule add priority 5205 iif 'awghome' to 192.168.1.250/32 lookup 2077", - "ip -4 rule add priority 5210 iif 'awghome' to 10.9.0.0/29 lookup main", - "ip -4 rule add priority 5210 iif 'awghome' to 192.168.1.0/24 lookup main", - "ip -4 rule add priority 5290 iif 'awghome' lookup 2077", - ], 'none yet: all of them'); - eq(loop.rule_cmds({ servers: [] }, HOME_SHOWN), [ - "ip -4 rule del priority 5205 iif 'awghome' to 192.168.1.250 lookup 2077", - "ip -4 rule del priority 5210 iif 'awghome' to 10.9.0.0/29 lookup main", - "ip -4 rule del priority 5210 iif 'awghome' to 192.168.1.0/24 lookup main", - "ip -4 rule del priority 5290 iif 'awghome' lookup 2077", - ], 'none wanted: each removed as shown, without "from all"'); - eq(loop.rule_cmds({ ...PLAN, servers: [ { ...PLAN.servers[0], direct: [ '10.9.0.0/29', '192.168.2.0/24' ] } ] }, HOME_SHOWN), [ - "ip -4 rule add priority 5210 iif 'awghome' to 192.168.2.0/24 lookup main", - "ip -4 rule del priority 5210 iif 'awghome' to 192.168.1.0/24 lookup main", - ], 'another home network: the new rule first, then the old one goes'); - eq(loop.rule_cmds(PLAN, [ ...HOME_SHOWN, { priority: 5290, src: '10.9.0.2', iif: 'awghome', table: '2077' } ]), - [ "ip -4 rule del priority 5290 from 10.9.0.2 iif 'awghome' lookup 2077" ], 'a rule of ours with a source is not one of them: it goes'); -}); diff --git a/tests/ucode/meter.test.uc b/tests/ucode/meter.test.uc deleted file mode 100644 index 3db39e4..0000000 --- a/tests/ucode/meter.test.uc +++ /dev/null @@ -1,75 +0,0 @@ -// dawnline.meter: the point between two samples (each server's and each -// moving device's bytes per second), the sample taken from a dump, the two minutes kept, and the file -// the watcher writes and the RPC reads (in RUN_DIR, removed after). -import * as meter from 'dawnline.meter'; -import { stat, unlink } from 'fs'; - -test('point', () => { - let a = { - t: 100.0, ts: 5000, servers: [ 's_1', 's_2' ], - dev: { d_1: [ 1000, 2000, 's_1' ], d_2: [ 500, 500, 's_1' ], d_3: [ 9000, 9000, 's_1' ], d_5: [ 0, 0, 's_2' ] }, - }; - let b = { - t: 101.0, ts: 5001, servers: [ 's_1', 's_2' ], - // d_2 sent nothing; d_3's peer was added again (counters from zero); d_4 is new; d_5 moved to s_1. - dev: { d_1: [ 3000, 12000, 's_1' ], d_2: [ 500, 500, 's_1' ], d_3: [ 100, 300, 's_1' ], d_4: [ 10, 10, 's_1' ], d_5: [ 50, 50, 's_1' ] }, - }; - eq(meter.point(a, b), { ts: 5001, servers: { s_1: [ 2000, 10000 ], s_2: [ 0, 0 ] }, dev: { d_1: [ 2000, 10000 ] } }, - 'bytes per second of each server\'s devices together; a server read with nothing moving is 0; only devices that moved'); - eq(meter.point(a, { ...b, t: 102.0 }).dev, { d_1: [ 1000, 5000 ] }, 'a device over two seconds'); - eq(meter.point(a, { ...b, t: 102.0 }).servers.s_1, [ 1000, 5000 ], 'over two seconds'); - eq(meter.point(a, { ...b, t: 100.0 }), null, 'no time passed'); - eq(meter.point(a, { ...b, t: 110.0 }), null, 'the watcher stalled'); - eq(meter.point(a, { ...b, servers: [ 's_2' ], dev: { d_5: [ 50, 50, 's_2' ] } }).servers, { s_2: [ 50, 50 ] }, 'only servers read in the newer sample'); - eq(meter.point({ ...a, dev: {} }, b).servers, { s_1: [ 0, 0 ], s_2: [ 0, 0 ] }, 'a first look at every device: nothing yet'); - eq(meter.point({ ...a, dev: {} }, b).dev, {}, 'and no device either'); -}); - -test('sample', () => { - let m = { - servers: { s_1: { ifname: 'dawn0' }, s_2: { ifname: 'dawn9' } }, - people: { p: { server: 's_1' }, q: { server: 's_2' } }, - devices: { d_1: { person: 'p', public_key: 'K1' }, d_2: { person: 'p', public_key: 'K2' }, d_3: { person: 'q', public_key: 'K3' } }, - }; - let d = { reads: { dawn0: 'read', dawn9: 'error' }, peers: { K1: { rx: 10, tx: 20 }, K3: { rx: 1, tx: 1 } } }; - let s = meter.sample(m, d, 5000); - eq([ s.ts, s.servers, s.dev ], [ 5000, [ 's_1' ], { d_1: [ 10, 20, 's_1' ] } ], - 'the servers read and their devices in the tunnel; not a tunnel that could not be read'); - ok(s.t > 0, 'monotonic time'); -}); - -test('keep', () => { - let pt = (ts) => ({ ts: ts, servers: { s_1: [ ts, 0 ] }, dev: { d_1: [ ts, 0 ] } }); - let ring = []; - for (let ts = 1000; ts < 1000 + meter.POINTS + 5; ts++) - meter.keep(ring, pt(ts)); - eq([ length(ring), ring[0][0], ring[length(ring) - 1][0] ], [ meter.POINTS, 1005, 1000 + meter.POINTS + 4 ], - 'the last POINTS seconds, newest last'); - eq(json(ring[0][1]), pt(1005), 'each point kept as its JSON'); - meter.keep(ring, pt(5000)); - eq(map(ring, (r) => r[0]), [ 5000 ], 'after a stalled watcher: nothing older than two minutes'); - meter.keep(ring, pt(5001)); - meter.keep(ring, pt(5002)); - meter.keep(ring, pt(5001)); - eq(map(ring, (r) => r[0]), [ 5000, 5001 ], 'a clock that went back: its points replace the later ones'); -}); - -test('want, save and read', () => { - let had = stat(meter.WANT) != null; - meter.want(); - ok(meter.wanted(time()), 'just asked'); - ok(!meter.wanted(time() + meter.WANT_FOR), 'stale after WANT_FOR'); - ok(!meter.wanted(time() - meter.WANT_FOR - 1), 'a clock that went back does not keep it'); - let t = time(); - meter.save([ [ t - 2, `{"ts":${t - 2},"servers":{}}` ], [ t - 1, `{"ts":${t - 1},"servers":{}}` ], [ t, `{"ts":${t},"servers":{"s_1":[1,2]}}` ] ]); - let r = meter.read(0); - eq([ r.ts, length(r.points), r.want, r.keep ], [ t, 3, meter.WANT_FOR, meter.POINTS ], 'everything'); - eq(meter.read(t - 1).points, [ { ts: t, servers: { s_1: [ 1, 2 ] } } ], 'only what is newer'); - let old = t - meter.WANT_FOR - 1; - meter.save([ [ old, `{"ts":${old},"servers":{}}` ] ]); - eq([ meter.read(0).ts, meter.read(0).points ], [ old, [] ], 'left by an agent that died while someone looked: no points'); - meter.stop(); - eq([ meter.read(0).ts, meter.read(0).points ], [ 0, [] ], 'nobody looks: nothing'); - if (!had) - unlink(meter.WANT); -}); diff --git a/tests/ucode/migrate.test.uc b/tests/ucode/migrate.test.uc deleted file mode 100644 index 5f2daa7..0000000 --- a/tests/ucode/migrate.test.uc +++ /dev/null @@ -1,46 +0,0 @@ -// dawnline.migrate: the one-time steps on the fixture config (real libuci): -// each changes what it must the first time and nothing the second time. -// This test rewrites /etc/config/dawnline and /etc/config/uhttpd. -import { cursor } from 'uci'; -import { stat } from 'fs'; -import * as core from 'dawnline.core'; -import * as migrate from 'dawnline.migrate'; - -function conf(name) { - let c = cursor(); - c.load(name); - return c; -} - -test('before: the fixture holds the old state', () => { - let c = conf('dawnline'); - eq(c.get('dawnline', 'bob', 'code'), 'XyZ12345', 'random code'); - eq(c.get('dawnline', 'main', 'mtu'), '1380', 'stored MTU'); - eq(c.get('dawnline', 'settings', 'portal_title'), 'My VPN', 'a portal title'); - eq(conf('uhttpd').get('uhttpd', 'main', 'error_page'), '/cgi-bin/dawnline-portal', 'portal as error page'); -}); - -test('run: the steps change what they must', () => { - migrate.run(); - let c = conf('dawnline'); - ok(match(c.get('dawnline', 'bob', 'code'), core.WORD_CODE), 'bob has a word code'); - eq(c.get('dawnline', 'alice', 'code'), 'abcdef-ghijkl-mnopqr', 'alice keeps hers'); - eq(c.get('dawnline', 'main', 'mtu'), null, 'MTU is automatic'); - eq(c.get('dawnline', 'main', 'subnet'), '10.9.0.0/29', 'the rest of the server stays'); - eq(c.get('dawnline', 'settings', 'portal_443'), null, 'no portal_443'); - eq(c.get('dawnline', 'settings', 'portal_title'), null, 'no portal title'); - eq(conf('uhttpd').get('uhttpd', 'main', 'error_page'), null, 'error page gone'); - eq(conf('uhttpd').get('uhttpd', 'main', 'home'), '/www', 'the rest of uhttpd stays'); - eq(stat('/etc/config/dawnline').perm, { setuid: false, setgid: false, sticky: false, - user_read: true, user_write: true, user_exec: false, - group_read: false, group_write: false, group_exec: false, - other_read: false, other_write: false, other_exec: false }, 'config stays private'); -}); - -test('run again: a step runs once', () => { - let before = conf('dawnline').get('dawnline', 'bob', 'code'); - let mtime = stat('/etc/config/dawnline').mtime; - migrate.run(); - eq(conf('dawnline').get('dawnline', 'bob', 'code'), before, 'the code is not drawn again'); - eq(stat('/etc/config/dawnline').mtime, mtime, 'nothing written'); -}); diff --git a/tests/ucode/netifd.test.uc b/tests/ucode/netifd.test.uc deleted file mode 100644 index 27bb5f4..0000000 --- a/tests/ucode/netifd.test.uc +++ /dev/null @@ -1,57 +0,0 @@ -// dawnline.netifd: drift(), the watchdog's look at a server's interface -// (network. against what sync() writes, markers aside), on the -// fixture's server and a section this test puts into /etc/config/network -// the way sync() writes it, and takes out again. -import { readfile, writefile, unlink } from 'fs'; -import { cursor } from 'uci'; -import { uci_put } from 'dawnline.util'; -import * as core from 'dawnline.core'; -import * as awg from 'dawnline.awg'; -import * as netifd from 'dawnline.netifd'; - -const NETWORK = '/etc/config/network'; - -test('drift: the interface as Dawnline set it, and edited outside it', () => { - let had = readfile(NETWORK); - if (had == null) - writefile(NETWORK, ''); - let m = core.load(); - let srv = m.servers.main; - let c = cursor(); - c.load('network'); - c.set('network', 'awgmain', 'interface'); - for (let k, v in awg.netifd_options(srv)) - uci_put(c, 'network', 'awgmain', k, v); - c.set('network', 'awgmain', '_dawnline', 'main'); - c.set('network', 'awgmain', '_dawnline_name', srv.name); - c.commit('network'); - let edit = (opt, val) => { - uci_put(c, 'network', 'awgmain', opt, val); - c.commit('network'); - return netifd.drift(m); - }; - let got = { as_set: netifd.drift(m) }; - got.renamed = edit('_dawnline_name', 'Renamed in LuCI'); - got.edited = edit('mtu', '1420'); - got.more = edit('awg_jc', null); - edit('mtu', `${core.tunnel_mtu(srv)}`); - got.restored = edit('awg_jc', srv.obf.jc); - got.disabled = edit('disabled', '1'); - edit('disabled', null); - got.foreign = edit('_dawnline', 'someone'); - m.servers.main.enabled = false; - got.off = netifd.drift(m); - // Put the router back as the other tests know it. - c.delete('network', 'awgmain'); - c.commit('network'); - if (had == null) - unlink(NETWORK); - eq(got.as_set, { main: [] }, 'as sync() writes it'); - eq(got.renamed, { main: [] }, 'the markers are not compared'); - eq(got.edited, { main: [ 'mtu' ] }, 'an option changed by hand'); - eq(got.more, { main: [ 'mtu', 'awg_jc' ] }, 'and one removed, by name only'); - eq(got.restored, { main: [] }, 'put back'); - eq(got.disabled, { main: [ 'disabled' ] }, 'switched off outside Dawnline'); - eq(got.foreign, {}, "a section that isn't the server's is not looked at"); - eq(got.off, {}, 'a server turned off is not looked at'); -}); diff --git a/tests/ucode/nft.test.uc b/tests/ucode/nft.test.uc deleted file mode 100644 index 0e0b417..0000000 --- a/tests/ucode/nft.test.uc +++ /dev/null @@ -1,55 +0,0 @@ -// dawnline.nft: the access table rendered for a model with two servers (one -// sending everyone like a home device, one direct) and the router read as a -// fixed context: what 0.13.0 rendered (fixtures/nft-table.txt, made by -// that version from this model). -import { readfile } from 'fs'; -import * as nft from 'dawnline.nft'; - -const KEY = 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='; -const SNAP = { devices: { 'br-lan': { nets: [ '192.168.1.0/24' ], zone: 'lan', addrs: [ '192.168.1.1/24' ] }, eth1: { nets: [], zone: 'wan' } }, - wan: 'eth1', lan: 'br-lan', zones: [ 'lan', 'wan' ] }; -// The netns is up (its DNS address, the Home-only resolver inside it) and the LAN's DNS is the router. -const CTX = { dns_addr: '192.168.1.250', resolver: { mode: 'ns', address: '169.254.77.2', port: 53 }, lan_dns: '192.168.1.1', snap: SNAP }; -const STATES = { alice: 'active', bob: 'active', carol: 'active', dave: 'active', erin: 'active' }; -let golden = readfile(sourcepath(0, true) + '/fixtures/nft-table.txt'); - -/** Server home sends everyone like a home device, work sends everyone direct. */ -function model() { - let srv = (id, ifname, subnet, lan_like, mesh) => ({ id, name: id, ifname, subnet, private_key: KEY, enabled: true, lan_like, mesh, - auto_wan: true, auto_lan: true, lan_devices: [], lan_zone: 'lan', wan_zone: 'wan', obf: {} }); - let person = (id, server, access, extra) => ({ id, name: id, server, access, dns_mode: 'device', services: [], home_nets: [], - circle: '', ...(extra ?? {}) }); - let dev = (person, address) => ({ person, address, disabled: false }); - return { - settings: { portal_enabled: true, portal_port: 8443, portal_host: 'vpn.example.com', portal_alt: [] }, - servers: { home: srv('home', 'awghome', '10.9.0.0/29', true, 'all'), work: srv('work', 'awgwork', '10.9.1.0/29', false, 'circles') }, - people: { - alice: person('alice', 'home', 'both'), bob: person('bob', 'work', 'internet'), - carol: person('carol', 'home', 'lan', { dns_mode: 'home' }), dave: person('dave', 'home', 'internet'), - erin: person('erin', 'work', 'both'), - }, - devices: { - a1: dev('alice', '10.9.0.2'), b1: dev('bob', '10.9.1.2'), c1: dev('carol', '10.9.0.3'), - d1: dev('dave', '10.9.0.4'), d2: dev('dave', '10.9.0.5'), e1: dev('erin', '10.9.1.3'), - }, - services: {}, circles: {}, - }; -} - -function render(m, states) { - return nft.render(m, nft.access_sets(m, null, states ?? STATES, SNAP), CTX); -} - -test('render: the table as it was', () => { - ok(golden != null, 'the fixture is there'); - eq(render(model()), golden, 'line for line'); - let m = model(); - m.devices.b1.lan_bypass = true; - eq(render(m), golden, 'a device that keeps its own local network out of the tunnel changes nothing here'); -}); - -test('shape: chains, sets and rules of a table script', () => { - let t = 'table inet dawnline {\n\tset inet_ok {\n\t\ttype ipv4_addr\n\t}\n\tchain forward {\n\t\ttype filter hook forward priority 0; policy accept;\n\t\tiifname "dawn0" ip saddr @inet_ok accept\n\t\t# a note\n\t\tiifname "dawn0" drop\n\t}\n}\n'; - eq(nft.shape(t), { chains: 1, sets: 1, rules: 2 }, 'the hook line, the policy and a comment are no rules'); - eq(nft.shape(''), { chains: 0, sets: 0, rules: 0 }, 'nothing'); -}); diff --git a/tests/ucode/pkg.test.uc b/tests/ucode/pkg.test.uc deleted file mode 100644 index b3c7e12..0000000 --- a/tests/ucode/pkg.test.uc +++ /dev/null @@ -1,71 +0,0 @@ -// dawnline.pkg: the package a control text or file names (ipk control, -// `apk adbdump`), and when an apk install of package files took: every -// package at its file's version, a rollback to an older one included. -import * as pkg from 'dawnline.pkg'; - -const DIR = '/tmp/dawnline-tests/pkg'; - -// AmneziaWG 3.1 as the Components tab installs it, and the 2.0 build before it. -const NEW = [ - { name: 'kmod-amneziawg', version: '6.12.94.3.1.20260906-r1', file: '/tmp/x/kmod.apk' }, - { name: 'amneziawg-tools', version: '3.1.20260812-r1', file: '/tmp/x/tools.apk' }, - { name: 'luci-proto-amneziawg', version: '3.1.0-r1', file: '/tmp/x/proto.apk' }, -]; -const OLD = { 'kmod-amneziawg': '6.12.94.1.0.20250722-r1', 'amneziawg-tools': '1.0.20250722-r1', 'luci-proto-amneziawg': '2.0.0-r1' }; - -function at(list) { - let have = {}; - for (let w in list) - have[w.name] = w.version; - return have; -} - -test('control_info of an ipk control file', () => { - eq(pkg.control_info('Package: amneziawg-tools\nVersion: 1.0.20250722-r1\nDepends: libc\nArchitecture: aarch64_cortex-a53\n', true), - { name: 'amneziawg-tools', version: '1.0.20250722-r1' }, 'fields'); - eq(pkg.control_info('Description: no package here\n', true), { name: null, version: null }, 'nothing said'); -}); - -test('control_info of apk adbdump', () => { - let dump = '#%SCHEMA: 00504B47\ninfo:\n name: kmod-amneziawg\n version: 6.12.94.3.1.20260906-r1\n' + - ' description: AmneziaWG kernel module\n arch: aarch64_cortex-a53\n depends: # 2 items\n - kernel=6.12.94\n' + - ' - kmod-udptunnel4\npaths: # 2 items\n - name: lib/modules\n - name: lib/modules/6.12.94\n files: # 1 items\n' + - ' - name: amneziawg.ko\n'; - eq(pkg.control_info(dump, false), { name: 'kmod-amneziawg', version: '6.12.94.3.1.20260906-r1' }, 'the package, not its files'); - eq(pkg.control_info('', false), { name: null, version: null }, 'adbdump failed'); - eq(pkg.control_info(null, false), { name: null, version: null }, 'no output'); -}); - -test('file_info of an ipk', () => { - system(`rm -rf ${DIR} && mkdir -p ${DIR}`); - ok(system(`cd ${DIR} && printf 'Package: luci-proto-amneziawg\\nVersion: 2.0.0-r1\\n' > control && tar -czf control.tar.gz ./control && tar -czf proto.ipk ./control.tar.gz`) == 0, - 'made the ipk'); - eq(pkg.file_info(`${DIR}/proto.ipk`), { name: 'luci-proto-amneziawg', version: '2.0.0-r1' }, 'name and version'); - eq(pkg.file_version(`${DIR}/proto.ipk`), '2.0.0-r1', 'file_version'); -}); - -test('mismatched: an update took', () => { - eq(pkg.mismatched(NEW, at(NEW)), [], 'every package at its file'); -}); - -test('mismatched: a rollback to an older build took', () => { - let back = map(keys(OLD), (n) => ({ name: n, version: OLD[n], file: `/tmp/x/${n}.apk` })); - eq(pkg.mismatched(back, OLD), [], 'older versions are what the files hold'); -}); - -test('mismatched: apk left a package alone', () => { - let have = { ...at(NEW), 'amneziawg-tools': OLD['amneziawg-tools'] }; - eq(pkg.mismatched(NEW, have), [ NEW[1] ], 'the tools kept their old version'); - eq(pkg.mismatched(NEW, OLD), NEW, 'nothing changed'); -}); - -test('mismatched: missing or unreadable', () => { - let have = at(NEW); - delete have['luci-proto-amneziawg']; - eq(pkg.mismatched(NEW, have), [ NEW[2] ], 'not installed after the install'); - let blind = [ { name: null, version: null, file: '/tmp/x/broken.apk' } ]; - eq(pkg.mismatched(blind, {}), blind, 'a file that names no package never counts as installed'); - eq(pkg.mismatched([ { name: 'amneziawg-tools', version: null, file: '/tmp/x/t.apk' } ], { 'amneziawg-tools': null }), - [ { name: 'amneziawg-tools', version: null, file: '/tmp/x/t.apk' } ], 'no version on either side'); - eq(pkg.mismatched(NEW, null), NEW, 'no installed versions'); -}); diff --git a/tests/ucode/run.sh b/tests/ucode/run.sh deleted file mode 100755 index e277ab5..0000000 --- a/tests/ucode/run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Run the ucode unit tests against the real libuci: the fixture configs are -# copied into /etc/config (replacing what is there), the stand-in `awg` goes on -# PATH and tests/ucode/run.uc runs every *.test.uc. For a throw-away OpenWrt -# rootfs container (scripts/ucode-container.sh); on anything else it refuses -# unless DAWNLINE_TEST_FORCE=1, because it overwrites /etc/config/dawnline. -# tests/ucode/run.sh [REPO] [test name filter] -set -eu -REPO="$(cd "${1:-$(dirname "$0")/../..}" && pwd)" -T="$REPO/tests/ucode" -if [ ! -e /.dockerenv ] && [ "${DAWNLINE_TEST_FORCE:-}" != 1 ]; then - echo "run.sh replaces /etc/config/dawnline and /etc/config/uhttpd: run it in a container (scripts/ucode-container.sh)" >&2 - exit 2 -fi -cp "$T"/fixtures/config/* /etc/config/ -mkdir -p /tmp/dawnline-tests /var/run/dawnline -PATH="$T/fixtures/bin:$PATH" ucode -L "$REPO/package/luci-app-dawnline/root/usr/share/ucode/*.uc" "$T/run.uc" "${2:-}" diff --git a/tests/ucode/run.uc b/tests/ucode/run.uc deleted file mode 100644 index 095e49b..0000000 --- a/tests/ucode/run.uc +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/ucode -'use strict'; -// Dawnline ucode unit tests. Runs every *.test.uc beside this file (in name -// order; migrate.test.uc changes /etc/config/dawnline, so it sorts after the -// tests that read the fixture as it is) with four helpers in scope: -// test(name, fn) one case; a thrown error or die() fails it -// eq(got, want, note) deep equality (JSON form), note names the case -// ok(cond, note) a true value -// throws(fn, re, note) fn must throw; the message must match re when given -// tests/ucode/run.sh prepares the fixtures and starts this with the modules -// on -L; an optional argument runs only the files whose name contains it. -import { lsdir } from 'fs'; - -let dir = sourcepath(0, true); -let passed = 0, failed = 0, file = null; - -function eq(got, want, note) { - let g = sprintf('%J', got), w = sprintf('%J', want); - if (g != w) - die(`${note ? note + ': ' : ''}got ${g}, want ${w}`); -} - -function ok(cond, note) { - if (!cond) - die(note ?? 'expected a true value'); -} - -function throws(fn, re, note) { - let msg = null; - try { - fn(); - } - catch (e) { - msg = e.message ?? `${e}`; - } - if (msg == null) - die(`${note ?? 'call'} did not throw`); - if (re && !match(msg, re)) - die(`${note ?? 'call'} threw "${msg}", not ${re}`); - return msg; -} - -function test(name, fn) { - try { - fn(); - passed++; - } - catch (e) { - failed++; - // The first frame in the test file itself (not eq()/ok() in here). - let at = filter(e.stacktrace ?? [], (f) => f.filename && index(f.filename, '/run.uc') < 0)[0]; - printf('FAIL %s: %s\n %s%s\n', file, name, e.message ?? `${e}`, at ? ` (${at.filename}:${at.line})` : ''); - } -} - -for (file in sort(lsdir(dir) ?? [])) { - if (!match(file, /\.test\.uc$/) || (ARGV[0] && index(file, ARGV[0]) < 0)) - continue; - try { - include(`${dir}/${file}`, { test, eq, ok, throws }); - } - catch (e) { - failed++; - printf('FAIL %s: could not run\n %s\n', file, e.message ?? `${e}`); - } -} -printf('%d passed, %d failed\n', passed, failed); -exit(failed ? 1 : 0); diff --git a/tests/ucode/schema.test.uc b/tests/ucode/schema.test.uc deleted file mode 100644 index f502867..0000000 --- a/tests/ucode/schema.test.uc +++ /dev/null @@ -1,139 +0,0 @@ -// dawnline.schema: what the admin may save (validate) and how stored values -// are read (get), one case per settings type. -import * as schema from 'dawnline.schema'; - -test('validate: bool', () => { - eq(schema.validate('portal_enabled', true), '1', 'true'); - eq(schema.validate('portal_enabled', false), '0', 'false'); - eq(schema.validate('portal_enabled', '1'), '1', 'string 1'); - eq(schema.validate('portal_enabled', ''), null, 'empty removes the option'); - throws(() => schema.validate('portal_enabled', 'yes'), /0 or 1/, 'yes'); -}); - -test('validate: int', () => { - eq(schema.validate('portal_port', '8443'), '8443', 'in range'); - eq(schema.validate('portal_port', ' 443 '), '443', 'trimmed'); - eq(schema.validate('portal_port', '08443'), '8443', 'leading zero dropped'); - eq(schema.validate('portal_port', 9000), '9000', 'number'); - throws(() => schema.validate('portal_port', '0'), /free port/, 'below min'); - throws(() => schema.validate('portal_port', '70000'), /free port/, 'above max'); - throws(() => schema.validate('portal_port', 'abc'), /free port/, 'letters'); - throws(() => schema.validate('portal_port', '-1'), /free port/, 'negative'); - throws(() => schema.validate('default_device_limit', '33'), /1-32/, 'device limit'); - eq(schema.validate('log_keep_days', '0'), '0', 'zero allowed where min is 0'); -}); - -test('validate: enum', () => { - eq(schema.validate('geo_provider', 'ipapi.co'), 'ipapi.co', 'known'); - throws(() => schema.validate('geo_provider', 'maxmind'), /Unknown location service/, 'unknown'); - eq(schema.validate('log_level', 'debug'), 'debug', 'a syslog level'); - throws(() => schema.validate('log_level', 'trace'), /system log level/, 'not a syslog level'); - eq(schema.validate('update_interval', '7d'), '7d', 'interval from dawnline.updates'); - throws(() => schema.validate('update_interval', '2d'), /6h, 12h, 1d or 7d/, 'unknown interval'); -}); - -test('validate: host and hosts', () => { - eq(schema.validate('portal_host', 'vpn.example.com'), 'vpn.example.com', 'name'); - eq(schema.validate('portal_host', '203.0.113.7'), '203.0.113.7', 'address'); - throws(() => schema.validate('portal_host', 'bad host!'), /hostname or IP/, 'bad'); - eq(schema.validate('portal_alt', [ 'a.example.com', ' a.example.com ', '', 'b.example.com' ]), - [ 'a.example.com', 'b.example.com' ], 'trimmed, deduplicated, empty ones dropped'); - throws(() => schema.validate('portal_alt', [ 'a.example.com', 'bad host' ]), /hostnames or IP/, 'a typo is refused, not dropped'); - eq(schema.validate('portal_alt', []), null, 'empty list removes the option'); - eq(schema.validate('portal_alt', 'a.example.com'), null, 'not a list'); -}); - -test('validate: url', () => { - eq(schema.validate('portal_redirect', 'https://example.com/x?y=1'), 'https://example.com/x?y=1', 'https with path'); - eq(schema.validate('portal_redirect', 'http://example.com:8080'), 'http://example.com:8080', 'http with port'); - throws(() => schema.validate('portal_redirect', 'ftp://example.com'), /full http/, 'scheme'); - throws(() => schema.validate('portal_redirect', 'https://example.com/'), /full http/, 'angle brackets'); - throws(() => schema.validate('portal_redirect', 'https://example.com/' + replace(sprintf('%300s', ''), ' ', 'a')), /full http/, 'over 300 characters'); -}); - -test('validate: file', () => { - eq(schema.validate('portal_cert', '/etc/passwd'), '/etc/passwd', 'existing file'); - throws(() => schema.validate('portal_cert', '/nonexistent/cert.pem'), /does not exist/, 'missing'); - throws(() => schema.validate('portal_cert', 'cert.pem'), /does not exist/, 'relative'); -}); - -test('validate: domain', () => { - eq(schema.validate('domain', 'lan'), 'lan', 'single'); - eq(schema.validate('domain', 'home.arpa'), 'home.arpa', 'dotted'); - throws(() => schema.validate('domain', 'Lan'), /lowercase/, 'upper case'); - throws(() => schema.validate('domain', replace(sprintf('%33s', ''), ' ', 'a')), /lowercase/, '33-char label'); -}); - -test('validate: ipv4', () => { - eq(schema.validate('home_dns_fallback', '9.9.9.9'), '9.9.9.9', 'address'); - eq(schema.validate('home_dns_fallback', ''), 'none', 'empty means no fallback'); - throws(() => schema.validate('home_dns_fallback', '999.1.1.1'), /IPv4/, 'bad octet'); - throws(() => schema.validate('home_dns_fallback', 'dns.example'), /IPv4/, 'name'); -}); - -test('validate: time', () => { - eq(schema.validate('update_time', '04:00'), '04:00', 'padded'); - eq(schema.validate('update_time', '4:00'), '4:00', 'unpadded'); - eq(schema.validate('update_time', '23:59'), '23:59', 'last minute'); - throws(() => schema.validate('update_time', '24:00'), /HH:MM/, 'hour 24'); - throws(() => schema.validate('update_time', '23:60'), /HH:MM/, 'minute 60'); -}); - -test('validate: targets', () => { - eq(schema.validate('update_targets', [ 'app', 'bogus', 'app', 'amneziawg' ]), [ 'app', 'amneziawg' ], 'known ones, once'); - eq(schema.validate('update_targets', []), [ 'none' ], 'empty is a choice'); - eq(schema.validate('update_targets', 'app'), [ 'none' ], 'not a list'); -}); - -test('validate: unknown key', () => { - throws(() => schema.validate('nonsense', '1'), /Unknown setting/); -}); - -test('get', () => { - eq(schema.get({ portal_enabled: 'on' }, 'portal_enabled'), true, 'bool synonyms'); - eq(schema.get({ portal_enabled: 'maybe' }, 'portal_enabled'), false, 'bad bool is the default'); - eq(schema.get({}, 'portal_enabled'), false, 'missing bool'); - eq(schema.get({ portal_port: '443' }, 'portal_port'), 443, 'int'); - eq(schema.get({ portal_port: '99999' }, 'portal_port'), 8443, 'int out of range is the default'); - eq(schema.get({ portal_port: 'x' }, 'portal_port'), 8443, 'bad int'); - eq(schema.get({}, 'portal_alt'), [], 'missing list'); - eq(schema.get({ portal_alt: 'a.example.com' }, 'portal_alt'), [ 'a.example.com' ], 'single value as list'); - eq(schema.get({ portal_alt: [ 'a', '' ] }, 'portal_alt'), [ 'a' ], 'empty entries dropped'); - eq(schema.get({}, 'update_targets'), [ 'app', 'packages' ], 'default targets'); - eq(schema.get({ geo_provider: 'ipapi.co' }, 'geo_provider'), 'ipapi.co', 'enum'); - eq(schema.get({ geo_provider: 'x' }, 'geo_provider'), 'ipwho.is', 'bad enum is the default'); - eq(schema.get({ home_dns_fallback: 'none' }, 'home_dns_fallback'), '', 'none reads as empty'); - eq(schema.get({}, 'home_dns_fallback'), '1.1.1.1', 'missing ipv4'); - eq(schema.get({ home_dns_fallback: '300.1.1.1' }, 'home_dns_fallback'), '1.1.1.1', 'bad ipv4'); - eq(schema.get({ portal_host: 'vpn.example.com' }, 'portal_host'), 'vpn.example.com', 'host passes through'); - eq(schema.get({ other: 'raw' }, 'other'), 'raw', 'unknown key is the raw value'); - eq(schema.get(null, 'portal_port'), 8443, 'no section'); -}); - -test('parsing helpers', () => { - eq(schema.bool('TRUE', false), true, 'case-insensitive'); - eq(schema.bool(' 0 ', true), false, 'trimmed'); - eq(schema.bool(null, true), true, 'default'); - eq(schema.to_int('-5', 0, 0, 10), 0, 'below min'); - eq(schema.to_int('7', 0, 0, 10), 7, 'in range'); - eq(schema.to_int('7.5', 0), 0, 'not whole'); - ok(schema.valid_port('65535'), 'max port'); - ok(!schema.valid_port('0'), 'port 0'); - ok(!schema.valid_port('65536'), 'port 65536'); - ok(!schema.valid_port('12a'), 'letters'); - ok(!schema.valid_port(null), 'null'); -}); - -test('addresses', () => { - ok(schema.ipv4('10.0.0.1') && !schema.ipv4('10.0.0.256') && !schema.ipv4(null), 'ipv4'); - eq(schema.ipv6_groups('::1'), [ 0, 0, 0, 0, 0, 0, 0, 1 ], 'loopback'); - eq(schema.ipv6_groups('2001:db8::1'), [ 0x2001, 0xdb8, 0, 0, 0, 0, 0, 1 ], 'compressed'); - eq(schema.ipv6_groups('::ffff:192.0.2.1'), [ 0, 0, 0, 0, 0, 0xffff, 0xc000, 0x0201 ], 'embedded IPv4'); - eq(schema.ipv6_groups('1:2:3:4:5:6:7:8'), [ 1, 2, 3, 4, 5, 6, 7, 8 ], 'full'); - eq(schema.ipv6_groups('1:2:3:4:5:6:7:8:9'), null, 'nine groups'); - eq(schema.ipv6_groups('1:2:3:4:5:6:7'), null, 'seven groups, no gap'); - eq(schema.ipv6_groups('1::2::3'), null, 'two gaps'); - eq(schema.ipv6_groups('fe80::1%eth0'), null, 'zone id'); - eq(schema.ipv6_groups('12345::'), null, 'group too long'); - ok(schema.ip('10.0.0.1') && schema.ip('fe80::1') && !schema.ip('nope'), 'ip'); -}); diff --git a/tests/ucode/updater.test.uc b/tests/ucode/updater.test.uc deleted file mode 100644 index d71b75c..0000000 --- a/tests/ucode/updater.test.uc +++ /dev/null @@ -1,36 +0,0 @@ -// usr/libexec/dawnline/updater: a call without a command it knows prints the usage and changes nothing (no job for -// Components, no history, no "update failed" in the service log). -import * as fs from 'fs'; - -const REPO = `${sourcepath(0, true)}/../..`; -const UPDATER = `${REPO}/package/luci-app-dawnline/root/usr/libexec/dawnline/updater`; -const MODULES = `${REPO}/package/luci-app-dawnline/root/usr/share/ucode/*.uc`; -const JOB = '/var/run/dawnline/update-job.json'; - -/** The updater run with `args`: { code, out } (stdout and stderr together). */ -function updater(args) { - let p = fs.popen(`ucode -L '${MODULES}' '${UPDATER}' ${args} 2>&1; echo "exit=$?"`, 'r'); - let out = p.read('all') ?? ''; - p.close(); - let m = match(out, /exit=([0-9]+)\s*$/); - return { code: m ? +m[1] : -1, out: replace(out, /exit=[0-9]+\s*$/, '') }; -} - -test('without a command it knows: the usage, nothing written', () => { - for (let args in [ '', 'frobnicate', 'install', "install ''" ]) { - fs.unlink(JOB); - let r = updater(args); - eq(r.code, 2, `exit code for "${args}"`); - ok(index(r.out, 'Usage:') == 0, `usage for "${args}"`); - ok(index(r.out, 'updater install app | app@') > 0, `the commands for "${args}"`); - ok(!fs.access(JOB), `no job for "${args}"`); - } -}); - -test('asked for help: the usage, exit 0', () => { - for (let args in [ '-h', '--help', 'help' ]) { - let r = updater(args); - eq(r.code, 0, `exit code for "${args}"`); - ok(index(r.out, 'Usage:') == 0, `usage for "${args}"`); - } -}); diff --git a/tests/ucode/updates.test.uc b/tests/ucode/updates.test.uc deleted file mode 100644 index c569d14..0000000 --- a/tests/ucode/updates.test.uc +++ /dev/null @@ -1,54 +0,0 @@ -// dawnline.updates: the update policy from raw settings, what is due at a -// given time, and release version ordering. -import * as updates from 'dawnline.updates'; - -function at(y, mo, d, h, mi) { - return timelocal({ year: y, mon: mo, mday: d, hour: h, min: mi, sec: 0 }); -} - -test('policy defaults', () => { - eq(updates.policy(null), { check: true, interval: '1d', auto: true, mode: 'scheduled', time: '04:00', - targets: [ 'app', 'packages' ], keep: false, mirrors: true }, 'no settings'); - eq(updates.policy({}), updates.policy(null), 'empty settings'); -}); - -test('policy values', () => { - let p = updates.policy({ update_check: '0', update_interval: '7d', update_auto: 'no', update_mode: 'immediate', - update_time: '23:59', update_targets: 'amneziawg', update_keep: '1', update_mirrors: 'off' }); - eq(p, { check: false, interval: '7d', auto: false, mode: 'immediate', time: '23:59', targets: [ 'amneziawg' ], keep: true, mirrors: false }, 'all set'); - eq(updates.policy({ update_interval: '2d' }).interval, '1d', 'unknown interval'); - eq(updates.policy({ update_time: '24:00' }).time, '04:00', 'bad time'); - eq(updates.policy({ update_time: '4:30' }).time, '4:30', 'unpadded time'); - eq(updates.policy({ update_mode: 'later' }).mode, 'scheduled', 'unknown mode'); - eq(updates.policy({ update_targets: [ 'packages', 'bogus', 'app' ] }).targets, [ 'packages', 'app' ], 'unknown targets dropped'); - eq(updates.policy({ update_targets: [ 'none' ] }).targets, [], '"none" is no target'); - eq(updates.policy({ update_targets: [] }).targets, [], 'empty list'); -}); - -test('due', () => { - let pol = updates.policy({ update_time: '04:00' }); - let t = at(2026, 3, 10, 4, 30); - eq(updates.due(pol, {}, t), 'install', 'in the window, never run'); - eq(updates.due(pol, { install_day: '2026-03-10' }, t), 'check', 'window spent, check is due'); - eq(updates.due(pol, { install_day: '2026-03-10', check: t - 3600 }, t), null, 'checked an hour ago'); - eq(updates.due(pol, { check: t - 90000 }, at(2026, 3, 10, 12, 0)), 'check', 'outside the window, a day has passed'); - eq(updates.due(pol, {}, at(2026, 3, 10, 5, 30)), 'check', 'window over (an hour)'); - eq(updates.due(updates.policy({ update_auto: '0', update_check: '0' }), {}, t), null, 'everything off'); - eq(updates.due(updates.policy({ update_mode: 'immediate' }), {}, t), 'check', 'immediate mode has no window'); - eq(updates.due(updates.policy({ update_targets: [] }), {}, t), 'check', 'nothing to install'); - let late = updates.policy({ update_time: '23:30' }); - eq(updates.due(late, {}, at(2026, 3, 11, 0, 15)), 'install', 'window across midnight'); - eq(updates.mark_day(late, {}, at(2026, 3, 11, 0, 15)).install_day, '2026-03-10', 'mark_day records the slot\'s day'); -}); - -test('version_cmp', () => { - eq(updates.version_cmp('0.5.1', '0.5.1'), 0, 'equal'); - eq(updates.version_cmp('v0.5.1', '0.5.1'), 0, 'v prefix'); - eq(updates.version_cmp('0.5.1', '0.5.2'), -1, 'patch'); - eq(updates.version_cmp('0.10.0', '0.9.9'), 1, 'numbers, not strings'); - eq(updates.version_cmp('0.6', '0.6.0'), 0, 'missing part is zero'); - eq(updates.version_cmp('0.6.0-rc1', '0.6.0'), -1, 'pre-release before the release'); - eq(updates.version_cmp('0.6.0-rc2', '0.6.0-rc10'), -1, 'rc numbers as numbers'); - eq(updates.version_cmp('0.6.0-beta', '0.6.0-rc1'), -1, 'beta before rc'); - eq(updates.version_cmp('garbage', '0.1'), -1, 'unparsable is lowest'); -}); diff --git a/tests/ucode/util.test.uc b/tests/ucode/util.test.uc deleted file mode 100644 index 27d014b..0000000 --- a/tests/ucode/util.test.uc +++ /dev/null @@ -1,335 +0,0 @@ -// dawnline.util: validation, addresses, slugs and dates (pure functions). -import * as util from 'dawnline.util'; - -test('valid_name', () => { - ok(util.valid_name('Alice'), 'plain'); - ok(util.valid_name('Мама'), 'non-ASCII letters'); - ok(!util.valid_name(''), 'empty'); - ok(!util.valid_name(' '), 'blank'); - ok(!util.valid_name(null), 'null'); - ok(!util.valid_name(42), 'number'); - ok(util.valid_name('a' + replace(sprintf('%47s', ''), ' ', 'b')), '48 characters'); - ok(!util.valid_name('a' + replace(sprintf('%48s', ''), ' ', 'b')), '49 characters'); - ok(util.valid_name('ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧ'), '25 Cyrillic letters (50 bytes) are 25 characters'); - ok(!util.valid_name('Bob "B"'), 'quotes'); - ok(!util.valid_name('a { - eq(util.DEVICE_NAME_MAX, 20, 'the limit'); - ok(util.valid_device_name('9999999999999999999'), '19 characters'); - ok(util.valid_device_name('99999999999999999999'), '20 characters'); - ok(!util.valid_device_name('999999999999999999999'), '21 characters'); - ok(util.valid_device_name('Kitchen iPad'), 'letters and a space'); - ok(util.valid_device_name('my-pc_2.home'), 'dash, underscore and dot'); - ok(util.valid_device_name('Мой ноутбук'), 'Cyrillic'); - ok(util.valid_device_name('ЙЦУКЕНГШЩЗХЪФЫВАПРОЛ'), '20 Cyrillic letters (40 bytes) are 20 characters'); - ok(!util.valid_device_name('ЙЦУКЕНГШЩЗХЪФЫВАПРОЛД'), '21 Cyrillic letters'); - ok(util.valid_device_name('Ordinateur de Zoé'), 'Latin with an accent'); - ok(util.valid_device_name('客厅电视'), 'Chinese'); - ok(util.valid_device_name('Ελένη'), 'Greek'); - ok(!util.valid_device_name('Phone 📱'), 'emoji'); - ok(!util.valid_device_name('Офис™'), 'trade mark sign'); - ok(!util.valid_device_name('«Дом»'), 'guillemets'); - ok(!util.valid_device_name('a\u200bb'), 'zero-width space'); - ok(!util.valid_device_name('a×b'), 'multiplication sign'); - // Raw bytes by chr(): a "\xd0" in a literal is the character Ð to some ucode releases. - ok(!util.valid_device_name('a' + chr(0xc0) + chr(0xaf) + 'b'), 'a slash spelled long'); - ok(!util.valid_device_name('a' + chr(0xd0)), 'a character cut short'); - ok(!util.valid_device_name("Bob's iPhone"), 'apostrophe'); - ok(!util.valid_device_name('a;rm -rf /'), 'semicolon and slash'); - ok(!util.valid_device_name('$(reboot)'), 'shell'); - ok(!util.valid_device_name('a { - ok(util.valid_host('vpn.example.com'), 'name'); - ok(util.valid_host('router'), 'single label'); - ok(util.valid_host('203.0.113.7'), 'IPv4'); - ok(util.valid_host('2001:db8::1'), 'IPv6'); - ok(!util.valid_host('-a.example.com'), 'leading dash'); - ok(!util.valid_host('a..example.com'), 'empty label'); - ok(!util.valid_host('bad host'), 'space'); - ok(!util.valid_host(''), 'empty'); - ok(!util.valid_host(null), 'null'); - let label = replace(sprintf('%63s', ''), ' ', 'a'); - ok(util.valid_host(`${label}.example`), '63-char label'); - ok(!util.valid_host(`${label}a.example`), '64-char label'); - ok(!util.valid_host(join('.', [ label, label, label, label, 'x' ])), 'over 253 characters'); -}); - -test('valid_date', () => { - ok(util.valid_date('2026-01-31'), 'ISO day'); - ok(!util.valid_date('2026-1-31'), 'no padding'); - ok(!util.valid_date('20260131'), 'no dashes'); - ok(!util.valid_date('2026-01-31T00:00'), 'trailing time'); - ok(!util.valid_date(20260131), 'not a string'); -}); - -test('valid_slug and valid_key', () => { - ok(util.valid_slug('alice'), 'word'); - ok(util.valid_slug('a'), 'one character'); - ok(util.valid_slug('alice-2'), 'dash inside'); - ok(!util.valid_slug('-alice'), 'leading dash'); - ok(!util.valid_slug('Alice'), 'upper case'); - ok(!util.valid_slug(replace(sprintf('%33s', ''), ' ', 'a')), '33 characters'); - ok(util.valid_key('yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='), 'WireGuard key'); - ok(!util.valid_key('yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk'), 'no padding'); - ok(!util.valid_key('yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmb='), 'impossible last sextet'); - ok(!util.valid_key(''), 'empty'); -}); - -test('valid_key without a regex', () => { - let k = 'yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk='; - ok(util.valid_key('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop0='), 'letters'); - ok(util.valid_key('qrstuvwxyz0123456789+/qrstuvwxyz0123456789w='), 'digits, + and /'); - ok(!util.valid_key(`${k}=`), '45 characters'); - ok(!util.valid_key(substr(k, 1)), '43 characters'); - ok(!util.valid_key(replace(k, '+', '-')), 'URL-safe alphabet'); - ok(!util.valid_key(`${substr(k, 0, 20)}=${substr(k, 21)}`), 'padding inside'); - ok(!util.valid_key(`${substr(k, 0, 20)}\u0000${substr(k, 21)}`), 'NUL byte'); - ok(!util.valid_key(`${k}\u0000x`), 'NUL and more after the key'); - ok(!util.valid_key(` ${substr(k, 1)}`), 'space'); - ok(!util.valid_key(null), 'null'); - ok(!util.valid_key([ k ]), 'array'); - // The pattern it stands for, on keys changed at both ends and in the middle. - let re = /^[A-Za-z0-9+\/]{42}[AEIMQUYcgkosw048]=$/; - for (let i in [ 0, 1, 21, 41, 42, 43 ]) - for (let c in [ 'A', 'z', '0', '9', '+', '/', 'b', 'k', '=', '-', '_', ' ', '.', '\n' ]) { - let s = `${substr(k, 0, i)}${c}${substr(k, i + 1)}`; - eq(util.valid_key(s), match(s, re) != null, s); - } -}); - -test('valid_host without a regex', () => { - ok(util.valid_host('a'), 'one character'); - ok(util.valid_host('xn--80ak6aa92e.com'), 'dashes inside a label'); - ok(util.valid_host('Router-1.LAN'), 'upper case'); - ok(!util.valid_host('example.com.'), 'trailing dot'); - ok(!util.valid_host('.example.com'), 'leading dot'); - ok(!util.valid_host('a-.example.com'), 'dash ending a label'); - ok(!util.valid_host('under_score.example'), 'underscore'); - ok(!util.valid_host('example.com\u0000x'), 'NUL byte'); - // The pattern it stands for (and the address checks after it), on names with - // each character replaced, removed or with one inserted before it. - let re = /^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/; - let old = (s) => length(s) <= 253 && (match(s, re) != null || util.ip2int(s) != null || util.is_ip6(s)); - let label = replace(sprintf('%63s', ''), ' ', 'b'); - for (let h in [ 'vpn.example.com', 'a.b-c.d', `${label}.x`, `x.${label}`, '203.0.113.7', '2001:db8::1' ]) { - let at = []; - for (let i = 0; i <= length(h); i++) - if (length(h) < 20 || i < 2 || i > length(h) - 3 || (i > 60 && i < 66)) - push(at, i); - for (let i in at) - for (let c in [ 'a', 'Z', '0', '-', '.', '_', ' ', '*', ':', '\n', '' ]) { - let s = `${substr(h, 0, i)}${c}${substr(h, i + 1)}`, t = `${substr(h, 0, i)}${c}${substr(h, i)}`; - eq(util.valid_host(s), old(s), s); - eq(util.valid_host(t), old(t), t); - } - } -}); - -test('valid_iface without a regex', () => { - ok(util.valid_iface('wan'), 'wan'); - ok(util.valid_iface('lan.100'), 'dot'); - ok(util.valid_iface('@wan6'), 'alias'); - ok(!util.valid_iface(''), 'empty'); - ok(!util.valid_iface(replace(sprintf('%33s', ''), ' ', 'a')), '33 characters'); - ok(!util.valid_iface('wan\u0000x'), 'NUL byte'); - ok(!util.valid_iface(null), 'null'); - ok(!util.valid_iface([ 'wan' ]), 'array'); - // The pattern it stands for, as above. - let re = /^[A-Za-z0-9_.@-]{1,32}$/; - for (let n in [ 'wan', 'br-lan.10', 'A_z@0', replace(sprintf('%32s', ''), ' ', 'x') ]) - for (let i = 0; i <= length(n); i++) - for (let c in [ 'a', 'Z', '9', '_', '.', '@', '-', ' ', '$', ';', '/', '\n', '' ]) { - let s = `${substr(n, 0, i)}${c}${substr(n, i + 1)}`, t = `${substr(n, 0, i)}${c}${substr(n, i)}`; - eq(util.valid_iface(s), match(s, re) != null, s); - eq(util.valid_iface(t), match(t, re) != null, t); - } -}); - -test('ip2int / int2ip / cidr_any', () => { - eq(util.ip2int('10.9.0.1'), 168361985, 'ip2int'); - eq(util.int2ip(168361985), '10.9.0.1', 'int2ip'); - eq(util.ip2int('256.0.0.1'), null, 'octet over 255'); - eq(util.ip2int('1.2.3'), null, 'three octets'); - eq(util.cidr_any('10.0.0.5'), { net: util.ip2int('10.0.0.5'), prefix: 32, size: 1, ip: util.ip2int('10.0.0.5') }, 'bare address is a /32'); - eq(util.cidr_any('10.0.0.5/8'), { net: util.ip2int('10.0.0.0'), prefix: 8, size: 16777216, ip: util.ip2int('10.0.0.5') }, 'masked base'); - eq(util.cidr_any('10.0.0.0/33'), null, 'prefix over 32'); - eq(util.cidr_any(null), null, 'null'); - eq(util.in_nets('10.9.0.7', [ '192.168.0.0/16', '10.9.0.0/29' ]), '10.9.0.0/29', 'first match'); - eq(util.in_nets('10.9.0.8', [ '10.9.0.0/29' ]), null, 'just outside'); - eq(util.in_nets('nonsense', [ '10.9.0.0/29' ]), null, 'not an address'); -}); - -test('parse_cidr', () => { - let c = util.parse_cidr('10.9.0.0/24'); - eq([ util.int2ip(c.net), c.prefix, c.size, util.int2ip(c.first), util.int2ip(c.last) ], [ '10.9.0.0', 24, 256, '10.9.0.1', '10.9.0.254' ], '/24'); - eq(util.int2ip(util.parse_cidr('10.9.0.77/24').net), '10.9.0.0', 'host bits masked off'); - eq(util.cidr_str(util.parse_cidr('10.9.0.77/24')), '10.9.0.0/24', 'cidr_str'); - eq(util.parse_cidr('10.9.0.0/7'), null, 'too wide'); - eq(util.parse_cidr('10.9.0.0/31'), null, 'too narrow'); - eq(util.parse_cidr('10.9.0.0'), null, 'no prefix'); - eq(util.parse_cidr('300.0.0.0/24'), null, 'bad octet'); - eq(util.parse_cidr(null), null, 'null'); - ok(util.cidr_overlaps(util.parse_cidr('10.9.0.0/24'), util.parse_cidr('10.9.0.128/25')), 'overlap'); - ok(!util.cidr_overlaps(util.parse_cidr('10.9.0.0/24'), util.parse_cidr('10.9.1.0/24')), 'adjacent'); - ok(util.in_cidr('10.9.0.200', util.parse_cidr('10.9.0.0/24')), 'in_cidr'); - ok(!util.in_cidr('10.9.1.1', util.parse_cidr('10.9.0.0/24')), 'not in_cidr'); -}); - -test('parse_cidr and cidr_any share one pattern', () => { - // The patterns each had, on networks changed at each character. - let old_any = (s) => { - let m = match(s ?? '', /^([0-9.]+)(\/([0-9]+))?$/); - if (!m) - return null; - let ip = util.ip2int(m[1]), prefix = m[3] != null ? +m[3] : 32; - if (ip == null || prefix > 32) - return null; - let size = 1 << (32 - prefix); - return { net: ip - ip % size, prefix, size, ip }; - }; - let old_cidr = (s) => { - let m = match(s ?? '', /^([0-9.]+)\/([0-9]+)$/); - if (!m) - return null; - let ip = util.ip2int(m[1]), prefix = +m[2]; - if (ip == null || prefix < 8 || prefix > 30) - return null; - let size = 1 << (32 - prefix); - let net = ip - ip % size; - return { net, prefix, size, first: net + 1, last: net + size - 2, ip }; - }; - for (let n in [ '10.9.0.0/24', '192.168.1.77/30', '0.0.0.0/8', '10.0.0.5', '1.2.3.4/32', '//', '' ]) - for (let i = 0; i <= length(n); i++) - for (let c in [ '0', '9', '.', '/', ' ', 'a', '-', '\n', '' ]) { - let s = `${substr(n, 0, i)}${c}${substr(n, i + 1)}`, t = `${substr(n, 0, i)}${c}${substr(n, i)}`; - eq(util.parse_cidr(s), old_cidr(s), s); - eq(util.parse_cidr(t), old_cidr(t), t); - eq(util.cidr_any(s), old_any(s), s); - eq(util.cidr_any(t), old_any(t), t); - } -}); - -test('cloudflare_ip', () => { - ok(util.cloudflare_ip('104.16.1.1'), 'v4 range'); - ok(util.cloudflare_ip('2606:4700::1'), 'v6 range'); - ok(!util.cloudflare_ip('8.8.8.8'), 'other v4'); - ok(!util.cloudflare_ip('2001:db8::1'), 'other v6'); - ok(!util.cloudflare_ip(null), 'null'); -}); - -test('slugify', () => { - eq(util.slugify('Alice Smith'), 'alice-smith', 'spaces to dashes'); - eq(util.slugify(' --Bob!! '), 'bob', 'trimmed dashes'); - eq(util.slugify(''), 'user', 'empty'); - eq(util.slugify(null), 'user', 'null'); - eq(util.slugify('Мама'), 'mama', 'Cyrillic written in Latin'); - eq(util.slugify('Юля Щукина'), 'yulya-shchukina', 'Cyrillic words'); - eq(util.slugify('日本'), 'user', 'nothing left'); - eq(length(util.slugify(replace(sprintf('%40s', ''), ' ', 'x'))), 32, 'cut at 32'); -}); - -test('dates', () => { - let end = util.date_end('2026-02-28'); - let t = localtime(end); - eq([ t.year, t.mon, t.mday, t.hour, t.min, t.sec ], [ 2026, 2, 28, 23, 59, 59 ], 'end of the local day'); - eq(util.date_end('2026-2-28'), null, 'bad date'); - let noon = timelocal({ year: 2026, mon: 3, mday: 1, hour: 12, min: 0, sec: 0 }); - eq(util.day_key(noon), '2026-03-01', 'day_key'); - eq(util.month_key(noon), '2026-03', 'month_key'); - eq(util.day_key_ago(1, noon), '2026-02-28', 'day_key_ago crosses the month'); - eq(util.day_key_ago(0, noon), '2026-03-01', 'zero days'); - eq(util.uniq([ 'a', 'b', 'a', 'c', 'b' ]), [ 'a', 'b', 'c' ], 'uniq'); -}); - -test('text: ulength, ucut, translit, host_label, tunnel_name', () => { - eq(util.ulength('Мама'), 4, 'characters, not bytes'); - eq(util.ulength('abc'), 3, 'ascii'); - eq(util.ucut('Привет', 3), 'При', 'cut by characters'); - eq(util.ucut('ab', 5), 'ab', 'shorter than the cut'); - eq(util.translit('Мама Таня'), 'mama tanya', 'Russian'); - eq(util.translit('Їжак Ґава ёж'), 'yizhak gava yozh', 'Ukrainian letters and ё'); - eq(util.translit('Mixed Текст 1'), 'Mixed tekst 1', 'Latin and digits pass'); - eq(util.host_label('Galaxy S24'), 'galaxy-s24', 'label'); - eq(util.host_label('Телефон Ёжика'), 'telefon-yozhika', 'Cyrillic label'); - eq(util.tunnel_name('Outline Home'), 'Outline-Home', 'tunnel name keeps the case'); - eq(util.tunnel_name('Дом у моря'), 'dom-u-morya', 'Cyrillic tunnel name'); - eq(util.tunnel_name(' My VPN (home)! '), 'My-VPN-home', 'tunnel name: runs of other characters are one dash'); - eq(util.tunnel_name('A very long server name'), 'A-very-long-ser', 'tunnel name: 15 characters at most'); - eq(util.tunnel_name('Home server 12345'), 'Home-server-123', 'tunnel name: cut'); - eq(util.tunnel_name('Lakeside house x'), 'Lakeside-house', 'tunnel name: no dash left at the cut'); - eq(util.tunnel_name('nul'), 'dawnline', 'tunnel name: a Windows device name'); - eq(util.tunnel_name('COM1'), 'dawnline', 'tunnel name: a Windows device name, any case'); - eq(util.tunnel_name('???'), 'dawnline', 'tunnel name: nothing left'); - eq(util.tunnel_name(null), 'dawnline', 'tunnel name: null'); - eq(util.host_label('!!!'), 'device', 'nothing left'); - eq(length(util.host_label(replace(sprintf('%50s', ''), ' ', 'x'))), 40, 'cut at 40'); -}); - -test('host_label, tunnel_name, slugify: dashes trimmed without a regex', () => { - // What they were with the dash patterns and the device-name regex, on names - // changed at each character (names come from uci, which holds no NUL byte). - let old_label = (s) => { - let l = replace(lc(util.translit(`${s ?? ''}`)), /[^a-z0-9]+/g, '-'); - l = replace(substr(replace(l, /^-+|-+$/g, ''), 0, 40), /-+$/g, ''); - return l || 'device'; - }; - let old_tunnel = (s) => { - let l = replace(util.translit(`${s ?? ''}`), /[^A-Za-z0-9]+/g, '-'); - l = replace(substr(replace(l, /^-+|-+$/g, ''), 0, 15), /-+$/g, ''); - return l && !match(l, /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i) ? l : 'dawnline'; - }; - let old_slug = (s) => { - let out = lc(util.translit(trim(`${s ?? ''}`))); - out = replace(out, /[^a-z0-9]+/g, '-'); - out = replace(out, /^-+|-+$/g, ''); - return substr(out, 0, 32) || 'user'; - }; - let same = (s) => { - eq(util.host_label(s), old_label(s), s); - eq(util.tunnel_name(s), old_tunnel(s), s); - eq(util.slugify(s), old_slug(s), s); - }; - let long = replace(sprintf('%13s', ''), ' ', 'x'); - for (let n in [ 'Outline Home', '--a--b--', ' (My VPN)! ', 'Дом у моря', `${long}-yz`, `${long}y-z`, - `${long}${long}${long}-ab`, `${replace(sprintf('%31s', ''), ' ', 'q')}--r`, '-', '' ]) - for (let i = 0; i <= length(n); i++) - for (let c in [ 'a', 'Z', '0', '-', ' ', '!', '.', '_', 'Ж', '\n', '' ]) { - same(`${substr(n, 0, i)}${c}${substr(n, i + 1)}`); - same(`${substr(n, 0, i)}${c}${substr(n, i)}`); - } - // Windows device names in any case, and their neighbours. - for (let b in [ 'con', 'prn', 'aux', 'nul', 'com', 'lpt', 'co', 'conx' ]) - for (let d in [ '', '0', '1', '5', '9', 'x', '10', '-1', ' 2' ]) { - same(`${b}${d}`); - same(uc(`${b}${d}`)); - same(`${uc(substr(b, 0, 1))}${substr(b, 1)}${d}`); - } - same(null); -}); - -test('syslog_line', () => { - eq(util.syslog_line('warn', 'awg', 'Home stopped unexpectedly'), '[warn] [awg] Home stopped unexpectedly', 'level, source, words'); - eq(util.syslog_line('error', 'apply', 'failed:\n no table\tthere'), '[error] [apply] failed: no table there', 'one line'); - eq(util.syslog_line('loud', null, 'x'), '[info] [dawnline] x', 'an unknown level is info, no source is dawnline'); - eq(length(util.syslog_line('info', 'x', replace(sprintf('%1500s', ''), ' ', 'y'))), 1000, 'at most 1000 characters'); -}); - -test('opts_text: options in a log line, keys masked', () => { - eq(util.opts_text({ listen_port: 51820, addresses: [ '10.8.0.1/24' ], private_key: 'abc=', mtu: null }), - 'listen_port=51820, addresses=10.8.0.1/24, private_key=***, mtu=-', 'values, lists, a secret, nothing'); - eq(util.opts_text({ preshared_key: 'x', awg_header_protection_key: 'y', public_key: 'z' }), - 'preshared_key=***, awg_header_protection_key=***, public_key=z', 'a public key is no secret'); - eq(util.opts_text(null), '', 'none'); -}); diff --git a/tests/ucode/view.test.uc b/tests/ucode/view.test.uc deleted file mode 100644 index 1309b1f..0000000 --- a/tests/ucode/view.test.uc +++ /dev/null @@ -1,59 +0,0 @@ -// dawnline.view: which device a portal page was opened from, and the usage series it draws. -import * as view from 'dawnline.view'; -import { day_key_ago } from 'dawnline.util'; - -const devs = [ - { id: 'd_1', address: '10.0.0.2', online: true, endpoint: '203.0.113.7' }, - { id: 'd_2', address: '10.0.0.3', online: false, endpoint: '198.51.100.4' }, - { id: 'd_3', address: '10.0.0.4', online: true, endpoint: '192.0.2.9' }, -]; - -test('device_here', () => { - eq(view.device_here(devs, '10.0.0.3'), 'd_2', 'through the tunnel: its address, online or not'); - eq(view.device_here(devs, '203.0.113.7'), 'd_1', 'beside the tunnel: where its tunnel comes from'); - eq(view.device_here(devs, '::ffff:203.0.113.7'), 'd_1', 'an IPv4 request on a dual-stack socket'); - eq(view.device_here(devs, '198.51.100.4'), null, 'a device that is not online does not count'); - eq(view.device_here(devs, '233.252.0.1'), null, 'from elsewhere'); - eq(view.device_here([ ...devs, { id: 'd_4', address: '10.0.0.5', online: true, endpoint: '203.0.113.7' } ], '203.0.113.7'), null, - 'two devices behind one address: neither'); - eq(view.device_here(devs, ''), null, 'no address'); - eq(view.device_here([ { id: 'd_5', address: '10.0.0.6', online: true, endpoint: '' } ], ''), null, 'no address, no endpoint'); -}); - -test('month_days', () => { - let n = +substr(day_key_ago(0), 8, 2); - let days = {}; - // On the 1st, today is the 1st: then only today's own value. - if (n > 1) - days[day_key_ago(n - 1)] = [ 1, 2 ]; - days[day_key_ago(0)] = [ 5, 7 ]; - // Last month's last day stays out of this month's chart. - days[day_key_ago(n)] = [ 100, 100 ]; - let s = view.month_days({ days }); - eq(length(s), n, 'one bar a day, from the 1st to today'); - eq(s[n - 1], [ 5, 7 ], 'today last, received and sent apart'); - eq(s[0], n > 1 ? [ 1, 2 ] : [ 5, 7 ], 'the 1st first'); - eq(length(view.month_days(null)), n, 'no usage yet: zeros'); - eq(view.month_days(null)[0], [ 0, 0 ], 'a day without traffic is zero both ways'); - eq(view.spark({ days }, 1), [ [ 5, 7 ] ], 'the week the same way, today last'); -}); - -// What the set-up sheet reads off a device: the watcher's state, or without the agent a session that lives. -test('device_view: set-up state', () => { - let m = { - settings: { hostnames: false }, - servers: { s_1: { id: 's_1', keepalive: 25, obf: {} } }, - people: { p_1: { id: 'p_1', server: 's_1', devices: [ 'd_1' ] } }, - devices: { d_1: { id: 'd_1', person: 'p_1', kind: 'phone', public_key: 'K1', private_key: 'x', mtu: 0, keepalive: null } }, - _reconnect: {}, _issued: {}, - }; - let hs = time() - 10; - let peers = { K1: { ifname: 'awga', endpoint: '203.0.113.7:4000', handshake: hs, rx: 100, tx: 100 } }; - let usage = { devices: {}, people: {} }; - let watched = { peers, presence: { online: { d_1: true } }, windows: {}, link: {}, setup: { d_1: { state: 'nodata', since: hs + 15 } } }; - eq(view.device_view(m, m.devices.d_1, usage, watched).setup, { state: 'nodata', since: hs + 15 }, 'the watcher\'s'); - eq(view.device_view(m, m.devices.d_1, usage, { ...watched, setup: {} }).setup, null, 'the watcher sees nothing'); - let alone = { peers, presence: null, windows: {}, link: {}, setup: null }; - eq(view.device_view(m, m.devices.d_1, usage, alone).setup, { state: 'flowing', since: hs }, 'no agent: a live session'); - eq(view.device_view(m, m.devices.d_1, usage, { ...alone, peers: {} }).setup, null, 'no agent, not online: nothing'); -}); diff --git a/uninstall.sh b/uninstall.sh index 751118a..51d05e7 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -451,22 +451,29 @@ do_backup() { do_teardown() { step "Running Dawnline's own removal" - if ubus list luci.dawnline >/dev/null 2>&1; then - # The removal takes the update lock itself: hand it over (the service is - # stopped first, so no automatic update can slip in between). - [ "$DRY_RUN" -eq 1 ] || /etc/init.d/dawnline stop >/dev/null 2>&1 + # The same call as Settings → Remove Dawnline from this router. The backend's own object stops the + # service itself, last; a version from before it answers through rpcd, with the service stopped first + # (so no automatic update can slip in between). + for _obj in dawnline luci.dawnline; do + ubus list "$_obj" >/dev/null 2>&1 || continue + ubus -v list "$_obj" 2>/dev/null | grep -q '"uninstall"' || continue + if [ "$_obj" = luci.dawnline ] && [ "$DRY_RUN" -ne 1 ]; then + /etc/init.d/dawnline stop >/dev/null 2>&1 + fi + # The removal takes the update lock itself: hand it over. exec 8>&- 2>/dev/null - # The same call as Settings → Remove Dawnline from this router. - if act "call luci.dawnline uninstall (Settings → Remove Dawnline)" rpc \ - ubus -t 120 call luci.dawnline uninstall '{"confirm":"remove"}'; then + if act "call $_obj uninstall (Settings → Remove Dawnline)" rpc \ + ubus -t 120 call "$_obj" uninstall '{"confirm":"remove"}'; then [ "$DRY_RUN" -eq 1 ] && return 0 if grep -q '"ok": *true' "$TMP_DIR/last.out" 2>/dev/null; then + # the backend stops the service a moment after it answers + [ "$_obj" = dawnline ] && sleep 3 && /etc/init.d/dawnline stop >/dev/null 2>&1 ok "Tunnels, firewall rules, portal and routing removed; service stopped" return 0 fi fi - warn "luci.dawnline uninstall failed: $(sed -n 's/.*"error": *"\(.*\)".*/\1/p' "$TMP_DIR/last.out" 2>/dev/null | head -n 1)" - fi + warn "$_obj uninstall failed: $(sed -n 's/.*"error": *"\(.*\)".*/\1/p' "$TMP_DIR/last.out" 2>/dev/null | head -n 1)" + done if [ -x /usr/bin/dawnline ]; then act "stop the Dawnline service" stop /etc/init.d/dawnline stop if act "run 'dawnline teardown'" teardown /usr/bin/dawnline teardown; then diff --git a/web/.prettierignore b/web/.prettierignore index 2a4b441..d3134d7 100644 --- a/web/.prettierignore +++ b/web/.prettierignore @@ -1,5 +1,4 @@ node_modules/ coverage/ package-lock.json -src/admin/styles/*.css dist/ diff --git a/web/build/shadow-css.ts b/web/build/shadow-css.ts new file mode 100644 index 0000000..88a92f1 --- /dev/null +++ b/web/build/shadow-css.ts @@ -0,0 +1,142 @@ +// The portal's stylesheet made fit for a Shadow DOM (the admin inside LuCI): +// a pure text transform, run by the build (tsup.config.ts) on the bundled +// CSS. What a page's stylesheet says of the document says it of the shadow +// host instead, and the theme follows an attribute the admin sets on the +// host (LuCI's light/dark switch), not the system's choice: +// - `:root`, `html`, `body` (with any class or attribute on them) → `:host`, +// `:host(.x)`; +// - a selector that starts with a class the portal sets on (`.kbd`, +// `.own-tsel`) → `:host(.kbd) …`; +// - `@media (prefers-color-scheme: light|dark) { r }` → `r` under +// `:host([data-theme=light|dark])`; +// - everything else (other at-rules, keyframes, strings) as it is. +// It reads CSS as esbuild writes it (no comments needed, but they are skipped). + +export interface ShadowOptions { + /** Classes the page sets on ; a selector starting with one is about the host. */ + rootClasses?: string[]; +} + +const SCHEME = /^@media\s*\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/; +/** At-rules whose block holds rules (the others' blocks are copied as they are). */ +const NESTING = /^@(media|supports|container|layer|scope)\b/; + +/** A block's text from `open` (just past "{") to its "}"; strings and comments skipped. Returns the index of the "}". */ +function blockEnd(css: string, open: number): number { + let depth = 1; + for (let i = open; i < css.length; i++) { + const c = css[i]; + if (c === '"' || c === "'") i = stringEnd(css, i); + else if (c === '/' && css[i + 1] === '*') i = css.indexOf('*/', i + 2) + 1 || css.length; + else if (c === '{') depth++; + else if (c === '}' && --depth === 0) return i; + } + throw new Error('shadow-css: unbalanced braces'); +} + +function stringEnd(css: string, at: number): number { + const q = css[at]; + for (let i = at + 1; i < css.length; i++) { + if (css[i] === '\\') i++; + else if (css[i] === q) return i; + } + return css.length; +} + +/** Split at top-level commas (not inside parentheses, brackets or strings). */ +export function splitList(s: string): string[] { + const out: string[] = []; + let depth = 0; + let from = 0; + for (let i = 0; i < s.length; i++) { + const c = s[i]; + if (c === '"' || c === "'") i = stringEnd(s, i); + else if (c === '(' || c === '[') depth++; + else if (c === ')' || c === ']') depth--; + else if (c === ',' && depth === 0) { + out.push(s.slice(from, i).trim()); + from = i + 1; + } + } + out.push(s.slice(from).trim()); + return out.filter(Boolean); +} + +/** The compound at the start of `sel` (up to the first combinator outside parentheses). */ +function leadingCompound(sel: string): [string, string] { + let depth = 0; + for (let i = 0; i < sel.length; i++) { + const c = sel[i]; + if (c === '(' || c === '[') depth++; + else if (c === ')' || c === ']') depth--; + else if (depth === 0 && (c === ' ' || c === '>' || c === '+' || c === '~')) return [sel.slice(0, i), sel.slice(i)]; + } + return [sel, '']; +} + +/** `:host` with what the compound adds (classes, attributes), e.g. `html.kbd` → `:host(.kbd)`. */ +function hostOf(extra: string): string { + return extra ? `:host(${extra})` : ':host'; +} + +/** One selector, with the document's root turned into the host; `theme`: under that data-theme. */ +export function hostSelector(sel: string, o: ShadowOptions = {}, theme?: string): string { + const [head, rest] = leadingCompound(sel.trim()); + const root = /^(:root|html|body)(?![\w-])(.*)$/.exec(head); + const cls = (o.rootClasses ?? []).find((c) => head === `.${c}` || head.startsWith(`.${c}:`) || head.startsWith(`.${c}.`)); + const themeAttr = theme ? `[data-theme=${theme}]` : ''; + if (root) return `${hostOf(themeAttr + root[2])}${rest}`; + if (head.startsWith(':host')) { + // Already the host: the theme joins what it says of it. + if (!themeAttr) return sel.trim(); + const m = /^:host(?:\((.*)\))?(.*)$/.exec(head)!; + return `${hostOf(themeAttr + (m[1] ?? ''))}${m[2]}${rest}`; + } + if (cls) return `${hostOf(themeAttr + head)}${rest}`; + return theme ? `${hostOf(themeAttr)} ${sel.trim()}` : sel.trim(); +} + +/** Transform a stylesheet (see the header). */ +export function shadowCss(css: string, o: ShadowOptions = {}, theme?: string): string { + let out = ''; + let i = 0; + while (i < css.length) { + const open = nextStop(css, i); + if (open < 0) { + out += css.slice(i); + break; + } + if (css[open] === ';') { + // A statement (`@charset`, `@import`): as it is. + out += css.slice(i, open + 1); + i = open + 1; + continue; + } + const prelude = css.slice(i, open).trim(); + const close = blockEnd(css, open + 1); + const body = css.slice(open + 1, close); + i = close + 1; + if (prelude.startsWith('@')) { + const scheme = SCHEME.exec(prelude.replace(/\s+/g, ' ')); + if (scheme) out += shadowCss(body, o, scheme[1]); + else if (NESTING.test(prelude)) out += `${prelude}{${shadowCss(body, o, theme)}}`; + else out += `${prelude}{${body}}`; + } else { + out += `${splitList(prelude) + .map((s) => hostSelector(s, o, theme)) + .join(',')}{${body}}`; + } + } + return out; +} + +/** The next "{" (a block) or ";" (a statement) outside strings and comments; -1 at the end. */ +function nextStop(css: string, from: number): number { + for (let i = from; i < css.length; i++) { + const c = css[i]; + if (c === '"' || c === "'") i = stringEnd(css, i); + else if (c === '/' && css[i + 1] === '*') i = css.indexOf('*/', i + 2) + 1 || css.length; + else if (c === '{' || c === ';') return i; + } + return -1; +} diff --git a/web/i18n/extract.ts b/web/i18n/extract.ts index 43a0daa..dc7ebf6 100644 --- a/web/i18n/extract.ts +++ b/web/i18n/extract.ts @@ -61,16 +61,47 @@ const walk = (dir: string, keep: (f: string) => boolean): string[] => const tsFiles = (dir: string, skip?: string) => walk(path.join(WEB, dir), (f) => f.endsWith('.ts') && !f.endsWith('.d.ts') && !(skip && f.startsWith(path.join(WEB, skip) + path.sep))); -/** The backend: ucode modules and the ucode programs (by their shebang) in the package. */ -const ucodeFiles = () => - walk(path.join(PKG, 'root'), (f) => f.endsWith('.uc') || (!path.extname(f) && fs.readFileSync(f, 'utf8').startsWith('#!/usr/bin/ucode'))); +/** + * The portal's modules the admin bundles (its UI on the pages: the sheet, + * menus, toasts…), followed through their relative imports from src/admin: + * their strings are drawn by the admin page, in LuCI's language, so they are + * in the admin's catalog too. + */ +function portalFilesOfAdmin(): string[] { + const portal = path.join(WEB, 'src/portal') + path.sep; + const seen = new Set(); + const todo = tsFiles('src/admin'); + const resolve = (from: string, spec: string): string | null => { + const base = path.resolve(path.dirname(from), spec); + for (const f of [base, `${base}.ts`, path.join(base, 'index.ts')]) if (f.endsWith('.ts') && fs.existsSync(f)) return f; + return null; + }; + while (todo.length) { + const f = todo.pop()!; + for (const m of fs.readFileSync(f, 'utf8').matchAll(/(?:^|\n)\s*(?:import|export)\b[^'"]*?from\s*['"](\.[^'"]+)['"]/g)) { + const dep = resolve(f, m[1]); + if (dep && dep.startsWith(portal) && !seen.has(dep)) { + seen.add(dep); + todo.push(dep); + } + } + } + return [...seen].sort(); +} + +/** + * The backend's messages. The backend is Go (backend/), which this extractor does not read: what it says to + * people is listed in backend/i18n/messages.js, as the calls the ucode backend made (_(), N_(), L_()). + */ +const BACKEND = path.join(REPO, 'backend/i18n'); +const ucodeFiles = () => [path.join(BACKEND, 'messages.js')]; /** * The backend modules whose messages reach the portal's visitors (its own * refusals, what refuses a device change, the keys): the page translates them when * the router sends them in English (no translation package installed). */ -const PORTAL_UCODE = ['portal.uc', 'devices.uc', 'core.uc', 'awg.uc'].map((f) => path.join(PKG, 'root/usr/share/ucode/dawnline', f)); +const PORTAL_UCODE = [path.join(BACKEND, 'portal-messages.js')]; const menuFiles = () => walk(path.join(PKG, 'root/usr/share/luci/menu.d'), (f) => f.endsWith('.json')); @@ -91,11 +122,12 @@ const CATALOGS: CatalogSpec[] = [ name: 'dawnline', pot: path.join(PKG, 'po/templates/dawnline.pot'), po: (l) => path.join(PKG, `po/${l}/dawnline.po`), - sources: () => [...tsFiles('src/admin'), ...tsFiles('src/shared'), ...ucodeFiles()], + sources: () => [...tsFiles('src/admin'), ...tsFiles('src/shared'), ...portalFilesOfAdmin(), ...ucodeFiles()], menus: menuFiles, logs: true, - // rpcd keeps the backend's modules loaded while the language changes per call. - lazy: (f) => f.startsWith(path.join(WEB, 'src/shared')) || f.startsWith(path.join(PKG, 'root')), + // rpcd keeps the backend's modules loaded while the language changes per call; the portal's own modules + // make their text when they draw it. + lazy: (f) => [path.join(WEB, 'src/shared'), path.join(WEB, 'src/portal'), BACKEND].some((d) => f.startsWith(d)), }, { name: 'portal', diff --git a/web/package-lock.json b/web/package-lock.json index 04014ba..71d05a0 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "dawnline-web", - "version": "0.18.0", + "version": "0.20.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dawnline-web", - "version": "0.18.0", + "version": "0.20.0", "license": "MIT", "dependencies": { "qrcode-generator": "2.0.4" diff --git a/web/package.json b/web/package.json index 7e54e4a..3209f70 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "dawnline-web", - "version": "0.18.0", + "version": "0.20.0", "private": true, "license": "MIT", "type": "module", diff --git a/web/src/admin/access.ts b/web/src/admin/access.ts deleted file mode 100644 index 8478e34..0000000 --- a/web/src/admin/access.ts +++ /dev/null @@ -1,530 +0,0 @@ -// Server → Access pieces: home services (picked from devices at home), circles, -// "Who reaches what" and "Check access". - -import type { Circle, Person, Server, Status } from '../shared/types'; -import { E } from './e'; -import { api, type HomeHost } from './api'; -import { button } from './ui/button'; -import { cancelButton, closeModal, confirmDialog, modal } from './ui/modal'; -import { attempt, notify } from './ui/toast'; -import { chipToggle, input } from './ui/controls'; -import { firstBad, liveField } from './ui/layout'; -import { circleNameHelp, ipv4Help, nameHelp, portsHelp } from './netcheck'; -import { icon } from '../shared/icons'; -import { fmt, plural } from '../shared/i18n'; - -type Service = Status['services'][number]; - -/** Circle colours; the circle stores an index. */ -const CIRCLE_COLORS = ['#3a83f7', '#a78bfa', '#f472b6', '#f59e0b', '#10b981', '#22d3ee', '#ef4444', '#84cc16']; - -export const circleDot = (c: Circle | undefined) => - E('i', { class: 'dl-circle-dot', style: `background:${CIRCLE_COLORS[c?.color ?? 0] ?? CIRCLE_COLORS[0]}` }); - -/** People whose devices can be reached at home (the mesh and home devices). */ -export const homeAccess = (p: Person) => p.access === 'both' || (p.access === 'lan' && !p.services?.length); - -/* ---------- Home services ---------- */ - -function serviceDialog(sv: Service | null, prefill: Partial, onSaved: () => unknown) { - const name = input(sv?.name ?? prefill.name ?? '', { placeholder: _('NAS') }); - const addr = input(sv?.address ?? prefill.address ?? '', { placeholder: '192.168.1.10', class: 'cbi-input-text dl-mono' }); - const ports = input((sv?.ports ?? prefill.ports ?? []).join(', '), { - placeholder: _('All ports, or e.g. 445, 5000'), - class: 'cbi-input-text dl-mono', - }); - const nameRow = liveField(_('Name', 'circle or service'), name, () => nameHelp(name.value, [], _('Shown to people who may reach it.'))); - const addrRow = liveField(_('Address'), addr, () => ipv4Help(addr.value)); - const portsRow = liveField(_('Ports'), ports, () => portsHelp(ports.value)); - modal( - sv ? fmt(_('Edit %s'), sv.name) : _('Add service'), - [nameRow, addrRow, portsRow], - [ - cancelButton(), - ' ', - button( - _('Save'), - async () => { - const bad = firstBad([nameRow, addrRow, portsRow]); - if (bad) { - notify(bad, 'warning'); - return; - } - const list = ports.value.split(/[ ,]+/).filter(Boolean); - if (await attempt(() => api.serviceSet(sv?.id ?? '', name.value, addr.value, list), _('Saved'))) { - closeModal(); - onSaved(); - } - }, - 'positive', - ), - ], - ); -} - -/** The port group a Bonjour service type belongs to, by its name. */ -function mdnsLabels(): Record { - const web = _('Web'); - const printer = _('Printer'); - return { - _smb: 'SMB', - _afpovertcp: 'AFP', - _http: web, - _https: web, - _ssh: 'SSH', - _sftp: 'SFTP', - '_sftp-ssh': 'SFTP', - _ipp: printer, - _ipps: printer, - _printer: printer, - '_pdl-datastream': printer, - _airplay: 'AirPlay', - _raop: 'AirPlay', - _rfb: _('Screen sharing'), - _googlecast: 'Cast', - _hap: 'HomeKit', - _rdp: _('Remote desktop'), - _ftp: 'FTP', - }; -} - -/** Port groups a device at home offers: what it announces over Bonjour, or the usual ones. */ -function portGroups(h: HomeHost): [string, string[]][] { - const labels = mdnsLabels(); - const by = new Map>(); - for (const s of h.services) { - const label = labels[s.type.split('.')[0]]; - if (!label || !s.port) continue; - (by.get(label) ?? by.set(label, new Set()).get(label)!).add(String(s.port)); - } - return by.size - ? [...by].map(([l, p]) => [l, [...p].sort((a, b) => +a - +b)]) - : [ - [_('Web'), ['80', '443']], - ['SMB', ['445']], - ['SSH', ['22']], - ]; -} - -/** Home services as a live part of Server → Access: `update` repaints it from a new status. */ -export interface HomeServices { - el: HTMLElement; - update(st: Status): void; -} - -/** - * Services shared by all servers, and the devices at home to add them from. - * The devices are read once; `reload` refreshes the status after a change - * (the rest of the Access section, and what is typed there, stays). - */ -export function homeServices(initial: Status, serverId: string, reload: () => Promise): HomeServices { - let st = initial; - let hosts: { hosts: HomeHost[]; mdns: boolean } | null = null; - let failed = false; - /** The "Add from devices at home" fold, once opened or closed by hand. */ - let open: boolean | null = null; - /** Devices with a change on its way: a second click would add the service twice. */ - const busy = new Set(); - const list = E('div', { class: 'dl-list' }); - const picker = E('div', { class: 'dl-stack gap8' }, E('span', { class: 'dl-sub' }, _('Looking for devices at home…'))); - - const paintRows = () => { - const services = st.services; - dom.content( - list, - services.length - ? services.map((sv) => - E('div', { class: 'dl-row' }, [ - icon('home'), - E('span', { class: 'dl-row-main dl-stack' }, [ - E('b', {}, sv.name), - E( - 'span', - { class: 'dl-mono dl-faint' }, - `${sv.address} · ${sv.ports.length ? fmt(_('ports %s'), sv.ports.join(', ')) : _('all ports')}`, - ), - ]), - button(_('Edit'), () => serviceDialog(sv, {}, reload)), - button( - [icon('trash')], - async () => { - if ( - (await confirmDialog( - fmt(_('Remove %s?'), sv.name), - _('People limited to this service lose access to it.'), - _('Remove'), - true, - )) && - (await attempt(() => api.serviceDelete(sv.id), _('Removed'))) - ) - await reload(); - }, - 'neutral', - { title: _('Remove'), 'aria-label': fmt(_('Remove %s'), sv.name) }, - ), - ]), - ) - : [E('div', { class: 'dl-row dl-muted' }, _('No services yet: pick ports of a device below.'))], - ); - }; - - /** Ports chosen for a device: add, change or remove its service at once. */ - async function choose(h: HomeHost, ports: string[] | null) { - if (busy.has(h.address)) return; - busy.add(h.address); - paintPicker(); - try { - const sv = st.services.find((s) => s.address === h.address); - const ok = - ports === null - ? sv && (await attempt(() => api.serviceDelete(sv.id), fmt(_('%s removed'), sv.name))) - : await attempt( - () => api.serviceSet(sv?.id ?? '', sv?.name ?? (h.name || h.address), h.address, ports), - sv ? fmt(_('%s updated'), sv.name) : fmt(_('%s added'), h.name || h.address), - ); - if (ok) await reload(); - } finally { - busy.delete(h.address); - paintPicker(); - } - } - - function hostRow(h: HomeHost): HTMLElement { - const sv = st.services.find((s) => s.address === h.address); - const all = !!sv && !sv.ports.length; - const chosen = new Set(sv?.ports ?? []); - const wait = busy.has(h.address); - const chip = (label: string, on: boolean, click: () => void) => - chipToggle(label, on, click, { disabled: wait ? 'disabled' : null, 'aria-busy': wait ? 'true' : null }); - // The name and the ports share a wrapping line: the ports go under the name before it is squeezed. - return E('div', { class: 'dl-row dl-host' }, [ - icon(h.services.some((s) => s.type.startsWith('_ipp') || s.type.startsWith('_printer')) ? 'file' : 'computer'), - E('div', { class: 'dl-host-body' }, [ - E('span', { class: 'dl-row-main dl-stack' }, [ - E('b', {}, h.name || h.address), - E('span', { class: 'dl-mono dl-faint' }, h.address), - ]), - E('div', { class: 'dl-chips-row' }, [ - chip(_('All ports'), all, () => choose(h, all ? null : [])), - ...portGroups(h).map(([label, ports]) => { - const on = !all && ports.every((p) => chosen.has(p)); - return chip(`${label} ${ports.join(', ')}`, on, () => { - const next = new Set(all ? [] : chosen); - for (const p of ports) { - if (on) next.delete(p); - else next.add(p); - } - choose(h, next.size ? [...next] : null); - }); - }), - ]), - ]), - ]); - } - - function paintPicker() { - if (failed) return dom.content(picker, E('span', { class: 'dl-sub' }, _("Couldn't read the devices at home."))); - if (!hosts) return; - const r = hosts; - if (!r.hosts.length) return dom.content(picker, E('span', { class: 'dl-sub' }, _('No devices found in the home network right now.'))); - // Open while there are no services yet (that is where they come from), then as left. - const fold = E('details', { class: 'dl-params', open: (open ?? !st.services.length) ? '' : null }, [ - E('summary', {}, [ - icon('chevron'), - E('span', {}, _('Add from devices at home')), - E('span', { class: 'dl-pcount' }, String(r.hosts.length)), - ]), - E('div', { class: 'dl-params-body' }, [ - E( - 'span', - { class: 'dl-sub' }, - r.mdns - ? _('Ports they announce over Bonjour. Pick what to open, or all ports.') - : _('Devices that got an address from this router. Pick the ports to open, or all ports.'), - ), - E('div', { class: 'dl-list' }, r.hosts.map(hostRow)), - ]), - ]); - fold.addEventListener('toggle', () => (open = (fold as HTMLDetailsElement).open)); - dom.content(picker, fold); - } - - api - .homeHosts(serverId) - .then((r) => { - hosts = r; - paintPicker(); - }) - .catch(() => { - failed = true; - paintPicker(); - }); - paintRows(); - - const el = E('div', { class: 'dl-stack gap8' }, [ - E('div', { class: 'dl-iflead' }, [ - E('div', { class: 'dl-iflead-row' }, [ - E('b', {}, _('Home services')), - button([icon('plus'), ' ', _('Add service')], () => serviceDialog(null, {}, reload)), - ]), - E( - 'span', - { class: 'dl-sub' }, - _('Home-only people can be limited to these instead of whole networks (chosen on their page). Shared by all servers.'), - ), - ]), - list, - picker, - ]); - return { - el, - update(n: Status) { - st = n; - paintRows(); - paintPicker(); - }, - }; -} - -/* ---------- Circles ---------- */ - -export function circleDialog(st: Status, serverId: string, ci: Circle | null, onDone: () => unknown) { - const used = new Set(st.circles.filter((c) => c.server === serverId).map((c) => c.color)); - let color = ci?.color ?? CIRCLE_COLORS.findIndex((_c, i) => !used.has(i)); - if (color < 0) color = 0; - const name = input(ci?.name ?? '', { placeholder: _('Family') }); - const people = st.people.filter((p) => p.server === serverId).sort((a, b) => a.name.localeCompare(b.name)); - const members = new Set(people.filter((p) => ci && p.circle === ci.id).map((p) => p.id)); - - const swatches = E('div', { class: 'dl-swatches', role: 'radiogroup', 'aria-label': _('Colour') }); - const paintSwatches = () => - dom.content( - swatches, - CIRCLE_COLORS.map((c, i) => - E('button', { - type: 'button', - role: 'radio', - class: `dl-swatch${i === color ? ' on' : ''}`, - style: `--sw:${c}`, - 'aria-checked': i === color ? 'true' : 'false', - 'aria-label': fmt(_('Colour %s'), i + 1), - click: () => { - color = i; - paintSwatches(); - }, - }), - ), - ); - paintSwatches(); - - const chips = E( - 'div', - { class: 'dl-chips-row' }, - people.map((p) => { - const other = p.circle && p.circle !== ci?.id ? st.circles.find((c) => c.id === p.circle) : undefined; - return E( - 'button', - { - type: 'button', - class: `dl-chipbtn${members.has(p.id) ? ' on' : ''}`, - title: !homeAccess(p) - ? fmt(_("%s has no home access: their devices aren't reachable anyway"), p.name) - : other - ? fmt(_('Now in %s'), other.name) - : '', - click: (ev: Event) => { - if (!members.delete(p.id)) members.add(p.id); - (ev.currentTarget as HTMLElement).classList.toggle('on', members.has(p.id)); - }, - }, - [p.name, !homeAccess(p) ? E('b', {}, _('internet')) : other ? E('b', {}, other.name) : ''], - ); - }), - ); - const field = (label: string, el: Node) => - E('div', { class: 'cbi-value' }, [E('label', { class: 'cbi-value-title' }, label), E('div', { class: 'cbi-value-field' }, el)]); - const others = st.circles.filter((c) => c.server === serverId && c.id !== ci?.id).map((c) => c.name); - const nameRow = liveField(_('Name', 'circle or service'), name, () => circleNameHelp(name.value, others)); - - modal( - ci ? fmt(_('Edit %s'), ci.name) : _('New circle'), - [ - nameRow, - field(_('Colour'), swatches), - field(_('People'), chips), - E('p', { class: 'dl-sub' }, _('Devices of people in one circle reach each other. A person is in one circle at a time.')), - ], - [ - ci - ? button( - _('Delete'), - async () => { - if (await attempt(() => api.circleDelete(ci.id), fmt(_('%s deleted'), ci.name))) { - closeModal(); - onDone(); - } - }, - 'negative', - ) - : '', - E('span', { class: 'dl-spacer' }), - cancelButton(), - ' ', - button( - _('Save'), - async () => { - const h = nameRow.help(); - if (h.bad) { - notify(h.text, 'warning'); - return; - } - if (await attempt(() => api.circleSet(ci?.id ?? '', serverId, name.value, color, [...members]), _('Saved'))) { - closeModal(); - onDone(); - } - }, - 'positive', - ), - ], - 'dl-circle-modal', - ); -} - -/** The server's circles as chips (click to edit) and a round "+" to add one. */ -export function circleChips(st: Status, serverId: string, onDone: () => unknown): HTMLElement { - const list = st.circles.filter((c) => c.server === serverId); - return E('div', { class: 'dl-chips-row dl-circles' }, [ - ...list.map((c) => { - const who = st.people.filter((p) => p.circle === c.id).map((p) => p.name); - return E( - 'button', - { type: 'button', class: 'dl-chip', title: fmt(_('Edit %s'), c.name), click: () => circleDialog(st, serverId, c, onDone) }, - [circleDot(c), E('b', {}, c.name), E('span', { class: 'dl-faint' }, who.length ? who.join(', ') : _('nobody yet'))], - ); - }), - E( - 'button', - { - type: 'button', - class: 'dl-chip add', - title: _('New circle'), - 'aria-label': _('New circle'), - click: () => circleDialog(st, serverId, null, onDone), - }, - icon('plus'), - ), - ]); -} - -/* ---------- Who reaches what ---------- */ - -export function whoReaches(st: Status, srv: Server): HTMLElement { - const people = st.people.filter((p) => p.server === srv.id); - const yes = (t = '') => E('span', { class: 'dl-yes' }, [icon('check'), t]); - const no = () => E('span', { class: 'dl-faint' }, '—'); - const home = (list: Person[]) => { - const kinds = new Set(list.map((p) => (p.access === 'lan' && p.services?.length ? 'services' : p.home_nets?.length ? 'some' : 'all'))); - if (!kinds.size) kinds.add('all'); - const label = { all: _('all networks'), some: _('their networks'), services: _('services') }; - return yes([...kinds].map((k) => label[k]).join(' / ')); - }; - const each = () => (srv.mesh === 'off' ? no() : srv.mesh === 'circles' ? yes(_('circle')) : yes()); - const net = srv.lan_like ? _('like home') : _('direct'); - const row = (label: string, list: Person[], cells: Node[]) => - E('tr', {}, [ - E('td', {}, [E('b', {}, label), E('div', { class: 'dl-sub' }, plural(list.length, '%s person', '%s people'))]), - ...cells.map((c) => E('td', {}, c)), - ]); - const by = (a: string) => people.filter((p) => p.access === a); - return E('section', { class: 'dl-setsec' }, [ - E('div', { class: 'dl-setsec-body' }, [ - E('div', { class: 'dl-panel-head' }, [ - E('h3', {}, _('Who reaches what')), - E('span', { class: 'dl-spacer' }), - E('span', { class: 'dl-sub' }, _('From the rules on this server')), - ]), - E( - 'div', - { class: 'dl-reach-wrap' }, - E('table', { class: 'dl-table dl-reach' }, [ - E( - 'tr', - {}, - ['', _('Internet'), _('Home'), _('This router'), _('Each other')].map((t) => E('th', {}, t)), - ), - row(_('Internet'), by('internet'), [yes(net), no(), E('span', { class: 'dl-faint' }, 'DNS'), no()]), - row(_('Home'), by('lan'), [E('span', { class: 'dl-faint' }, _('their own')), home(by('lan')), yes(), each()]), - row(_('Both'), by('both'), [yes(net), home(by('both')), yes(), each()]), - ]), - ), - E( - 'p', - { class: 'dl-sub' }, - _( - 'Home devices reach the devices of people with home access, on the networks those people reach. Paused, ended and over-the-limit people reach nothing.', - ), - ), - ]), - ]); -} - -/* ---------- Check access ---------- */ - -export function checkAccess(st: Status, srv: Server): HTMLElement { - const devs = st.people - .filter((p) => p.server === srv.id) - .flatMap((p) => p.devices.map((d) => ({ id: d.id, label: `${p.name} · ${d.name}` }))) - .sort((a, b) => a.label.localeCompare(b.label)); - const ADDR = '@addr'; - /** A device, or an address typed in. */ - const end = (placeholder: string, initial: string) => { - const sel = E('select', { class: 'cbi-input-select', 'aria-label': placeholder }, [ - ...devs.map((d) => E('option', { value: d.id, selected: d.id === initial ? 'selected' : null }, d.label)), - E('option', { value: ADDR, selected: initial === ADDR ? 'selected' : null }, _('Address')), - ]) as HTMLSelectElement; - const addr = input('', { placeholder, class: 'cbi-input-text dl-mono' }); - const wrap = E('div', { class: 'dl-check-end' }, [sel, addr]); - const sync = () => (addr.hidden = sel.value !== ADDR); - sel.addEventListener('change', sync); - sync(); - return { el: wrap, value: () => (sel.value === ADDR ? addr.value.trim() : sel.value) }; - }; - const from = end('10.0.1.11', devs[0]?.id ?? ADDR); - const to = end('10.0.1.20:445', ADDR); - const out = E('div', { class: 'dl-stack gap8' }); - const run = async () => { - const r = await attempt(() => api.accessCheck(from.value(), to.value())); - if (!r) return; - const stop = r.steps.findIndex((s) => !s.ok); - dom.content(out, [ - E('div', { class: `dl-verdict ${r.ok ? 'ok' : 'bad'}` }, [ - E('b', {}, r.ok ? _('Allowed') : _('Blocked')), - E('span', { class: 'dl-sub' }, r.ok ? _('Every step lets it through') : fmt(_('Stops at step %s of %s'), stop + 1, r.steps.length)), - ]), - E( - 'ul', - { class: 'dl-checks' }, - r.steps.map((s) => - E('li', {}, [ - E('span', { class: `dl-check-icon ${s.ok ? 'ok' : 'error'}` }, icon(s.ok ? 'check' : 'x')), - E('div', { class: 'dl-check-body' }, [ - E('div', { class: 'dl-check-title' }, s.title), - s.detail ? E('div', { class: 'dl-check-detail' }, s.detail) : '', - ]), - ]), - ), - ), - ]); - }; - return E('section', { class: 'dl-setsec' }, [ - E('div', { class: 'dl-setsec-body' }, [ - E('div', { class: 'dl-panel-head' }, [ - E('h3', {}, _('Check access')), - E('span', { class: 'dl-spacer' }), - E('span', { class: 'dl-sub' }, _('Why something does or does not connect')), - ]), - E('div', { class: 'dl-check-form' }, [from.el, E('span', { class: 'dl-faint' }, '→'), to.el, button(_('Check'), run)]), - out, - ]), - ]); -} diff --git a/web/src/admin/api.ts b/web/src/admin/api.ts index 12a68bc..ea852f8 100644 --- a/web/src/admin/api.ts +++ b/web/src/admin/api.ts @@ -1,4 +1,4 @@ -// luci.dawnline RPC bindings. The backend reports failures as { error }, and +// The backend's RPC bindings (ubus object `dawnline`, the Go backend). The backend reports failures as { error }, and // a change the router saved but could not fully put into effect (access rules // that did not load, a server that refused its devices) as { warning }. @@ -18,6 +18,7 @@ import type { } from '../shared/types'; import { notify } from './ui/toast'; import { lang } from '../shared/i18n'; +import { markWritten, streamMeter, streamStatus } from './state/stream'; /** Throw a backend failure; show a warning the answer carries. */ function settle(r: any): T { @@ -29,14 +30,26 @@ function settle(r: any): T { } /** - * A method of luci.dawnline. The page's language goes last, after the + * A method of the backend (`dawnline`). The page's language goes last, after the * method's own arguments: the router writes its messages in it. */ function call(method: string, params: string[] = []) { - const fn = rpc.declare({ object: 'luci.dawnline', method, params: [...params, 'lang'] }); - return async (...args: unknown[]): Promise => settle(await fn(...params.map((_p, i) => args[i]), lang())); + const declare = (object: string) => rpc.declare({ object, method, params: [...params, 'lang'] }); + const here = declare('dawnline'); + return async (...args: unknown[]): Promise => { + try { + return settle(await here(...params.map((_p, i) => args[i]), lang())); + } finally { + // anything but a question may have changed what the stream shows: the next status is read after it + if (!ASKS.test(method)) markWritten(); + } + }; } +/** The methods that only ask. */ +const ASKS = + /^(status|meter|rev|events|health|service_log|settings_get|portal_info|(server_)?interfaces|access_check|home_hosts|setup_defaults|endpoint_probe|person_(links|usage)|device_config|backup_(list|read)|export|updates_(status|releases|notes|changes))$/; + export interface SetupDefaults { id: string; name: string; @@ -111,11 +124,12 @@ export interface Meter { /** * A device's own link values for device_update; left out = kept. Numbers go as text: '' = the server's, keep-alive - * '0' = off. LAN Bypass stays as chosen when the device was added (the RPC takes it, the admin UI never changes it). + * '0' = off. LAN Bypass: its own local network outside the tunnel (the device fetches its configuration again). */ export interface DeviceLinkPatch { mtu?: string; keepalive?: string; + lan_bypass?: boolean; } export interface Backup { @@ -310,7 +324,7 @@ interface LikeHome { error?: string; } -export type IfaceCategory = 'wan' | 'ethernet' | 'wifi' | 'vpn' | 'other'; +type IfaceCategory = 'wan' | 'ethernet' | 'wifi' | 'vpn' | 'other'; export interface NetDevice { name: string; @@ -390,26 +404,11 @@ const logsClear = (f: LogFilter = {}) => logsClearRaw(f.person ?? '', f.device ? /** Fields for person_update; send strings ('' clears an optional value). */ export type PersonPatch = Partial< - Record< - | 'name' - | 'access' - | 'device_limit' - | 'expires' - | 'expire_action' - | 'expire_warn' - | 'quota_gb' - | 'quota_period' - | 'bonus_gb' - | 'hours' - | 'note' - | 'dns_mode' - | 'server', - string - > + Record<'name' | 'access' | 'device_limit' | 'expires' | 'quota_gb' | 'quota_period' | 'bonus_gb' | 'note' | 'dns_mode' | 'server', string> > & { paused?: boolean; services?: string[]; circle?: string; home_nets?: string[] }; const personUpdateRaw = rpc.declare({ - object: 'luci.dawnline', + object: 'dawnline', method: 'person_update', params: [ 'id', @@ -417,12 +416,9 @@ const personUpdateRaw = rpc.declare({ 'access', 'device_limit', 'expires', - 'expire_action', - 'expire_warn', 'quota_gb', 'quota_period', 'bonus_gb', - 'hours', 'note', 'dns_mode', 'paused', @@ -434,30 +430,42 @@ const personUpdateRaw = rpc.declare({ }); async function personUpdate(id: string, patch: PersonPatch): Promise<{ person: Person }> { - const keys = [ - 'name', - 'access', - 'device_limit', - 'expires', - 'expire_action', - 'expire_warn', - 'quota_gb', - 'quota_period', - 'bonus_gb', - 'hours', - 'note', - 'dns_mode', - ] as const; + const keys = ['name', 'access', 'device_limit', 'expires', 'quota_gb', 'quota_period', 'bonus_gb', 'note', 'dns_mode'] as const; const args: unknown[] = [id, ...keys.map((k) => patch[k]), patch.paused, patch.services, patch.circle, patch.home_nets, patch.server]; - return settle(await personUpdateRaw(...args)); + try { + return settle(await personUpdateRaw(...args)); + } finally { + markWritten(); + } } -const status = call('status', ['days']); +/** One person's changes in a people_update list. */ +export interface PeopleChange { + id: string; + patch: Pick & { + paused?: boolean; + }; +} -const deviceUpdateRaw = call('device_update', ['id', 'name', 'disabled', 'mtu', 'keepalive']); +/** + * From the backend's stream (state/stream.ts: the backend reads the router once for every open tab, when + * something changed). The stream's status holds the longest history a page asks for; one that asked for + * fewer days gets more. A backend that does not answer yet (it is starting, or was just restarted) is waited + * for a quarter of a minute; then the page says so, and fills in when it does. + */ +const status = async (_days: number): Promise => { + for (let i = 0; i < 6; i++) { + const st = await streamStatus(); + if (st) return st; + await new Promise((done) => setTimeout(done, 2500)); + } + throw new Error(_('Dawnline is starting on the router: this page fills in when it answers.')); +}; + +const deviceUpdateRaw = call('device_update', ['id', 'name', 'disabled', 'mtu', 'keepalive', 'lan_bypass']); /** Rename, turn off or on, or change how a device connects; what is undefined stays as it is. */ const deviceUpdate = (id: string, name?: string, disabled?: boolean, link: DeviceLinkPatch = {}) => - deviceUpdateRaw(id, name, disabled, link.mtu, link.keepalive); + deviceUpdateRaw(id, name, disabled, link.mtu, link.keepalive, link.lan_bypass); /** One line of the service log: tunnel and service starts, stops, watchdog repairs, errors. */ export interface ServiceLogEntry { @@ -472,6 +480,8 @@ export interface ServiceLogEntry { by?: 'admin'; kind?: string; note?: string; + /** The server an admin's change was made on (older entries have only its name, in `who`). */ + sid?: string; } export interface ServiceLog { @@ -491,9 +501,9 @@ export interface ServiceLog { export type Health = { checks: HealthCheck[] } & ServiceLog; export const api = { - rev: call<{ rev: number; version?: string }>('rev'), /** The live meter's points newer than `since` (0: all); polled while the Overview shows it. */ - meter: call('meter', ['since']), + meter: async (since: number): Promise => + (await streamMeter(since)) ?? { now: Date.now() / 1000, want: 10, keep: 120, ts: since, points: [] }, personUpdate, settingsGet: call('settings_get'), portalInfo: call('portal_info'), @@ -501,8 +511,8 @@ export const api = { serviceSet: call<{ id: string }>('service_set', ['id', 'name', 'address', 'ports']), serviceDelete: call('service_delete', ['id']), geoClear: call('geo_clear'), - /** The newest `limit` events; a person's only, or only those after `since` (a ts), when given. */ - events: call<{ events: LogEvent[]; total: number; policy: LogsInfo['policy'] }>('events', ['limit', 'person', 'since']), + /** The newest `limit` events; a person's or a device's only, or only those after `since` (a ts), when given. */ + events: call<{ events: LogEvent[]; total: number; policy: LogsInfo['policy'] }>('events', ['limit', 'person', 'since', 'device']), logsClear, interfaces: call('interfaces', ['id']), serverInterfaces: call('server_interfaces', [ @@ -558,17 +568,28 @@ export const api = { 'quota_period', ]), personPause: call('person_pause', ['id', 'paused']), + /** Several people at once, all or nothing (one transaction, one apply): People's picks and their undo. */ + peopleUpdate: call<{ changed: number }>('people_update', ['list']) as (list: PeopleChange[]) => Promise<{ changed: number }>, /** A new link; `remove` lists devices (ids) to take away with the old one. */ personRegen: call<{ link: string | null; removed: number }>('person_regen', ['id', 'remove']), personDelete: call('person_delete', ['id']), personUsage: call<{ person: DayUsage[]; devices: Record }>('person_usage', ['id', 'days']), /** A new device; `lan_bypass` (true) keeps its own local network outside the tunnel. */ - deviceCreate: call<{ id: string; config: ClientConfig }>('device_create', ['person', 'name', 'kind', 'lan_bypass']), - /** A device's configuration; `issue` (true) when it goes to the device as a code, a file or a key: only that clears "Update config". */ - deviceConfig: call('device_config', ['id', 'issue']), + /** `networks`: what stands behind a new router, its own from the start. */ + deviceCreate: call<{ id: string; config: ClientConfig }>('device_create', ['person', 'name', 'kind', 'lan_bypass', 'networks']), + /** The networks behind a router, all of them at once; the router applies everything (its routes move). */ + deviceNetworks: call<{ networks: string[] }>('device_networks', ['id', 'networks']), + /** + * The answer to what a router's owner asked for on their own page: `accept` or `decline` (with a reason they + * read), for the networks named or for all that is asked; `reopen` puts the question back (the undo of either). + */ + deviceAnswer: call('device_answer', ['id', 'answer', 'reason', 'router', 'networks']), + /** A device's configuration, to show it; showing marks nothing as given out (that is the portal's fetch, a new device, new keys). */ + deviceConfig: call('device_config', ['id']), deviceUpdate, deviceDelete: call('device_delete', ['id']), - deviceRotate: call('device_rotate', ['id']), + /** New keys: the device is set up again; `kind` and `lan_bypass` (asked again) change with them when given. */ + deviceRotate: call('device_rotate', ['id', 'kind', 'lan_bypass']), apply: call('apply'), health: call('health'), healthFix: call('health_fix', ['id']), diff --git a/web/src/admin/cores/awg.ts b/web/src/admin/cores/awg.ts deleted file mode 100644 index 5176b5a..0000000 --- a/web/src/admin/cores/awg.ts +++ /dev/null @@ -1,564 +0,0 @@ -// The AmneziaWG core in the admin: how a device connects (.conf, AmneziaVPN -// key, QR, V2RayTun's link), the disguise and its parameters, and the core's own settings on -// Server → AmneziaWG. Plain WireGuard is AmneziaWG with the disguise off. - -import type { AwgConfig, Kind, Server, Status } from '../../shared/types'; -import { E } from '../e'; -import { api } from '../api'; -import { button } from '../ui/button'; -import { confirmDialog } from '../ui/modal'; -import { copyText, downloadFile } from '../ui/files'; -import { attempt, notify } from '../ui/toast'; -import { input } from '../ui/controls'; -import { callout, card, firstBad, group, liveRow, row } from '../ui/layout'; -import { qrCode } from '../ui/qr'; -import { keepaliveHelp, mtuHelp, portHelp, type PortHold } from '../netcheck'; -import { vpnKey } from '../../shared/vpnkey'; -import { awgLink, v2rFits } from '../../shared/awglink'; -import { V2R_WINDOWS } from '../../shared/flags'; -import { icon } from '../../shared/icons'; -import { methodInfo, methodPicker, type Method, defaultMethod, legacyTitle } from '../disguise'; -import { fmt, fill, num, plural } from '../../shared/i18n'; -import { coreHead, type ConnectView, type Core, type CoreCtx } from './common'; - -/** `.conf` names of the disguise parameters, in file order. */ -const CONF: [string, string][] = [ - ['jc', 'Jc'], - ['jmin', 'Jmin'], - ['jmax', 'Jmax'], - ['s1', 'S1'], - ['s2', 'S2'], - ['s3', 'S3'], - ['s4', 'S4'], - ['h1', 'H1'], - ['h2', 'H2'], - ['h3', 'H3'], - ['h4', 'H4'], - ['i1', 'I1'], - ['i2', 'I2'], - ['i3', 'I3'], - ['i4', 'I4'], - ['i5', 'I5'], - ['header_protection_key', 'HeaderProtectionKey'], - ['content_padding_addition', 'ContentPaddingAddition'], - ['rekey_after_time', 'RekeyAfterTime'], - ['rekey_timeout', 'RekeyTimeout'], - ['reject_after_time', 'RejectAfterTime'], - ['keepalive_timeout', 'KeepaliveTimeout'], - ['max_handshake_attempts', 'MaxHandshakeAttempts'], - ['random_trailers', 'RandomTrailers'], - ['disable_cookies', 'DisableCookies'], -]; - -/** - * The applied parameters, grouped by what they do, with a plain-language - * line per group. Collapsed by default; copyable as config lines. The header - * protection key stays out of the status (read-only users can read it): the - * view says there is one, and each device's file has it. - */ -function paramsView(o: Record, hpk: boolean): HTMLElement | null { - const has = (k: string) => (k === 'header_protection_key' ? hpk : o[k] != null && o[k] !== ''); - const keys = CONF.filter(([k]) => has(k)); - if (!keys.length) return null; - const val = (k: string, name: string) => - E('span', { class: 'dl-pv' }, [E('i', {}, name), E('b', {}, k === 'header_protection_key' ? _('set', 'key') : o[k])]); - const group = (title: string, ic: string, text: string, ks: string[]) => { - const present = CONF.filter(([k]) => ks.includes(k) && has(k)); - return present.length - ? E('div', { class: 'dl-pgroup' }, [ - E('div', { class: 'dl-pgroup-head' }, [icon(ic), E('b', {}, title)]), - E('p', {}, text), - E( - 'div', - { class: 'dl-pvals' }, - present.map(([k, n]) => val(k, n)), - ), - ]) - : ''; - }; - const jc = Number(o.jc || 0); - const signature = (o.i1 ?? '').includes('0x8580') - ? _('A first packet shaped like a DNS answer.') - : _('Extra packets sent before the handshake.'); - const conf = keys - .filter(([k]) => k !== 'header_protection_key') - .map(([k, n]) => `${n} = ${o[k]}`) - .join('\n'); - const body = E('div', { class: 'dl-pgrid' }, [ - group( - _('Junk packets'), - 'zap', - jc - ? fmt( - N_(jc, '%s random packet of %s–%s bytes before each handshake.', '%s random packets of %s–%s bytes before each handshake.'), - num(jc), - o.jmin, - o.jmax, - ) - : _('No junk packets.'), - ['jc', 'jmin', 'jmax'], - ), - group( - _('Padding'), - 'archive', - _('Random bytes in front of handshake, cookie and data packets, so their sizes do not match WireGuard.'), - ['s1', 's2', 's3', 's4'], - ), - group(_('Packet types'), 'key', _('The values that replace WireGuard’s recognisable message types.'), ['h1', 'h2', 'h3', 'h4']), - group(_('Signatures'), 'globe', signature, ['i1', 'i2', 'i3', 'i4', 'i5']), - group(_('Protection'), 'lock', _('AmneziaWG 3.1: encrypted headers, random tails and extra padding on data packets.'), [ - 'header_protection_key', - 'content_padding_addition', - 'random_trailers', - 'disable_cookies', - ]), - group(_('Timing'), 'clock', _('Handshake and key timers vary within these ranges instead of WireGuard’s fixed values.'), [ - 'rekey_after_time', - 'rekey_timeout', - 'reject_after_time', - 'keepalive_timeout', - 'max_handshake_attempts', - ]), - ]); - return E('details', { class: 'dl-params' }, [ - E('summary', {}, [ - icon('chevron'), - E('span', {}, _('Current parameters')), - E('span', { class: 'dl-pcount' }, String(keys.length)), - E('span', { class: 'dl-spacer' }), - E( - 'button', - { - type: 'button', - class: 'dl-linkbtn', - click: (ev: Event) => { - ev.preventDefault(); - copyText(conf, hpk ? _('Parameters copied. The header protection key is in each device’s file.') : _('Parameters copied')); - }, - }, - _('Copy as config'), - ), - ]), - body, - ]); -} - -/** One configuration line, highlighted; private and preshared keys masked unless shown. */ -function confLine(line: string, reveal: boolean): Node { - if (/^\s*\[.+\]\s*$/.test(line)) return E('span', { class: 'dl-conf-sec' }, line); - const m = /^(\s*[A-Za-z0-9]+\s*=)\s*(.*)$/.exec(line); - if (!m) return document.createTextNode(line); - const secret = /^(\s*)(PrivateKey|PresharedKey)\b/.test(line); - return E('span', {}, [ - E('span', { class: 'dl-conf-k' }, m[1]), - ' ', - secret && !reveal ? E('span', { class: 'dl-conf-mask' }, '••••••••••••••••') : m[2], - ]); -} - -/** The .conf as a file card (download) and a folded, highlighted view with copy and a hidden key. */ -function fileCard(cfg: AwgConfig): HTMLElement { - let reveal = false; - const pre = E('pre', { class: 'dl-conf' }); - const paint = () => - dom.content( - pre, - cfg.conf.split('\n').flatMap((l, i) => (i ? ['\n', confLine(l, reveal)] : [confLine(l, reveal)])), - ); - const eye = E( - 'button', - { - type: 'button', - class: 'dl-chipbtn', - click: (ev: Event) => { - ev.preventDefault(); - reveal = !reveal; - dom.content(eye, [icon(reveal ? 'x' : 'key'), reveal ? _('Hide key') : _('Show key')]); - paint(); - }, - }, - [icon('key'), _('Show key')], - ); - paint(); - const size = new Blob([cfg.conf]).size; - return E('div', { class: 'dl-stack gap8' }, [ - E('div', { class: 'dl-filecard' }, [ - E('span', { class: 'dl-filecard-ic' }, '.conf'), - E('span', { class: 'dl-stack' }, [ - E('span', { class: 'dl-mono dl-ellipsis' }, cfg.filename), - E('span', { class: 'dl-sub' }, `AmneziaWG · ${plural(size, '%s byte', '%s bytes')}`), - ]), - button([icon('download'), ' ', _('Download')], () => downloadFile(cfg.filename, cfg.conf, 'application/octet-stream'), 'positive'), - ]), - E('details', { class: 'dl-params' }, [ - E('summary', {}, [ - icon('chevron'), - E('span', {}, _('Configuration')), - E('span', { class: 'dl-spacer' }), - eye, - E( - 'button', - { - type: 'button', - class: 'dl-chipbtn', - click: (ev: Event) => { - ev.preventDefault(); - copyText(cfg.conf, _('Configuration copied')); - }, - }, - [icon('copy'), _('Copy')], - ), - ]), - pre, - ]), - ]); -} - -/** The configuration carries no disguise values: plain WireGuard, any WireGuard app takes it. */ -export function plainWg(cfg: AwgConfig): boolean { - const o = (cfg.amnezia.obfuscation ?? {}) as Record; - const neutral: Record = { h1: '1', h2: '2', h3: '3', h4: '4' }; - return Object.entries(o).every(([k, v]) => v == null || v === '' || v === (neutral[k] ?? '0')); -} - -/** - * V2RayTun's way in: the connection as its awg:// link (shared/awglink.ts; - * the app's own words are in portal/setup.ts, with where they come from). A - * computer runs it on Windows, whose core looks the server's name up itself: - * the link keeps the name. That one is off for now (shared/flags.ts - * V2R_WINDOWS: its core leaves the server's DNS unused). Anything else is - * taken for Android, whose core takes no name: the link has the server's IP - * (amnezia.host_ip, from device_config). - */ -function v2rPane(cfg: AwgConfig, kind: Kind): HTMLElement { - const win = kind === 'computer'; - const host = cfg.amnezia.host.replace(/^\[(.*)\]$/, '$1'); - const ip = win ? null : (cfg.amnezia.host_ip ?? null); - const link = awgLink(cfg.conf, cfg.server, ip); - const box = E('div', { class: 'dl-linkbox' }, [ - E('span', { class: 'dl-mono', title: link }, link), - button(_('Copy'), () => copyText(link, _('Link copied'))), - ]); - if (win) - return E('div', { class: 'dl-stack gap8' }, [ - box, - E( - 'span', - { class: 'dl-sub' }, - fmt( - _( - 'V2RayTun on Windows: %s, then set its mode to %s and connect. That mode needs administrator rights: the app offers to restart with them.', - ), - ['+', _('Import from clipboard', 'V2RayTun app')].join(' → '), - _('Tunnel', 'V2RayTun app'), - ), - ), - ]); - return E('div', { class: 'dl-qr-pane' }, [ - qrCode(link), - E( - 'span', - { class: 'dl-sub' }, - fmt( - _('V2RayTun on Android: %s, or copy the link and %s.'), - ['+', _('Import config from QRcode', 'V2RayTun app')].join(' → '), - ['+', _('Import config from Clipboard', 'V2RayTun app')].join(' → '), - ), - ), - box, - // Honest about what the IP costs, and about a name that gives none. - ip && ip !== host - ? E( - 'div', - { class: 'dl-hint' }, - _('The link has the server’s IP address, not its name: if the address changes, set the device up again.'), - ) - : !ip - ? callout('warn', fmt(_('%s does not resolve right now, and V2RayTun on Android connects by IP address only.'), host)) - : '', - ]); -} - -/** - * File / key / QR / V2RayTun switcher for a client configuration of a device - * of this kind; opens on the file unless asked otherwise. V2RayTun is left out - * for a router, for a computer while V2R_WINDOWS is off (shared/flags.ts) and - * for AmneziaWG 3.1 (the Maximum disguise), which it lacks. - */ -async function connectBlock(cfg: AwgConfig, kind: Kind, initial: ConnectView = 'file'): Promise { - if (!cfg.has_private_key) - return E( - 'div', - { class: 'dl-hint' }, - _('This device generated its own keys in the browser, so its full configuration only exists on that device.'), - ); - const key = await vpnKey(cfg, cfg.server); - const panes: Partial Node>> = { - qr: () => - E('div', { class: 'dl-qr-pane' }, [ - qrCode(cfg.conf), - E( - 'span', - { class: 'dl-sub' }, - plainWg(cfg) - ? _('Scan with AmneziaVPN or any WireGuard app on the device.') - : _('Scan with AmneziaVPN or AmneziaWG on the device.'), - ), - ]), - key: () => - E('div', { class: 'dl-stack gap8' }, [ - E('div', { class: 'dl-linkbox' }, [E('span', { class: 'dl-mono' }, key), button(_('Copy'), () => copyText(key, _('Key copied')))]), - // The app's own labels (portal/setup.ts has where they come from): + in its bottom bar, Insert, Continue. - E( - 'span', - { class: 'dl-sub' }, - fmt(_('AmneziaVPN → %s. Keep it private.'), ['+', _('Insert', 'AmneziaVPN app'), _('Continue', 'AmneziaVPN app')].join(' → ')), - ), - ]), - file: () => fileCard(cfg), - }; - if (kind !== 'router' && (kind !== 'computer' || V2R_WINDOWS) && v2rFits(cfg.conf)) panes.v2r = () => v2rPane(cfg, kind); - const labels: [ConnectView, string][] = [ - ['file', _('File')], - ['key', _('Key')], - ['qr', _('QR code')], - ['v2r', 'V2RayTun'], - ]; - const body = E('div', { class: 'dl-connect-body' }); - const seg = E('div', { class: 'dl-seg' }); - const show = (id: ConnectView) => { - seg.querySelectorAll('button').forEach((b) => b.classList.toggle('on', b.dataset.id === id)); - dom.content(body, panes[id]!()); - }; - for (const [id, label] of labels) - if (panes[id]) seg.appendChild(E('button', { type: 'button', 'data-id': id, click: () => show(id) }, label)); - show(panes[initial] ? initial : 'file'); - return E('div', { class: 'dl-stack gap12' }, [seg, body]); -} - -/** Switch the disguise (every device imports its configuration again). */ -async function applyDisguise(ctx: CoreCtx, srv: Server, m: Method, same: boolean) { - const info = methodInfo(m)!; - const people = ctx.st.people.filter((p) => p.server === srv.id); - const devices = people.reduce((n, p) => n + p.devices.length, 0); - const ok = await confirmDialog( - same ? _('Generate new disguise values?') : fmt(_('Switch to %s?'), info.title), - [ - plural( - devices, - '%s AmneziaWG device stops connecting until it imports its configuration again (from their personal link or from you).', - '%s AmneziaWG devices stop connecting until they import their configuration again (from their personal link or from you).', - ), - m === 'max' ? _('They need an app with AmneziaWG 3.1.') : m === 'balanced' ? _('They need an app with AmneziaWG 2.0 or newer.') : '', - ctx.st.servers.length === 1 && devices ? _('To keep the old disguise for some people, add a second server and move them there.') : '', - ] - .filter(Boolean) - .join(' '), - same ? _('Generate and apply') : _('Switch and apply'), - true, - ); - if (!ok) return; - if (await attempt(() => api.serverObfuscation(srv.id, m), same ? _('New values applied') : fmt(_('%s applied'), info.title))) { - notify(_('Devices are marked “Update config” until they import again.'), 'info', 6000); - await ctx.refresh(); - } -} - -/** Server → AmneziaWG: listening port, what goes into every configuration, disguise, tunnel. */ -function settingsCard(ctx: CoreCtx, srv: Server): HTMLElement { - const st: Status = ctx.st; - const port = input(String(srv.port), { inputmode: 'numeric', class: 'cbi-input-text dl-w-port dl-mono' }); - const mtu = input(srv.mtu ? String(srv.mtu) : '', { - placeholder: _('Auto'), - inputmode: 'numeric', - class: 'cbi-input-text dl-w-port dl-mono', - }); - const ka = input(String(srv.keepalive ?? ''), { placeholder: '25', inputmode: 'numeric', class: 'cbi-input-text dl-w-port dl-mono' }); - const current = methodInfo(srv.preset) ? (srv.preset as Method) : undefined; - let selected: Method = current ?? defaultMethod(st.awg); - const apply = button('', () => applyDisguise(ctx, srv, selected, selected === current), 'neutral'); - const label = () => - dom.content( - apply, - selected === current ? [icon('reset'), ' ', _('Generate new values')] : [fmt(_('Switch to %s'), methodInfo(selected)!.title)], - ); - label(); - const tools = st.awg_state?.tools !== false; - // Who holds which port arrives once the card is built (netstat on the - // router); until then the port is only checked for its range. - let holds: PortHold[] = []; - const portRow = liveRow(_('UDP port'), port, () => - portHelp( - Number(port.value), - holds, - [ - _('Opened on the WAN firewall automatically.'), - Number(port.value) === 4500 ? _('4500 is IPsec’s port: most networks let it through.') : '', - ] - .filter(Boolean) - .join(' '), - ), - ); - api - .serverPorts(srv.id) - .then((r) => { - holds = r.udp_taken ?? []; - portRow.refresh(); - }) - .catch(() => {}); - const mtuRow = liveRow('MTU', mtu, () => mtuHelp(mtu.value, srv.mtus)); - const kaRow = liveRow(_('Keep-alive'), ka, () => keepaliveHelp(ka.value)); - return card( - '', - [ - coreHead('AmneziaWG', srv.ifname), - group('globe', _('Listening'), _('Where devices reach this core from the internet'), [portRow]), - group('file', _('In every device configuration'), _('Changing these marks devices “Update config” until they import again'), [ - mtuRow, - kaRow, - ]), - group('shield', _('Disguise'), _('So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard'), [ - // A server from before 0.8 on the old junk-only disguise: it runs, but is no longer offered. - legacyTitle(srv.preset) - ? callout( - 'warn', - fill( - _( - '%s is AmneziaWG 1.0 junk only, which networks learned to spot; it is not offered any more. Switch to %s or %s: devices import their configuration again.', - ), - E('b', {}, legacyTitle(srv.preset)!), - E('b', {}, _('Balanced')), - E('b', {}, _('Maximum')), - ), - ) - : '', - methodPicker( - st.awg, - selected, - (m) => { - selected = m; - label(); - }, - current, - tools, - ), - // Only about an installed AmneziaWG: without one the server page says what to install. - tools && !st.awg.v3 - ? callout( - 'info', - fill( - _('This router runs an older AmneziaWG. %s becomes available with kmod-amneziawg and amneziawg-tools 3.1.'), - E('b', {}, _('Maximum')), - ), - ) - : '', - paramsView(srv.obf ?? {}, srv.hpk) ?? '', - E('div', { class: 'dl-row-end' }, [ - E('span', { class: 'dl-sub' }, _('Applies at once: every AmneziaWG device imports its configuration again.')), - apply, - ]), - ]), - E('details', { class: 'dl-params' }, [ - E('summary', {}, [icon('chevron'), E('span', {}, _('Tunnel')), E('span', { class: 'dl-pcount' }, '3')]), - E('div', { class: 'dl-params-body' }, [ - row(_('Interface'), E('span', { class: 'dl-mono' }, `${srv.ifname} · ${fmt(_('router %s'), srv.address)}`)), - row(_('Tunnel subnet'), E('span', { class: 'dl-mono' }, srv.subnet), _('Device addresses come from it.')), - row( - _('Server public key'), - E('span', { class: 'dl-keyrow' }, [ - E('code', { class: 'dl-mono' }, srv.public_key), - button([icon('copy')], () => copyText(srv.public_key, _('Public key copied')), 'neutral', { - title: _('Copy'), - class: 'cbi-button cbi-button-neutral dl-icon-only sm', - }), - ]), - ), - ]), - ]), - ], - [ - E('span', { class: 'dl-sub' }, _('Port, MTU and keep-alive apply at once.')), - button( - _('Save'), - () => { - // The help lines already say what is wrong: do not send it anyway. - const bad = firstBad([portRow, mtuRow, kaRow]); - if (bad) { - notify(bad, 'warning'); - return; - } - return ctx.save({ port: port.value, mtu: mtu.value, keepalive: ka.value }, _('AmneziaWG saved')); - }, - 'positive', - ), - ], - ); -} - -/** Overview: the disguise in use, its stealth and speed, and the values devices carry in words. */ -function overviewTile(srv: Server): HTMLElement { - const m = methodInfo(srv.preset); - const o = srv.obf ?? {}; - const segs = (n: number, cls: string) => - E( - 'span', - { class: `dl-segs ${cls}` }, - [0, 1, 2, 3].map((i) => E('i', { class: i < n ? 'on' : '' })), - ); - const chips: string[] = []; - if (+o.jc) chips.push(`${plural(+o.jc, '%s junk', '%s junk')} · ${o.jmin}–${o.jmax} ${_('B')}`); - const pad = ['s1', 's2', 's3', 's4'].filter((k) => +o[k]).map((k) => `${k.toUpperCase()} ${o[k]}`); - if (pad.length) chips.push(pad.slice(0, 2).join(' · ') + (pad.length > 2 ? ` +${pad.length - 2}` : '')); - if (['h1', 'h2', 'h3', 'h4'].some((k) => o[k] && o[k] !== String(['h1', 'h2', 'h3', 'h4'].indexOf(k) + 1))) chips.push(_('H1–H4 random')); - if (o.i1) chips.push(/0x(8580|0100)0001/.test(o.i1) ? _('DNS-like first packets') : _('Signature packets')); - if (srv.hpk) chips.push(_('Encrypted headers')); - if (!chips.length) chips.push(m?.id === 'off' ? _('Plain WireGuard') : _('No values yet')); - return E('div', { class: 'dl-bento-tile dl-disg' }, [ - E('div', { class: 'dl-bento-head' }, [ - E('span', { class: 'dl-metric-label' }, _('Disguise')), - E('a', { href: `${L.url('admin/services/dawnline/server')}?server=${encodeURIComponent(srv.id)}§ion=awg` }, _('Change')), - ]), - E('div', { class: 'dl-disg-id' }, [ - E('span', { class: `dl-disg-ic${m?.id === 'off' ? ' off' : ''}` }, icon(m?.ic ?? 'shield')), - E('span', { class: 'dl-stack' }, [ - E('b', {}, m ? m.title : (legacyTitle(srv.preset) ?? _('Custom', 'disguise'))), - E('span', { class: 'dl-sub' }, m ? m.short : legacyTitle(srv.preset) ? _('Switch to Balanced or Maximum') : _('Set by hand')), - ]), - ]), - m - ? E('div', { class: 'dl-disg-meters' }, [ - E('span', {}, _('Stealth')), - segs(m.stealth, 'acc'), - E('span', {}, _('Speed')), - segs(m.speed, 'ok'), - ]) - : '', - E( - 'div', - { class: 'dl-disg-chips' }, - chips.map((c) => E('span', {}, c)), - ), - ]); -} - -export const awg: Core = { - id: 'awg', - label: 'AmneziaWG', - settingsCard, - overviewTile, - connectBlock, - qrText: (cfg) => cfg.conf, - // Labels are getters: the text is made when a menu is drawn. - appKey: { - get label() { - return _('Copy AmneziaVPN config'); - }, - make: (cfg) => vpnKey(cfg, cfg.server), - }, - file: { - get label() { - return _('Download AmneziaWG config'); - }, - make: (cfg) => ({ name: cfg.filename, text: cfg.conf }), - }, -}; diff --git a/web/src/admin/cores/common.ts b/web/src/admin/cores/common.ts deleted file mode 100644 index 8c7a79c..0000000 --- a/web/src/admin/cores/common.ts +++ /dev/null @@ -1,40 +0,0 @@ -// What every tunnel core gives the admin (cores/index.ts holds the registry), -// what a core's settings card gets from the Server page, and that card's head. - -import type { ClientConfig, Kind, Server, Status } from '../../shared/types'; -import { E } from '../e'; - -/** The ways a device takes its configuration, as the set-up switcher names them. */ -export type ConnectView = 'file' | 'key' | 'qr' | 'v2r'; - -/** What the Server page hands a core's settings card. */ -export interface CoreCtx { - st: Status; - /** server_update with these values, then refresh. */ - save: (values: Record, ok?: string) => Promise; - refresh: () => Promise; -} - -/** A tunnel core (AmneziaWG today): its name and the pieces of the admin that differ per core. */ -export interface Core { - id: string; - /** "AmneziaWG": the server section, the address bar, the settings card. */ - label: string; - /** Server →