Let every bundled preset publish extra ports and autofill its host port#708
Merged
Conversation
The ports manager treated a service as built-in only when its preset carried default: true, but that flag means part of the default stack we start automatically, not provided by lerd. Optional presets we also ship, gotenberg being the obvious one, fell outside the gate, so their ports modal showed an empty published-port field and refused to add extra ports even though we own them. The gate now keys off preset ownership rather than default-stack membership. PresetPorts resolves the declared ports for any bundled preset, ServiceExtraPorts exposes the recorded extra mappings, and the extra-ports application moved into EnsureCustomServiceQuadlet, the single choke point every service quadlet passes through, so the default-preset and materialised-preset paths behave identically instead of the preset path appending them itself. SetExtraPorts and the Web UI expose handler both gate on PresetExists now, and the services API surfaces a preset_owned flag plus the port fields for optional presets, which materialise as custom services and so are built through the custom-services path rather than the default-preset one. The modal reads preset_owned for the extra-ports affordance and leaves is_default to the delete and reinstall confirmations that legitimately mean default stack. Refs #707
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.
The ports manager treated a service as built-in only when its preset carried default: true, but that flag means part of the default stack we start automatically, not provided by lerd. Optional presets we also ship, gotenberg being the obvious one, fell outside the gate, so their ports modal showed an empty published-port field and refused to add extra ports even though we own them.
The gate now keys off preset ownership rather than default-stack membership. PresetPorts resolves the declared ports for any bundled preset, ServiceExtraPorts exposes the recorded extra mappings, and the extra-ports application moved into EnsureCustomServiceQuadlet, the single choke point every service quadlet passes through, so the default-preset and materialised-preset paths behave identically instead of the preset path appending them itself. SetExtraPorts and the Web UI expose handler both gate on PresetExists now, and the services API surfaces a preset_owned flag plus the port fields for optional presets, which materialise as custom services and so are built through the custom-services path rather than the default-preset one. The modal reads preset_owned for the extra-ports affordance and leaves is_default to the delete and reinstall confirmations that legitimately mean default stack.
Refs #707