Skip to content

Commit dae02a0

Browse files
authored
Merge pull request #1 from DysfunctionalProgramming/komga
Komga
2 parents a6158a2 + c27366c commit dae02a0

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

ct/komga.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 tteck
4+
# Author: tteck (tteckster)
5+
# Co-Author: madelyn (DysfunctionalProgramming)
6+
# License: MIT
7+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
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="Komga"
23+
var_disk="2"
24+
var_cpu="1"
25+
var_ram="2048"
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/komga ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
59+
msg_info "Updating ${APP}"
60+
RELEASE=$(curl -s https://api.github.com/repos/gotson/komga/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
61+
if [[ ! -d /opt/komga/komga-${RELEASE}.jar ]]; then
62+
systemctl stop komga
63+
msg_info "Downloading ${APP} v$RELEASE"
64+
wget -q "https://github.com/gotson/komga/releases/download/v$RELEASE/komga-${RELEASE}.jar"
65+
mv komga-${RELEASE}.jar /opt/komga/komga-${RELEASE}.jar
66+
systemctl start komga
67+
fi
68+
msg_ok "Updated ${APP} to v$RELEASE"
69+
exit
70+
}
71+
72+
start
73+
build_container
74+
description
75+
76+
msg_ok "Completed Successfully!\n"
77+
echo -e "${APP} should be reachable by going to the following URL.
78+
${BL}http://${IP}:25600 ${CL} \n"

install/komga-install.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2024 tteck
4+
# Author: tteck (tteckster)
5+
# Co-Author: madelyn (DysfunctionalProgramming)
6+
# License: MIT
7+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
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 curl
19+
$STD apt-get install -y openjdk-17-jre
20+
msg_ok "Installed Dependencies"
21+
22+
RELEASE=$(curl -s https://api.github.com/repos/gotson/komga/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
23+
24+
msg_info "Installing Komga"
25+
wget -q https://github.com/gotson/komga/releases/download/${RELEASE}/komga-${RELEASE}.jar
26+
mv https://github.com/gotson/komga/releases/download/${RELEASE}/komga-${RELEASE}.jar /opt/komga
27+
msg_ok "Installed TriliumNext"
28+
29+
msg_info "Creating Service"
30+
service_path="/etc/systemd/system/komga.service"
31+
32+
echo "[Unit]
33+
Description=Komga
34+
After=syslog.target network.target
35+
36+
[Service]
37+
User=root
38+
Type=simple
39+
ExecStart=java -jar -Xmx2g komga-${RELEASE}.jar
40+
WorkingDirectory=/opt/komga/
41+
TimeoutStopSec=20
42+
Restart=always
43+
44+
[Install]
45+
WantedBy=multi-user.target" >$service_path
46+
systemctl enable --now -q komga
47+
msg_ok "Created Service"
48+
49+
motd_ssh
50+
customize
51+
52+
msg_info "Cleaning up"
53+
$STD apt-get -y autoremove
54+
$STD apt-get -y autoclean
55+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)