diff --git a/install/paperless-ngx-install.sh b/install/paperless-ngx-install.sh index 541aa4b2a..d4ad4cba9 100644 --- a/install/paperless-ngx-install.sh +++ b/install/paperless-ngx-install.sh @@ -35,17 +35,9 @@ $STD apt-get install -y \ libleptonica-dev msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv PG_VERSION="16" install_postgresql -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-pip \ - python3-dev \ - python3-setuptools \ - python3-wheel -msg_ok "Setup Python3" - msg_info "Installing OCR Dependencies (Patience)" $STD apt-get install -y \ unpaper \ @@ -85,8 +77,7 @@ $STD tar -xf "paperless-ngx-$Paperlessngx.tar.xz" -C /opt/ mv paperless-ngx paperless rm "paperless-ngx-$Paperlessngx.tar.xz" cd /opt/paperless -$STD pip install --upgrade pip -$STD pip install -r requirements.txt +$STD uv sync curl -fsSL "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example" -o /opt/paperless/paperless.conf mkdir -p {consume,data,media,static} sed -i -e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' /opt/paperless/paperless.conf @@ -98,7 +89,7 @@ echo "${Paperlessngx}" >/opt/"${APPLICATION}"_version.txt msg_ok "Installed Paperless-ngx" msg_info "Installing Natural Language Toolkit (Patience)" -$STD python3 -m nltk.downloader -d /usr/share/nltk_data all +$STD /opt/paperless/.venv/bin/python -m nltk.downloader -d /usr/share/nltk_data all msg_ok "Installed Natural Language Toolkit" msg_info "Setting up PostgreSQL database" @@ -122,7 +113,7 @@ sed -i -e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" /opt/paperl sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf cd /opt/paperless/src -$STD python3 manage.py migrate +$STD /opt/paperless/.venv/bin/python manage.py migrate msg_ok "Set up PostgreSQL database" read -r -p "${TAB3}Would you like to add Adminer? " prompt @@ -144,7 +135,7 @@ fi msg_info "Setting up admin Paperless-ngx User & Password" ## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations -cat </opt/prometheus-pve-exporter/pve.yml default: @@ -42,7 +37,7 @@ After=syslog.target network.target User=root Restart=always Type=simple -ExecStart=pve_exporter \ +ExecStart=/usr/local/bin/uv run pve_exporter \ --config.file=/opt/prometheus-pve-exporter/pve.yml \ --web.listen-address=0.0.0.0:9221 ExecReload=/bin/kill -HUP \$MAINPID diff --git a/install/radicale-install.sh b/install/radicale-install.sh index bed34b116..c8e374c11 100644 --- a/install/radicale-install.sh +++ b/install/radicale-install.sh @@ -15,17 +15,16 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - apache2-utils \ - python3-pip \ - python3.11-venv + apache2-utils msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv + msg_info "Setting up Radicale" -python3 -m venv /opt/radicale -source /opt/radicale/bin/activate -$STD python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz +$STD uv venv /opt/radicale +$STD /opt/radicale/bin/uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) -$STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS +$STD htpasswd -c -b -5 /opt/radicale/users admin "$RNDPASS" { echo "Radicale Credentials" echo "Admin User: admin" @@ -34,16 +33,15 @@ $STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS msg_ok "Done setting up Radicale" msg_info "Setup Service" - cat </opt/radicale/start.sh #!/usr/bin/env bash -source /opt/radicale/bin/activate -python3 -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 +/opt/radicale/bin/uv run -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512 EOF chmod +x /opt/radicale/start.sh cat </etc/systemd/system/radicale.service +[Unit] Description=A simple CalDAV (calendar) and CardDAV (contact) server After=network.target Requires=network.target @@ -51,13 +49,11 @@ Requires=network.target [Service] ExecStart=/opt/radicale/start.sh Restart=on-failure -# User=radicale -# Deny other users access to the calendar data -# UMask=0027 [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now radicale msg_ok "Created Service" diff --git a/install/searxng-install.sh b/install/searxng-install.sh index 0d955cb20..e3a4fc972 100644 --- a/install/searxng-install.sh +++ b/install/searxng-install.sh @@ -22,13 +22,7 @@ $STD apt-get install -y \ git msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3 \ - python3-{pip,venv,yaml,dev} -$STD pip install --upgrade pip setuptools wheel -$STD pip install pyyaml -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Setup SearXNG" mkdir -p /usr/local/searxng /etc/searxng @@ -36,11 +30,10 @@ useradd -d /etc/searxng searxng chown searxng:searxng /usr/local/searxng /etc/searxng $STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src cd /usr/local/searxng/ -sudo -u searxng python3 -m venv /usr/local/searxng/searx-pyenv -source /usr/local/searxng/searx-pyenv/bin/activate -$STD pip install --upgrade pip setuptools wheel -$STD pip install pyyaml -$STD pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src +$STD uv venv /usr/local/searxng/searx-pyenv +$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --upgrade pip setuptools wheel pyyaml +$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src + SECRET_KEY=$(openssl rand -hex 32) cat </etc/searxng/settings.yml # SearXNG settings @@ -94,7 +87,7 @@ Type=simple User=searxng Group=searxng Environment="SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml" -ExecStart=/usr/local/searxng/searx-pyenv/bin/python -m searx.webapp +ExecStart=/usr/local/searxng/searx-pyenv/bin/uv run -m searx.webapp WorkingDirectory=/usr/local/searxng/searxng-src Restart=always diff --git a/install/slskd-install.sh b/install/slskd-install.sh index b4b3d8b12..d064fb7cb 100644 --- a/install/slskd-install.sh +++ b/install/slskd-install.sh @@ -13,10 +13,7 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - python3-pip -msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv msg_info "Setup ${APPLICATION}" tmp_file=$(mktemp) @@ -40,13 +37,13 @@ sed -i \ msg_ok "Setup ${APPLICATION}" msg_info "Installing Soularr" -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED cd /tmp curl -fsSL -o main.zip https://github.com/mrusse/soularr/archive/refs/heads/main.zip $STD unzip main.zip mv soularr-main /opt/soularr cd /opt/soularr -$STD pip install -r requirements.txt +$STD uv venv /opt/soularr/venv +$STD /opt/soularr/venv/bin/uv pip install -r requirements.txt sed -i \ -e "\|[Slskd]|,\|host_url|s|yourslskdapikeygoeshere|$SLSKD_API_KEY|" \ -e "/host_url/s/slskd/localhost/" \ @@ -54,7 +51,7 @@ sed -i \ sed -i \ -e "/#This\|#Default\|INTERVAL/{N;d;}" \ -e "/while\|#Pass/d" \ - -e "\|python|s|app|opt/soularr|; s|python|python3|" \ + -e "\|python|s|app|opt/soularr|; s|python|/opt/soularr/venv/bin/python3|" \ -e "/dt/,+2d" \ /opt/soularr/run.sh sed -i -E "/(soularr.py)/s/.{5}$//; /if/,/fi/s/.{4}//" /opt/soularr/run.sh @@ -106,6 +103,7 @@ ExecStart=/bin/bash -c /opt/soularr/run.sh [Install] WantedBy=multi-user.target EOF + systemctl enable -q --now ${APPLICATION} systemctl enable -q soularr.timer msg_ok "Created Services" @@ -114,8 +112,8 @@ motd_ssh customize msg_info "Cleaning up" -rm -rf $tmp_file -rm -rf /tmp/main.zip +rm -f $tmp_file +rm -f /tmp/main.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index 4a70725bf..beee29ed2 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -22,22 +22,17 @@ $STD apt-get install -y \ ca-certificates msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - python3-dev \ - python3-setuptools \ - python3-wheel \ - python3-pip -msg_ok "Setup Python3" +PYTHON_VERSION="3.12" setup_uv msg_info "Installing Spoolman" RELEASE=$(curl -fsSL https://github.com/Donkie/Spoolman/releases/latest | grep "title>Release" | cut -d " " -f 4) cd /opt curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip" -o "spoolman.zip" $STD unzip spoolman.zip -d spoolman -rm -rf spoolman.zip +rm -f spoolman.zip cd spoolman -$STD pip3 install -r requirements.txt +$STD uv venv /opt/spoolman/venv +$STD /opt/spoolman/venv/bin/uv pip install -r requirements.txt curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env" echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Spoolman" @@ -47,13 +42,15 @@ cat </etc/systemd/system/spoolman.service [Unit] Description=Spoolman After=network.target + [Service] Type=simple WorkingDirectory=/opt/spoolman EnvironmentFile=/opt/spoolman/.env -ExecStart=uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 +ExecStart=/opt/spoolman/venv/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 7912 Restart=always User=root + [Install] WantedBy=multi-user.target EOF