fix(docs): keep APP_PORT numeric in dynamic-config installer - #63
Conversation
Coolify's compose uses APP_PORT in both `ports:` and `expose:`, and
`expose:` only accepts a bare port number. The installer defaulted
APP_PORT to `0.0.0.0:3000` and wrote it straight into `.env`, so the
restart in step 5 failed with:
strconv.ParseUint: parsing "0.0.0.0:3000": invalid syntax
Default APP_PORT to `3000` and validate the prompt: strip a bind address
if one is entered, reject non-numeric or out-of-range values, and reject
8000 since it is reserved for the Traefik dashboard entrypoint. A broken
value already present in `.env` is now flagged and replaced.
Fixes #62
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xR9ywD6vmwcbAce4VXfbz
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe installer now writes validated plain port numbers to ChangesAPP_PORT validation
Sidebar SCSS formatting
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Installer
participant EnvFile
participant Coolify
User->>Installer: Enter or accept APP_PORT
Installer->>Installer: Strip bind address and validate port
Installer->>EnvFile: Write plain APP_PORT
Coolify->>EnvFile: Read APP_PORT
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
These two files have been unformatted since the theme selector work landed. The `format` CI job on dev never caught it because that run failed earlier, during setup, on a transient bun download 504. Whitespace only - no CSS selectors or declarations changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013xR9ywD6vmwcbAce4VXfbz
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/public/scripts/install/dynamic-config.sh`:
- Around line 199-235: Update the APP_PORT initialization around
CURRENT_APP_PORT and the prompt loop so a valid existing CURRENT_APP_PORT is
sanitized and assigned as the prompt default, while APP_PORT_DEFAULT remains the
fallback when no valid current value exists. Preserve the existing warning for
invalid CURRENT_APP_PORT values and ensure the prompt uses the resulting default
without overwriting a valid configured port on Enter.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: fb52f288-0091-49be-8a4e-2034e4facdc3
📒 Files selected for processing (6)
.changeset/tidy-pugs-clap.mdapps/docs/.cspell.jsonapps/docs/content/docs/style/installation/dynamic-config.mdxapps/docs/public/scripts/install/dynamic-config.shapps/style/src/components/sidebar/_index.scssapps/style/src/components/sidebar/_theme-switcher.scss
Re-running the installer on a host with a working custom port (say 4000) showed the prompt default as 3000, so pressing Enter silently moved the dashboard. The current value was read but only ever used to warn. It is now sanitized and reused as the default when usable, with one carve-out: stock Coolify ships APP_PORT=8000, which is the port this installer hands to Traefik. Offering it back would suggest a value the validation loop always rejects, which re-prompts forever - and never terminates at all on a non-interactive run. That case keeps the 3000 fallback and says why. The warning for a value Coolify cannot start with still fires, and a bind-address value like 0.0.0.0:4000 now both warns and recovers the intended 4000 instead of falling back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013xR9ywD6vmwcbAce4VXfbz
Fixes #62
Problem
The dynamic-config installer defaulted
APP_PORTto0.0.0.0:3000and wrote that value straight into/data/coolify/source/.env. Coolify's compose usesAPP_PORTin two places:expose:only accepts a bare port number, so the bind address made step 5 of the installer fail and left Coolify down:Changes
apps/docs/public/scripts/install/dynamic-config.shAPP_PORT_DEFAULTis now3000instead of0.0.0.0:3000.strip_bind_address()andis_valid_port()helpers.APP_PORTprompt now loops until it gets a usable value:host:portentry has the bind address stripped, with a warning8000is rejected because step 3 reserves it for the Traefikcoolify_dashboardentrypointAPP_PORT_DEFAULTsupplied via env is sanitized and validated up front, so a bad override exits early rather than looping..envalready holds a brokenAPP_PORT(e.g. from a previous run of this installer), it is called out before being replaced — re-running the installer repairs an already-broken host.apps/docs/content/docs/style/installation/dynamic-config.mdxAPP_PORT=3000, with a callout explaining why a bind address breaks the restart.8000rather than0.0.0.0:8000.apps/docs/.cspell.json— addedstrconv(appears in the quoted error message).apps/style/src/components/sidebar/_index.scss,_theme-switcher.scss— prettier formatting only, in a separate commit (see below).About the second commit
The
formatjob failed on the first push, on two@repo/stylefiles this PR doesn't otherwise touch. They have been unformatted since the theme-selector work landed; theformatjob ondevnever caught it because that run died earlier during setup, on a transientbundownload 504. Fixed here withprettier --writeso this PR can go green — whitespace only, no selectors or declarations changed. Happy to split it out if you'd rather it land separately.Testing
bash -non the script passes.0.0.0.0:4000, garbage input,8000, EOF/non-interactive, missingAPP_PORTline, invalidAPP_PORT_DEFAULT, andAPP_PORT_DEFAULT=127.0.0.1:3001. All produce a plain numeric port or exit with a clear message; no infinite loop under EOF.pnpm formatandpnpm check:spellingboth pass on the full workspace.Summary by CodeRabbit
Bug Fixes
8000from disrupting application restarts.1–65535range.Documentation
Style