Rust web server to proxy the hypixel api with caching and rate limiting. Backend is almost entirely handled by actix-web, actix-governor (rate limiting) and moka (caching). Cache is compressed via lz4.
Currently only has 2 paths, full skyblock profile via /get/<uuid> and accross profile secrets via achievement data at /secrets/<uuid>
Api key should be an environment variable. Per session can be set with export API_KEY="<apikeyhere>"
While made for HateCheaters, it should work just fine for any other projects as long as the expected paths are the same. Its built to run on a minimum lightsail instance, with a constant value for max cache entries of 125, due to low memory. If you intend on running this on a larger server, fork the repository and update the max cache entries to whatever you expect to use. Large players may take ~1.2mb to store all profile data in the cache (after compression).
By default this is expected to be run through a reverse proxy with port 8000. You will need to pass client ip through. The installation script will automatically handle installing nginx and setting this, however.
Installation and usage: (These instructions only apply to a fresh server. The script may not work as intended otherwise)
- git clone this repo
- move to the repo using
cd RustHypixelApi - source the script by running
source install.shand follow its instructions - build the repo with
cargo build --release - set api key as an environment variable with key
API_KEY - run using pm2 by running
pm2 start "cargo run --release" - access via set url
To update the server:
- move to the clone using
cd RustHypixelApi - run
git pull - rebuild the repo using
cargo build --release - run
pm2 restart 0to restart the server