To configure your installation see Environment Variables
docker run -p 8080:8080 -p 27015:27015/udp -v cs-server-manager_volume:/data phiis/cs-server-manager:latest
services:
cs-server-manager:
image: phiis/cs-server-manager:latest
volumes:
- cs-server-manager_volume:/data
ports:
- 27015:27015/udp
- 8080:8080
volumes:
cs-server-manager_volume:
Download the binary from releases
Run with ./cs-server-manager
Default API path: /api/v1
Default Swagger UI path: /api/swagger/index.html
This project is designed to only run on Linux (for now).
For development with Windows, WSL2 can be used
Before every commit please run
make ready
- Go version 1.22 or higher
- NodeJs v20.17.0
- Steamcmd requires
lib32gcc-s1
to run.sudo apt install lib32gcc-s1
git clone https://github.com/Phi-S/cs-server-manager.git
cd cs-server-manager
go get -C backend/
npm install --prefix frontend/
Status endpoint: http://localhost:8080/api/v1/status
WebUI: http://localhost:8090
make backend
make frontend
make build
docker build -t cs-server-manager .
Generate swagger docs with swaggo/swag:
If the command
swag
was not found, add the following lines to your.bashrc
and restart your terminalexport GOPATH="$HOME/go" export PATH=$PATH:$GOPATH/bin
go install github.com/swaggo/swag/cmd/[email protected]
swag init --dir backend -o . -ot json
Generate api-documentation.md with widdershins:
npm install [email protected]
make doc
Those environment variables can also be set via an
.env
file.
It should be located in the same folder as thecs-server-manager
binary or in thebackend
folder for development
KEY | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
IP | string | current public IP | This IP is returned with the status endpoint to generate the connection url. If no specified, the current public ip will be used. |
HTTP_PORT | string | 8080 | The API / WebSocket port |
CS_PORT | string | 27015 | CS 2 server port. This port will be reported with the status endpoint to generate the connection URL |
DATA_DIR | string | {working directory}/data | The base data directory for all CS server files |
LOG_DIR | string | {DATA_DIR}/logs | Location of the CS server logs |
SERVER_DIR | string | {DATA_DIR}/server | The CS 2 server directory. After installation this folder will be around 30 GB is size |
STEAMCMD_DIR | string | {DATA_DIR}/steamcmd | The steamcmd directory |
ENABLE_WEB_UI | bool | true | If set to true, the backend will host the WEB UI |
ENABLE_SWAGGER | bool | true | If set to true, the backend will host the swagger UI |
By default, following plugins are available via one click install.
If you want your plugin to be in this default list, please add it to the default_plugins.go file.
Some plugins require additional steps after installation for them to work correctly.
For example: Metamod requires a line to be added in the gameinfo.gi
for it to work.
For Metamod, this action will be automatically executed if you try to install metamod_source
(name must match) as dependency for your custom plugin.
If your plugin requires such an action add it to the custom_install_actions.go file.
It is also possible to create your own plugins list.
To create your own list create a file called plugins.json
in the {DATA_DIR}
(By Default /data
) directory.
This will overwrite the default plugin list, so only the plugins defined in the new plugin.json
will be available for installation.
At the moment only
.tar.gz
and.zip
files are supported
The install_dir
field is the directory in which the downloaded content gets extracted to.
/
means /{SERVER_DIR}/game/csgo
.
[
{
"name": "CounterStrikeSharp",
"description": "CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2",
"url": "https://github.com/roflmuffin/CounterStrikeSharp",
"install_dir": "/",
"versions": [
{
"name": "v264",
"download_url": "https://github.com/roflmuffin/CounterStrikeSharp/releases/download/v264/counterstrikesharp-with-runtime-build-264-linux-8f59fd5.zip",
"dependencies": [
{
"name": "metamod_source",
"install_dir": "/",
"version": "2.0.0-git1313",
"download_url": "https://mms.alliedmods.net/mmsdrop/2.0/mmsource-2.0.0-git1313-linux.tar.gz",
"dependencies": null
}
]
}
]
},
{
"name": "Cs2PracticeMode",
"description": "Practice mode for cs2 server based on CounterStrikeSharp",
"url": "https://github.com/Phi-S/cs2-practice-mode",
"install_dir": "/addons/counterstrikesharp/plugins/",
"versions": [
{
"name": "0.0.16",
"download_url": "https://github.com/Phi-S/cs2-practice-mode/releases/download/0.0.16/cs2-practice-mode-0.0.16.tar.gz",
"dependencies": [
{
"name": "CounterStrikeSharp",
"install_dir": "/",
"version": "v264",
"download_url": "https://github.com/roflmuffin/CounterStrikeSharp/releases/download/v264/counterstrikesharp-with-runtime-build-264-linux-8f59fd5.zip",
"dependencies": [
{
"name": "metamod_source",
"install_dir": "/",
"version": "2.0.0-git1313",
"download_url": "https://mms.alliedmods.net/mmsdrop/2.0/mmsource-2.0.0-git1313-linux.tar.gz",
"dependencies": null
}
]
}
]
}
]
}
]
The endpoints /files
or /configs
in the WebUI can be used to edit local files (for example the server.cfg file).
By default following files can be edited:
- Files witch end with
.cfg
in/game/csgo/cfg
- Files witch end with
.json
in/game/csgo/addons/counterstrikesharp/configs
- Files witch end with
.json
or.cfg
in/game/csgo/addons/counterstrikesharp/plugins
Custom entries can be added by creating the file editor-files.json
in the DATA_DIR
If a
editor-files.json
file exist, the defaults will be overwritten
Files will only show if they exist
Example content of editor-files.json
:
[
{
"path": "/path/to/file.txt",
"extensions": null
},
{
"path": "/game/csgo/cfg",
"extensions": [
".cfg"
]
},
{
"path": "/game/csgo/addons/counterstrikesharp/configs",
"extensions": [
".json"
]
},
{
"path": "/game/csgo/addons/counterstrikesharp/plugins",
"extensions": [
".json",
".cfg"
]
}
]