goldberries.net is an archive of the community's efforts of playing modded Celeste maps without dying. In contrast to the old Google spreadsheet only listing all challenge completions, goldberries.net provides a proper database, verification queue, web-frontend, API and much more.
- Issue Tracker
- Frontend Repository
- Backend Repository [YOU ARE HERE]
- Celeste Modded Done Deathless Discord Server
This repository contains the backend. The backend provides an API written in PHP, ontop of a postgres database.
The recommended way to run the backend is via Docker. This spins up the PHP backend, a cron container and a PostgreSQL database with a single command.
- Docker and Docker Compose
- A Discord OAuth application (ClientID and Secret)
- Set the redirect URI to
http://localhost/api/auth/discord_auth.php
- Set the redirect URI to
-
Copy
.env.exampleto.envand fill in proper values (database credentials, Discord OAuth, webhook URLs, ...):cp .env.example .env
-
Build the containers:
docker compose build
-
Start the containers in the background:
docker compose up -d
-
Restore the database from the provided dump (
backup-safe.dumpcontains no user data):pg_restore -d goldberries backup-safe.dump
-
Add an admin account for yourself. Replace
<your_id>with your player ID and<your_discord_id>with your Discord ID:INSERT INTO account (player_id, role, discord_id) VALUES (<your_id>, 40, <your_discord_id>);
- PostgreSQL
- Run the build script from
/documentation/models/database-build-scripts/goldberries.sql
Some webserver that allows PHP (like nginx or apache2)
Setup an SSL certificate with LetsEncrypt, then you can use the following virtual host file for Apache2. The important part is the custom logging format to log all requests to a file, which will be handled later to extract the traffic to the database.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@goldberries.net
ServerName goldberries.net
ServerAlias www.goldberries.net
DocumentRoot /var/www/goldberries.net
ErrorLog ${APACHE_LOG_DIR}/goldberries.net_error.log
CustomLog ${APACHE_LOG_DIR}/goldberries.net_access.log combined
LogFormat "%t %m %U %>s %q %{Referer}i %{User-agent}i %{ms}T" traffic
CustomLog ${APACHE_LOG_DIR}/goldberries.net_traffic.log traffic
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/goldberries.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/goldberries.net/privkey.pem
</VirtualHost>
</IfModule>
- Extensions:
curlgdmbstringpgsql
memory_limit = 256Mpost_max_size = 8Mfile_uploads = Onupload_max_filesize = 8M
export DEBUG=false
export GB_DBPORT=5432
export GB_DBNAME=goldberries
export GB_DBUSER=<user>
export GB_DBPASS=<password>
export DISCORD_CLIENT_ID=<client-id>
export DISCORD_CLIENT_SECRET=<secret>
export SUGGESTION_BOX_WEBHOOK_URL=<url>
export CHANGELOG_WEBHOOK_URL=<url>
export NOTIFICATIONS_WEBHOOK_URL=<url>
export POST_CHANGELOG_WEBHOOK_URL=<url>
export POST_NEWS_WEBHOOK_URL=<url>
export REPORT_WEBHOOK_URL=<url>
export MOD_REPORT_WEBHOOK_URL=<url>
export MILESTONES_WEBHOOK_URL=<url>
export PYTHON_COMMAND=python3
export TRAFFIC_FILE=/var/log/apache2/goldberries.net_traffic.log
Edit the shell script under /api/traffic/log.sh to add your DB user and password:
cd /var/www/goldberries.net/api/traffic
export GB_DBPORT=5432 && export GB_DBNAME=goldberries && export GB_DBUSER=<user> && export GB_DBPASS=<password> && export TRAFFIC_FILE=/var/log/apache2/goldberries.net_traffic.log && php log_traffic.phpAdd a cron job that runs it every 15 minutes:
*/15 * * * * /var/www/goldberries.net/api/traffic/log.sh
To run the backend:
- Start the database server
- Start the backend server
Depending on the type of resource you want to help with:
- UI/UX designs or improvements: @viddie in
#gb-chaton the Discord server - Code: PR request to the appropriate repository
- Translations: Check this message from the Discord server, then @viddie in
#gb-chat
Any data issues (incorrect map name, missing submission videos, ...) should be reported in the #gb-report channel in the Discord server linked above.
For application issues, open a new issue in the Issue Tracker linked above.