Refresh main branch documentation

This commit is contained in:
Alexa
2026-06-15 23:53:11 +03:00
parent a9e08dbe0c
commit 8986b1301e
13 changed files with 171 additions and 197 deletions
+80 -120
View File
@@ -1,154 +1,114 @@
# Advanced mode — Docker stack
# Advanced setup
For hosts running a community server (more than ~10 concurrent players),
doing custom modding work, or contributing to DorkNet itself.
Use this path if you are running a community server, deploying to a VPS,
testing the server from source, or working on DorkNet itself.
If you just want to play with friends, the [easy-setup](easy-setup.md)
desktop app is what you want.
The important bit: `main` is not the server branch. It only has the
launcher, the CLI, `versions.json`, and these shared docs. The actual
ASP.NET server, admin UI, client mod, Dockerfile, and deploy scripts live
on the version branches.
## What you get
## Pick the right branch
- **server**: the ASP.NET Core backend
- **postgres**: the canonical store (the desktop app uses SQLite; for >10
concurrent players, Postgres is what you want)
- **redis**: cross-replica presence cache (skip with `REDIS_URL=` empty
to fall back to in-memory; loses presence on restart but otherwise fine)
- **nginx**: TLS termination + multi-subdomain routing
(`api.*`, `auth.*`, `accounts.*`, `match.*`, `chat.*`, `cdn.*`, `commerce.*`,
`img.*`, `leaderboard.*`, `notify.*`)
Use the branch that matches the Rec Room build your players will run.
Behind a proper TLS certificate (Let's Encrypt via Caddy or Cloudflare
Tunnel) this should comfortably run 50+ concurrent players on a $20/mo VPS.
## Prerequisites
- A Linux VPS (Debian 12 / Ubuntu 22.04 / etc.)
- A domain you control with wildcard DNS pointing at the VPS
(`*.your-server.example.com → 1.2.3.4`)
- Docker + Docker Compose
## Setup
### 1. Pick the branch matching your client build
DorkNet keeps one branch per supported Rec Room build. See
[`../BRANCHES.md`](../BRANCHES.md) for the full chart. Quick map:
| Your Rec Room install | Branch to clone |
| Rec Room install | Branch |
|---|---|
| 2020.12.18 (most common DorkNet target) | `december-2020-12-18` |
| 2020.03.10 (or 2020.03.06) | `march-2020-03-10` |
| 2020.12.18 | `december-2020-12-18` |
| 2020.03.10 or 2020.03.06 | `march-2020-03-10` |
### 2. Clone + configure
The same list is in [`../BRANCHES.md`](../BRANCHES.md) and
[`../versions.json`](../versions.json). If the client build is not in
that list, DorkNet will not know how to talk to it.
## Clone the server branch
Example for December:
```bash
# Replace the branch in --branch with the row that matched above.
git clone --branch december-2020-12-18 https://github.com/DorkSquadRR/DorkNet
cd DorkNet/docker
cp .env.example .env
$EDITOR .env # fill in the values noted below
cd DorkNet
```
### Required `.env` values
```env
# Your domain. Server expects to find itself at *.DORKNET_DOMAIN.
DORKNET_DOMAIN=your-server.example.com
# A long random string. Used to sign JWTs.
JWT_SECRET=$(openssl rand -base64 64)
# Postgres password. Random, written once, kept in this file.
POSTGRES_PASSWORD=$(openssl rand -base64 32)
# Photon Cloud AppIds. Free tier at https://dashboard.photonengine.com
PHOTON_APP_ID=your-photon-realtime-appid
PHOTON_VOICE_APP_ID=your-photon-voice-appid # optional
PHOTON_CLOUD_REGION=eu # eu, us, asia, jp, sa, kr, in, au, etc.
# Steam Web API key — only needed if you want Steam logins to work.
# Free at https://steamcommunity.com/dev/apikey
STEAM_API_KEY=
```
### TLS
The bundled nginx config terminates TLS but expects certificates to exist
on the host. You have two reasonable paths:
1. **Caddy in front** (recommended for new hosts) — replace the nginx
service with a Caddyfile; Caddy auto-fetches Let's Encrypt certs.
2. **Cloudflare Tunnel** — DNS your wildcard at Cloudflare, run
`cloudflared` as another container, never expose port 443 to the
internet. The repo includes a sample `docker-compose.cloudflared.yml`.
### Run it
Example for March:
```bash
docker compose up -d
docker compose logs -f server
git clone --branch march-2020-03-10 https://github.com/DorkSquadRR/DorkNet
cd DorkNet
```
First boot does:
From that checkout, read the branch's own `README.md` first. If the
branch has `docs/deploy.md`, use that as the production deploy guide.
Those files are more accurate than any generic command copied from
`main`, because each branch is laid out a little differently.
1. Schema initialization (`EnsureCreated` from the entity classes)
2. Legacy data upgrades (no-op on a fresh install)
3. Seeds RR-Original rooms + store catalog
4. Applies canonical room overrides (Crescendo, Paintball merge, etc.)
5. Downloads the bundled room thumbnail images
## What you usually need
You should see `[boot] migrations complete` within ~3 seconds. Then the
server is ready at `https://api.your-server.example.com/healthz`.
For a real hosted server, plan on:
## Patching the client to point here
- a domain or tunnel that can route the Rec Room service subdomains,
- a Photon Realtime AppId,
- a Photon Voice AppId if you want in-game voice,
- persistent storage for the server database,
- object/blob storage if the branch's deploy guide calls for it,
- the matching 2020 Rec Room client on each player machine.
Same patcher as Easy mode, but you'll run it from the command line. The
CLI installer ships on the version-specific branch (e.g.
`december-2020-12-18`):
For Photon setup, use [`photon-setup.md`](photon-setup.md).
```powershell
.\tools\install-melon.ps1 `
-RecRoomPath "C:\path\to\Recroom_Release_Data" `
-PhotonAppId "<your-photon-realtime-app-id>" `
-PhotonVoiceAppId "<your-photon-voice-app-id>"
```
## Running from source
The installer drops the DorkNet MelonLoader mod (`DorkNet.ClientMod`)
into the client's `Mods/` folder and writes its config under
`MelonLoader/UserData/`.
## Admin UI
`https://admin.your-server.example.com` — log in with the first account
you create (it auto-promotes to admin) or with the bootstrap credentials
in your `.env` if you set `BOOTSTRAP_ADMIN_*`.
## Backups
Postgres is the only stateful service.
On a version branch, the usual local loop is:
```bash
docker compose exec postgres pg_dump -U dorknet dorknet > backup.sql
dotnet run --project DorkNet.Server
```
`data/images/` on the host is the image blob store. Back that up too.
Then follow that branch's README for the exact environment variables,
database settings, and client patching steps.
For admin UI work on a version branch:
```bash
cd DorkNet.Server/admin-ui
npm install
npm run dev
```
For public site work, use the same pattern under `DorkNet.Server/site`.
## Docker and production deploys
There is no top-level `docker/` folder on the active branches.
Start from the branch README and deploy guide instead.
The version branches contain the current Dockerfile and deploy docs.
December has the newer microservices/Dokploy path in `docs/deploy.md`.
March is the older single-server branch. If you are unsure which one you
are on, run:
```bash
git branch --show-current
```
## Updating
Branches are independent. Pulling `main` updates the launcher docs and
manifest, not the server code you are running.
To update a server checkout:
```bash
cd DorkNet
git checkout december-2020-12-18 # or march-2020-03-10
git pull
docker compose pull
docker compose up -d
```
The server runs all idempotent migrations on boot, so version upgrades
are zero-downtime as long as the schema changes are additive.
Then follow that branch's deploy guide for rebuild/restart steps.
> ⚠️ `git pull` only fetches updates for **your current branch**.
> DorkNet branches are independent — updates on `december-2020-12-18`
> don't flow to `march-2020-03-10` and vice versa. If you've checked
> out the wrong branch for your client, switching is a fresh
> `git clone --branch ...` (the schema and Photon AppId requirements
> differ).
## Backups
Back up the database and any blob/image storage before you upgrade. The
exact paths depend on the branch and deploy mode, so use the branch's
own deploy guide rather than guessing from this page.
For the launcher/easy-mode database, the local SQLite file lives under
the DorkNet app data folder shown in the launcher's Settings view.