mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2025-12-10 21:11:28 -06:00
finalize wallabag
This commit is contained in:
parent
52c3796b44
commit
ec521401a4
@ -5,7 +5,6 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxV
|
|||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||||
# Source: https://wallabag.org/
|
# Source: https://wallabag.org/
|
||||||
|
|
||||||
# App Default Values
|
|
||||||
APP="Wallabag"
|
APP="Wallabag"
|
||||||
var_tags="${var_tags:-productivity;read-it-later}"
|
var_tags="${var_tags:-productivity;read-it-later}"
|
||||||
var_cpu="${var_cpu:-2}"
|
var_cpu="${var_cpu:-2}"
|
||||||
@ -15,11 +14,7 @@ var_os="${var_os:-debian}"
|
|||||||
var_version="${var_version:-12}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
# App Output & Base Settings
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
base_settings
|
|
||||||
|
|
||||||
# Core
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
catch_errors
|
||||||
@ -28,61 +23,45 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -d /opt/wallabag ]]; then
|
if [[ ! -d /opt/wallabag ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/wallabag/wallabag/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
if check_for_gh_release "wallabag" "wallabag/wallabag"; then
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
|
||||||
msg_info "Stopping Services"
|
msg_info "Stopping Services"
|
||||||
systemctl stop nginx
|
systemctl stop nginx php8.3-fpm
|
||||||
systemctl stop php8.3-fpm
|
|
||||||
msg_ok "Stopped Services"
|
msg_ok "Stopped Services"
|
||||||
|
|
||||||
msg_info "Backing up Wallabag"
|
msg_info "Creating Backup"
|
||||||
cp /opt/wallabag/app/config/parameters.yml /tmp/wallabag_parameters.yml.bak
|
cp /opt/wallabag/app/config/parameters.yml /tmp/wallabag_parameters.yml.bak
|
||||||
msg_ok "Backed up Configuration"
|
msg_ok "Created Backup"
|
||||||
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wallabag" "wallabag/wallabag" "prebuild" "latest" "/opt/wallabag" "wallabag-*.tar.gz"
|
||||||
cd /tmp
|
|
||||||
wget -q "https://github.com/wallabag/wallabag/releases/download/${RELEASE}/wallabag-${RELEASE#v}.tar.gz"
|
|
||||||
tar -xzf "wallabag-${RELEASE#v}.tar.gz"
|
|
||||||
|
|
||||||
rm -rf /opt/wallabag/vendor /opt/wallabag/var/cache/*
|
|
||||||
cp -rf wallabag-${RELEASE#v}/* /opt/wallabag/
|
|
||||||
|
|
||||||
|
msg_info "Restoring Configuration"
|
||||||
cp /tmp/wallabag_parameters.yml.bak /opt/wallabag/app/config/parameters.yml
|
cp /tmp/wallabag_parameters.yml.bak /opt/wallabag/app/config/parameters.yml
|
||||||
|
rm -f /tmp/wallabag_parameters.yml.bak
|
||||||
|
msg_ok "Restored Configuration"
|
||||||
|
|
||||||
|
msg_info "Running Migrations"
|
||||||
cd /opt/wallabag
|
cd /opt/wallabag
|
||||||
export COMPOSER_ALLOW_SUPERUSER=1
|
|
||||||
$STD composer install --no-dev --prefer-dist --optimize-autoloader --no-interaction
|
|
||||||
$STD php bin/console cache:clear --env=prod
|
$STD php bin/console cache:clear --env=prod
|
||||||
$STD php bin/console doctrine:migrations:migrate --env=prod --no-interaction
|
$STD php bin/console doctrine:migrations:migrate --env=prod --no-interaction
|
||||||
|
chown -R www-data:www-data /opt/wallabag
|
||||||
chown -R wallabag:wallabag /opt/wallabag
|
|
||||||
chmod -R 755 /opt/wallabag/var
|
chmod -R 755 /opt/wallabag/var
|
||||||
chmod -R 755 /opt/wallabag/web/assets
|
chmod -R 755 /opt/wallabag/web/assets
|
||||||
|
msg_ok "Ran Migrations"
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
|
||||||
rm -rf /tmp/wallabag-${RELEASE#v}*
|
|
||||||
rm -f /tmp/wallabag_parameters.yml.bak
|
|
||||||
msg_ok "Cleanup Completed"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
msg_info "Starting Services"
|
||||||
systemctl start php8.3-fpm
|
systemctl start php8.3-fpm nginx
|
||||||
systemctl start nginx
|
|
||||||
msg_ok "Started Services"
|
msg_ok "Started Services"
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
msg_ok "Update Successful"
|
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
build_container
|
build_container
|
||||||
description
|
description
|
||||||
|
|||||||
@ -20,6 +20,7 @@ $STD apt install -y \
|
|||||||
imagemagick
|
imagemagick
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
import_local_ip
|
||||||
setup_mariadb
|
setup_mariadb
|
||||||
MARIADB_DB_NAME="wallabag" MARIADB_DB_USER="wallabag" setup_mariadb_db
|
MARIADB_DB_NAME="wallabag" MARIADB_DB_USER="wallabag" setup_mariadb_db
|
||||||
PHP_VERSION="8.3" PHP_FPM="YES" PHP_MODULE="bcmath,bz2,curl,gd,imagick,intl,mbstring,mysql,redis,tidy,xml,zip" setup_php
|
PHP_VERSION="8.3" PHP_FPM="YES" PHP_MODULE="bcmath,bz2,curl,gd,imagick,intl,mbstring,mysql,redis,tidy,xml,zip" setup_php
|
||||||
@ -31,7 +32,6 @@ fetch_and_deploy_gh_release "wallabag" "wallabag/wallabag" "prebuild" "latest" "
|
|||||||
msg_info "Configuring Wallabag"
|
msg_info "Configuring Wallabag"
|
||||||
cd /opt/wallabag
|
cd /opt/wallabag
|
||||||
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)"
|
||||||
CONTAINER_IP=$(hostname -I | awk '{print $1}')
|
|
||||||
cat <<EOF >/opt/wallabag/app/config/parameters.yml
|
cat <<EOF >/opt/wallabag/app/config/parameters.yml
|
||||||
parameters:
|
parameters:
|
||||||
database_driver: pdo_mysql
|
database_driver: pdo_mysql
|
||||||
@ -45,7 +45,7 @@ parameters:
|
|||||||
database_socket: null
|
database_socket: null
|
||||||
database_charset: utf8mb4
|
database_charset: utf8mb4
|
||||||
|
|
||||||
domain_name: http://${CONTAINER_IP}:8000
|
domain_name: http://${LOCAL_IP}:8000
|
||||||
server_name: Wallabag
|
server_name: Wallabag
|
||||||
|
|
||||||
mailer_dsn: null
|
mailer_dsn: null
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user