mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-12 15:46:10 +02:00
fix(stirling-pdf): install unoserver on the system python, and append to .env (#16439)
This commit is contained in:
@@ -34,7 +34,11 @@ msg_ok "Installed Dependencies"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
JAVA_VERSION="25" setup_java
|
||||
|
||||
read -r -p "${TAB3}Do you want to use Stirling-PDF with Login? (no/n = without Login) [Y/n] " response
|
||||
if ! read -r -p "${TAB3}Do you want to use Stirling-PDF with Login? (no/n = without Login) [Y/n] " response; then
|
||||
# No interactive stdin (EOF): fall back to the no-login install instead of
|
||||
# silently selecting login, which the -z test below would otherwise do.
|
||||
response="n"
|
||||
fi
|
||||
response=${response,,} # Convert to lowercase
|
||||
login_mode="false"
|
||||
if [[ "$response" == "y" || "$response" == "yes" || -z "$response" ]]; then
|
||||
@@ -72,7 +76,10 @@ $STD uv pip install \
|
||||
pillow \
|
||||
pdf2image
|
||||
$STD apt install -y python3-uno python3-pip
|
||||
$STD pip3 install --break-system-packages --timeout=120 unoserver
|
||||
# Install unoserver for the system Python, not the venv activated above: `uno` is
|
||||
# provided by python3-uno for /usr/bin/python3 only, and unoserver.service expects
|
||||
# /usr/local/bin/unoserver. A bare `pip3` here resolves to the venv's pip.
|
||||
$STD /usr/bin/python3 -m pip install --break-system-packages --timeout=120 unoserver
|
||||
ln -sf /opt/.venv/bin/python3 /usr/local/bin/python3
|
||||
ln -sf /opt/.venv/bin/pip /usr/local/bin/pip
|
||||
msg_ok "Installed Python Dependencies"
|
||||
@@ -104,7 +111,7 @@ PATH=/opt/.venv/bin:/usr/lib/libreoffice/program:/usr/local/sbin:/usr/local/bin:
|
||||
EOF
|
||||
|
||||
if [[ "$login_mode" == "true" ]]; then
|
||||
cat <<EOF >/opt/Stirling-PDF/.env
|
||||
cat <<EOF >>/opt/Stirling-PDF/.env
|
||||
# activate Login
|
||||
DISABLE_ADDITIONAL_FEATURES=false
|
||||
SECURITY_ENABLELOGIN=true
|
||||
|
||||
Reference in New Issue
Block a user