Add new LXC: Mylar3

This commit is contained in:
davalanche 2024-11-27 15:29:16 -06:00
parent a11755de5d
commit d58a338765
3 changed files with 179 additions and 0 deletions

71
ct/mylar3.sh Normal file
View File

@ -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"

69
install/mylar3-install.sh Normal file
View File

@ -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 <<EOF >/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"

39
json/mylar3.json Normal file
View File

@ -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"
}
]
}