Files
cultivation-world-simulator/tests/test_server_binding.py
Zihao Xu bd6f7e67d5 feat(server): make server host and port configurable (#127)
* feat(server): make server host and port configurable

Support configuring server binding address via environment variables
and config files. Priority: ENV > local_config.yml > config.yml > default.

- Add host and port options to system section in config.yml
- Read SERVER_HOST and SERVER_PORT from environment variables
- Default to 127.0.0.1:8002 for security

Set host to "0.0.0.0" to allow LAN access.

* test(server): add comprehensive tests for server binding config

Add 28 test cases covering:
- Environment variable priority (SERVER_HOST, SERVER_PORT)
- Config file reading (system.host, system.port)
- Default value fallback
- OmegaConf integration
- Edge cases (IPv6, empty values, invalid ports)

* docs: add mobile/LAN access instructions

- Add mobile access section to README and EN_README
- Configure Vite to listen on 0.0.0.0 for LAN access in dev mode
- Link to Issue #130 for mobile UI compatibility tracking
2026-02-04 21:47:17 +08:00

15 KiB