-
Notifications
You must be signed in to change notification settings - Fork 0
How to set up Austeritas
AXOME edited this page Mar 8, 2023
·
12 revisions
Please check the requirements to run Austeritas here.
- 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 .
- Initialize the directory by running these commands:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 install.py confirm
- Open constants.py using an editor, a.E. nano:
nano constants.py
- Change the value
False
for the variableALLOW_NEW_USERS
toTrue
. - Adjust the
SCREEN_PROCESS_NAME
to whatever the screen session your bedrock server is running in is called. -
When running in production, make sure that
DEBUG
is set toFalse
! - Write the changes and exit.
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:
sudo rm /etc/nginx/sites-enabled/default
sudo nano /etc/nginx/sites-enabled/austeritas
- 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;
}
- Save and exit the file. Then run
sudo systemctl restart nginx
- Run
gunicorn -w 2 austeritas:create_app()
- Open your webbrowser and type into your address bar:
http://ENTER_YOUR_SERVER_IP:9002/auth/login
(replace theENTER_YOUR_SERVER_IP
with your server's public IP address.) - 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.
- Submit the form. Copy the JSON you see in the bottom left in your screen.
- Stop the server by hitting
CTRL
+C
. - 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": {
...
}
}
- 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.
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:
- Run
sudo apt install supervisor
- Run
sudo nano /etc/supervisor/conf.d/austeritas.conf
- 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
- Run
sudo mkdir -p /var/log/austeritas
- Run
sudo touch /var/log/austeritas/austeritas.err.log
andsudo touch /var/log/austeritas/austeritas.out.log
- Restart the supervisor by running
sudo supervisorctl reload
- 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!