From 647af55b408679b0b8f45a3950c2358e9cd133e3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:18:06 +0200 Subject: [PATCH] more uv migs --- install/jupyternotebook-install.sh | 18 +++++++-------- install/kometa-install.sh | 33 +++++++++++++-------------- install/lazylibrarian-install.sh | 36 +++++++++++++----------------- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/install/jupyternotebook-install.sh b/install/jupyternotebook-install.sh index 843921187..30749a115 100644 --- a/install/jupyternotebook-install.sh +++ b/install/jupyternotebook-install.sh @@ -13,15 +13,14 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - python3 \ - python3-pip -msg_ok "Installed Dependencies" +PYTHON_VERSION="3.12" setup_uv -msg_info "Setting up Jupyter Notebook" -$STD pip3 install jupyter -msg_ok "Setup Jupyter Notebook" +msg_info "Installing Jupyter" +mkdir -p /opt/jupyter +cd /opt/jupyter +$STD uv venv .venv +$STD .venv/bin/uv pip install jupyter +msg_ok "Installed Jupyter" msg_info "Creating Service" cat </etc/systemd/system/jupyternotebook.service @@ -31,7 +30,7 @@ After=network.target [Service] Type=simple -ExecStart=jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root +WorkingDirectory=/opt/jupyter Restart=always RestartSec=10 @@ -39,6 +38,7 @@ RestartSec=10 WantedBy=multi-user.target EOF systemctl enable -q --now jupyternotebook +msg_ok "Created Service" motd_ssh customize diff --git a/install/kometa-install.sh b/install/kometa-install.sh index 8c9634188..9368c1997 100644 --- a/install/kometa-install.sh +++ b/install/kometa-install.sh @@ -13,28 +13,27 @@ setting_up_container network_check update_os -msg_info "Setup Python 3" -$STD apt-get install python3-pip -y -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Setup Python 3" +PYTHON_VERSION="3.12" setup_uv -msg_info "Setup Kometa" -temp_file=$(mktemp) +msg_info "Installing Kometa" +tmp_file=$(mktemp) RELEASE=$(curl -fsSL https://api.github.com/repos/Kometa-Team/Kometa/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o """$temp_file""" -tar -xzf "$temp_file" -mv Kometa-"${RELEASE}" /opt/kometa +curl -fsSL "https://github.com/Kometa-Team/Kometa/archive/refs/tags/v${RELEASE}.tar.gz" -o "$tmp_file" +tar -xzf "$tmp_file" +mv "Kometa-${RELEASE}" /opt/kometa cd /opt/kometa -$STD pip install -r requirements.txt --ignore-installed + +$STD uv venv .venv +$STD .venv/bin/uv pip install -r requirements.txt mkdir -p config/assets cp config/config.yml.template config/config.yml -echo "${RELEASE}" >/opt/kometa_version.txt -msg_ok "Setup Kometa" +echo "$RELEASE" >/opt/kometa_version.txt +msg_ok "Installed Kometa" -read -p "${TAB3}nter your TMDb API key: " TMDBKEY +read -p "${TAB3}Enter your TMDb API key: " TMDBKEY read -p "${TAB3}Enter your Plex URL: " PLEXURL read -p "${TAB3}Enter your Plex token: " PLEXTOKEN -sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL #g" /opt/kometa/config/config.yml +sed -i -e "s#url: http://192.168.1.12:32400#url: $PLEXURL#g" /opt/kometa/config/config.yml sed -i -e "s/token: ####################/token: $PLEXTOKEN/g" /opt/kometa/config/config.yml sed -i -e "s/apikey: ################################/apikey: $TMDBKEY/g" /opt/kometa/config/config.yml @@ -47,21 +46,21 @@ After=network-online.target [Service] Type=simple WorkingDirectory=/opt/kometa -ExecStart=/usr/bin/python3 kometa.py +ExecStart=/opt/kometa/.venv/bin/python kometa.py Restart=always RestartSec=30 [Install] WantedBy=multi-user.target EOF -systemctl enable --now -q kometa +systemctl enable -q --now kometa msg_ok "Created Service" motd_ssh customize msg_info "Cleaning up" -rm -f "$temp_file" +rm -f "$tmp_file" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" diff --git a/install/lazylibrarian-install.sh b/install/lazylibrarian-install.sh index 7749ae6bc..2374cd6f1 100644 --- a/install/lazylibrarian-install.sh +++ b/install/lazylibrarian-install.sh @@ -14,29 +14,22 @@ setting_up_container network_check update_os +PYTHON_VERSION="3.12" setup_uv + msg_info "Installing Dependencies" $STD apt-get install -y \ - git \ - libpng-dev \ - libjpeg-dev \ - libtiff-dev \ - imagemagick + git \ + libpng-dev \ + libjpeg-dev \ + libtiff-dev \ + imagemagick msg_ok "Installed Dependencies" -msg_info "Setup Python3" -$STD apt-get install -y \ - pip \ - python3-irc -$STD pip install jaraco.stream -$STD pip install python-Levenshtein -$STD pip install soupsieve -$STD pip install pypdf -msg_ok "Setup Python3" - msg_info "Installing LazyLibrarian" $STD git clone https://gitlab.com/LazyLibrarian/LazyLibrarian /opt/LazyLibrarian cd /opt/LazyLibrarian -$STD pip install . +$STD uv venv .venv +$STD .venv/bin/uv pip install . jaraco.stream python-Levenshtein soupsieve pypdf msg_ok "Installed LazyLibrarian" msg_info "Creating Service" @@ -44,17 +37,20 @@ cat </etc/systemd/system/lazylibrarian.service [Unit] Description=LazyLibrarian Daemon After=syslog.target network.target + [Service] -UMask=0002 Type=simple -ExecStart=/usr/bin/python3 /opt/LazyLibrarian/LazyLibrarian.py +WorkingDirectory=/opt/LazyLibrarian +ExecStart=/opt/LazyLibrarian/.venv/bin/python LazyLibrarian.py +UMask=0002 +Restart=on-failure TimeoutStopSec=20 KillMode=process -Restart=on-failure + [Install] WantedBy=multi-user.target EOF -systemctl enable --now -q lazylibrarian +systemctl enable -q --now lazylibrarian msg_ok "Created Service" motd_ssh