Le very basic osu! direct

Giuseppe Guerra d24ca02672 Add origin and mirror links to README 4 months ago
constants c4049d0445 Initial commit 5 months ago
db c4049d0445 Initial commit 5 months ago
objects 3687b2cd12 Add tabs in default config file 5 months ago
utils 5f16c01abc Add game mode, ranked status and query filters 5 months ago
web a3fb228142 Add /beatmap and /beatmapset api handlers 5 months ago
.gitignore c4049d0445 Initial commit 5 months ago
LICENSE edd820b4d2 Add LICENSE, README.md and requriements.txt 4 months ago
README.md d24ca02672 Add origin and mirror links to README 4 months ago
convert.py 6391cb2934 Open json files with utf-8 encoding, truncate child_beatmaps table when conversion starts 5 months ago
levbod.py 2ad264b170 Renamed tempmirror.py to levbod.py 5 months ago
requirements.txt edd820b4d2 Add LICENSE, README.md and requriements.txt 4 months ago
schema.sql fce419df38 Add db schema 4 months ago

README.md

Levbod

Le very basic osu!direct

A temporary osu!direct api when bloodcat goes offline

  • Origin: https://git.zxq.co/ripple/levbod
  • Mirror: https://github.com/osuripple/levbod

This software is an api with osu!direct features that can be used with the ripple static mirror. index.json's content is saved in a MySQL database, for performance reasons, and info of single beatmaps is read from the json files in b/ mirror's data folder.

Requirements

Installation

  • Make sure the mirror has downloaded all the beatmaps and it has created all the json files
  • Create an empty MySQL database (and user)
  • Import schema.sql in your database $ mysql -u levbod -p levbod < schema.sql
  • Install levbod's dependencies using pip $ pip install -r requirements.txt
  • Start levbod once to create a default config file and edit it $ python3 levbod.py $ nano config.json ...
  • Put index.json data in the database using convert.py (this might take a while depending on your disk speed) $ python3 convert.py
  • Start the api server $ python3 levbod.py

Nginx config

Optionally, you can configure nginx as a reverse proxy:

server {
    listen 80;
    server_name storage.ripple.moe;
    charset utf-8;

    # Ripple static mirror
    location ~ \.osz$ {
        add_header Content-Disposition 'attachment;filename="$basename";';
    }

    # Levbod reverse proxy
    location /levbod {
        rewrite ^/levbod/(.*) /$1  break;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://127.0.0.1:5588$uri$is_args$args;
    }
}

API Documentation

LICENSE

All code in this repository is licensed under the GNU AGPL 3 License. See the "LICENSE" file for more information