Skip to content

fix(settings): no gateway-wide concurrency limits, a written-out default allow list, one row per interface - #104

Merged
fylorn merged 1 commit into
mainfrom
fix/settings-limits-allow-nics
Sep 22, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/settings-limits-allow-nics

Conversation

@fylorn

@fylorn fylorn commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Three settings in the app did not match what the gateway should do. This fixes them in core, so the app can show them as they are.

No gateway-wide concurrency limits

The settings page had a "Concurrency" section (per upstream 8, queue 64, queue timeout 30 s). A local gateway serves the sessions the user opened on this computer, and a ceiling on them only holds back the user's own parallel work. The section is removed from the app, so the limits are removed from core:

  • limits is gone from config.yaml and from the overview (LimitsView). So is the overloaded failure source: the gateway never refuses a request for load.
  • A key's own max_concurrent stays. Requests over it wait with no deadline. The client decides how long to wait, and it stops waiting when it disconnects.
  • When a key's limit changes, the running count carries over. Raising the limit lets waiting requests in at once. Lowering it takes back the free permits now and the held ones as they are released. Before, the semaphore kept its first size until the gate was rebuilt.
  • max_concurrent: 0 is a validation error, because every request with that key would wait forever.

The allow list is what is written

allow_from had a hidden rule: empty meant "the private ranges". The app showed an empty box while four ranges were allowed, and removing the last entry brought the defaults back.

  • If allow_from is not written, it is the private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7. The loopback entries are dropped from the list because this machine is always let in.
  • An empty list means only this machine.
  • ListenView carries default_allow_from so the app can offer a restore action.
  • PUT /listen writes allow_from: [] for an empty list. It writes nothing when the list equals the default.
  • ListenSave.allow_from is now required.

One row per interface

GET /interfaces listed each address, so en0 appeared once for IPv4 and once for IPv6. The configuration stores the name, so choosing the second row saved the same thing as the first.

  • There is now one row per interface. Its address is the one the gateway listens on when bound to that interface: IPv4 first, IPv6 if there is no IPv4.
  • nics::by_name provides this, and Bind::resolve uses the same function.
  • An interface that exists but has no address is reported as NicHasNoAddr, not as missing. That branch could not be reached before.

Control API version 9.

Checks

  • cargo fmt --all, cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --locked (proxy variables unset): 1542 passed
  • ./scripts/smoke.sh: 51 passed, 0 failed. Memory was 36 MB against the 30 MB target, which is within the 40 MB regression bound.

🤖 Generated with Claude Code

…ult allow list, one row per interface

- The gateway no longer has limits of its own: `limits` (per upstream,
  queue depth, queue timeout) is gone from the configuration and the
  overview, and so is the `overloaded` failure source. The only limit
  left is a key's own `max_concurrent`; requests over it wait with no
  deadline, and a limit changed in the configuration is applied to the
  running count instead of starting a fresh semaphore. A limit of 0 is
  a validation error, since every request would wait forever.
- The allow list is exactly what is written. Leaving it out means the
  private ranges (10/8, 172.16/12, 192.168/16, fc00::/7); an empty list
  means only this machine. `ListenView` carries the default list for a
  restore action, and `PUT /listen` writes `allow_from: []` for an empty
  list and nothing for the default one.
- `GET /interfaces` gives one row per interface, with the address the
  gateway listens on when bound to it (IPv4 first), from the same
  function `Bind::resolve` uses. An interface that exists without an
  address is now reported as such instead of as missing.

Control API version 9.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit b859a8c into main Sep 22, 2026
1 check passed
@fylorn
fylorn deleted the fix/settings-limits-allow-nics branch September 22, 2026 08:26
@fylorn fylorn mentioned this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant