82 lines
1.8 KiB
Markdown
82 lines
1.8 KiB
Markdown
# Deployment
|
|
|
|
## Dedicated Linux server
|
|
|
|
Publish a self-contained server:
|
|
|
|
```bash
|
|
cd server
|
|
dotnet publish CommonwealthOnline.Server.csproj \
|
|
-c Release \
|
|
-r linux-x64 \
|
|
--self-contained true \
|
|
-p:PublishSingleFile=true \
|
|
-o publish/linux-x64
|
|
```
|
|
|
|
Copy the published files, `commonwealth-server.json`, and the native GNS bridge when GNS is enabled to the target host.
|
|
|
|
Start:
|
|
|
|
```bash
|
|
./CommonwealthOnline.Server serve --config commonwealth-server.json
|
|
```
|
|
|
|
A systemd example is provided at `server/commonwealth-online.service.example`.
|
|
|
|
## Windows dedicated server
|
|
|
|
```bat
|
|
dotnet publish server\CommonwealthOnline.Server.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o server\publish\win-x64
|
|
```
|
|
|
|
Run:
|
|
|
|
```bat
|
|
CommonwealthOnline.Server.exe serve --config commonwealth-server.json
|
|
```
|
|
|
|
## Qt Host package
|
|
|
|
Run:
|
|
|
|
```bat
|
|
build.bat
|
|
deploy.bat
|
|
```
|
|
|
|
CMake publishes the C# server self-contained and stages it under:
|
|
|
|
```text
|
|
build\bin\Release\server\
|
|
```
|
|
|
|
The staging and deployment checks reject prohibited legacy runtime artifacts before packaging succeeds.
|
|
|
|
Package the entire `build\bin\Release` directory so the Qt runtime, plugins and bundled server remain together.
|
|
|
|
## Runtime state
|
|
|
|
Preserve these files across upgrades:
|
|
|
|
- `commonwealth-server.json`
|
|
- `bans.json`
|
|
- `.admin-token`
|
|
|
|
The CMake staging step preserves those files when replacing the server binaries.
|
|
|
|
## Network
|
|
|
|
Default ports:
|
|
|
|
- TCP 7777: gameplay compatibility
|
|
- UDP 7777: GameNetworkingSockets when enabled
|
|
- UDP 7778: LAN discovery
|
|
- TCP 127.0.0.1:7779: authenticated admin control
|
|
|
|
Do not expose the admin port to the network.
|
|
|
|
## GNS bridge
|
|
|
|
The native bridge is platform-specific. Set `gns_bridge_path` when it is not installed beside the server. GNS startup is fail-loud when enabled and the bridge cannot be loaded.
|