Skip to content

Commit 85b8039

Browse files
New script: Mylar3 LXC (#554)
* Add new LXC: Mylar3 * Apply suggestions from code review The rest of the suggestions will be addressed in my local repo and pushed back Co-authored-by: Håvard Gjøby Thom <[email protected]> * Additional changes based on the code review * The application is no longer updatable via the user interface --------- Co-authored-by: Håvard Gjøby Thom <[email protected]>
1 parent 53807c9 commit 85b8039

File tree

3 files changed

+181
-0
lines changed

3 files changed

+181
-0
lines changed

ct/mylar3.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: davalanche
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
# Source: https://github.com/mylar3/mylar3
8+
9+
function header_info {
10+
clear
11+
cat <<"EOF"
12+
__ ___ __ _____
13+
/ |/ /_ __/ /___ _____|__ /
14+
/ /|_/ / / / / / __ `/ ___//_ <
15+
/ / / / /_/ / / /_/ / / ___/ /
16+
/_/ /_/\__, /_/\__,_/_/ /____/
17+
/____/
18+
EOF
19+
}
20+
header_info
21+
echo -e "Loading..."
22+
APP="Mylar3"
23+
var_disk="4"
24+
var_cpu="1"
25+
var_ram="512"
26+
var_os="debian"
27+
var_version="12"
28+
variables
29+
color
30+
catch_errors
31+
32+
function default_settings() {
33+
CT_TYPE="1"
34+
PW=""
35+
CT_ID=$NEXTID
36+
HN=$NSAPP
37+
DISK_SIZE="$var_disk"
38+
CORE_COUNT="$var_cpu"
39+
RAM_SIZE="$var_ram"
40+
BRG="vmbr0"
41+
NET="dhcp"
42+
GATE=""
43+
APT_CACHER=""
44+
APT_CACHER_IP=""
45+
DISABLEIP6="no"
46+
MTU=""
47+
SD=""
48+
NS=""
49+
MAC=""
50+
VLAN=""
51+
SSH="no"
52+
VERB="no"
53+
echo_default
54+
}
55+
56+
function update_script() {
57+
header_info
58+
if [[ ! -d /opt/mylar3 ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
59+
RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name')
60+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
61+
msg_info "Updating ${APP} to ${RELEASE}"
62+
rm -rf /opt/mylar3/* /opt/mylar3/.*
63+
wget -qO- https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz | tar -xz --strip-components=1 -C /opt/mylar3
64+
systemctl restart mylar3
65+
echo "${RELEASE}" > /opt/${APP}_version.txt
66+
msg_ok "Updated ${APP} to ${RELEASE}"
67+
else
68+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
69+
fi
70+
exit
71+
}
72+
73+
start
74+
build_container
75+
description
76+
77+
msg_ok "Completed Successfully!\n"
78+
echo -e "${APP} should be reachable by going to the following URL.
79+
${BL}http://${IP}:8090${CL} \n"

install/mylar3-install.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: davalanche
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
# Source: https://github.com/mylar3/mylar3
8+
9+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
10+
color
11+
verb_ip6
12+
catch_errors
13+
setting_up_container
14+
network_check
15+
update_os
16+
17+
msg_info "Installing Dependencies"
18+
$STD apt-get install -y \
19+
curl \
20+
sudo \
21+
mc \
22+
jq
23+
echo "deb http://deb.debian.org/debian bookworm non-free non-free-firmware" > /etc/apt/sources.list.d/non-free.list
24+
$STD apt-get update
25+
$STD apt-get install -y unrar
26+
rm /etc/apt/sources.list.d/non-free.list
27+
msg_ok "Installed Dependencies"
28+
29+
msg_info "Updating Python3"
30+
$STD apt-get install -y python3-pip
31+
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
32+
$STD pip install -U --no-cache-dir pip
33+
msg_ok "Updated Python3"
34+
35+
msg_info "Installing ${APPLICATION}"
36+
mkdir -p /opt/mylar3
37+
mkdir -p /opt/mylar3-data
38+
RELEASE=$(curl -s https://api.github.com/repos/mylar3/mylar3/releases/latest | jq -r '.tag_name')
39+
wget -qO- https://github.com/mylar3/mylar3/archive/refs/tags/${RELEASE}.tar.gz | tar -xz --strip-components=1 -C /opt/mylar3
40+
$STD pip install --no-cache-dir -r /opt/mylar3/requirements.txt
41+
echo "${RELEASE}" > /opt/${APPLICATION}_version.txt
42+
msg_ok "Installed ${APPLICATION}"
43+
44+
msg_info "Creating Service"
45+
cat <<EOF >/etc/systemd/system/mylar3.service
46+
[Unit]
47+
Description=Mylar3 Service
48+
After=network-online.target
49+
50+
[Service]
51+
ExecStart=/usr/bin/python3 /opt/mylar3/Mylar.py --daemon --nolaunch --datadir=/opt/mylar3-data
52+
GuessMainPID=no
53+
Type=forking
54+
Restart=on-failure
55+
56+
[Install]
57+
WantedBy=multi-user.target
58+
EOF
59+
systemctl enable -q --now mylar3.service
60+
msg_ok "Created Service"
61+
62+
motd_ssh
63+
customize
64+
65+
msg_info "Cleaning up"
66+
$STD apt-get -y autoremove
67+
$STD apt-get -y autoclean
68+
msg_ok "Cleaned"

json/mylar3.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Mylar3",
3+
"slug": "mylar3",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2024-11-27",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": "8090",
12+
"documentation": "https://mylarcomics.com/docs/introduction/",
13+
"website": "https://mylarcomics.com/",
14+
"logo": "https://mylarcomics.com/img/mylarlogo.png",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/mylar3.sh",
20+
"resources": {
21+
"cpu": "1",
22+
"ram": "512",
23+
"hdd": "4",
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)