Repository navigation
Publish the managed gateway's ports 80 and 443 only for HTTPS - #271
Merged
Merged
Conversation
SaladDay
force-pushed
the
codex/managed-https-ports
branch
from
September 30, 2026 08:54
7e0d138 to
9c757f0
Compare
SaladDay
force-pushed
the
codex/managed-https-ports
branch
from
September 30, 2026 09:02
9c757f0 to
54c5151
Compare
The gateway publishes ports.web always, and 80 and 443 once public_url is set or while domain setup verifies a candidate address (ingress_config.published). configuration.listeners follows, so a new installation checks 80 and 443 only with --public-url and oac apply checks them when public_url turns HTTPS on. Domain setup (Web and oac domain) checks, before it reserves a job, that the hostname resolves (hostname_unresolved, 409) and that no other program holds 80 or 443 (https_ports_unavailable, 409). The installation's own listeners include those of the written gateway, so a domain change with HTTPS on, or a retry after an interrupted attempt, never fails on the gateway's own ports. The attempt renders the candidate through the common apply, which recreates the gateway with 80 and 443 before Caddy verifies it; failure restores the gateway without them. The verification failure message now names DNS, firewall or NAT, and the certificate request as its causes. The fake host's listening table includes the ports running containers publish.
Domain setup returns Core to the applied address before it switches, so prepare confirms a public URL change from there, and the final apply makes the change prepare confirmed. A retry after a switch interrupted with Core already on the new address no longer fails after verification. The written gateway ports count as the installation's own only while the gateway runs with the written inputs. oac start keeps an unfinished domain setup recorded, so its status reports the interruption, and that message says what oac apply does. A failure in the candidate apply reaches Web as the domain setup message. DNS resolves the hostname as an absolute name. The interrupted-retry test now stops the switch itself, before and after Core restarts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The managed gateway published host ports 80 and 443 even before any domain was configured, so a host whose port 80 was taken (for example by nginx) could not install at all, although HTTPS is optional and set up later in Web. Domain setup only discovered port or DNS problems after a 180 s certificate verification timeout, with one lumped message.
What
ingress_config.published(config, candidate=None)always publishesports.web, and adds 80/443 only whenpublic_urlis set or a domain candidate is being verified. The single listener derivation follows, so:--public-urlinstalls still check 80/443 up front;oac applychecks them when HTTPS turns on.Domain setup (
ingress.prepare, used by Web andoac domain) runs fast checks before reserving a job, each returning a 409:hostname_unresolvedwhen the hostname has no A/AAAA record;https_ports_unavailablenaming the busy port(s).The gateway's own ports never count, so a domain change with HTTPS already on passes.
The attempt recreates the gateway with 80/443 through the common apply path, keeping Core and Web on the applied address until verification succeeds. A failed attempt restores the gateway without 80/443.
The verification-failure message now names DNS, firewall/NAT and certificate causes.
Docs: the Ports section of
install-options.mdowns the fact; install, operations, configuration, the installer README and the printed next steps link to it.Web shows the new 409s through the existing "not accepted" alert with details. No
apps/webchange.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.