Ripple's mirror api. Outdated, not used anymore.
- Python 100%
| .gitignore | ||
| exceptions.py | ||
| LICENSE | ||
| mirrorapi.py | ||
| README.md | ||
| requirements.txt | ||
| settings.sample.json | ||
| test_async.py | ||
| test_wait.py | ||
MirrorAPI
This is a little api written in Python + Bottle + Gevent that handles beatmap set update requests from Bancho.
When someone uses the !update command from FokaBot, Bancho sends a request to this server.
Requirements
- Python 3.5
- Bottle
- Gevent
- Requests
Setting up
Install all the required dependencies with pip
$ pip install -r requirements.txt
Then copy and edit the config file
$ cp settings.sample.json settings.json
$ nano settings.json
...
Finally, start the server
$ python3 mirrorapi.py
Bottle v0.12.9 server starting up (using GeventServer())...
Listening on http://0.0.0.0:9274/
Hit Ctrl-C to quit.
API Docs
POST /api/v1/update_beatmap
Request a beatmap set update and send message to Bancho using FokaBot's api when done.
POST Parameters
| Name | Description |
|---|---|
beatmap_set_id |
Beatmap set id to update. |
beatmap_name |
Song name, used in FokaBot's response |
username |
User who requested the beatmap update. Used for rate limiting. |
key |
Secret api key, configurable in settings.json |
Response
| Field name | Type | Value |
|---|---|---|
status |
int |
200 if ok, 400 if missing/wrong parameters, 403 if wrong key, 429 if user has passed rate limit |
message |
string |
Response message |
Rate limiting
The default rate limit is 1 request every 20 seconds per user.
You can change rate limits in settings.json.
License
All code in this repository is licensed under the GNU AGPL 3 License. See the "LICENSE" file for more information