migrations

This commit is contained in:
CanbiZ 2025-06-03 16:18:24 +02:00
parent 5551c2757c
commit 44c98dda24
6 changed files with 51 additions and 60 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/python_to_uv/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE

View File

@ -23,6 +23,7 @@ $STD apt-get install -y \
python3-pip
msg_ok "Installed Dependencies"
setup_uv
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
PG_VERSION="16" PG_MODULES="postgis" install_postgresql
@ -79,11 +80,13 @@ DISABLE_REGISTRATION=False
EOF
cd /opt/adventurelog/backend/server
mkdir -p /opt/adventurelog/backend/server/media
$STD pip install --upgrade pip
$STD pip install -r requirements.txt
$STD python3 manage.py collectstatic --noinput
$STD python3 manage.py migrate
$STD python3 manage.py download-countries
$STD uv venv /opt/adventurelog/backend/server/venv
source /opt/adventurelog/backend/server/venv/bin/activate
$STD uv pip install --upgrade pip
$STD uv pip install -r requirements.txt
$STD uv python3 manage.py collectstatic --noinput
$STD uv python3 manage.py migrate
$STD uv python3 manage.py download-countries
cat <<EOF >/opt/adventurelog/frontend/.env
PUBLIC_SERVER_URL=http://$LOCAL_IP:8000
BODY_SIZE_LIMIT=Infinity
@ -96,7 +99,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed AdventureLog"
msg_info "Setting up Django Admin"
$STD python3 /opt/adventurelog/backend/server/manage.py shell <<EOF
$STD uv python3 /opt/adventurelog/backend/server/manage.py shell <<EOF
from django.contrib.auth import get_user_model
UserModel = get_user_model()
user = UserModel.objects.create_user('$DJANGO_ADMIN_USER', password='$DJANGO_ADMIN_PASS')

View File

@ -19,15 +19,12 @@ $STD apt-get install -y git \
build-essential
msg_ok "Installed Dependencies"
msg_info "Setup Python3"
$STD apt-get install -y \
python3 \
python3-dev \
python3-pip \
python3-venv \
python3-setuptools
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Setup Python3"
setup_uv
UV_PYTHON_VERSION="3.12"
msg_info "Installing Python $UV_PYTHON_VERSION via uv"
$STD uv python install $UV_PYTHON_VERSION
msg_ok "Installed Python $UV_PYTHON_VERSION"
msg_info "Creating user octoprint"
useradd -m -s /bin/bash -p $(openssl passwd -1 octoprint) octoprint
@ -40,11 +37,9 @@ msg_info "Installing OctoPrint"
$STD sudo -u octoprint bash <<EOF
mkdir /opt/octoprint
cd /opt/octoprint
python3 -m venv .
source bin/activate
pip install --upgrade pip
pip install wheel
pip install octoprint
uv venv --python $UV_PYTHON_VERSION
uv pip install wheel
uv pip install octoprint
EOF
msg_ok "Installed OctoPrint"
@ -60,7 +55,7 @@ Environment="LC_ALL=C.UTF-8"
Environment="LANG=C.UTF-8"
Type=exec
User=octoprint
ExecStart=/opt/octoprint/bin/octoprint serve
ExecStart=/opt/octoprint/.venv/bin/octoprint serve
[Install]
WantedBy=multi-user.target

View File

@ -19,9 +19,7 @@ $STD apt-get install -y \
p7zip-full
msg_ok "Installed Dependencies"
msg_info "Setup uv"
setup_uv
msg_ok "Setup uv"
msg_info "Setup Unrar"
cat <<EOF >/etc/apt/sources.list.d/non-free.list

View File

@ -35,13 +35,10 @@ $STD apt-get -y install --no-install-recommends \
x11-apps
msg_ok "Installed Dependencies"
setup_uv
$STD uv python install
NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules
msg_info "Setup Python3"
$STD apt-get install -y python3
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Setup Python3"
msg_info "Installing Chromium"
curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/trusted.gpg.d/google-archive.gpg
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >/etc/apt/sources.list.d/google.list

View File

@ -20,11 +20,8 @@ $STD apt-get install -y \
libapache2-mod-wsgi-py3
msg_ok "Installed Dependencies"
msg_info "Installing Python"
$STD apt-get install -y python3-pip
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Installed Python"
setup_uv
$STD uv python install
NODE_VERSION="22" NODE_MODULE="yarn@latest,sass" install_node_and_modules
msg_info "Setting up wger"
@ -42,13 +39,14 @@ curl -fsSL "https://github.com/wger-project/wger/archive/refs/tags/$RELEASE.tar.
tar xzf $RELEASE.tar.gz
mv wger-$RELEASE /home/wger/src
cd /home/wger/src
$STD pip install -r requirements_prod.txt
$STD pip install -e .
$STD uv venv /home/wger/.venv
$STD uv pip install -r requirements_prod.txt --python=/home/wger/.venv
$STD uv pip install -e . --python=/home/wger/.venv
$STD wger create-settings --database-path /home/wger/db/database.sqlite
sed -i "s#home/wger/src/media#home/wger/media#g" /home/wger/src/settings.py
sed -i "/MEDIA_ROOT = '\/home\/wger\/media'/a STATIC_ROOT = '/home/wger/static'" /home/wger/src/settings.py
$STD wger bootstrap
$STD python3 manage.py collectstatic
$STD uv python3 manage.py collectstatic
echo "${RELEASE}" >/opt/wger_version.txt
msg_ok "Finished setting up wger"