feat: add public IP detection for VPS/NAS deployment

- Add getPublicIP() via api.ipify.org with configurable timeout
- Startup log now shows both local and public access URLs
- Graceful fallback: skip public IP if network unreachable
- Update README with dual-IP log example for both CN/EN
This commit is contained in:
ShukeBta
2026-05-17 00:19:38 +08:00
parent dd8f2a466c
commit 158fffaba0
3 changed files with 40 additions and 6 deletions
+5 -1
View File
@@ -192,7 +192,11 @@ cd MediaStationGo
docker compose up -d
```
> 🌐 The server auto-detects your local IP on startup and logs the access URL (e.g. `http://192.168.x.x:8080`). Log in with `admin` / `admin123`.
> 🌐 The server auto-detects both your **local network IP** and **public IP** on startup (NAS / VPS supported):
> ```json
> {"msg":"server is ready","local":"http://192.168.1.4:8080","public":"http://1.2.3.4:8080"}
> ```
> Log in with `admin` / `admin123`.
### 💻 Bare Metal