From 8e81f3f81cdfb2adf5d6125358158ff01ae48237 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 28 Apr 2026 00:48:02 +0200 Subject: [PATCH] selfmanaged wordpress --- .env.sample | 4 +++- abra.sh | 17 ++++++++++++++--- compose.selfmanaged.yml | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 compose.selfmanaged.yml diff --git a/.env.sample b/.env.sample index 387fb83..d74bed7 100644 --- a/.env.sample +++ b/.env.sample @@ -28,6 +28,9 @@ LETS_ENCRYPT_ENV=production # PHP composer for plugin installation #COMPOSE_FILE="$COMPOSE_FILE:compose.composer.yml" +# Self managed Wordpress for automatic updates +#COMPOSE_FILE="$COMPOSE_FILE:compose.selfmanaged.yml" + #WORDPRESS_DEBUG=true ## Additional extensions @@ -81,7 +84,6 @@ SECRET_DB_PASSWORD_VERSION=v1 # 🚩🚩 dangerous, use only for development sites! #CORS_ALLOW_ALL=1 - # FTP #COMPOSE_FILE="$COMPOSE_FILE:compose.ftp.yml" #SECRET_FTP_PASS_VERSION=v1 diff --git a/abra.sh b/abra.sh index 6b3650d..f1bb6f3 100644 --- a/abra.sh +++ b/abra.sh @@ -31,8 +31,6 @@ core_install(){ wp "language core install $LOCALE" wp "site switch-language $LOCALE" wp "rewrite structure '/%year%/%monthnum%/%day%/%postname%/'" - wp "plugin install --activate disable-update-notifications" - wp "option update disable_notification_setting --format=json '{\"dpun_setting\":false,\"dwtu_setting\":false,\"dwcun_setting\":true}'" if [ -n "$DEFAULT_USER_ROLE" ] then wp "option set default_role $DEFAULT_USER_ROLE" @@ -40,7 +38,20 @@ core_install(){ wp "option set default_role subscriber" fi wp "theme auto-updates enable --all" - wp 'plugin auto-updates enable --all' || exit 0 + wp 'plugin auto-updates enable --all' || true +} + +enable_auto_updates(){ + wp "plugin deactivate disable-update-notifications --allow-root" + wp "plugin uninstall disable-update-notifications --allow-root" + wp "option delete disable_notification_setting --allow-root" + wp "plugin auto-updates enable --all --allow-root" + wp "theme auto-updates enable --all --allow-root" +} + +disable_auto_updates(){ + wp "plugin install --activate disable-update-notifications" + wp "option update disable_notification_setting --format=json '{\"dpun_setting\":false,\"dwtu_setting\":false,\"dwcun_setting\":true}'" } set_authentik(){ diff --git a/compose.selfmanaged.yml b/compose.selfmanaged.yml new file mode 100644 index 0000000..100308c --- /dev/null +++ b/compose.selfmanaged.yml @@ -0,0 +1,21 @@ +--- +version: "3.8" + +services: + app: + image: "wordpress:latest" + volumes: + - "wordpress:/var/www/html/" + environment: + WORDPRESS_CONFIG_EXTRA: | + define( 'AUTOMATIC_UPDATER_DISABLED', false ); + define( 'WP_AUTO_UPDATE_CORE', true ); + define( 'FS_METHOD', 'direct' ); + ${WORDPRESS_CONFIG_EXTRA} + + ftp: + volumes: + - "wordpress:/home/ftp_user/" + +volumes: + wordpress: