fixed both script changed pip env to uv

This commit is contained in:
bilulib
2025-07-21 14:30:16 +02:00
parent e2b9ac687f
commit 2c61e49140
2 changed files with 91 additions and 85 deletions

View File

@ -5,7 +5,6 @@
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dictionarry-Hub/profilarr
# Import Functions and Setup
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
@ -18,48 +17,39 @@ APPLICATION="profilarr"
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
wget \
git \
unzip \
build-essential \
python3 \
python3-pip \
python3-venv \
ca-certificates \
gnupg
build-essential
msg_ok "Installed Dependencies"
msg_info "Installing Python"
$STD apt-get install -y \
python3 \
python3-venv
msg_ok "Installed Python"
msg_info "Setup uv"
setup_uv
msg_ok "Setup uv"
msg_info "Installing Node.js"
$STD mkdir -p /etc/apt/keyrings
$STD curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
$STD echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
$STD apt-get update
$STD apt-get install -y nodejs
NODE_VERSION="20" install_node_and_modules
msg_ok "Installed Node.js"
msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
temp_file=$(mktemp)
$STD curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/v${RELEASE}.zip"
cd /tmp
$STD unzip -q "$temp_file"
$STD curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/${RELEASE}.zip"
$STD unzip -q "$temp_file" -d /tmp
$STD mkdir -p /opt/${APPLICATION}
$STD mkdir -p /opt/${APPLICATION}_config
$STD mv "profilarr-${RELEASE}/backend" /opt/${APPLICATION}/
$STD mv "profilarr-${RELEASE}/frontend" /opt/${APPLICATION}/
$STD chown -R root:root /opt/${APPLICATION}
$STD mv "/tmp/profilarr-${RELEASE}/backend" /opt/${APPLICATION}/
$STD mv "/tmp/profilarr-${RELEASE}/frontend" /opt/${APPLICATION}/
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
$STD uv venv /opt/${APPLICATION}/venv
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python -r /opt/${APPLICATION}/backend/requirements.txt
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python gunicorn
msg_ok "Setup ${APPLICATION}"
msg_info "Setting up Python Virtual Environment"
$STD python3 -m venv /opt/${APPLICATION}/venv
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
cd /opt/${APPLICATION}/backend
$STD /opt/${APPLICATION}/venv/bin/pip install -r requirements.txt
$STD /opt/${APPLICATION}/venv/bin/pip install gunicorn
msg_ok "Setup Python Environment"
msg_info "Building Frontend"
cd /opt/${APPLICATION}/frontend
$STD npm install
@ -73,7 +63,6 @@ cat <<EOF >/etc/systemd/system/${APPLICATION}.service
[Unit]
Description=Profilarr Profile Manager
After=network.target
[Service]
Type=simple
User=root
@ -83,14 +72,12 @@ Environment=CONFIG_PATH=/opt/${APPLICATION}_config
ExecStart=/opt/${APPLICATION}/venv/bin/gunicorn --bind 0.0.0.0:6868 --workers 2 --timeout 120 app.main:create_app()
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
$STD systemctl daemon-reload
$STD systemctl enable ${APPLICATION}.service
$STD systemctl start ${APPLICATION}.service
systemctl enable -q --now ${APPLICATION}
msg_ok "Created Service"
motd_ssh