From a0b4e0b5b86c9e02ade552c9347e87e29e7ffc30 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Sun, 26 Oct 2025 09:05:03 +0100 Subject: [PATCH] Mylar3 testing --- ct/mylar3.sh | 43 ++++++++++++++++++++++++++++ install/mylar3-install.sh | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 ct/mylar3.sh create mode 100644 install/mylar3-install.sh diff --git a/ct/mylar3.sh b/ct/mylar3.sh new file mode 100644 index 000000000..2bb791386 --- /dev/null +++ b/ct/mylar3.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: davalanche +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/mylar3/mylar3 + +APP="Mylar3" +var_tags="${var_tags:-torrent;downloader;comic}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + if [[ ! -d /opt/mylar3 ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "mylar3" "mylar3/mylar3"; then + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "mylar3" "mylar3/mylar3" "tarball" + systemctl restart mylar3 + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8090${CL}" diff --git a/install/mylar3-install.sh b/install/mylar3-install.sh new file mode 100644 index 000000000..bdce72d09 --- /dev/null +++ b/install/mylar3-install.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: davalanche +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/mylar3/mylar3 + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y unrar +msg_ok "Installed Dependencies" + +msg_info "Setup Python3" +$STD apt install -y python3-pip +msg_ok "Setup Python3" + +setup_uv +fetch_and_deploy_gh_release "mylar3" "mylar3/mylar3" "tarball" + +msg_info "Installing ${APPLICATION}" +mkdir -p /opt/mylar3-data +$STD uv venv /opt/mylar3/.venv +$STD /opt/mylar3/.venv/bin/python -m ensurepip --upgrade +$STD /opt/mylar3/.venv/bin/python -m pip install --upgrade pip +$STD /opt/mylar3/.venv/bin/python -m pip install --no-cache-dir -r /opt/mylar3/requirements.txt +msg_ok "Installed ${APPLICATION}" + +msg_info "Creating Service" +cat </etc/systemd/system/mylar3.service +[Unit] +Description=Mylar3 Service +After=network-online.target + +[Service] +ExecStart=/opt/mylar3/.venv/bin/python /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data +GuessMainPID=no +Type=forking +Restart=on-failure + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now mylar3 +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean +msg_ok "Cleaned"