Skip to content

Conversation

Copy link

Copilot AI commented Nov 21, 2025

The codebase had hardcoded IP addresses (192.168.10.2, 192.168.10.1) throughout configuration and API code, preventing deployment flexibility across local, private network, ZeroTier VPN, or public internet scenarios.

Changes

Configuration files

  • All Docker Compose variants (docker-compose.yml, docker-compose.swarm.yml, stack.yml) now use environment variables for hosts and ports
  • Defaults to localhost for local development; override via .env for other deployments

Python APIs

  • API/app.py: Changed PUBLIC_BASE default from http://192.168.10.2 to http://localhost
  • price-estimation/api/main.py: Removed hardcoded IP from ALLOW_ORIGINS default
  • Both now read PUBLIC_BASE and ALLOW_ORIGINS from environment

Documentation

  • .env.example: Template with 15+ network configuration variables
  • NETWORK_SETUP.md: Setup examples for 5 deployment scenarios (local, LAN, ZeroTier, public, Swarm)
  • mediamtx/mediamtx.yml.example: WebRTC configuration template
  • README.md: Added network configuration section

Usage

# Local development (no config needed)
docker compose up --build

# Private network or ZeroTier
cp .env.example .env
# Edit .env:
FRONTEND_HOST=192.168.10.2
WORKER_HOST=192.168.10.1
PUBLIC_BASE=http://192.168.10.2
docker compose up --build

Key Variables

  • FRONTEND_HOST, WORKER_HOST, API_HOST: Node hostnames/IPs
  • *_PORT variables: All service ports (frontend, API, MediaMTX, YOLO, etc.)
  • PUBLIC_BASE: Browser-accessible URL
  • ALLOW_ORIGINS: CORS configuration
Original prompt

This section details on the original issue you should resolve

<issue_title>Workaround network requests</issue_title>
<issue_description>Do we stay with virtual LAN Zero Tier, or we fully go through public ip addresses (something between both?)</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits November 21, 2025 10:51
- Create .env.example with all network configuration options
- Update docker-compose.yml to use environment variables for all network settings
- Update docker-compose.swarm.yml with flexible network configuration
- Update stack.yml with environment variable support
- Remove hardcoded IP addresses from API/app.py and price-estimation/api/main.py
- Create mediamtx.yml.example and ui-astro/.env.example templates
- Update README.md with comprehensive network configuration documentation

Co-authored-by: Balmine <[email protected]>
Copilot AI changed the title [WIP] Discuss options for network requests configuration Replace hardcoded IPs with environment variables for flexible network deployment Nov 21, 2025
Copilot AI requested a review from Balmine November 21, 2025 11:01
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.

Workaround network requests

2 participants