gbans

command module
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 2 Imported by: 0

README

gbans

release Codacy Badge Go Report Card GoDoc Lines of Code Discord chat

gbans was initially intended to be a more modern & secure replacement for sourcebans / sourcebans++. It has since had its scope expanded to include more optional support for general game server management tasks as well as future plans for in depth plater stat tracking.

Stability / Usage Notice

While we currently are dogfooding the project on a community with around 50 servers, I would not recommend non-developers use the project yet. It's still in fairly major development mode and large sections are still incomplete or function but very rough. This is very notable for the web frontend which we don't really use yet. Sticking with the discord command interface is the best current way to interact with the system.

Before we tag a 1.0.0 release, we will write some proper user-facing documentation.

Primary differences from sourcebans++

  • No direct SQL queries across networks. Exposing MySQL to the internet is a very poor security practice. You can of course mitigate this with firewalls and sql accounts with ip restrictions or VPNs, but the majority of server admins will not ever do this.
  • Game servers authenticate with the gbans server upon startup of the plugin. Subsequent requests will use the returned authentication token.
  • Communication over HTTPS
  • Discord bot integration for administration & announcements.
  • Built using Go & PostgreSQL. It has a built-in webserver that is safe to directly expose to the internet. This means it's not necessary to setup MySQL, Nginx/Apache and PHP on your server.
  • Non-legacy codebase that is (hopefully) not a nightmare to hack on.

Features

  • General
    • Multi server support
    • Global bans
    • Docker support
    • ACME (Lets encrypt / Zero SSL) protocol support for automatic SSL certificates
    • Import/Export of gbans databases
    • Backend linking of gbans services to enable use of other operators lists in real-time.
    • Multi-tenant support
  • Game support
    • Team Fortress 2
  • Blocking lists & types
    • Valves source server banip config
    • Existing sourcebans database
    • CIDR/IP bans
    • tf2_bot_detector
    • Known VPN Networks
    • Known non-residential addresses
    • Known proxies
    • FireHOL databases
  • Database support
    • Postgresql w/PostGIS
  • Remote Agent
    • Install & Update game installations
    • Apply custom configs and plugins per server
    • Relay game logs to central service
  • SourceMod Plugin
    • Game server authentication
    • Restrict banned players from connecting
    • Restrict muted/gagged players on join
    • /gb_ban <player_id|steam_id> duration Reason Ban a user
    • /gb_unban Unban a previously banned user
    • /gb_kick Kick a user
    • /gb_mod or /mod <message> Call for a mod on discord
  • User Interfaces
    • CLI
    • Discord
    • Web
    • Matrix
  • Game server logs event storage and processing
    • Remote relay agent gbans relay -h
    • Parsing
    • Indexing
    • Querying

Docker

Docker is recommended to run gbans. You can find the official docker images at dockerhub.

Assuming you have created your config file and have a database setup you can run it using something like:

docker run -it --rm -v `$(pwd)`/gbans.yml:/app/gbans.yml:ro leighmacdonald/gbans:latest

There is also a docker-compose config you can use which provides the database as well.

docker-compose -f docker/docker-compose.yml up --build --remove-orphans --abort-on-container-exit --exit-code-from gbans

Documentation

For installation, configuration and usage instruction, developer notes, please see the docs directory.

Documentation

Overview

Copyright © 2020 Leigh MacDonald <leigh.macdonald@gmail.com>

Directories

Path Synopsis
internal
action
Package action defines a set of common argument structures.
Package action defines a set of common argument structures.
agent
Package agent implements a service that can create, delete, manage, etc.
Package agent implements a service that can create, delete, manage, etc.
app
Package app is the main application and entry point.
Package app is the main application and entry point.
cmd
Package cmd implements the CLI (Command Line Interface) of the application.
Package cmd implements the CLI (Command Line Interface) of the application.
config
Package config contains the functionality for reading in and loosely validating config files.
Package config contains the functionality for reading in and loosely validating config files.
consts
Package consts contains common errors and constants
Package consts contains common errors and constants
discord
Package discord implements the ChatBot interface using discord as the underlying chat service
Package discord implements the ChatBot interface using discord as the underlying chat service
event
Package event implements an event dispatcher for incoming log events.
Package event implements an event dispatcher for incoming log events.
external
Package external implements functionality for communicating and parsing external or 3rd party data sources.
Package external implements functionality for communicating and parsing external or 3rd party data sources.
model
Package model defines common model structures used in many places throughout the application.
Package model defines common model structures used in many places throughout the application.
query
Package query implements functionality for making RCON and A2S queries
Package query implements functionality for making RCON and A2S queries
state
Package state is used for exporting state or other stats to prometheus.
Package state is used for exporting state or other stats to prometheus.
steam
Package steam is used for communicating with the steam api using the steamweb package.
Package steam is used for communicating with the steam api using the steamweb package.
store
Package store provides functionality for communicating with the backend database.
Package store provides functionality for communicating with the backend database.
web
Package web implements the HTTP and websocket services for the frontend client and backend server.
Package web implements the HTTP and websocket services for the frontend client and backend server.
web/ws
Package ws implements a websocket client and server for communication between the host and agents.
Package ws implements a websocket client and server for communication between the host and agents.
pkg
depotdownloader
Package depotdownloader implements a go interface to the depotDownloader .net application used to download and update game assets.
Package depotdownloader implements a go interface to the depotDownloader .net application used to download and update game assets.
ip2location
Package ip2location implements downloading and parsing of ip2location databases.
Package ip2location implements downloading and parsing of ip2location databases.
logparse
Package logparse provides functionality for parsing TF2 console logs into known events and values.
Package logparse provides functionality for parsing TF2 console logs into known events and values.
util
Package util provides some useful functions that don't fit anywhere else.
Package util provides some useful functions that don't fit anywhere else.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL