Skip to content

Allow host-side env ports in free-form --expose#15

Merged
NawaMan merged 1 commit into
mainfrom
feature/expose-host-env-port
Jul 17, 2026
Merged

Allow host-side env ports in free-form --expose#15
NawaMan merged 1 commit into
mainfrom
feature/expose-host-env-port

Conversation

@NawaMan

@NawaMan NawaMan commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Accept host-side ${NAME} / ${NAME:-digits} on free-form --expose (and bare form expanded to HOST:HOST), so publish ports can be overridden from the host environment at booth start via existing shellexpand.
  • Container port stays numeric; env form on the container side is rejected.
  • Document host-env host ports in BOOTH_CONFIG.md / BOOTH_VARS.md and surface examples in the config TUI Expose field help.

Examples

booth config --no-tui --expose '${SERVER_PORT:-12345}:1234'
booth config --no-tui --select 'postgresql+expose:${POSTGRES_PORT:-15432}'
SERVER_PORT=18080 booth

Test plan

  • go test ./src/cmd/codingbooth/TestValidateExpose_HostEnvForm, TestApplyExposeFlags_HostEnvForm
  • tests/config/test75-init-expose-host-env.sh
  • Regression: test45-init-expose-flag.sh, test58-init-expose-plus-port.sh
  • Manual: configure with env host port, run booth with and without the env var set

Accept ${NAME} and ${NAME:-digits} on the host side of --expose
(and bare HOST:HOST expansion), so publish ports can be overridden
from the host environment at booth start without baking a fixed
number at config time. Container side stays numeric. Document the
pattern and add unit plus config shell tests.
@NawaMan
NawaMan merged commit fd56dca into main Jul 17, 2026
1 check passed
NawaMan added a commit that referenced this pull request Jul 18, 2026
Allow host-side env ports in free-form --expose
@NawaMan
NawaMan deleted the feature/expose-host-env-port branch July 18, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant