You may use github issues for error reports and feature requests. Pull requests are especially welcome :)
Pantheon can be run in production or in development mode. Please don't use development build for your production setup.
⚠ For the detailed guide of setting up Pantheon on clean VPS, refer to Production Setup Guide. Brief instructions on production setup are listed below.
Clone the pantheon repository to your own server. Make sure repo folder is not accessible for the outer world.
To deploy pantheon on your own VPS or personal environment on production mode:
node_modules as root when using docker).Env/.env.production. There are examples in Env folder. Fill the file with proper settings for your setup.nginx-reverse-proxy.example.conf file for basic nginx setup.nginx-reverse-proxy.example.conf as reference of what host to point where. Note that *.pantheon.internal hosts are used to distinguish the services inside container network. Optionally, you can also point PgAdmin4 host to port 5632.make pull to fetch fresh containers from registry.
make container to build containers from scratch, but it's not recommended for production environment.make prod_start to start containersmake prod_compile. This will build all static files for Tyr/Forseti/Sigrun and Sigrun server.make bootstrap_admin to bootstrap a super-administrator account (admin@localhost.localdomain with password 123456). Be careful doing this on the database that already has users or admins, as it will potentially create a security breach (e.g. superadmin account with default login and password).
https://{yourhost}/profile/editPlayer/{player_id} link to edit the email, and then use password reset feature to set the new password.player_id will be 1, in general you can find the player_id on https://{yourhost}/profile/manage page after logging in with default username and password.To update code on production server you will need to do the following:
Quick way
Use make prod_update to fetch all changes from master branch. Please note that your setup and intentions must meet the following requirements:
Sigrun-dist/server.js - this file is a result of prod_compile). If there are any changes, they will be discarded. You can check changes in your working copy using git status command. Production environment config is excluded from git, so it's guaranteed to be left untouched.Long way
Basically these are the same commands that are done inside make prod_update but performed one-by-one for better control.
git fetch && git checkout origin/master in repo folder)make pullmake prod_restart (please use this exact command, otherwise email service will be started with wrong environment settings)make prod_compile to build newer versions of the static code.If you ever change the environment variables in your current Env/.env.production file, you should also restart the containers using make prod_restart. After that, if VITE_* variables have been changed, you should also run make prod_compile for changes to take effect.
Please note that db and pgadmin containers are not restarted during make prod_restart. To stop these containers as well, use make prod_stop_all. This is rarely needed, though.
Pantheon provides container with pre-installed email agent (Hermod). If you want to send emails signed with DKIM, you will need to place your private keys to Hermod/opendkim_keys folder. Also following setting are required:
MAIL_ACTION_KEY variable in your environment config.ALLOWED_SENDER_DOMAINS variable in your environment config. Mailer address also will be set to noreply@[allowed domain].You may use bin/letsencrypt-scripts and nginx-reverse-proxy.example.conf as an example and reference to set up your SSL certificates using Let's Encrypt. If you're not intending to use https, please disable corresponding directives in your reverse proxy nginx config.
Pantheon provides built-in database backups using git. By default, it just stores database dump as new commits in /var/lib/postgresql/backup folder of the Database container (you can get to shell using make shell_db). If you want to set up some remote backups, you should do the following:
BACKUP_GIT_REMOTE variable in your environment config to point to your backup remote repository. There is an example included in the env file.Database folder and call make backup_dump_pubkey command to get ssh public key.make prod_restartEvery 15 minutes the database dump is made. You may view history of backups using make backup_show_history in Database folder. To rollback your database to previous state you may use either included pgadmin4 container (running at 5632 port) or the one-liner command from the Database folder: COMMIT=1234567 make backup_restore, where 1234567 should be replaced with target commit hash (which can be found using make backup_show_history command). Please note that one-liner will rollback both mimir and frey databases!
Please note that backups will consume quite much disk space. To clean up some space you may consider deleting the /var/lib/postgresql/backup/.git directory and changing the BACKUP_GIT_REMOTE variable, followed by containers restart.
Pantheon developer environment works on *nix hosts (mac, linux, *bsd). Windows-based systems are not supported (while it still MAY work, it is not tested at all, also you may want to try using it under WSL in Windows 10+).
First, please add the following entries to your /etc/hosts file so you could access pantheon services locally:
127.0.0.1 bragi.pantheon.local
127.0.0.1 forseti.pantheon.local
127.0.0.1 frey.pantheon.local
127.0.0.1 gullveig.pantheon.local
127.0.0.1 hermod.pantheon.local
127.0.0.1 hugin.pantheon.local
127.0.0.1 mimir.pantheon.local
127.0.0.1 meili.pantheon.local
127.0.0.1 sigrun.pantheon.local
127.0.0.1 skirnir.pantheon.local
127.0.0.1 tyr.pantheon.local
127.0.0.1 pga.pantheon.local
127.0.0.1 grafana.pantheon.local
127.0.0.1 dozzle.pantheon.local
Second, make sure your local port 80 is not used by any other software (like nginx, apache or another web server).
make pantheon_stop is run.Common/ReverseProxy/external-proxy.example.conf file for a list of hosts configuration (for nginx). For other web servers, please use equivalent instructions. Modify configuration of your currently running web server to allow requests pass to the services from your local browser.Common/ReverseProxy/nginx.conf file to add pantheon configuration there. You'll also need to add the container to pantheon_internal_net docker network.Make sure you have Docker, Docker compose plugin and Docker buildx plugin installed and daemon running on your system. For debugging, please make sure all the php extensions are installed as well, see Dockerfile for a complete list.
Note: on some linux distros almost every container-related command should be run as root. If nothing happens, or error is displayed, try adding sudo before make.
make pull to fetch all the containers from registry. This is optional, though, it will allow you to skip container build process.
make container_dev to build containers from scratch on you local machine. This may take a long time.make dev to start all containers, install dependencies for all projects, run database migrations and start webpack dev servers for Tyr and Forseti.make logs and make php_logs in each subsystem folder to view logs in real-time. Also you may use make shell to get to container shell, if you want to. Notice that killing php-fpm, postgres or nginx will ruin the container entirely.make pantheon_stop to stop all containers (without deleting the data) and make kill to stop the container AND clean images (e.g. this will remove all db data).Please note: if you're using podman, trying to stop a single service container will result in also stopping all containers it depends on. Docker has no such issue.
To create an event and fill it with some data, run make seed, make seed_bigevent or make seed_tournament (with sudo if required). Note that users are re-seeded on each command run. To log in as one of the created users, you may need the id and client hash emitted in the console. Note that dump is output in development mode only. Created users' data is saved to temporary file inside Frey container, so you may also access this data using make dump_users.
A separate guide about debugging in PhpStorm IDE is available.
Local port 5532 will available for PostgreSQL connections - if you want to use external pgAdmin3/4 or any other client to access your databases.
Services will be available at:
dev@pantheon.devpassworddb.pantheon.local5432mimirpgpassdb.pantheon.local5432freypgpassadminadmin (Grafana will ask to change it on first login)http://hugin.pantheon.internal:9090 as prometheus hostHugin/dashboards to view the resultsMimir and Frey use twirp interface to communicate with other services. See protocol description files in Common folder. Please note:
make proto_gen in root repo folder to regenerate all protocol related code.Frey has been rewritten from scratch for better maintainability. To migrate to new version you'll need to:
make pullgit fetch && git checkout origin/mastermake prod_restart && make prod_compilemake migrate_frey1After the steps are completed, you may want to remove old frey database. To do so, use make shell_db and drop the database using psql.
Pantheon services include e2e testing framework based on Playwright. To run it locally, make sure pantheon development environment is running (make dev) and use make e2e_dev command in separate terminal window. Note that it will run tests against development build, so no SSR is tested locally.
If you want to test full production build locally, you may stop the development environment and use following commands:
make e2e_run
make e2e_compile
make e2e
Remember to remove all the files created during the run before committing changes.
Pantheon provides container with pre-installed email agent (Hermod). You can view last sent email in CLI using make dump_last_mail command. This is useful to test registration and password recovery, because emails sent from the developer environment will most likely be rejected by target email relay (e.g. gmail rejects it in 100% of cases).
Pantheon supports realtime notifications (currently only via Telegram, but Discord may also be added soon). To use this functionality you should register a bot in Telegram and set its nickname and secret token in Env/.env.production:
BOT_TOKEN=yourtoken
VITE_BOT_NICKNAME=bot_nickname
After that your users should open the bot, start the conversation and follow the link it sends. After pressing the confirmation button, bot will be enabled for this particular user.
ip_tables module inserted into your kernel on the host. Otherwise, containers will fail to start.sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER.sudo rm -f /etc/containers/storage.conf.podman system reset -f. CAUTION: This will delete all running containers, images and volumes.net.ipv4.ip_unprivileged_port_start=80 in your /etc/sysctl.conf to allow binding on port 80, otherwise reverse proxy won't be able to start when you run make dev.Basic all-in-one script for all the notes above:
sudo aa-teardown || true
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER
sudo systemctl disable --now apparmor.service
sudo rm -f /etc/containers/storage.conf || true
podman system reset -f
sudo podman system reset -f
Any pull request should pass all current code style checks; also all unit tests should pass. Don't forget to run make check (with sudo if required) before sending your pull request. To fix all code style issues automatically (in php code only), run make autofix (also sudo may be required).
One may want to use Pantheon API in some own external service. Please make sure you have protoc v3.21.9-r0 so generated binary code matches our protocol version.
All Pantheon code except protocol files is licensed under the GNU GPL v3 License. See the LICENSE file for details. Protocol files are licensed under the Apache License, Version 2.0. See the LICENSE file in Common/proto folder for details.