Skip to content

sjstein/R8DIUM

Repository files navigation

R8DIUM

The Run8 Database for Integrated User Management

R8DIUM is a Discord "bot" which enables user management for a Run8 server. It allows admin/yardmasters the ability to add and remove users as well as ban and unban them. Furthermore, R8DIUM allows the users themselves to view their current password, and request a new one be generated.

R8DIUM keeps a local database of user records for its own use, and updates the Run8 HostSecurity.xml to reflect changes to the Run8 server.

BLUF:

  • R8DIUM was designed to make the job of Run8 server USER administration easier by automating certain server maintenance tasks.
  • Since R8DIUM is designed to run on the same machine or network which the Run8 server is hosted on, all data is stored locally - no data is exported off the host machine.
  • R8DIUM utilizes individual passwords for all Run8 server members.
  • Utilizing Discord server roles, the Run8 server owner can delegate certain personnel the ability to add, remove, ban and unban users by using R8DIUM commands.
  • R8DIUM can be configured to allow certain users the ability to restart / kill the Run8 server instance.
  • R8DIUM can allow the server owner to designate a variety of files to be eligible for users to download. These can include the Hump, Industry, and Traffic configurations. The last World Save is also an optional download.
  • R8DIUM admin types can be allowed to download R8DIUM infrastructure files for maintenance, backup, and debugging purposes.
  • R8DIUM handles tracking of Run8 server USER passwords and their active/banned status.
  • R8DIUM will automatically unban users after a specified duration has elapsed.
  • R8DIUM can (optionally) "expire" users after a specified duration of inactivity.
  • R8DIUM synchronizes its own user data with the Run8 server security file - no need for manual edits.
  • R8DIUM allows storing and reading of notes for each user it tracks.
  • R*DIUM has limited commands to interact with users - allowing them to view their password, request a new password, and view Run8 server info (address and port).
  • All R*DIUM responses are sent back to the requester as private text - no one else will see them.
  • R*DIUM has the ability to log all commands it receives - to a file and/or a specific Discord channel.

R8DIUM is a Discord bot that runs on your local machine

Unlike the typical Discord bot which is installed via a bot invite, R8DIUM requires the Run8 server admin to run the bot from their own machine. This keeps the user information local to that filesystem - avoiding hosting sensitive information on a third party machine.

Of course, the downside to that is the Run8 server administrator will have to go through the process on the Discord developer portal to register the bot and give it the proper server permissions to function properly.

The process of registering on the Discover developer portal and "programming" their own bot is beyond the scope of this document. There are a lot of guides and youTube videos available which describe the process. That being said, there are a couple of things to make note:

  1. Once your bot is registered, you will have access to its unique Token. This value will be put in the R8DIUM configuration file (discussed later).

  2. When setting up your bot authorizations, make sure that the following are toggled on:

    • PRESENCE INTENT
    • SERVER MEMBERS INTENT
    • MESSAGE CONTENT INTENT

Installing / running using a virtual environment (highly recommended):

To install:

From the R8DIUM installation directory:

  • Set up a new virtual environment per your local installation / OS within the directory you installed the R8DIUM software (for a walkthrough on virtual environments, try searching the internet. The official documentation is here: https://docs.python.org/3/library/venv.html )
  • Activate your new environment
  • update pip : python -m pip install --upgrade pip
  • install packages : pip install -r requirements.txt

To run:

From the R8DIUM installation directory:

  • Activate virtual environment
  • type: python r8dium.py

Installing / running without using a virtual environment (not recommended):

From the R8DIUM installation directory:

  • update pip : python -m pip install --upgrade pip
  • install packages : pip install -r requirements.txt

To run:

From the R8DIUM installation directory:

  • type: python r8dium.py

For further info on server/bot configuration and usage, see Getting_Started.md


Project files:

  • r8dium.py : Entry point
  • r8diumInclude.py : Helper routines / constants
  • botHandler.py : Define bot commands and interactions
  • msgHandler.py : Middleman between bot, database, and (local) file system
  • dbAccess.py : Database support
  • logScraper.py : Functions to parse through the Run8 log file
  • r8dium_example.cfg : Sample configuration file * r8diumDb-blank.csv : Blank database schema

Auxillary files:

  • logScraper.py : simple hack to scrape through run8 logs looking for user data

Deprecated files:

  • archived/msgHandlerGoogle.py : message handler for working with google sheets
  • archived/sheetHandler.py : database support when using google sheet as database

About

A discord bot to manage individual run8 users

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •