ref
This commit is contained in:
parent
3bcca9b22e
commit
faaee25a3e
@ -1,58 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
|
||||||
# Author: MickLesk (CanbiZ)
|
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
||||||
# Source: https://github.com/ZoeyVid/NPMplus
|
|
||||||
|
|
||||||
APP="NPMplus"
|
|
||||||
var_tags="${var_tags:-proxy;nginx}"
|
|
||||||
var_cpu="${var_cpu:-1}"
|
|
||||||
var_ram="${var_ram:-512}"
|
|
||||||
var_disk="${var_disk:-3}"
|
|
||||||
var_os="${var_os:-alpine}"
|
|
||||||
var_version="${var_version:-3.21}"
|
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
|
||||||
|
|
||||||
header_info "$APP"
|
|
||||||
variables
|
|
||||||
color
|
|
||||||
catch_errors
|
|
||||||
|
|
||||||
function update_script() {
|
|
||||||
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE MODE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 14 60 2 \
|
|
||||||
"1" "Check for Alpine Updates" OFF \
|
|
||||||
"2" "Update NPMplus Docker Container" ON \
|
|
||||||
3>&1 1>&2 2>&3)
|
|
||||||
|
|
||||||
header_info "$APP"
|
|
||||||
|
|
||||||
case "$UPD" in
|
|
||||||
"1")
|
|
||||||
msg_info "Updating Alpine OS"
|
|
||||||
$STD apk -U upgrade
|
|
||||||
msg_ok "System updated"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
"2")
|
|
||||||
msg_info "Updating NPMplus Container"
|
|
||||||
cd /opt
|
|
||||||
msg_info "Pulling latest container image"
|
|
||||||
$STD docker compose pull
|
|
||||||
msg_info "Recreating container"
|
|
||||||
$STD docker compose up -d
|
|
||||||
msg_ok "NPMplus container updated"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
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}https://${IP}:81${CL}"
|
|
@ -14,41 +14,35 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies (Patience)"
|
msg_info "Installing Dependencies (Patience)"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
unzip \
|
|
||||||
sudo \
|
|
||||||
make \
|
make \
|
||||||
php8.2 \
|
|
||||||
php8.2-{cli,common,bcmath,intl,fpm,tidy,xml,mysql,mbstring,zip,gd,curl} \
|
|
||||||
composer \
|
|
||||||
apache2 \
|
apache2 \
|
||||||
libapache2-mod-php \
|
libapache2-mod-php \
|
||||||
redis \
|
redis
|
||||||
mariadb-server
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
setup_mariadb
|
||||||
|
PHP_VERSION="8.3" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="bcmath,bz2,cli,exif,common,curl,tidy,fpm,gd,intl,mbstring,xml,mysql,zip" setup_php
|
||||||
|
setup_composer
|
||||||
|
|
||||||
msg_info "Setting up Database"
|
msg_info "Setting up Database"
|
||||||
DB_NAME=wallabag_db
|
DB_NAME=wallabag_db
|
||||||
DB_USER=wallabag
|
DB_USER=wallabag
|
||||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)"
|
SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)"
|
||||||
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
|
||||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
||||||
$STD mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
$STD mariadb -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||||
{
|
{
|
||||||
echo "Wallabag Credentials"
|
echo "Wallabag Credentials"
|
||||||
echo "Database User: $DB_USER"
|
echo "Database User: $DB_USER"
|
||||||
echo "Database Password: $DB_PASS"
|
echo "Database Password: $DB_PASS"
|
||||||
echo "Database Name: $DB_NAME"
|
echo "Database Name: $DB_NAME"
|
||||||
} >> ~/wallabag.creds
|
} >>~/wallabag.creds
|
||||||
msg_ok "Set up Database"
|
msg_ok "Set up Database"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "wallabag" "wallabag/wallabag" "prebuild" "latest" "/opt/wallabag" "wallabag-*.tar.gz"
|
||||||
|
|
||||||
msg_info "Installing Wallabag (Patience)"
|
msg_info "Installing Wallabag (Patience)"
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/wallabag/wallabag/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
wget -q "https://github.com/wallabag/wallabag/archive/refs/tags/${RELEASE}.zip"
|
|
||||||
unzip -q ${RELEASE}.zip
|
|
||||||
mv wallabag-${RELEASE} /opt/wallabag
|
|
||||||
cd /opt/wallabag
|
cd /opt/wallabag
|
||||||
useradd -d /opt/wallabag -s /bin/bash -M wallabag
|
useradd -d /opt/wallabag -s /bin/bash -M wallabag
|
||||||
chown -R wallabag:wallabag /opt/wallabag
|
chown -R wallabag:wallabag /opt/wallabag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user