Commit Graph
35 Commits
Author SHA1 Message Date
Zakk 4c38cfdc5b feat(groups): edit a group's exit node and explain rejected refreshes (#703)
## Problem / 问题

After #702, doona can add and edit proxy chains, but two parts of honk's
chain support are still missing. A group's experimental `exit` node can
only be set in the configuration text, and the group document from the
API does not expose it. When a subscription refresh removes or
duplicates a node that a chain hop or group exit names, honk rejects the
update and keeps the old nodes, but doona shows only a generic failure.

## How I fixed it / 解决方法

Group exit:
- `readGroupEntries` reads `exit`, and `writeGroupEntry` writes it with
`quoteName` right after `final`, the same way as `default` and `final`.
It is part of the no-change comparison and the save-conflict retry
merge.
- The group editor has an "Exit node (Experimental)" select, offered
only when the engine is honk. It lists None plus nodes that can be a
later hop, reusing the `tunnelDialable` check from #702. Chains, groups,
direct, block, Hysteria2, TUIC, Juicity and AnyTLS are excluded.
- The running-configuration section of the group dialog shows the exit
when one is set.
- honk's four group exit diagnostic codes have localized messages.

Rejected refresh:
- When a provider's `last_error.code` is `publication_rejected` and
`details.diagnostic_code` is one of the seven chain or exit codes, the
subscription status explains that a proxy chain or group exit refers to
a node the update removed or duplicated, and that the previous nodes
stay in use.

The mock `office` group gains `exit: hk-02`, which moves the mock rule
lines down by one; the rule tests follow.

## Screenshots

| | |
|---|---|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-select-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-select-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-options-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-options-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-notice-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-notice-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-detail-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-detail-zh-TW-dark-390.png)
|

The rejected refresh shots use an intercepted providers response,
because the mock has no such provider. All 40 variants are kept locally.

## Verified / 验证

- `pnpm typecheck`, `lint`, `check:i18n`, `format:check`, `check:gen`
and `build` all exit 0.
- `pnpm test` exits 0: 251 files, 4417 tests.
- Playwright on Chromium: 12 specs covering groups, policies, rules,
nodes and the builder, 273 tests, all pass.
- `check:size`: the Policies chunk is 21055 B gzip, up 213 B. The Nodes
route is 73134 B against a 76000 B budget.
- Not yet checked against a running honk: the exit write and the real
shape of `publication_rejected`, which honk documents in api.md but
which has not been observed live.
2026-11-25 19:06:44 +11:00
Zakk 8d81ddb689 feat(nodes): add, show and edit proxy chains (#702)
## Problem / 问题

After #701, doona reads proxy chains and keeps their references intact,
but it gives no way to see or build one. A chain row shows the raw
protocol `chain` and no hops. Adding or editing a chain means editing
the configuration text, because honk's `POST /nodes` only takes share
links.

## How I fixed it / 解决方法

Display:
- A chain row shows the protocol as "Proxy chain" (代理鏈 / 代理链).
- Its detail lists the hops from entry to exit, with each hop's protocol
and health, and marks a hop that is missing or ambiguous.
- UDP is shown as "No" with the reason when the hop protocols rule it
out. Otherwise it reads "depends on node settings", because the catalog
does not expose UDP flags.
- The node-level TCP connect test is hidden for chains, since honk
returns 422. Group latency no longer counts a chain member's
`no_node_address` row as a failure.

Editing:
- The add-node dialog has a "Proxy chain" mode with an ordered picker of
2 to 4 existing non-chain nodes. Hops can be added, removed and moved up
or down.
- Editing a chain reopens the same dialog. `appendChainEntry` and
`writeChainEntry` write the configuration text through source PUT.
- Before writing, the dialog checks hop count, self reference, direct,
block or chain hops, and the protocol position rules from honk's
`nodes.md` that the catalog can show. honk's diagnostics are shown for
everything else.
- Creating and editing chains is offered only when the engine is honk
and the main source is editable.

`writeNodeEntry` and `writeChainEntry` share one edit helper.
`SearchSelect` gains optional `error` and `action` props, so a hop's
controls sit beside its picker and its error spans the row. Other call
sites are unchanged.

Group `exit` editing, the rejected subscription refresh notice and the
manual pages follow in a stacked PR.

## Screenshots

| | |
|---|---|
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/node-list-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/node-list-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-detail-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-detail-zh-TW-dark-1280.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-dialog-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-dialog-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-dialog-error-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/1e1f373d5d925683e7ddbf5e819ca774/raw/chain-dialog-error-zh-TW-dark-1280.png)
|

All 32 variants (390 and 1280, en and zh-TW, light and dark) are kept
locally and available on request.

## Verified / 验证

- `pnpm typecheck`, `lint` (0 warnings), `check:i18n`, `format:check`,
`check:gen` and `build` all exit 0.
- `pnpm test` exits 0: 251 files, 4405 tests.
- `check:size`:
- Nodes route is 73162 B gzip against a 76000 B budget, up from 72320 B.
  - The lazily loaded chain picker chunk is 812 B.
- Playwright `e2e/nodes.spec.ts` on chromium: 101 passed. The 6 other
specs that the new mock chain touched pass, but the full suite was not
rerun after the last change.
- A separate review ablated each key hunk, and every one is now caught
by a test.

Not verified:
- Writes against a live honk.
- Firefox and WebKit e2e.

Net shipped code is about 414 lines, over the 300-line feature budget.
The PR carries display, editing and the engine gate together; splitting
it is possible if wanted.

---

- [ ] I understand this change and answer for every line
- [x] This branch is based on the current main
- [x] I ran the repository's gates and recorded the results in Verified
- [x] Each commit is one coherent change
- [ ] If behaviour changed, I updated the documentation
- [x] If interface text changed, I updated `en.json` and every complete
language's catalogue
- [x] If interface appearance changed, I attached light and dark
screenshots
- [ ] If the API contract changed, I ran `pnpm gen:api` and `pnpm
check:gen`
- [ ] I checked the boxes above without reading them
- [ ] I am an AI agent, and this content was submitted without human
review
2026-11-25 17:58:58 +11:00
Zakk 6d59d639e2 feat(connections): group the detail panel and name a node's subscription
The connection detail panel listed about sixteen fields in one column,
each label above its value, many of them empty or unknown. It now groups
them into route, connection, traffic and source sections with the route
first, puts each value beside its label, leaves out fields a connection
lacks, and shows each traffic total with its rate. DNS and flow detail
panels use the same list.

A row under the chain names the subscription the node came from, read
from the nodes query the page already holds, and the connection filter
matches it. The demo's auto group flows now reach the subscription node
it selects.
2026-11-18 05:23:34 +11:00
Zakk a103cc9d6c chore(mock): report honk v0.1.0-beta.6
The demo and e2e mock backend still reported beta.5, a release behind honk's latest.
2026-11-18 01:16:19 +11:00
Zakk dcfa505700 feat(settings): schedule geodata updates at a daily hour
honk reports the geodata update schedule as a cron expression and defaults to daily at 03:00. The settings page only knew the interval in hours, so it showed a nominal 24 hours, and picking an interval silently replaced the cron schedule.

A schedule of the form '0 H * * *' shows as an hour select. Any other expression shows read-only with a button that switches to daily. An interval schedule keeps its select and can switch to daily and back. An engine without the cron field gets the page it had.
2026-11-12 01:51:42 +11:00
Zakk 15a3c2c5af feat(policies): recommend score and name the load-balance cost 2026-11-09 03:29:57 +11:00
Zakk 5b1c7d7e30 fix(nodes): say how a subscription download failed 2026-11-04 22:01:53 +00:00
Zakk c786c8ac80 fix(mock): report honk v0.1.0-beta.5 in the demo
honk v0.1.0-beta.5 is the release that will embed this doona.
2026-11-02 15:44:49 +00:00
Zakk 7c7e09fadd refactor(engines): reach engine facts through the adapter
The configuration export, import and revision routes, the export file
name, the store state, the restart command and the restart-only global
settings now come from src/api/engines instead of honk literals in the
app and in Lite.

- configOf(version) in engines/config.ts returns an engine's
  configuration extension, or null for an engine without one; every
  caller and the client methods take it, so an unknown engine offers
  no configuration history and reports none of it off. The module does
  not load the adapters, so the shell can use it at startup.
- Engine gains restartCommand and restartOnly. The restart notice and
  Lite show the command only when the engine names one.
- Lite reads the version when Settings opens and takes the global
  settings from engineOf; an engine doona does not know gets no forms.
- The suggested backend port is the native API's default, and the
  retired API names that block sign-in are kept in one list.

Raises the startupActivity budget from 326250 to 326482 and routeConfig
from 196050 to 196062, with the owner's approval: the shell now asks
the engine whether it manages configuration, which adds 232 B to the
Activity start and 12 B to the config route (Node 22 gzip).
2026-10-31 11:14:05 +00:00
Zakk 0119740c9b fix(mock): show the current honk version in the demo
The demo reported honk v0.0.1.beta.81 and a honk/0.0.1-alpha subscription user agent. It now reports v0.1.0-beta.4, the release that embeds this doona, and honk/0.1.0, the user agent honk sends.
2026-10-30 13:42:21 +00:00
Zakk fcf3f9c337 chore: remove unused code, messages and export surfaces
Remove the remaining dead lite helper and icon, 26 unused keys from each lite catalogue, and verified unconsumed exports. Keep live implementations and skip findings already addressed by round one.
2026-10-28 06:58:10 +00:00
Zakk 7d9a875779 fix(mock): enforce capabilities and preserve network evidence
Reject unavailable operations and invalid DNS-log source filters before state changes. Reuse endpoint parsing for bare and IPv6 addresses, and enforce DNS-log response budgets in UTF-8 bytes without serializing unlimited pages.

Cover capability refusals, address evidence and multibyte pagination. Keep contract traversal valid when a profile cannot start an operation, and clarify that generated DNS logs are samples rather than rule evaluations.
2026-10-28 06:58:10 +00:00
Zakk 0820004903 refactor(lite): share the demo mock with the standard edition
Lite kept a copy of the shared mock factory and swapped three of its
imports at build time. The shared factory now takes a fixtures option,
and lite passes its two extra subscriptions through it. The memoised
groupAdmits moves into src/dae/groupFilters.ts, and the demo no longer
rewrites config comments into Simplified Chinese.
2026-10-27 01:37:20 +00:00
Zakk 250f68a77f fix(mock): leave seeded manual nodes untagged
Nodes from the node section have no subscription tag, as nodes the mock creates on activation already show, so manual-node group filters now match the seeded demo nodes.
2026-10-27 01:37:20 +00:00
Zakk b142c602a7 fix(mock): create the node or subscription section a new entry needs
createNode and createProvider inserted the entry only after an existing
`node {` or `subscription {` header. Without one the edit changed
nothing, the write still activated, and reading the new entry back
answered 404. A missing section is now appended at the end of the main
source, as a new group section is.
2026-10-27 00:27:12 +00:00
Zakk 1d1cb41ba3 refactor(mock): read subscriptions with the shared entry reader
activateInventory parsed subscription blocks by hand to find tags and URLs while the routing step already used readSubscriptionEntries. It now reads the entries once and uses them for both.
2026-10-27 00:04:41 +00:00
Zakk fb540aed89 fix(ui): confirm destructive actions and show form errors at their fields
Suspend, clear and switching to direct or global mode now ask first,
like reload does. Form errors show under the field they belong to, and
a disabled submit says why.

The startup budgets follow the size CI measures for this tree plus 0.3%:
login 239,900 and Activity 344,300 bytes gzip. CI builds about 0.7 KB and
1 KB larger than a local build.
2026-10-26 14:24:13 +00:00
Zakk c04ae7fc59 fix(contract): type masked check_url reads
honk masks listener secrets in a group's check_url as the literal
<redacted>, which SafeHttpUrl's format: uri rejects. GroupConfig.check_url
now reads as MaskedHttpUrl, and the check_url patch value says that a
test with the masked value fails with 409 and a write stores it as sent.
2026-10-24 18:18:49 +11:00
Zakk a1cc63b6f8 fix(mock): reject cursors with honk's status codes
The mock pager answered every bad cursor with 400 invalid_request, except
flows (and dnsLog without a snapshot), which got 410. honk answers 410
snapshot_expired for an unknown, expired, exhausted, malformed or
noncanonical cursor and 400 invalid_request only for another page size or
other filters; flows also refuse an empty cursor with 400.

The pager now follows honk per resource: the same 410/400 split, the
page-grid and canonical-offset checks for nodes, providers and flows,
honk's eight held snapshots (oldest evicted, but a ninth DNS cache walk is
refused with 503 snapshot_unavailable), and a 400 for a noncanonical dnsLog
cursor. Tests cover each case in one table.
2026-10-24 18:18:44 +11:00
Zakk b7f7e3bfed fix(rules): trace a blank process as traffic without one
The trace form left pname out when the process field was blank, so honk treated
the process as unknown and every earlier pname() rule came back indeterminate,
even though forwarded LAN traffic, which has no process, routes fine. A blank
field now sends pname "", which honk evaluates as no process; the field says so.
2026-10-17 22:38:39 +11:00
Zakk 457b6fb5fd fix(mock): start the demo's plain links on raw TCP
The inline hk-01, hk-02 and sg-01 fixtures had no stream_transport, so the demo showed them without a transport until the configuration was applied, while honk reports tcp for these links.
2026-10-09 04:19:40 +11:00
Zakk 7bc48fc63f fix(mock): report stream transports the way honk does 2026-10-09 04:04:44 +11:00
Zakk d3c1bac6d6 fix(nodes): keep newly added node actions usable
Keep menu item identities stable as config-backed actions appear, and refresh config after node changes so editing does not require a reload. Separate menu choice IDs from internal commands and retain configured transports in demo nodes.
2026-10-08 03:44:22 +11:00
Zakk 0252b60f61 feat(nodes): show the configured stream transport
Display transport information reported by the backend while preserving protocol filters and compatibility with older responses. Keep XHTTP share links intact through node creation and editing.
2026-10-08 01:47:22 +11:00
Zakk 2ef4f1fed2 fix(events): let wheel scrolling override prepend anchoring
Prepending live rows can move the viewport down while the user scrolls up. Yield anchoring during vertical wheel or touch movement and resume it after scrolling settles.

Seed the healthy demo with 200 visible Events and Logs records to exercise scrolling with a full table, and cover active and stationary anchoring.
2026-10-06 22:52:26 +11:00
Zakk cd7d513eac fix(rules): show routing mode validation errors in the dialog
A routing mode the backend refused only raised a toast with the error
count, so the reason and the line were lost; a refusal from the write
itself, which alone checks a file other than the main one, closed the
dialog. Both now keep the confirm dialog open and list each error in a
focused inline alert with the backend's words, by line in the file
being written and by file name and line in another file. Changing the
DNS choice or closing the dialog clears it.

Every routing mode with every option combination, with and without
the DNS split, is checked against the demo validator from a bare file
and from the demo configuration, and the DNS split may route only to
upstreams it declares.
2026-10-05 14:37:40 +11:00
Zakk 74aa7a965e feat(ui): add skeletons for known shapes
Kit skeletons in one place: table placeholder rows at the real row height, block, rows, bars, fields and cards bodies, a fact strip loading state and a route-shaped PageSkeleton, all sharing the 150ms delay, one hidden status and still bars under reduced motion. The demo mock can hold calls with ?slow to show them.
2026-10-05 02:58:34 +11:00
Zakk cdd9263607 chore(comments): drop comments that restate code or narrate history
Remove comments that repeat the adjacent code, tell branch or lab history, or duplicate another comment, and fix a few that no longer match the code.
2026-10-04 15:55:44 +11:00
Zakk 3d9445b35a feat(widgets): add outbound errors, node availability and DNS latency
Three widgets join the gallery of the dashboard and the panel, not the
default layout. Outbound failures ranks the outbounds whose failure
counter is above zero since counter_since, in their usage colours, and
says when none failed. Node availability counts each node once by its
preferred health: available of all, then unavailable and unmeasured
with a status light. DNS latency gives the median and p95 of lookups
that reached an upstream, a swarm of them, and one strip per upstream
when tall or large; under five such lookups it shows the count alone.

Each offers only the sizes it fills: no small outbound failures, no
large node availability, and no upstream strips in the key-value form.
A dot chart without rows takes the chart heights. The gallery falls
back to samples when live data has no failure or too few lookups, and
the demo now counts failures on two outbounds. Hidden-dot counts in a
swarm closer than a label's width share one label instead of
overprinting.
2026-10-04 15:27:06 +11:00
Zakk 6ec538e706 feat(activity): explain that kernel-forwarded direct traffic is not counted
With an eBPF datapath the kernel forwards some direct connections on its own,
and a backend that observes traffic only in userspace leaves their bytes out of
the rates, the traffic history and the connection figures. When the runtime
reports traffic.observed_by userspace on an eBPF datapath, the Activity traffic
chart and the Connections traffic view now carry a help popover beside their
titles that says so. Mixed or eBPF observation shows no hint. The demo runtime
reports userspace observation, as honk does.
2026-10-04 15:08:33 +11:00
Zakk 3e6e3cd990 feat(settings): show geodata check times
The geodata details list when the last update attempt finished and when
the next automatic one is due, from last_checked_at and next_check_at.
The demo's last check is moved to this morning so its next check lies
ahead.
2026-10-04 14:36:04 +11:00
Zakk 72d1b8ed00 feat(dns): list expired cache entries on request
The cache tab gains a Show expired switch that sends include_expired=true
on every page of the walk and keys the listing by it. A walk with expired
entries no longer stands in for the usage read. The demo backend hides
expired entries unless asked and carries one expired entry.
2026-10-04 14:36:04 +11:00
Zakk 42afd7706b feat(widgets): draw upload and download in one rates chart
The rates widget's sparkline form stacked one sparkline per direction,
which with the panel's other default widgets overflowed its default
height. It now draws both in one plot on a shared scale with the Traffic
chart's component, without axis labels, at the height of one sparkline.
Combine upload and download charts in the panel menu, on by default,
restores the two sparklines.

The demo's upload rate swells on its own period and phase, so its curve
no longer copies download's.
2026-10-03 21:05:10 +10:00
Zakk b1cacc7a3b fix(activity): keep latency history in the ring store and draw it sooner
The latency card's history moves from a module map into the persisted
ring store, keyed by group and node with the CPU ring's retention, so a
return visit or the dashboard editor shows the line at once. A card that
opens with fewer than two readings brings one node list read forward an
event gap after its first; steady polling is unchanged. The mock repeats
its first stream's opening ready a second later, so a first demo visit
draws CPU and latency within two seconds.
2026-10-03 18:17:29 +10:00
Zakk f907d9b371 refactor(mock): move the mock backend out of src 2026-10-03 04:16:32 +10:00