Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 04ed5c087e | |||
|
e7952ec7bb
|
|||
|
fb0bc8e8f6
|
|||
| 7126fb291d | |||
|
71ffa2a1db
|
|||
| d271532f31 | |||
|
2390db2f0d
|
|||
|
3fc6a7048d
|
|||
|
15be511b4c
|
|||
| 332ab0b97d | |||
|
3b598e82dd
|
|||
|
8e81f3f81c
|
+3
-1
@@ -28,6 +28,9 @@ LETS_ENCRYPT_ENV=production
|
|||||||
# PHP composer for plugin installation
|
# PHP composer for plugin installation
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.composer.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.composer.yml"
|
||||||
|
|
||||||
|
# Self managed Wordpress for automatic updates
|
||||||
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.selfmanaged.yml"
|
||||||
|
|
||||||
#WORDPRESS_DEBUG=true
|
#WORDPRESS_DEBUG=true
|
||||||
|
|
||||||
## Additional extensions
|
## Additional extensions
|
||||||
@@ -81,7 +84,6 @@ SECRET_DB_PASSWORD_VERSION=v1
|
|||||||
# 🚩🚩 dangerous, use only for development sites!
|
# 🚩🚩 dangerous, use only for development sites!
|
||||||
#CORS_ALLOW_ALL=1
|
#CORS_ALLOW_ALL=1
|
||||||
|
|
||||||
|
|
||||||
# FTP
|
# FTP
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.ftp.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.ftp.yml"
|
||||||
#SECRET_FTP_PASS_VERSION=v1
|
#SECRET_FTP_PASS_VERSION=v1
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
export PHP_UPLOADS_CONF_VERSION=v4
|
export PHP_UPLOADS_CONF_VERSION=v4
|
||||||
export ENTRYPOINT_CONF_VERSION=v7
|
export ENTRYPOINT_CONF_VERSION=v8
|
||||||
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2
|
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2
|
||||||
export MSMTP_CONF_VERSION=v4
|
export MSMTP_CONF_VERSION=v4
|
||||||
export HTACCESS_CONF_VERSION=v2
|
export HTACCESS_CONF_VERSION=v5
|
||||||
export USERS_CONF_VERSION=v1
|
export USERS_CONF_VERSION=v1
|
||||||
|
|
||||||
wp() {
|
wp() {
|
||||||
@@ -31,8 +31,6 @@ core_install(){
|
|||||||
wp "language core install $LOCALE"
|
wp "language core install $LOCALE"
|
||||||
wp "site switch-language $LOCALE"
|
wp "site switch-language $LOCALE"
|
||||||
wp "rewrite structure '/%year%/%monthnum%/%day%/%postname%/'"
|
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" ]
|
if [ -n "$DEFAULT_USER_ROLE" ]
|
||||||
then
|
then
|
||||||
wp "option set default_role $DEFAULT_USER_ROLE"
|
wp "option set default_role $DEFAULT_USER_ROLE"
|
||||||
@@ -40,7 +38,20 @@ core_install(){
|
|||||||
wp "option set default_role subscriber"
|
wp "option set default_role subscriber"
|
||||||
fi
|
fi
|
||||||
wp "theme auto-updates enable --all"
|
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(){
|
set_authentik(){
|
||||||
@@ -96,3 +107,10 @@ fix_mysql() {
|
|||||||
show_plugins() {
|
show_plugins() {
|
||||||
wp "plugin list --fields=name,status,wporg_status,version,update_version,auto_update,tested_up_to,wporg_last_updated"
|
wp "plugin list --fields=name,status,wporg_status,version,update_version,auto_update,tested_up_to,wporg_last_updated"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rotate_db_pass() {
|
||||||
|
DB_PASS=$(cat /run/secrets/db_password)
|
||||||
|
DB_ROOT_PASS=$(cat /run/secrets/db_root_password)
|
||||||
|
echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASS}'; ALTER USER 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASS}'; ALTER USER 'wordpress'@'%' IDENTIFIED BY '${DB_PASS}'; FLUSH PRIVILEGES;" | mariadb -u root --skip-password 2>/dev/null \
|
||||||
|
|| echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASS}'; ALTER USER 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASS}'; ALTER USER 'wordpress'@'%' IDENTIFIED BY '${DB_PASS}'; FLUSH PRIVILEGES;" | mariadb -u root -p"${DB_ROOT_PASS}"
|
||||||
|
}
|
||||||
@@ -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:
|
||||||
+2
-2
@@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: "wordpress:6.9.4"
|
image: "wordpress:6.9.5"
|
||||||
volumes:
|
volumes:
|
||||||
- "wordpress_content:/var/www/html/wp-content/"
|
- "wordpress_content:/var/www/html/wp-content/"
|
||||||
networks:
|
networks:
|
||||||
@@ -62,7 +62,7 @@ services:
|
|||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectregex.replacement=https://${DOMAIN}/$${2}"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectregex.replacement=https://${DOMAIN}/$${2}"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectregex.permanent=true"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.redirectregex.permanent=true"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT}"
|
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.19.1+6.9.4"
|
- "coop-cloud.${STACK_NAME}.version=2.19.5+6.9.5"
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: "mariadb:12.2"
|
image: "mariadb:12.2"
|
||||||
|
|||||||
@@ -42,6 +42,19 @@ define('FORCE_SSL_ADMIN', true );
|
|||||||
define('COOKIE_DOMAIN', \$_SERVER['HTTP_HOST']);"
|
define('COOKIE_DOMAIN', \$_SERVER['HTTP_HOST']);"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
UPLOADS_HTACCESS=/var/www/html/wp-content/uploads/.htaccess
|
||||||
|
if [ ! -f "$UPLOADS_HTACCESS" ]; then
|
||||||
|
mkdir -p /var/www/html/wp-content/uploads
|
||||||
|
cat > "$UPLOADS_HTACCESS" <<'EOF'
|
||||||
|
# Prevent PHP execution in uploads directory
|
||||||
|
<FilesMatch "\.(?i:php|phtml|phar)$">
|
||||||
|
Require all denied
|
||||||
|
</FilesMatch>
|
||||||
|
EOF
|
||||||
|
chown www-data:www-data "$UPLOADS_HTACCESS"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$@" ]; then
|
if [ -n "$@" ]; then
|
||||||
"$@"
|
"$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
# Protect sensitive files from direct access
|
||||||
|
<FilesMatch "^(wp-config\.php|\.htaccess|\.htpasswd|readme\.html|license\.txt)$">
|
||||||
|
Require all denied
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# Block XML-RPC
|
||||||
|
<Files xmlrpc.php>
|
||||||
|
Require all denied
|
||||||
|
</Files>
|
||||||
|
|
||||||
{{ if eq (env "MULTISITE") "" -}}
|
{{ if eq (env "MULTISITE") "" -}}
|
||||||
# BEGIN WordPress
|
# BEGIN WordPress
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
patch to block XML-RPC via htaccess
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
temporarily block rest api against wp2shell CVE
|
||||||
Reference in New Issue
Block a user