CherryServersTrafficBuyer. It does what it says on the tin.
CherryServersTrafficBuyer automatically monitor's your Cherry Servers project's traffic usage at a provided interval. When CherryServersTrafficBuyer detects that your traffic usage has exceeded a provided threshold, more traffic will be purchased automatically.
This is a beta project. Before using, please carefully read the Cherry Servers API Documentation and the source code for this project, then decide whether using this project is right for you. Contributors to this project are not responsible for any unexpected behaviors, including (but not limited to) inappropriate use of Cherry Servers credit.
This project is intended to be used in a Docker container, although you may run it outside of a container if you wish.
There are several evironment variables you must configure.
API_KEYThe API key, which can be generated from the Cherry Servers Client PortalPROJECT_IDThe Project ID of your Cherry Servers projectTRAFFIC_THRESHOLD_PERCENTThe percentage of traffic used after which more traffic should be purchased (Default 90 if unspecified)REFRESH_INTERVAL_MINUTESThe interval (in minutes) at which traffic usage should be checked (Default 65 if unspecified)
Note: At this time, CherryServersTrafficBuyer has no cooldown for purchasing new traffic besides the REFRESH_INTERVAL_MINUTES environment variable. Therefore, it is wise to keep this number somewhat high to reduce the risk of duplicate purchases.
services:
cherryserverstrafficbuyer:
image: ghcr.io/blake502/cherryserverstrafficbuyer:latest
container_name: cherryserverstrafficbuyer
restart: unless-stopped
environment:
- API_KEY=2bv80ye20vbakjs3...
- PROJECT_ID=69420
- TRAFFIC_THRESHOLD_PERCENT=90
- REFRESH_INTERVAL_MINUTES=65