66# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
77# Source: https://github.com/seanmorley15/AdventureLog
88
9- source /dev/stdin <<< " $FUNCTIONS_FILE_PATH"
9+ source /dev/stdin <<< " $FUNCTIONS_FILE_PATH"
1010color
1111verb_ip6
1212catch_errors
@@ -17,9 +17,6 @@ update_os
1717msg_info " Installing Dependencies"
1818$STD apt-get install -y \
1919 gpg \
20- curl \
21- sudo \
22- mc \
2320 gdal-bin \
2421 libgdal-dev \
2522 git \
@@ -57,12 +54,12 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8'
5754$STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
5855$STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET timezone TO 'UTC';"
5956{
60- echo " AdventureLog-Credentials"
61- echo " AdventureLog Database User: $DB_USER "
62- echo " AdventureLog Database Password: $DB_PASS "
63- echo " AdventureLog Database Name: $DB_NAME "
64- echo " AdventureLog Secret: $SECRET_KEY "
65- } >> ~ /adventurelog.creds
57+ echo " AdventureLog-Credentials"
58+ echo " AdventureLog Database User: $DB_USER "
59+ echo " AdventureLog Database Password: $DB_PASS "
60+ echo " AdventureLog Database Name: $DB_NAME "
61+ echo " AdventureLog Secret: $SECRET_KEY "
62+ } >> ~/adventurelog.creds
6663msg_ok " Set up PostgreSQL"
6764
6865msg_info " Installing AdventureLog (Patience)"
@@ -74,7 +71,7 @@ RELEASE=$(curl -s https://api.github.com/repos/seanmorley15/AdventureLog/release
7471wget -q " https://github.com/seanmorley15/AdventureLog/archive/refs/tags/v${RELEASE} .zip"
7572unzip -q v${RELEASE} .zip
7673mv AdventureLog-${RELEASE} /opt/adventurelog
77- cat << EOF > /opt/adventurelog/backend/server/.env
74+ cat << EOF >/opt/adventurelog/backend/server/.env
7875PGHOST='localhost'
7976PGDATABASE='${DB_NAME} '
8077PGUSER='${DB_USER} '
@@ -103,7 +100,7 @@ $STD pip install -r requirements.txt
103100$STD python3 manage.py collectstatic --noinput
104101$STD python3 manage.py migrate
105102$STD python3 manage.py download-countries
106- cat << EOF > /opt/adventurelog/frontend/.env
103+ cat << EOF >/opt/adventurelog/frontend/.env
107104PUBLIC_SERVER_URL=http://$LOCAL_IP :8000
108105BODY_SIZE_LIMIT=Infinity
109106ORIGIN='http://$LOCAL_IP :3000'
@@ -115,7 +112,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
115112msg_ok " Installed AdventureLog"
116113
117114msg_info " Setting up Django Admin"
118- $STD python3 /opt/adventurelog/backend/server/manage.py shell << EOF
115+ $STD python3 /opt/adventurelog/backend/server/manage.py shell << EOF
119116from django.contrib.auth import get_user_model
120117UserModel = get_user_model()
121118user = UserModel.objects.create_user('$DJANGO_ADMIN_USER ', password='$DJANGO_ADMIN_PASS ')
@@ -124,11 +121,11 @@ user.is_staff = True
124121user.save()
125122EOF
126123{
127- echo " "
128- echo " Django-Credentials"
129- echo " Django Admin User: $DJANGO_ADMIN_USER "
130- echo " Django Admin Password: $DJANGO_ADMIN_PASS "
131- } >> ~ /adventurelog.creds
124+ echo " "
125+ echo " Django-Credentials"
126+ echo " Django Admin User: $DJANGO_ADMIN_USER "
127+ echo " Django Admin Password: $DJANGO_ADMIN_PASS "
128+ } >> ~/adventurelog.creds
132129msg_ok " Setup Django Admin"
133130
134131msg_info " Creating Service"
@@ -171,4 +168,4 @@ msg_info "Cleaning up"
171168rm -rf /opt/v${RELEASE} .zip
172169$STD apt-get -y autoremove
173170$STD apt-get -y autoclean
174- msg_ok " Cleaned"
171+ msg_ok " Cleaned"
0 commit comments