From d58a338765607689e9b118fb3a3547ecdda61512 Mon Sep 17 00:00:00 2001 From: davalanche Date: Wed, 27 Nov 2024 15:29:16 -0600 Subject: [PATCH] Add new LXC: Mylar3 --- ct/mylar3.sh | 71 +++++++++++++++++++++++++++++++++++++++ install/mylar3-install.sh | 69 +++++++++++++++++++++++++++++++++++++ json/mylar3.json | 39 +++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 ct/mylar3.sh create mode 100644 install/mylar3-install.sh create mode 100644 json/mylar3.json diff --git a/ct/mylar3.sh b/ct/mylar3.sh new file mode 100644 index 00000000..c67526ce --- /dev/null +++ b/ct/mylar3.sh @@ -0,0 +1,71 @@ +#!/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 <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +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 +msg_error "${APP} should be updated via the user interface." +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..1f6f2222 --- /dev/null +++ b/install/mylar3-install.sh @@ -0,0 +1,69 @@ +#!/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 \ + git \ + python3-pip +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 "Installing ${APPLICATION}" +mkdir -p /opt/mylar3 && mkdir -p /opt/mylar3-data +$STD git clone -b master https://github.com/mylar3/mylar3.git /opt/mylar3 +rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED +$STD pip install -U --no-cache-dir pip +$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt +msg_ok "Installed ${APPLICATION}" + +msg_info "Creating Service" +# Reference: /opt/mylar3/init-scripts/systemd/mylar.service +cat </etc/systemd/system/mylar3.service +[Unit] +Description=Systemd script to run Mylar3 as a 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" + +msg_info "Updating ${APPLICATION} configuration" +# version detection and updates through the user interface do not currently work unless "check_github_on_startup = True" +sed -i -e 's/check_github_on_startup = False/check_github_on_startup = True/' -e 's/check_github = False/check_github = True/' /opt/mylar3-data/config.ini +systemctl restart mylar3 +msg_ok "${APPLICATION} configuration updated" + +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..a469b1dc --- /dev/null +++ b/json/mylar3.json @@ -0,0 +1,39 @@ +{ + "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": [ + { + "text": "Mylar3 can be updated via the user interface.", + "type": "info" + } + ] +}