Skip to content

Release v0.128.0: the web terminal listens on an IPv6 bind; stale comments corrected - #154

Merged
tesseractAZ merged 4 commits into
mainfrom
claude/v01280-ipv6-bind-and-comments
Nov 23, 2026
Merged

tesseractAZ merged 4 commits into
mainfrom
claude/v01280-ipv6-bind-and-comments

Conversation

@tesseractAZ

Copy link
Copy Markdown
Owner

Two follow-ups from the 0.127.0 documentation release: the console web terminal on an IPv6 bind, and comments that still repeated claims the docs pass corrected.

Web terminal on an IPv6 console_web_bind

  • Bug: server.py built an AF_INET ThreadingTCPServer whatever CONSOLE_WEB_BIND said, so ::1 or [::1] died with gaierror before listening, and s6 restarted the service forever while the run script logged a start.
  • Fix: consoleproto.bind_address() (aliased in server.py) reads the bind once.
    • Outer whitespace and one pair of brackets are stripped; blank, or blank inside brackets, means 127.0.0.1 (fail closed: an empty host would be INADDR_ANY).
    • An IPv6 literal gets AF_INET6 and is logged as [::1]:8100.
  • The run script calls the same function for its start-up lines and loopback check, so the two can no longer disagree (they did for [], [127.0.0.1], [ ::1 ] and non-ASCII whitespace). If python3 cannot run, the value is treated as blank.
  • Any failed bind (OSError, an unencodable name, a port outside 0–65535) logs one line naming the address and the reason, instead of a traceback.
  • IPv4 binds behave as before. This install binds 0.0.0.0 (IPv4), so nothing changes for it.

Login throttle (webauth.LoginThrottle, shared by the web terminal and SSH)

  • Unchanged: 5 attempts per address per 300 s. IPv4 decisions are identical to 0.127.0 (0 mismatches in 1.14 million).
  • New: an IPv6 ceiling of 30 per /64 in the same window, so one host rotating source addresses meets a limit. Two refinements keep the ceiling from punishing neighbours, because a home LAN is one /64 shared by every device:
    • only attempts their own address was allowed count toward it, so a neighbour retrying a stale password locks out only itself;
    • a correct password takes its attempt back.
  • ::ffff:a.b.c.d counts as the IPv4 address.
  • The /64 counts live in their own bounded table. When they shared the address table, its first-inserted eviction let an address spray reset the ceiling.

Comments and docs corrected against the code

  • console.py footer order; what the mistyped resize message would have done (console_bridge.py and its test: p opens the page-all confirmation, or t a transfer, and neither acts on the rest of the string).
  • The trunk is not the emergency path (rtpmon/poller.py).
  • The cordless battery rule (devhealth/poller.py: low while discharging).
  • Announce vs wake-up delivery names and join (webui/app.py).
  • Whose numbers the call-quality ledger held (switchboard-callqos; CHANGELOG-ARCHIVE 0.81.0/0.99.0).
  • The operator-console reference and a test note on the footer; PERFORMANCE.md no longer calls the 2026-09-01 outage the only one.
  • tools/wp826.mjs login (not in the image) no longer prints part of the session id.
  • Comment-only Python files checked by comparing ASTs with string constants blanked.

Tests and review

  • Suite: 1636 passed. test_console_ssh.py with asyncssh 2.18 in a venv: 35 passed.
  • New tests:
    • the real server is started on ::1 and [::1] and the login page is fetched over IPv6 (skipped where IPv6 loopback cannot bind);
    • the whole run script is checked for every awkward bind value against bind_address;
    • throttle scenarios: neighbour lockout, rotation ceiling, 10 000-address spray, an hour of successful sign-ins, and eviction by least recent use.
  • Mutation: 39 distinct mutants across four rounds, all killed against a green baseline, each mutated file syntax-checked.
  • Review: three review rounds, each finding adversarially verified. Every confirmed defect is fixed, including a regression of mine ([] bound every interface) and a throttle design error (the /64-only key let one LAN device lock out the rest). The reviewers' own reproduction scripts, re-run on this tree, pass.

Deploy check

extensions.conf / pjsip.conf must hash as before. The web terminal must log its live bind (0.0.0.0 here) in both the run script and the server, serve its login page, and show 10/10 services.

🤖 Generated with Claude Code

tesseractAZ and others added 4 commits November 22, 2026 08:41
…ments corrected

console-web: server.py opened an AF_INET socket whatever CONSOLE_WEB_BIND
said, so console_web_bind ::1 (or [::1]) died with gaierror before listening
and s6 restarted it forever while the run script logged a start.
bind_address() now picks AF_INET6 for an IPv6 literal (brackets stripped),
logs it as [::1]:8100, and a failed bind logs one line naming the address
and the reason. The run script writes an IPv6 bind in brackets beside its
port. IPv4 binds, the 127.0.0.1 default included, are unchanged. Tests start
the real server on ::1 and [::1] and fetch the login page over IPv6 (skipped
where IPv6 loopback cannot be bound); 8/8 mutants killed.

Comments the 0.127.0 docs pass left behind, each checked against the code:
console footer order (message last, key bar above it), the resize-message
effect (p opens the page-all confirmation, which swallows the rest), the
trunk is not the emergency path, the cordless battery rule (low while
DISCHARGING is degraded), announce vs wake-up delivery names, and whose
numbers the call-quality ledger held. PERFORMANCE.md no longer calls the
2026-09-01 outage the only one; wp826.mjs login no longer prints part of
the session id. Comment-only files proven by AST comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rottle per /64

bind_address stripped brackets after the blank check, so "[]" became the
empty host, which the socket layer binds as INADDR_ANY: every interface,
where 0.127.0 never listened. Brackets are stripped first and a blank result
means 127.0.0.1, the run script's own fail-closed default (server.py's module
docstring already said so). A name the socket layer cannot encode raised
TypeError past the OSError handler; it now gets the same one-line message.

webauth.throttle_key: failed logins from an IPv6 client are counted by its
/64 (a host can pick a new address in its /64 for every try), an
IPv4-mapped address as its IPv4 address. Applied inside LoginThrottle, so
the web terminal and the SSH console both get it; IPv4 keys are unchanged
(SSH tests 35/35 with asyncssh).

Comments and docs the review found still stating corrected-away claims:
the resize effect is either/or (p opens the page-all confirmation, or t a
transfer when the room is on a call), the announce join is to the
audio-delivered row, operator-console.md and two test notes on the footer
order, and the 0.81.0/0.99.0 archive entries on whose numbers were
mirrored (10 callers, 2 dialled, 32 the household's own caller ID).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the log

The /64-only throttle assumed one host per /64. On a home LAN the router
advertises one /64 that every IPv6 device shares, so one device retrying a
stale password locked all the others out (and one success reset everyone's
count). Back to the per-address limit (5 per 300 s, unchanged for IPv4 and
for any one address), plus a separate ceiling of 30 per /64 that only
attempts their own address allowed count toward: a rotating host meets it, a
neighbour locks out only itself. clear() drops only the address's entry.

The run script now reads console_web_bind the way bind_address does (outer
spaces trimmed, "[]" / "[ ]" blank -> 127.0.0.1), so it no longer logs "[]"
as reachable from the LAN while the server listens on loopback; pure shell,
no tr/sed. A port outside 0-65535 (OverflowError) gets the one-line message
too. Transfer mode acts on the selection keys as well as Enter/Esc; the
0.81.0 archive sentence now accounts for all 45 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry, one bind reading

The /64 counts shared the address table, whose memory bound dropped the
FIRST-inserted key: the /64 entry, created on an attacker's first try, was
evicted after ~1024 fresh addresses and the ceiling started again (300 of
10000 got through; 1770/h at 200 tries/s). /64 counts now live in their own
table (256 entries; a LAN has a handful), and both tables move a key to the
end when it is charged, so the bound drops the entry used longest ago. A
correct password takes back the /64 attempt it spent, so a client signing in
every few seconds over IPv6 no longer locks out itself and its neighbours.
IPv4 decisions are identical to 0.127.0 (0 mismatches in 1.14 million).

The run script reads console_web_bind with consoleproto.bind_address (moved
out of server.py; the server keeps an alias), the function the server binds
with, instead of a second shell reading that disagreed for "[127.0.0.1]",
"[ ::1 ]" and non-ASCII whitespace. If python3 cannot run, the value is
treated as blank (127.0.0.1). test_documented_defaults points the real bind
chain at the source tree. Transfer-mode docstring names the quit keys.

The reviewers' own reproduction scripts, re-run on this tree: spray 30 of
10000 at any rate, successful logins never refused, run script and server
agree on every value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tesseractAZ
tesseractAZ merged commit f9a624f into main Nov 23, 2026
11 checks passed
@tesseractAZ
tesseractAZ deleted the claude/v01280-ipv6-bind-and-comments branch November 23, 2026 03:56
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