Skip to content

How to set up Austeritas

AXOME edited this page Mar 8, 2023 · 12 revisions

Setting up Austeritas

Installation

Requirements

Please check the requirements to run Austeritas here.

Doing the installation

  1. Clone the repository into an empty folder called "austeritas" in your user's home directory on your server (a.E. /home/user/austeritas): git clone https://github.com/AXOMEstudios/austeritas.git .
  2. Initialize the directory by running these commands:
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    python3 install.py confirm
  3. Open constants.py using an editor, a.E. nano: nano constants.py
  4. Change the value False for the variable ALLOW_NEW_USERS to True.
  5. Adjust the SCREEN_PROCESS_NAME to whatever the screen session your bedrock server is running in is called.
  6. When running in production, make sure that DEBUG is set to False!
  7. Write the changes and exit.

Configuration

You are almost all set! You do now have to run the server using the web server of your favour, a.E. gunicorn + nginx.
You can install nginx using sudo apt install nginx.
gunicorn is installed using pip install gunicorn.
If you already know how to do these steps, scroll down until you reach "Setting up your user account".

To configurate these, follow the steps:

  1. sudo rm /etc/nginx/sites-enabled/default
  2. sudo nano /etc/nginx/sites-enabled/austeritas
  3. Enter the following code, replacing ENTER_YOUR_SERVER_IP with your server's IP, a.E. 12.34.123.456. Replace "USERNAME" with your username:
    server {
    listen 9002;
    server_name ENTER_YOUR_SERVER_IP;
    location /static {
    alias /home/USERNAME/austeritas/static;
    }
    location / {
    proxy_pass http://localhost:8000;
    include /etc/nginx/proxy_params;
    proxy_redirect off;
    }
  4. Save and exit the file. Then run sudo systemctl restart nginx

Setting up your user account

  1. Run gunicorn -w 2 austeritas:create_app()
  2. Open your webbrowser and type into your address bar: http://ENTER_YOUR_SERVER_IP:9002/auth/login
    (replace the ENTER_YOUR_SERVER_IP with your server's public IP address.)
  3. You should see the Austeritas log-in page. Scroll down to the new user-form, then enter:
  • a username, a name without spaces, special symbols and capital letters is recommended, a.E. "marcel".
  • a password that is really secure. We recommend AT LEAST 10 characters length, capital and lowercase letters, numbers and special symbols.
  1. Submit the form. Copy the JSON you see in the bottom left in your screen.
  2. Stop the server by hitting CTRL + C.
  3. Paste the JSON into austeritas_config.json on your server: nano austeritas_config.json Before:
    {
    "users": [],
    "autoban_settings": {
    ...
    }
    }
    After pasting:
    {
    "users": [
    {"name": "marcel", "password": "$2b$1..."}
    ],
    "autoban_settings": {
    ...
    }
    }
  4. Save the changes, then:
  • RUN the server if you did the nginx + gunicorn part yourself, without the tutorial above.
  • CONTINUE READING if you did the tutorial above.

Ensuring the webserver is boot-safe

We're pretty much done, there's just one very important last thing to do. We have to ensure the Austeritas server keeps itself up. That's easy. Follow the steps below:

  1. Run sudo apt install supervisor
  2. Run sudo nano /etc/supervisor/conf.d/austeritas.conf
  3. Write into the file (replace USERNAME with your username):
    [program:austeritas]
    directory=/home/USERNAME/austeritas
    command=/home/USERNAME/austeritas/venv/bin/gunicorn -w 2 'austeritas:create_app()'
    user=USERNAME
    autostart=true
    autorestart=true
    stopasgroup=true
    killasgroup=true
    stderr_logfile=/var/log/austeritas/austeritas.err.log
    stdout_logfile=/var/log/austeritas/austeritas.out.log
  4. Run sudo mkdir -p /var/log/austeritas
  5. Run sudo touch /var/log/austeritas/austeritas.err.log and sudo touch /var/log/austeritas/austeritas.out.log
  6. Restart the supervisor by running sudo supervisorctl reload
  7. You may also leave the venv by using deactivate.

😊 That's everything! You're done setting up your Austeritas server and may now try it out as much as you like!