Repository navigation
feat(config): keep a switched-off ACME or EST block's settings - #312
Merged
Merged
Conversation
2 tasks done
Bugs5382
marked this pull request as ready for review
September 30, 2026 16:39
Bugs5382
force-pushed
the
feat/300-keep-disabled-protocol-settings
branch
from
September 30, 2026 16:51
5de15f0 to
356489d
Compare
An enabled=false block now stores its settings, and GetConfig returns them with enabled=false, so a reader can switch the protocol back on by flipping enabled alone. This is how the Fleet Manager switches a protocol, and switching on from its read-back used to be refused for a missing base_url and profile. - The settings sit apart from the on block, so nothing reads them at boot and changing only them is not a reboot. - Secrets stay write-only: GetConfig blanks them in an off block, and a blank secret keeps the stored one whether the stored block is on or off. - An empty enabled=false block still drops the settings, and an absent block keeps what the node has, on or off. - In YAML the block carries enabled: false; a block without the flag is on, as stored configs written before it are. - A Root still refuses a protocol switched on, and accepts an off block. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
… kept Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
…ocol tests Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
… reboot The config get help and the ACME and EST warnings said every protocol change waits for a reboot. Changing only the settings of a block with enabled: false is live, so say so. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Bugs5382
force-pushed
the
feat/300-keep-disabled-protocol-settings
branch
from
September 30, 2026 17:08
356489d to
1cd45b6
Compare
Contributor
Author
|
Merging for the v0.1.0 test run: CI green and mergeable at merge time. |
Merged
4 tasks done
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.
What and why
After #286 a node stored nothing for an ACME or EST block that was switched off: an
enabled: falseblock came back fromGetConfigempty. The Fleet Manager switches a protocol by reading the config, flippingenabledand applying it back, so switching a protocol on from the Fleet Manager was always refused for a missingbase_urlandprofile.A switched-off block now keeps its settings:
FromProtostores the fields of anenabled=falseblock inPKI.DisabledACME/PKI.DisabledEST, andToProtosends them back withenabled=false. Flippingenabledalone on the read-back switches the protocol back on.PKI.ACME/PKI.EST, which stay the only fields the boot path, status and validation read. A switched-off block can't start a listener, and changing only its settings is not a reboot.GetConfigblanks them in a switched-off block, and a blank secret keeps the stored value whether the stored block is on or off. A blank secret for an unknown identifier is still refused.enabled=falseblock still drops the settings (whatcryptosctl config applysends when the block is removed), and an absent block keeps what the node has, on or off.config getoutput, a switched-off block is theacmeorestblock withenabled: false. A block without the flag is on, as stored configs written before it are. An older image's strict parser refuses the flag instead of reading the block as on.cryptosctl config get --help, and the reboot warnings indocs/acme.mdanddocs/est.md, said every protocol change waits for a reboot. They now say that switching a protocol on or off, or changing the settings of one that is on, takes effect at the next reboot, and that changing only the settings of a block withenabled: falseneeds no reboot.TestDisabledSettingsChangeIsLivealready covers thatNeedsRebootcase.No API change: the fields already exist.
Closes #300
Docs:
docs/acme.mdanddocs/est.mdin this PR, and the companion CryptOS-PKI/docs#58 for the machine config reference, theconfig applyguide and the Fleet Manager switch steps. Merge the two together.Verification
How this was verified
internal/config/protocols_disabled_test.go: the disabled block round-trips through the proto and through YAML; switch-on from the read-back is accepted, validates, equals the original block (secrets included) and needs a reboot; secrets stay blank inGetConfigand are kept on the node; a blank secret for an unknownkey_idis refused; an empty off block drops settings; an absent block keeps them;enabled: true/false/ missing / non-boolean in YAML; a settings-only change to an off block is live; a Root accepts an off block and refuses switching ACME or EST on.internal/node/protocols_disabled_test.go: throughConfigStore.ApplyandCurrent, ACME switched off from the read-back keeps its settings with the secret blank inGetConfig, and switching back on from the read-back stores the full block with its secret, answeringrequires_rebootboth ways; EST settings stored while off switch on from the read-back; status reports an off block as not configured.task ci(fmt, golangci-lint, vet, go test, build) passes on the branch rebased onto current main, andtask licensereports no change.