Files
Comtropy_CargoRadar/docs/SYNOLOGY.md

109 lines
2.6 KiB
Markdown

# Synology Deployment
## Container Manager
1. Copy this repository or the NAS deploy ZIP to the NAS.
2. Extract it into a persistent folder, for example
`/docker/cargoradar`.
3. Create `.env` from `.env.example`.
4. Set `CARGORADAR_PORT` and, if needed, `ADMIN_TOKEN`.
5. Create a Container Manager project from `docker-compose.yml`.
6. Keep `runtime-data` mapped to persistent NAS storage.
## Environment
```text
CARGORADAR_PORT=8080
ADMIN_TOKEN=
KAKAO_JAVASCRIPT_KEY=ea26ed8ef3cf2960e9c36f1c161dadb5
```
For NAS deployment, start from `.env.nas.example` instead. The recommended NAS
host port is `18081` because `18080` is already forwarded for `opendaw`.
```text
CARGORADAR_PORT=18081
ADMIN_TOKEN=change_this_admin_token
KAKAO_JAVASCRIPT_KEY=ea26ed8ef3cf2960e9c36f1c161dadb5
```
`ADMIN_TOKEN` can stay blank during local MVP testing. For NAS exposure, set it.
If opening the app directly by port, use:
```text
http://<NAS-LAN-IP>:18081/?adminToken=<ADMIN_TOKEN>
```
The better public route is Synology Reverse Proxy:
```text
https://cargoradar.comtropy.synology.me -> http://127.0.0.1:18081
```
## Kakao Domain Entries
Register every origin that opens the control screen:
```text
http://localhost:8080
http://127.0.0.1:8080
http://<NAS-LAN-IP>:18081
https://cargoradar.comtropy.synology.me
https://<NAS-domain>
```
## Android URL
On the same LAN, use:
```text
http://<NAS-LAN-IP>:18081
```
When reverse proxy and HTTPS are ready, use:
```text
https://cargoradar.comtropy.synology.me
```
## Smoke Test
After deployment, run from a PC that can reach the NAS:
```powershell
.\scripts\health-check.ps1 -BaseUrl "http://<NAS-LAN-IP>:18081" -AdminToken "<ADMIN_TOKEN>"
.\scripts\post-demo-location.ps1 -BaseUrl "http://<NAS-LAN-IP>:18081"
```
Then open the control screen and confirm that the demo location appears in the
`위치` tab.
## Local Package
Create a NAS-ready ZIP from the repository root:
```powershell
.\scripts\package-nas-deploy.ps1
```
Upload the resulting `dist/cargoradar-nas-*.zip` to the NAS and extract it into
the deployment folder.
## Current Router Context
Known forwarding entries:
```text
50001 -> 192.168.200.129:5000 DSM HTTP
50002 -> 192.168.200.129:5001 DSM HTTPS
80 -> 192.168.200.129:80 Web Station / reverse proxy
443 -> 192.168.200.129:443 HTTPS reverse proxy
3000 -> 192.168.200.129:3000 Gitea
2222 -> 192.168.200.129:2222 Gitea SSH
50022 -> 192.168.200.129:22 SSH
18080 -> 192.168.200.129:18080 opendaw
```
Do not use `18080` for CargoRadar. Prefer a NAS-only host port such as `18081`
and publish it through reverse proxy on `443`.