Giter VIP home page Giter VIP logo

webrcon-server's Introduction

WebRcon

A web based control panel for srcds' RCON protocol (CS:GO, Minecraft, etc.).

preview

Install

Docker

You can get the docker image at forewing/webrcon-server

Using docker-compose is recommended, it makes connecting webrcon to game server easier

An example of webrcon + csgo compose file is at example/docker-compose-csgo.yml

Note that the server address should be configured to game server's service name with port, in the example, it should be csgo:27015

Pre-Built Binary

Build From Source

Require go 1.16+

Using go install

go install github.com/forewing/webrcon-server@latest

Or get the source code and build manually

git clone https://github.com/forewing/webrcon-server.git
cd webrcon-server
go build

Config

Flags

Usage of webrcon-server:
  -addr address
        address of the server RCON, in the format of HOST:PORT (default "127.0.0.1:27015")
  -admin-name username
        basicauth username for path /api/exec
  -admin-pass password
        basicauth password for path /api/exec
  -bind address
        webrcon-server bind address (default "0.0.0.0:8080")
  -conf file
        load configs from file instead of flags
  -debug
        turn on debug mode
  -pass password
        password of the RCON
  -preset preset
        use preset(path), empty for default csgo config
  -public-addr address
        redirect target(public address) for /api/connect, empty for disabled
  -timeout timeout
        timeout(seconds) of the connection (default 1)
  -version
        display versions

File Config

You should pass -conf PATH/TO/config.json flag in order to use file config

An example config file is at example/config.example.json

API

  1. exec

    curl -X POST 127.0.0.1:8080/api/exec -H "Content-Type: application/json" -d '{"cmd":"YOUR_CMD_HERE"}'
    

    or

    curl -v -X GET '127.0.0.1:8080/api/exec?cmd=YOUR_CMD_HERE'
    
  2. connect

    Visit 127.0.0.1:8080/api/connect, you will be 307 redired to steam game launching shortcut if public-addr set to steam://connect/SERVER_ADDRESS:PORT.

GUI

Browse to http://127.0.0.1:8080/

Shortcut group preset

Welcome to add presets for more games!

  • By default (preset config is empty), the server will use presets/csgo-default.json.

  • You may use other preset listed in presets/ by setting preset to corresponding file name.

  • If the file name set by preset cannot be found in presets/, the server will consider it as a path to your custom preset, and load it.

  • The preset must be a valid json and follow the style:

{
    "Rounds": [
        { id: 1, args: true, default: "5", name: "restart", cmd: "mp_restartgame" },
        { id: 2, args: true, default: "30", name: "maxrounds", cmd: "mp_maxrounds" },
    ],
    "Bots": [
        { id: 1, args: false, default: "", name: "kick bot", cmd: "bot_kick" },
        { id: 2, args: false, default: "", name: "kick ct", cmd: "bot_kick ct" },
        { id: 3, args: false, default: "", name: "kick t", cmd: "bot_kick t" },
        { id: 4, args: false, default: "", name: "add ct", cmd: "bot_add_ct" },
        { id: 5, args: false, default: "", name: "add t", cmd: "bot_add_t" },
    ],
    "Cheats": [
        { id: 1, args: false, default: "", name: "cheat on", cmd: "sv_cheats 1" },
        { id: 2, args: false, default: "", name: "cheat off", cmd: "sv_cheats 0" },
    ]
}

webrcon-server's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar forewing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

webrcon-server's Issues

ARM version?

Hi there,
is it possible to create an ARM version of the rcon server for the RasPi? This would be awesome!
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.