testing pip env
This commit is contained in:
parent
2df849ee42
commit
08549eb0c9
56
ct/sabnzbd.sh
Normal file
56
ct/sabnzbd.sh
Normal file
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://sabnzbd.org/
|
||||
|
||||
APP="SABnzbd"
|
||||
var_tags="${var_tags:-downloader}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/sabnzbd ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Updating $APP to ${RELEASE}"
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
systemctl stop sabnzbd.service
|
||||
tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
|
||||
cp -rf SABnzbd-${RELEASE}/* /opt/sabnzbd
|
||||
rm -rf SABnzbd-${RELEASE}
|
||||
cd /opt/sabnzbd
|
||||
$STD python3 -m pip install -r requirements.txt
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
systemctl start sabnzbd.service
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7777${CL}"
|
65
install/sabnzbd-install.sh
Normal file
65
install/sabnzbd-install.sh
Normal file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://sabnzbd.org/
|
||||
|
||||
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 par2
|
||||
$STD apt-get install -y p7zip-full
|
||||
cat <<EOF >/etc/apt/sources.list.d/non-free.list
|
||||
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
|
||||
EOF
|
||||
$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 "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3-dev \
|
||||
python3-pip
|
||||
$STD apt-get install -y python3-setuptools
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
msg_ok "Setup Python3"
|
||||
|
||||
msg_info "Installing SABnzbd"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
$STD tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
|
||||
mv SABnzbd-${RELEASE} /opt/sabnzbd
|
||||
cd /opt/sabnzbd
|
||||
$STD python3 -m pip install -r requirements.txt
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed SABnzbd"
|
||||
|
||||
msg_info "Creating Service"
|
||||
service_path="/etc/systemd/system/sabnzbd.service"
|
||||
echo "[Unit]
|
||||
Description=SABnzbd
|
||||
After=network.target
|
||||
[Service]
|
||||
WorkingDirectory=/opt/sabnzbd
|
||||
ExecStart=python3 SABnzbd.py -s 0.0.0.0:7777
|
||||
Restart=always
|
||||
User=root
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >$service_path
|
||||
systemctl enable --now -q sabnzbd.service
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
@ -95,7 +95,7 @@ function install_php_and_modules() {
|
||||
msg_ok "All required PHP modules are already installed"
|
||||
fi
|
||||
else
|
||||
$PKG_MANAGER_INSTALL nginx php-fpm php-mysqli php-json php-session curl tar openssl &>/dev/null
|
||||
$PKG_MANAGER_INSTALL lighttpd php-fpm php-session php-json php-mysqli curl tar openssl &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
@ -130,43 +130,42 @@ function configure_phpmyadmin() {
|
||||
systemctl restart apache2
|
||||
msg_ok "Configured phpMyAdmin with Apache"
|
||||
else
|
||||
msg_info "Configuring Nginx for phpMyAdmin (Alpine detected)"
|
||||
msg_info "Configuring Lighttpd for phpMyAdmin (Alpine detected)"
|
||||
|
||||
mkdir -p /etc/nginx/http.d
|
||||
cat <<EOF >/etc/nginx/http.d/phpmyadmin.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
mkdir -p /etc/lighttpd
|
||||
cat <<EOF >/etc/lighttpd/lighttpd.conf
|
||||
server.modules = (
|
||||
"mod_access",
|
||||
"mod_alias",
|
||||
"mod_accesslog",
|
||||
"mod_fastcgi"
|
||||
)
|
||||
|
||||
root ${INSTALL_DIR};
|
||||
index index.php index.html index.htm;
|
||||
server.document-root = "${INSTALL_DIR}"
|
||||
server.port = 80
|
||||
|
||||
location / {
|
||||
try_files \$uri \$uri/ =404;
|
||||
}
|
||||
index-file.names = ( "index.php", "index.html" )
|
||||
|
||||
location ~ \.php\$ {
|
||||
include fastcgi.conf;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
fastcgi.server = ( ".php" =>
|
||||
((
|
||||
"host" => "127.0.0.1",
|
||||
"port" => 9000,
|
||||
"check-local" => "disable"
|
||||
))
|
||||
)
|
||||
|
||||
alias.url = ( "/phpMyAdmin/" => "${INSTALL_DIR}/" )
|
||||
|
||||
accesslog.filename = "/var/log/lighttpd/access.log"
|
||||
server.errorlog = "/var/log/lighttpd/error.log"
|
||||
EOF
|
||||
|
||||
msg_info "Testing Nginx configuration"
|
||||
if nginx -t; then
|
||||
if ! pgrep -x "nginx" >/dev/null; then
|
||||
msg_info "Starting Nginx"
|
||||
rc-service nginx start
|
||||
else
|
||||
msg_info "Reloading Nginx"
|
||||
rc-service nginx reload
|
||||
fi
|
||||
msg_ok "Configured and started Nginx successfully"
|
||||
else
|
||||
msg_error "Nginx configuration test failed. Please fix before starting nginx."
|
||||
exit 1
|
||||
fi
|
||||
msg_info "Starting php-fpm and Lighttpd"
|
||||
rc-service php-fpm start
|
||||
rc-service lighttpd start
|
||||
rc-update add php-fpm default
|
||||
rc-update add lighttpd default
|
||||
msg_ok "Configured and started Lighttpd successfully"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -175,16 +174,18 @@ function uninstall_phpmyadmin() {
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
systemctl stop apache2
|
||||
else
|
||||
rc-service nginx stop
|
||||
rc-service lighttpd stop
|
||||
rc-service php-fpm stop
|
||||
fi
|
||||
|
||||
msg_info "Removing phpMyAdmin directory"
|
||||
rm -rf "$INSTALL_DIR"
|
||||
|
||||
if [[ "$OS" == "Alpine" ]]; then
|
||||
msg_info "Removing Nginx config"
|
||||
rm -f /etc/nginx/conf.d/phpmyadmin.conf
|
||||
rc-service nginx restart
|
||||
msg_info "Removing Lighttpd config"
|
||||
rm -f /etc/lighttpd/lighttpd.conf
|
||||
rc-service php-fpm restart
|
||||
rc-service lighttpd restart
|
||||
else
|
||||
systemctl restart apache2
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user