feat(sites): a site somebody declared is a site the front end answers for (T43) - #19
Merged
Conversation
…ooks a site needs (T43)
…ery site write (T43)
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.
T43 closes the loop between a site somebody declared and a front end that actually answers for it: a
site write renders, validates and reloads the front end, and
site.start/site.stopdecide whethera site is in that set. Re-running any of it changes nothing on disk.
What the daemon now does
documents. There is no separate "apply" step to forget.
site.startandsite.stopmove a site betweenRunningandStopped; a second call is a no-op.mix site start/mix site stopreach both, by name or from the site's own directory.The pieces underneath
Recipe::swept()names thedirectories the generator owns; anything else in them is removed after the commit loop, so a
deleted site's config leaves with it.
Installednow carriesremovedalongsidewritten,because a removal is not a document.
Upstreamis one value for where a pool listens, since Caddy spells a socketunix/<path>andnginx spells it
unix:<path>— the difference belongs in the recipes, not in four call sites.PortAccess::bindingslifts the answer-port → bind-port table out ofprobeso a generator canhold it as a value. A
boundfilter renders it into templates, which is how macOS's 80→8080 mapreaches a Caddyfile without a
#[cfg]inmixengine-core.front end renders every site the map can satisfy.
nginx listens on the address its row asked for
The site template renders
listen <bind_addr>:<port>, not the bare port. nginx groupsserverblocks by listen address first and consults
server_nameonly inside a group, so a site left onthe wildcard is unreachable beside anything holding
127.0.0.1:<port>— the name is never lookedat. The status endpoint already honoured
bind_addr; the site block was the one place that did not.This also makes LAN sharing (T74) a change to one column rather than to the template.
Verified
Both front ends are exercised against the real packaged binary: a site is declared, generated,
validated, started, reloaded and stopped, and the front end is asked for it over HTTP.
cargo fmt,clippy -D warningsandcargo doc -D warningsare clean on all three OSes.