diff --git a/ct/mylar3.sh b/ct/mylar3.sh new file mode 100644 index 00000000..82b66663 --- /dev/null +++ b/ct/mylar3.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2024 community-scripts ORG +# Author: davalanche +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/mylar3/mylar3 + +function header_info { +clear +cat <<"EOF" + __ ___ __ _____ + / |/ /_ __/ /___ _____|__ / + / /|_/ / / / / / __ `/ ___//_ < + / / / / /_/ / / /_/ / / ___/ / +/_/ /_/\__, /_/\__,_/_/ /____/ + /____/ +EOF +} +header_info +echo -e "Loading..." +APP="Mylar3" +var_disk="4" +var_cpu="1" +var_ram="512" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +if [[ ! -d /opt/mylar3 ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name') +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Updating ${APP} to ${RELEASE}" + rm -rf /opt/mylar3/* /opt/mylar3/.* + wget -qO- https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz | tar -xz --strip-components=1 -C /opt/mylar3 + systemctl restart mylar3 + echo "${RELEASE}" > /opt/${APP}_version.txt + msg_ok "Updated ${APP} to ${RELEASE}" +else + msg_ok "No update required. ${APP} is already at ${RELEASE}" +fi +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}:8090${CL} \n" diff --git a/install/mylar3-install.sh b/install/mylar3-install.sh new file mode 100644 index 00000000..eebb3b52 --- /dev/null +++ b/install/mylar3-install.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 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-get install -y \ + curl \ + sudo \ + mc \ + jq +echo "deb http://deb.debian.org/debian bookworm non-free non-free-firmware" > /etc/apt/sources.list.d/non-free.list +$STD apt-get update +$STD apt-get install -y unrar +rm /etc/apt/sources.list.d/non-free.list +msg_ok "Installed Dependencies" + +msg_info "Updating Python3" +$STD apt-get install -y python3-pip +rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED +$STD pip install -U --no-cache-dir pip +msg_ok "Updated Python3" + +msg_info "Installing ${APPLICATION}" +mkdir -p /opt/mylar3 +mkdir -p /opt/mylar3-data +RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name') +wget -qO- https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz | tar -xz --strip-components=1 -C /opt/mylar3 +$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt +echo "${RELEASE}" > /opt/${APPLICATION}_version.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=/usr/bin/python3 /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.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/mylar3.json b/json/mylar3.json new file mode 100644 index 00000000..0d0c4d0a --- /dev/null +++ b/json/mylar3.json @@ -0,0 +1,34 @@ +{ + "name": "Mylar3", + "slug": "mylar3", + "categories": [ + 12 + ], + "date_created": "2024-11-27", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": "8090", + "documentation": "https://mylarcomics.com/docs/introduction/", + "website": "https://mylarcomics.com/", + "logo": "https://mylarcomics.com/img/mylarlogo.png", + "description": "Mylar is an automated Comic Book (cbr/cbz) downloader program for use with NZB and torrents.\r\nMylar allows you to create a watchlist of series that it monitors for various things (new issues, updated information, etc). It will grab, sort, and rename downloaded issues. It will also allow you to monitor weekly pull-lists for items belonging to said watchlisted series to download, as well as being able to monitor and maintain story-arcs.", + "install_methods": [ + { + "type": "default", + "script": "ct/mylar3.sh", + "resources": { + "cpu": "1", + "ram": "512", + "hdd": "4", + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +}