UBS/README.md
2024-12-23 15:49:55 -07:00

107 lines
3.4 KiB
Markdown

# RTECH Unified Ban System
The UBS Project is brought to you by the RTECH Development Team.
This project aims to solve a simple but crucial problem: managing bans across roblox and discord. And making it easy to impliment, to keep communities safe.
## [Join the RTECH Discord!](https://ubs.rtech.foundation/discord)
## [Server Status](https://status.chrischro.me/status/rtech)
![UBS Status](https://status.chrischro.me/api/badge/91/status?style=flat-square)
![UBS Uptime](https://status.chrischro.me/api/badge/91/uptime?+&style=flat-square)
![UBS Response Time](https://status.chrischro.me/api/badge/91/avg-response?style=flat-square)
## Features
- [X] MariaDB database for storing ban data
- [X] REST API for querying bans
- [X] Web interface for querying bans
- [X] Admin web interface for managing bans
- [X] Mass import of bans
- [ ] Mass export of bans
- [ ] Ban appeal system
- [ ] Ban appeal system admin interface
- [ ] Discord integrations (Notifications, Appeals, Querying)
<!-- ## Installation
1. Clone the repository
2. Run `npm install`
3. Configure the `.env` file with your database and API settings (see `.env.example`)
4. Run `node .` to start the server -->
## Usage on Roblox
1. Download either the [UBS-Loader](https://ubs.rtech.foundation/UBS-Loader.rbxm) or [UBS-Static](https://ubs.rtech.foundation/UBS-Static.rbxm) module.
- `UBS-Loader` is a loader module that will automatically download the latest version of the UBS module from Roblox. (Recommended)
- `UBS-Static` is the static version of the module, without automatic updates. (This does not affect the ban list, as that is stored on our servers, and is served by the API)
2. Insert the module into your game
3. Move the module to `ServerScriptService`
4. Configure via the `Configuration` module, or just leave it as-is to use the default settings
5. Profit!
## API Documentation
### 🔓 Unauthenticated Endpoints
`GET /health` - Healthcheck endpoint (For Uptime Kuma)
`GET /v1/myIP` - Get your IP address (As seen by the server. Useful for debugging)
`GET /v1/info` - Get information about the API (Version, All reason flags)
`GET /api/v1/bans` - Get all bans
`GET /api/v1/ban/roblox/:robloxId` - Get bans by Roblox ID
`GET /api/v1/ban/discord/:discordId` - Get bans by Discord ID
### 🔒 Authenticated Endpoints
`GET /admin` - Renders the admin dashboard.
`GET /admin/edit/:id` - Renders the edit ban page for a specific ban.
`GET /admin/create` - Renders the create ban page.
`POST /admin/create` - Creates a new ban.
**Post Data:**
```json
{
"robloxId": "string",
"discordId": "string",
"reason": "string",
"duration": "number"
}
```
`POST /admin/edit/:id` - Edits an existing ban.
**Post Data:**
```json
{
"reason": "string",
"duration": "number"
}
```
`GET /admin/import` - Renders the import page for uploading ban data.
`POST /admin/import` - Handles the import of ban data from a file.
**Post Data:**
- `fileInput`: File upload (CSV format)
- `fileType`: Type of the file being uploaded (e.g., 'csv', 'mfd')
`GET /admin/uploadStatus` - Renders the upload status page.
`GET /admin/api/bans` - Retrieves all bans.
`GET /admin/api/uploads/:id` - Retrieves the status of a specific upload.
`GET /admin/api/uploads` - Retrieves the status of all uploads.
`GET /admin/login` - Renders the admin login page.
`POST /admin/login` - Handles admin login.
**Post Data:**
```json
{
"username": "string",
"password": "string",
"totp": "string"
}
```
`ALL /admin/logout` - Logs out the admin.