Skip to content

Commit 1b7234d

Browse files
authored
feat: default ogx go to localhost instead of all interfaces (#6402)
The generated config now sets server.host to 127.0.0.1, preventing accidental exposure of the server to the network. A new --host flag allows users to explicitly bind to a different address. Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
1 parent 3a71a54 commit 1b7234d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/ogx/cli/stack/lets_go.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ def add_letsgo_arguments(parser: argparse.ArgumentParser) -> None:
211211
default=False,
212212
help="Allow running without TLS certificates. Disables FIPS enforcement. For local development only.",
213213
)
214+
parser.add_argument(
215+
"--host",
216+
type=str,
217+
default="127.0.0.1",
218+
help="Host to bind the server to",
219+
)
214220
parser.add_argument(
215221
"--no-auth",
216222
action="store_true",
@@ -478,7 +484,8 @@ async def _run_letsgo_cmd_impl(args: argparse.Namespace, parser: argparse.Argume
478484
config_dict["server"]["insecure"] = False
479485
cprint(f" ✓ Generated self-signed TLS certificate → {cert_path}", color="green")
480486

481-
# ── Auth config injection ──
487+
config_dict["server"]["host"] = args.host
488+
482489
if not args.no_auth:
483490
api_keys = [f"ogk_{secrets.token_urlsafe(24)}" for _ in range(3)]
484491
if "server" not in config_dict:

0 commit comments

Comments
 (0)