Skip to content

besser435/TEAW-Website

Repository files navigation

Welcome to the Git repo for the ToEndAllWars website! Here is the place to find source code, post issues, and submit pull requests. We gladly welcome community contributions, we just ask that you test them first.

TODO:

  • Improve tmux script
  • Figure out a better proxy for the Bluemap
  • Put the project in a venv
  • Add a TEAW Times archive page
  • Add website credits and about page
  • Add animation to burger menu on small screens 🍔

Git guidelines

There are two branches, prod and dev. The default is dev, and where any changes should be made.

In the future, changes will be deployed by bringing changes over from dev (or some other branch) to prod using a pull request. Only once approved, will the PR be merged, and the new changes deployed using a GH webhook.

Before submitting a PR, run the VS Code task to generate the requirements.txt file for pip.

Starting a development server

To start a local version of the website for testing/development, run the teaw_webserver.py file. This will start Flask in debug mode, with the logger set to the DEBUG level. This will also enable Flask's debug mode. For any changes to show up on the website, the process must be restarted.

Note

In order for the server and API to work, the SQLite DBs will need to contain information. By default, there is some data in them. The data will not be updated unless the db_updater.py and stats_updater.py processes are started, but thats not needed for development.

Starting a production server

Before we start, we need to set up the proxy to the Bluemap. TEAW's map is using HTTP, so when we use it in an iframe we run into issues where the browser prevent the connection. This is because this website is using HTTPS. To fix this, we use an nginx proxy. This allows us to use a Cloudflare tunnel to point to the proxy on the server, which then points to the map. This allows the tunnel to use HTTPS, so we don't run into any browser security rules.

This has the added benefit of not requiring a port number on the public facing URL for the map.

To start the proxy, run the bluemap_proxy.sh file in the root directory.

To deploy the server, run the run_prod.sh script with Bash. This will take the Flask app variable inside the teaw_webserver script, and start it with Gunicorn. Note that this disables any debugging features, and can only be ran on Linux.

The db_updater.py and stats_updater.py processes need to be started, so the databases are updated. It is best to use tmux to open and keep running the DB updaters and the webserver. In the future there will be a Bash script to automatically destroy an existing tmux session, and create new ones which contain the required processes.

(yes I know tmux is not a proper process management tool, but it works well)

About

Website for the ToEndAllWars Minecraft server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published