SplatNet-Backend/README.md

95 lines
5.1 KiB
Markdown
Raw Permalink Normal View History

<p align= "center">
2026-02-21 23:32:19 +01:00
<img src="https://git.crafterpika.cc/kittentm/splatnet-backend/raw/branch/main/cover.png" width=600>
<br>
2026-02-21 23:24:25 +01:00
2026-02-21 23:32:19 +01:00
<img src="https://git.crafterpika.cc/kittentm/splatnet-backend/raw/branch/main/currentprogress.png" height=50px>
<img src="https://progress-bar.xyz/65?title=&height=20&show_text=false" width="100%" height=20px>
2026-02-21 23:24:25 +01:00
<br>
</p>
---
2026-02-28 05:54:27 +01:00
<div align=center>
2026-02-21 23:24:25 +01:00
2026-02-28 05:54:27 +01:00
# SplatNet
2026-02-22 20:18:47 +01:00
2026-05-08 05:53:46 +02:00
![Last Commit](https://img.shields.io/gitea/last-commit/kittentm/splatnet-backend?gitea_url=https://git.crafterpika.cc&style=for-the-badge&color=blue)
2026-02-28 05:54:27 +01:00
[![Build Status](https://git.crafterpika.cc/kittentm/splatnet-backend/badges/workflows/build.yml/badge.svg?style=for-the-badge)](https://git.crafterpika.cc/kittentm/splatnet-backend/actions)
2026-05-08 05:53:46 +02:00
[![Languages](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgit.crafterpika.cc%2Fapi%2Fv1%2Frepos%2Fkittentm%2Fsplatnet-backend%2Flanguages&query=%24.*~&label=language&style=for-the-badge&color=blue)](https://git.crafterpika.cc/kittentm/splatnet-backend)
2026-02-28 05:54:27 +01:00
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge&logo=gnu&logoColor=white)](https://git.crafterpika.cc/kittentm/splatnet-backend/src/branch/main/LICENSE)
2026-05-08 05:53:46 +02:00
![L1 Service Status](https://img.shields.io/website?url=https%3A%2F%2Fsplatnet.spbr.net%2F&up_message=online&down_message=offline&style=for-the-badge&up_color=blue&down_color=red&label=Production+Instance)
![T1 Service Status](https://img.shields.io/website?url=https%3A%2F%2Fsplatoon.cubexmine.dev%2F&up_message=online&down_message=offline&style=for-the-badge&up_color=blue&down_color=red&label=Testing+Instance)
2026-02-28 05:54:27 +01:00
2026-05-08 05:53:46 +02:00
This is the backend for the [SplatNet](https://git.crafterpika.cc/kittentm/splatnet) Revival frontend.
2026-02-28 05:54:27 +01:00
</div>
2026-02-28 05:54:27 +01:00
## Self-hosting
2026-02-22 20:18:47 +01:00
2026-02-20 06:20:24 +01:00
> [!IMPORTANT]
2026-02-28 05:54:27 +01:00
> This project is not easy to self host!! Please please please read the console logs before asking for help.
### Installing from source
2026-02-28 05:54:27 +01:00
Telemetry is technically not required for the server to run, however it is required for most functions on the website. Judd is run via Node `/judd`. First change directories to Judd, and install the node modules.
2026-02-28 05:54:27 +01:00
```
npm install
2026-02-28 05:54:27 +01:00
```
To start, install either Python `3.11` or `3.12`. While newer versions aren't tested they should work fine. Note that anything **ABOVE** 3.12 will require building oead from source, as it is a required dependency. View their documentation [here](https://oead.readthedocs.io/en/stable/about.html#building-from-source). Then install using:
2026-02-28 05:54:27 +01:00
```
pip install . -v
2026-02-28 05:54:27 +01:00
```
> [!NOTE]
> It is not required to run in verbose, however is reccomended as otherwise it looks like it has hung. The installation progress will take awhile as it copies all Node modules.
2026-02-28 05:54:27 +01:00
Now you must configure your `.env` A example `.env` is included for you. For a full explanation, jump to [.env configuration](https://git.crafterpika.cc/kittentm/splatnet-backend#env-configuration).
Once done, run:
```
splatnet
```
This uses the `.env` found in your current directory.
2026-02-28 05:54:27 +01:00
### Docker
Alternatively, this is available as a Docker image.
> [!NOTE]
> Postgres & incoming connections will have to be manually allowed through into Docker
```
docker run kittentm/splatnet-backend:latest
```
By default, the program will look for the `.env` in the same directory main.py is located. If you wish to not do that, you can manually specify a `.env`
Here is an example of that, it pulls from your current directory for the .env.
```
docker run --env-file .env kittentm/splatnet-backend:latest
```
## DB Config
This project requires postgres. Database setup is automatic upon startup, so all you need to do is add your database URL in the .env.
2026-02-05 01:25:39 +01:00
2026-02-28 05:54:27 +01:00
## .env configuration
2026-02-20 06:20:24 +01:00
The .env file is used for server setup. A example one with the fields already there has been provided for your pleasure. Rename it to .env & fill in the fields.
| Field Name | Type | Default Value | Description / Usage |
| :--- | :--- | :--- | :--- |
| `port` | `int` | `5000` | The port the API will listen on |
| `db_url` | `str` | *Required* | Connection string for the database |
| `fernet_key` | `str` | *Required* | Key used for DB encryption |
| `cookie_httponly` | `bool` | `True` | Primarily for debugging, controls the flag in cookies |
| `frontend_url` | `str` | *Required* | The URL where the frontend is hosted |
| `boss_url` | `str` | *Required* | Endpoint URL for retrieving Boss |
| `boss_aes_key` | `str` | *Required* | AES key for Boss |
| `boss_hmac_key` | `str` | *Required* | HMAC key for Boss |
| `cookie_secure` | `bool` | `True` | Primarily for debugging, controls the flag in cookies |
2026-02-22 20:18:47 +01:00
| `judd_port` | `int` | `4000` | The port the Judd (telemetry) server will listen on |
| `webhook_url` | str | *Required* | Where logging of blacklist.json will be sent to |
| `twitter_client_id` | `str` | *Required* | Twitter API client id |
| `twitter_client_secret` | `str` | *Required* | Twitter API Client secret |
| `twitter_redirect_uri` | `str` | *Required* | Where twitter redirects after logging in. Must match whats set in the API key. |
2026-02-20 06:20:24 +01:00
2026-02-22 20:18:47 +01:00
> [!TIP]
> For dumping your boss keys, see [this](https://github.com/PretendoNetwork/BetterKeyDumper/releases/tag/v1.0.0) HBL app. Note that the keys shown on the screen are garbage, I reccomend using a hex editor on the files it dumps.