Ripple's mirror api. Outdated, not used anymore.
Find a file
2016-10-16 10:55:02 +02:00
.gitignore Initial commit 2016-10-15 22:59:07 +02:00
exceptions.py Initial commit 2016-10-15 22:59:07 +02:00
LICENSE Add license 2016-10-15 23:09:45 +02:00
mirrorapi.py Fix subprocess call to ./mirror not working 2016-10-16 10:55:02 +02:00
README.md Add requests to requirements list 2016-10-16 10:42:25 +02:00
requirements.txt Add requests to requirements list 2016-10-16 10:42:25 +02:00
settings.sample.json Initial commit 2016-10-15 22:59:07 +02:00
test_async.py Initial commit 2016-10-15 22:59:07 +02:00
test_wait.py Initial commit 2016-10-15 22:59:07 +02:00

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