No description
Find a file
2024-11-19 02:18:27 -05:00
src use once_cell instead of lazy_static 2024-11-07 22:14:12 -05:00
.gitignore init 2024-11-06 22:24:25 -05:00
Cargo.lock update deps 2024-11-08 02:19:33 -05:00
Cargo.toml update deps 2024-11-08 02:19:33 -05:00
flake.lock working binary/image crossbuild 2024-11-07 21:49:11 -05:00
flake.nix finished first version 2024-11-07 23:55:33 -05:00
Makefile support semver tagging 2024-11-19 02:18:27 -05:00
README.md note dependency 2024-11-13 22:15:13 -05:00

DockerHub

ansible-tf2network-relay

Relay bot for use with ansible-tf2network.

This only facilitates Discord to TF2 message relaying and the /rcon command, and is dependent on this SourceMod plugin for displaying messages.

Setup

The bot expects two environment variables:

  1. DISCORD_TOKEN - Your Discord bot token from your developer portal
  2. RCON_USERS - Colon-delimited list of Discord user IDs to grant rcon access to

The bot also expects a manifest.yml defining the servers. This is usually generated using your Ansible variables and this Python script, but here is a sample:

hosts:
- hostname: "My Team Fortress 2 Server"
  internal_name: my_unique_internal_id # id for use with the /rcon command
  ip: tf2.mytf2server.com:27015
  rcon_pass: p4$$w0rd
  relay_channel: 1238569871910895626 # messages to this channel will be relayed in-game
  stv_enabled: false
- # ... other servers...

A sample docker-compose.yml:

version: '3'

services:
  my-relay:
    image: "jackavery/ansible-tf2network-relay:latest"
    env:
      DISCORD_TOKEN: "mydiscordtoken"
      RCON_USERS: "97441955893477376:1178147836081217627"
    volumes:
      - /path/to/your/manifest.yml:/manifest.yml:ro

Building

This image uses Nix as a build tool. You can still get a raw binary with cargo build --release and make your own Dockerfile.