# Test environments (TRL-49 / TRL-51)

Always-on ShortP2P / TorgLink test servers for developers and the community.

## Servers

| Audience | Label | Base URL |
|----------|-------|----------|
| Developers / developer community | Server A — Dev community | https://103.195.5.190:51111 |
| Non-dev community / general testers | Server B — Others / community | https://103.195.6.73:51111 |

Do **not** mix audiences on one server. Client apps must point at the Base URL for the intended group.

## Updates

- Servers stay up continuously (test, not production SLA).
- Updates are **manual** via GitHub Actions workflow **Test servers: promote** in https://github.com/TorgLink/TorgLink (`workflow_dispatch`).
- Target repository: https://github.com/TorgLink/ShortP2P
- Pipeline inputs: **target** (`dev-community` / `community` / `both`) and **branch** (ref in that repo to check out).
- On each host the workflow checks out that branch into `/shortp2p_server`, then starts `dotnet run -c Release` under `src/Server/ShortP2P.MessengerServer.Api` with **nohup** (process keeps running after SSH ends; logs in `/shortp2p_server/messenger-api.out` / `.err`).
- Only a **Maintainer** of `TorgLink/TorgLink` may start the promote workflow.
- There is no auto-deploy on every commit.

## Secrets (names only)

Configure on `TorgLink/TorgLink` repository secrets (values never in git). Server SSH passwords stay as configured on the hosts.

| Secret | Purpose |
|--------|---------|
| `SSH_HOST_A` | SSH host for Server A |
| `SSH_USER_A` | SSH user for Server A |
| `SSH_PASS_A` | SSH password for Server A |
| `SSH_HOST_B` | SSH host for Server B |
| `SSH_USER_B` | SSH user for Server B |
| `SSH_PASS_B` | SSH password for Server B |
| `TEST_SERVER_SSH_PORT` | Optional; default 22 |
| `SHORTP2P_GIT_TOKEN` | Optional PAT if clone needs auth |

## Backup / restore (minimal)

- Treat each server data directory as independent.
- Before a risky promote, note the running branch/pid under `/shortp2p_server`.
- Rollback: re-run promote with a known-good **branch** input.

## Related

- Spec: [`docs/specs/TRL-49-test-environment.md`](../docs/specs/TRL-49-test-environment.md)
- Build catalog: [build-catalog.md](build-catalog.md)
- Onboarding: [onboarding-checklist.md](onboarding-checklist.md)
