Respect .env for bind address and port in start-macos.sh #450

Closed
o3LL wants to merge 2 commits from o3LL/main into main
o3LL commented 2026-06-01 13:03:42 +02:00 (Migrated from github.com)

Summary

  • start-macos.sh now loads .env at startup (same way python-dotenv does in app.py), so APP_BIND and APP_PORT are honoured without having to retype them on the command line every run
  • Shell environment always takes priority over .env values for one-shot overrides (e.g. APP_BIND=0.0.0.0 ./start-macos.sh)
  • Bind address defaults to 127.0.0.1 (loopback, safe — no behaviour change for existing users)
  • Set APP_BIND=0.0.0.0 to opt into LAN access — aligns with the APP_BIND variable already used by Docker Compose, so the same knob works across both launchers
  • When bound to 0.0.0.0, the ready banner prints both the local and network URLs
  • README updated with the new knobs and a note to keep AUTH_ENABLED=true before exposing to the network
  • Drops the ODYSSEUS_PORT / ODYSSEUS_HOST aliases in favour of the consistent APP_* naming

Test plan

  • Run ./start-macos.sh — confirm it starts on 127.0.0.1:7860 as before
  • Run APP_BIND=0.0.0.0 ./start-macos.sh — confirm ready banner shows both Local and Network URLs
  • Open the Network URL from another device on the same LAN — confirm it loads
  • Set APP_PORT=7900 in .env — confirm the script picks it up without a command-line flag

🤖 Generated with Claude Code

## Summary - `start-macos.sh` now loads `.env` at startup (same way python-dotenv does in `app.py`), so `APP_BIND` and `APP_PORT` are honoured without having to retype them on the command line every run - Shell environment always takes priority over `.env` values for one-shot overrides (e.g. `APP_BIND=0.0.0.0 ./start-macos.sh`) - Bind address defaults to `127.0.0.1` (loopback, safe — no behaviour change for existing users) - Set `APP_BIND=0.0.0.0` to opt into LAN access — aligns with the `APP_BIND` variable already used by Docker Compose, so the same knob works across both launchers - When bound to `0.0.0.0`, the ready banner prints both the local and network URLs - README updated with the new knobs and a note to keep `AUTH_ENABLED=true` before exposing to the network - Drops the `ODYSSEUS_PORT` / `ODYSSEUS_HOST` aliases in favour of the consistent `APP_*` naming ## Test plan - [ ] Run `./start-macos.sh` — confirm it starts on `127.0.0.1:7860` as before - [ ] Run `APP_BIND=0.0.0.0 ./start-macos.sh` — confirm ready banner shows both Local and Network URLs - [ ] Open the Network URL from another device on the same LAN — confirm it loads - [ ] Set `APP_PORT=7900` in `.env` — confirm the script picks it up without a command-line flag 🤖 Generated with [Claude Code](https://claude.com/claude-code)
rinzler100 commented 2026-06-01 17:27:45 +02:00 (Migrated from github.com)

Why not allow the script to use the variables already declared in .env? This way things stay consistent...

Why not allow the script to use the variables already declared in .env? This way things stay consistent...
o3LL commented 2026-06-01 17:47:29 +02:00 (Migrated from github.com)

Why not allow the script to use the variables already declared in .env? This way things stay consistent...

Good call, done. The script now parses .env at startup (same way python-dotenv does in app.py) so APP_BIND and APP_PORT are picked up automatically. Shell environment takes priority over .env for one-shot overrides.

Also aligned the bind variable name with APP_BIND which I noticed was already use for Docker Compose, so it means the same thing across all launchers now. Defaults stay 127.0.0.1 so existing users aren't affected.

What do you think ?

> Why not allow the script to use the variables already declared in .env? This way things stay consistent... Good call, done. The script now parses .env at startup (same way python-dotenv does in app.py) so APP_BIND and APP_PORT are picked up automatically. Shell environment takes priority over .env for one-shot overrides. Also aligned the bind variable name with APP_BIND which I noticed was already use for Docker Compose, so it means the same thing across all launchers now. Defaults stay 127.0.0.1 so existing users aren't affected. What do you think ?
o3LL commented 2026-06-01 17:58:53 +02:00 (Migrated from github.com)

Needs #581 to be merged to work as intended after a rebase.

Needs #581 to be merged to work as intended after a rebase.
rinzler100 commented 2026-06-01 18:17:11 +02:00 (Migrated from github.com)

Sounds good, that's what I did locally as a temporary fix and it works well.

Sounds good, that's what I did locally as a temporary fix and it works well.
Owner

||Closing — macOS start script PR. Out of scope.

||Closing — macOS start script PR. Out of scope.
sleepy closed this pull request 2026-06-01 19:31:36 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.