MCPSERV.CLUB
SourceBans++

SourceBans++

Self-Hosted

Centralized ban and admin management for Source engine servers

Stale(63)
349stars
0views
Updated Apr 29, 2025

Overview

Discover what makes SourceBans++ powerful

SourceBans++ is a self‑hosted, PHP‑based web panel that centralises administrative tasks for servers running the Source engine. From a developer’s point of view, it acts as a lightweight REST‑style API gateway that exposes ban lists, player statistics, and communication logs to external tooling. The panel is written in **PHP 8.2+** with a lean MVC architecture, and it relies on a relational database (MySQL 5.6+ or MariaDB 10+) for persistence. The web interface is rendered with Twig templates, while the core logic uses PDO for database access, ensuring compatibility across most Linux and Windows hosting environments.

Language & Frameworks

Database

Server Integration

Security

Overview

SourceBans++ is a self‑hosted, PHP‑based web panel that centralises administrative tasks for servers running the Source engine. From a developer’s point of view, it acts as a lightweight REST‑style API gateway that exposes ban lists, player statistics, and communication logs to external tooling. The panel is written in PHP 8.2+ with a lean MVC architecture, and it relies on a relational database (MySQL 5.6+ or MariaDB 10+) for persistence. The web interface is rendered with Twig templates, while the core logic uses PDO for database access, ensuring compatibility across most Linux and Windows hosting environments.

Architecture

  • Language & Frameworks: Pure PHP 8.2, no heavy frameworks; routing is handled by a custom front‑controller that dispatches to controller classes. Twig provides view rendering, and Composer manages third‑party packages such as Guzzle for HTTP requests to SourceMod plugins.
  • Database: MySQL/MariaDB with a normalized schema that stores servers, bans, player data, and audit logs. The schema is fully versioned via migrations bundled with the release.
  • Server Integration: Requires MetaMod:Source and SourceMod ≥ 1.11 on the game server. A compiled plugin (sbpp.smx) communicates with the web panel over HTTP, pushing ban events and fetching configuration data.
  • Security: Uses token‑based authentication (JWT) for API endpoints, role‑based access control in the admin UI, and strict input validation to prevent SQL injection or XSS.

Core Capabilities

  • Ban Management: API endpoints for creating, updating, and expiring bans. The plugin listens to in‑game ban events and pushes them automatically.
  • Player Lookup: Resolve Steam IDs to usernames via the Steam Web API, cached in the database for quick retrieval.
  • Audit Trail: Every action is logged with timestamps, actor IDs, and a JSON payload, enabling full traceability.
  • Webhooks: Developers can register HTTP callbacks that fire on ban, unban, or server‑join events, allowing integration with Discord bots, Slack, or custom dashboards.
  • Extensible Plugin System: Additional SourceMod plugins can be added to the server; the web panel automatically discovers them through a plugin registry table.

Deployment & Infrastructure

SourceBans++ is designed for easy self‑hosting:

  • Minimal Requirements: A standard LAMP/LEMP stack with PHP 8.2, a MySQL/MariaDB instance, and a web server (Apache or Nginx). The only PHP extensions needed are gmp and the default PDO drivers.
  • Containerization: Official Docker images are available on Docker Hub, providing a reproducible environment that includes PHP, Composer dependencies, and the database schema. Compose files can spin up a full stack in minutes.
  • Scalability: The stateless PHP front‑end can be load‑balanced across multiple web servers, while the database is shared. Caching layers (Redis or Memcached) can be added to reduce database load for high‑traffic servers.
  • Backup & Migration: Built‑in export/import tools allow migration of bans and player data between instances, facilitating upgrades or failover.

Integration & Extensibility

  • REST API: Exposes CRUD operations for bans, servers, and users. Endpoints are documented with OpenAPI annotations and can be consumed by any HTTP client.
  • Webhooks: Developers can subscribe to events (ban_created, player_joined) and receive payloads in JSON format. The webhook system supports retry logic and delivery status tracking.
  • Custom Plugins: SourceMod scripts can be written in SourcePawn to extend functionality. The panel exposes a simple sourcebans++ API that plugins can call to fetch configuration or push custom metrics.
  • Theme & UI Customization: The Twig templates are modular; developers can override styles or add custom components without touching core files.

Developer Experience

The project ships with comprehensive documentation covering installation, API usage, and plugin development. The community is active on Discord and GitHub Issues, providing rapid feedback for bug reports or feature requests. The codebase follows PSR‑4 autoloading and is fully unit‑tested with PHPUnit, making it approachable for contributors. Licensing under CC BY‑SA 4.0 ensures that modifications can be freely shared, while the open‑source nature encourages community contributions.

Use Cases

  • Multi‑Server Administration: A network operator can host a single SourceBans++ instance to manage bans across dozens of CS:GO, TF2, or Alien Swarm servers, centralising moderation.
  • Custom Dashboards: Developers can build real‑time ban dashboards or analytics tools that consume the API, providing insights into player behavior.
  • Automation: Integrate with CI/CD pipelines to automatically purge expired bans or synchronize player data across services.
  • Compliance & Auditing: The audit trail and export features allow compliance teams to review moderation actions for policy enforcement.

Advantages

  • Performance: Lightweight PHP code and a single‑page application front‑end keep response times low, even under heavy load.
  • Flexibility: The plugin architecture and webhook system let developers tailor the panel to niche workflows without modifying core code.
  • Longevity: With LTS support since 2015 and a mature community, the project offers stability that rivals commercial alternatives.
  • Cost‑Effective: Open‑source licensing eliminates recurring fees, and the minimal hardware requirements keep operational costs low.

In sum,

Open SourceReady to get started?

Join the community and start self-hosting SourceBans++ today