Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2024-04-21 16:38:20 +10:00
5 changed files with 253 additions and 36 deletions
+17 -20
View File
@@ -18,22 +18,22 @@ $STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y wget
$STD apt-get install -y unzip
$STD apt-get install -y nginx
msg_ok "Installed Dependencies"
msg_info "Installing Aria2"
DEBIAN_FRONTEND=noninteractive $STD apt-get -o Dpkg::Options::="--force-confold" install -y aria2
$STD apt-get install -y aria2
msg_ok "Installed Aria2"
read -r -p "Would you like to add AriaNG? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing AriaNG"
cd /root
mkdir -p /var/www
wget -q "$(curl -s https://api.github.com/repos/mayswind/ariang/releases/latest | grep download | grep AllInOne.zip | cut -d\" -f4)" -O /root/ariang.zip
$STD unzip "$(ls -l /root | grep zip$ | awk '{print $9}')" -d /var/www
cat <<EOF >/etc/nginx/conf.d/ariang.conf
$STD apt-get install -y nginx
$STD apt-get install -y unzip
systemctl disable -q --now nginx
wget -q "$(curl -s https://api.github.com/repos/mayswind/ariang/releases/latest | grep download | grep AllInOne.zip | cut -d\" -f4)"
$STD unzip AriaNg-*-AllInOne.zip -d /var/www
rm /etc/nginx/sites-enabled/*
cat <<EOF >/etc/nginx/conf.d/ariang.conf
server {
listen 6880 default_server;
listen [::]:6880 default_server;
@@ -48,18 +48,15 @@ server {
}
}
EOF
rm /etc/nginx/sites-enabled/*
$STD systemctl disable --now nginx
$STD cp /lib/systemd/system/nginx.service /lib/systemd/system/ariang.service
$STD systemctl enable --now ariang
cp /lib/systemd/system/nginx.service /lib/systemd/system/ariang.service
msg_ok "Installed AriaNG"
fi
msg_info "Creating Service"
mkdir /root/downloads
rpc_secret=$(openssl rand -base64 8)
echo "rpc-secret: $rpc_secret" >>~/rpc.secret
cat <<EOF >/root/aria2.daemon
continue
dir=/root/downloads
file-allocation=falloc
max-connection-per-server=4
@@ -67,13 +64,13 @@ max-concurrent-downloads=2
max-overall-download-limit=0
min-split-size=25M
rpc-allow-origin-all=true
rpc-secret=YouShouldChangeThis
rpc-secret=${rpc_secret}
input-file=/var/tmp/aria2c.session
save-session=/var/tmp/aria2c.session
EOF
cat <<EOF >/etc/systemd/system/aria2.service
echo '[Unit]
[Unit]
Description=Aria2c download manager
After=network.target
@@ -87,17 +84,17 @@ TimeoutStopSec=20
Restart=on-failure
[Install]
WantedBy=multi-user.target'
WantedBy=multi-user.target
EOF
systemctl enable --now -q aria2.service
systemctl enable -q --now aria2.service
systemctl enable -q --now ariang
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
rm /root/"$(ls -l /root | grep zip$ | awk '{print $9}')"
rm AriaNg-*-AllInOne.zip
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# Co-Author: remz1337
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
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
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y imagemagick
msg_ok "Installed Dependencies"
msg_info "Installing Python Dependencies"
$STD apt-get -y install python3-pip
msg_ok "Installed Python Dependencies"
msg_info "Installing Kepubify"
mkdir -p /opt/kepubify
cd /opt/kepubify
curl -fsSLO https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit &>/dev/null
chmod +x kepubify-linux-64bit
msg_ok "Installed Kepubify"
msg_info "Installing Calibre-Web"
mkdir -p /opt/calibre-web
$STD wget https://github.com/janeczku/calibre-web/raw/master/library/metadata.db -P /opt/calibre-web
$STD pip install calibreweb
msg_ok "Installed Calibre-Web"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/cps.service
[Unit]
Description=Calibre-Web Server
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/calibre-web
ExecStart=/usr/local/bin/cps
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now cps.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"