From 96511db9efea6ae7ca3b394cf304498791cebeb9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:52:02 +0200 Subject: [PATCH] next migrations --- install/stirling-pdf-install.sh | 11 +++++------ install/tandoor-install.sh | 26 ++++++++++---------------- install/tasmocompiler-install.sh | 18 +++++++----------- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/install/stirling-pdf-install.sh b/install/stirling-pdf-install.sh index c058ab7bea..a26327b9d8 100644 --- a/install/stirling-pdf-install.sh +++ b/install/stirling-pdf-install.sh @@ -40,12 +40,11 @@ $STD apt-get install -y \ python3-uno msg_ok "Installed LibreOffice Components" -msg_info "Installing Python Dependencies" -$STD apt-get install -y \ - python3 \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -$STD pip3 install \ +PYTHON_VERSION="3.12" setup_uv + +msg_info "Installing Python Dependencies via uv" +uv venv /opt/stirling/venv +$STD /opt/stirling/venv/bin/uv pip install \ uno \ opencv-python-headless \ unoconv \ diff --git a/install/tandoor-install.sh b/install/tandoor-install.sh index 3673e30138..e514d17ba7 100644 --- a/install/tandoor-install.sh +++ b/install/tandoor-install.sh @@ -32,25 +32,19 @@ $STD apt-get install -y --no-install-recommends \ libxmlsec1-openssl msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-setuptools \ - python3-pip \ - python3-xmlsec -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="20" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Installing Tandoor (Patience)" $STD git clone https://github.com/TandoorRecipes/recipes -b master /opt/tandoor mkdir -p /opt/tandoor/{config,api,mediafiles,staticfiles} -$STD pip3 install -r /opt/tandoor/requirements.txt +$STD uv venv /opt/tandoor/venv +$STD /opt/tandoor/venv/bin/uv pip install -r /opt/tandoor/requirements.txt + cd /opt/tandoor/vue $STD yarn install $STD yarn build + curl -fsSL "https://raw.githubusercontent.com/TandoorRecipes/recipes/develop/.env.template" -o "/opt/tandoor/.env" DB_NAME=db_recipes DB_USER=tandoor @@ -65,7 +59,7 @@ sed -i -e "s|SECRET_KEY=.*|SECRET_KEY=$secret_key|g" \ -e "s|POSTGRES_USER=.*|POSTGRES_USER=$DB_USER|g" \ -e "\$a\STATIC_URL=/staticfiles/" /opt/tandoor/.env cd /opt/tandoor -$STD python3 version.py +$STD /opt/tandoor/venv/bin/uv run python version.py msg_ok "Installed Tandoor" msg_info "Install/Set up PostgreSQL Database" @@ -83,9 +77,9 @@ echo -e "Tandoor Database Name: \e[32m$DB_NAME\e[0m" >>~/tandoor.creds echo -e "Tandoor Database User: \e[32m$DB_USER\e[0m" >>~/tandoor.creds echo -e "Tandoor Database Password: \e[32m$DB_PASS\e[0m" >>~/tandoor.creds export $(cat /opt/tandoor/.env | grep "^[^#]" | xargs) -/usr/bin/python3 /opt/tandoor/manage.py migrate >/dev/null 2>&1 -/usr/bin/python3 /opt/tandoor/manage.py collectstatic --no-input >/dev/null 2>&1 -/usr/bin/python3 /opt/tandoor/manage.py collectstatic_js_reverse >/dev/null 2>&1 +$STD /opt/tandoor/venv/bin/uv run python manage.py migrate +$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic --no-input +$STD /opt/tandoor/venv/bin/uv run python manage.py collectstatic_js_reverse msg_ok "Set up PostgreSQL Database" msg_info "Creating Services" @@ -100,7 +94,7 @@ Restart=always RestartSec=3 WorkingDirectory=/opt/tandoor EnvironmentFile=/opt/tandoor/.env -ExecStart=/usr/local/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application +ExecStart=/opt/tandoor/venv/bin/gunicorn --error-logfile /tmp/gunicorn_err.log --log-level debug --capture-output --bind unix:/opt/tandoor/tandoor.sock recipes.wsgi:application [Install] WantedBy=multi-user.target diff --git a/install/tasmocompiler-install.sh b/install/tasmocompiler-install.sh index 1ba241f0bb..a4ad101585 100644 --- a/install/tasmocompiler-install.sh +++ b/install/tasmocompiler-install.sh @@ -14,19 +14,15 @@ network_check update_os msg_info "Installing Dependencies. Patience" -$STD apt-get install -y \ - git +$STD apt-get install -y git msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y python3-venv -msg_ok "Setup Python3" - +PYTHON_VERSION="3.12" setup_uv NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules msg_info "Setup Platformio" -curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -$STD python3 get-platformio.py +uv venv /opt/tasmocompiler/venv +$STD /opt/tasmocompiler/venv/bin/uv pip install platformio msg_ok "Setup Platformio" msg_info "Setup TasmoCompiler" @@ -42,9 +38,9 @@ export NODE_OPTIONS=--openssl-legacy-provider $STD npm i $STD yarn build mkdir -p /usr/local/bin -ln -s ~/.platformio/penv/bin/platformio /usr/local/bin/platformio -ln -s ~/.platformio/penv/bin/pio /usr/local/bin/pio -ln -s ~/.platformio/penv/bin/piodebuggdb /usr/local/bin/piodebuggdb +ln -sf /opt/tasmocompiler/venv/bin/platformio /usr/local/bin/platformio +ln -sf /opt/tasmocompiler/venv/bin/pio /usr/local/bin/pio +ln -sf /opt/tasmocompiler/venv/bin/piodebuggdb /usr/local/bin/piodebuggdb echo "${RELEASE}" >"/opt/tasmocompiler_version.txt" msg_ok "Setup TasmoCompiler"