The networking section is read from constants and written to nothing #169
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The networking page saves nothing but the remote-access checkbox, and answers
204for the rest — so the dashboard reports a save that did not happen andevery field is back to what it was on the next load.
Posted through
POST /System/Configuration/networkand read straight back:crates/ephyra-http/src/routes/admin/configuration.rs::update_sectionparsesthe body into a
NetworkConfiguration, assignsconfig.server.enable_remote_access, and drops the object.The read side is not the configuration either.
network()in the same filebuilds the section from literals —
internal_https_port: 8920,auto_discovery: true,enable_i_pv4: true— and leaves the rest atNetworkConfiguration::default(). It reads neitherconfig.server.published_urlnor
config.discovery.enabled, so a server configured with either reports theopposite of what it is running.
Three of those fields are settings this server has.
server.bind,server.published_url(crates/ephyra-core/src/config/server.rs:26, which iswhat a stream URL is built from behind a proxy) and
discovery.enabled(
crates/ephyra-server/src/discovery.rs:50, which decides whether the broadcastprobe is answered). All three are reachable by editing
config.tomlandrestarting, and by nothing a client can do. Upstream persists the whole
NetworkConfigurationand serves it back.Where to start
The three above are the ones with somewhere to go:
AutoDiscoveryontodiscovery.enabled, the published-URL fields ontoserver.published_url, andthe port onto
server.bind— the last needs upstream's restart-to-apply, sincethe listener is already bound.
The rest of the section — HTTPS and its certificate, UPnP, the LAN subnet lists,
the remote-IP filter, the known proxies — is configuration this server does not
have, and
docs/install.mdsays as much about the proxy fields deliberately.Storing them so they read back is one answer; refusing them is another. Taking
them and reporting success is the one that misleads.
How to know it is done
Turning off autodiscovery on the networking page survives a reload and stops the
broadcast answer; setting a published URL there is what a stream URL is built
from afterwards. A test that posts a section and reads it back, failing today.
House rules
CLAUDE.mdis the short version and these are the parts that bite: tests rununder
cargo nextest; upstream's source is the checkout inupstream/at thepin; generated files are regenerated rather than edited; a comment says what
the code does, not how it got there.
A test that cannot fail is worse than none.
Landed in
61eb033, with review fixes in9f43537.Three fields have somewhere real to go and now round-trip:
AutoDiscoveryontodiscovery.enabled, which decides whether the broadcastprobe is answered.
PublishedServerUriBySubnetontoserver.published_url, which is what astream URL is built from behind a proxy. The unscoped
all=entry only:upstream applies a scoped one to the clients whose address it matches, and
this server has one URL for everybody — promoting a LAN-only override to it
would hand a remote client an address it cannot reach.
server.bind, taking effect on the next start because thelistener is already bound.
The review caught the port being the wrong one. It was
PublicHttpPort;upstream binds
InternalHttpPort(ApplicationHost.cs:HttpPort = networkConfiguration.InternalHttpPort) and the public one is what itadvertises. Behind a proxy those are different numbers — 8096 and 443 — so
binding the advertised one would have abandoned the port the proxy points at,
and tried to bind a privileged one. The IPv4 and IPv6 flags are read off what
the listener is actually on, and the HTTPS ports report upstream's default 8920
rather than the DTO's zero.
The rest — HTTPS and its certificate, UPnP, the LAN subnet lists, the remote-IP
filter, the known proxies — is configuration this server does not have, and
docs/install.mdsays as much about the proxy fields. It is taken and notstored, and reported absent rather than as a value the page would show and
nothing would honour. Storing it would make the page disagree with itself.