fix(config): preserve bind host when CLI overrides port - #124
Merged
Conversation
CLI -p/-w flags previously rewrote RTMP_BIND and HTTP_BIND as 0.0.0.0:{port},
silently discarding a localhost-only host from config. Operators changing only
the port could unintentionally expose RTMP/HTTP on all interfaces.
Add set_bind_port() to replace the port while preserving the configured host
(including bracketed IPv6 literals) and add unit tests.
Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
AlexanderWagnerDev
marked this pull request as ready for review
August 5, 2026 04:52
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_71dba50f-ed12-4c4a-9c4b-24e16d93333b) |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Contributor
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Bug scan: config module (2026-08-05)
Bug
CLI
-p/-wport overrides rewroteRTMP_BINDandHTTP_BINDas0.0.0.0:{port}, discarding a configured localhost-only host.Scenario: Operator sets
RTMP_BIND=127.0.0.1:1935(orHTTP_BIND=127.0.0.1:8080) and runs./librtmp2-server -p 1936to change only the port. The server would bind to0.0.0.0:1936, unintentionally exposing RTMP/HTTP on all interfaces.Fix
Add
set_bind_port()inconfig.rsto replace the port while preserving the configured host (including bracketed IPv6). Use it frommain.rsfor-p/-woverrides.Validation
config::unit tests pass (including newset_bind_porttests)Scan notes
Also re-verified: API token isolation from
.envfile,parse_env_line/apply_kv,config_apply_env, TLS/trusted-proxy parsing, memory/idle clamps,port_ofvs librtmp2 bind parsing.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes listener bind behavior for operators using
-p/-wwith non-wildcard hosts; fixes accidental exposure but alters semantics from the buggy0.0.0.0override.Overview
Fixes a bind-address regression where CLI
-p/-wport overrides always rewroteRTMP_BINDandHTTP_BINDas0.0.0.0:{port}, dropping a configured localhost-only host (e.g.127.0.0.1:1935) and unintentionally listening on all interfaces.Adds
set_bind_port()(withbind_host_of()parsing aligned to existing bind-string rules) so only the port changes while the configured host is kept, including bracketed IPv6.main.rsnow uses that helper instead of hard-coded0.0.0.0formatting.Includes unit tests for localhost, wildcard, and IPv6 bind strings, plus a config bug-scan note in
.cursor/bug-scan-progress.md.Cargo.lockhas minor transitive dependency version bumps.Reviewed by Cursor Bugbot for commit d7e01db. Bugbot is set up for automated code reviews on this repo. Configure here.