next migrations

This commit is contained in:
CanbiZ 2025-06-03 16:52:02 +02:00
parent 128c84a79a
commit 96511db9ef
3 changed files with 22 additions and 33 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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"