From 538417f0e22db45e38a297bf2ece026cee1b209e Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Wed, 27 Sep 2023 15:05:45 -0700 Subject: [PATCH] rearrange files into etc/ and local/ dirs --- README.md | 1 + .../apache2}/conf-available/wp-secuirty.conf | 0 .../bash_completion.d}/wp-cli | 0 .../fail2ban}/filter.d/wp-auth.conf | 0 .../fail2ban}/filter.d/xmlrpc.conf | 0 {fail2ban => etc/fail2ban}/jail.d/wp-auth.conf | 0 {fail2ban => etc/fail2ban}/jail.d/xmlrpc.conf | 0 install.sh | 18 +++++++++--------- .../bin}/wp-create-db-user-from-config.sh | 0 {bin => local/bin}/wp-installer.sh | 0 {bin => local/bin}/wp-update-config-db-info.sh | 0 {bin => local/bin}/wp-verify-checksums.sh | 0 {sbin => local/sbin}/wp-cron.sh | 0 {systemd => local/systemd}/wp-cron.service | 0 {systemd => local/systemd}/wp-cron.timer | 0 15 files changed, 10 insertions(+), 9 deletions(-) rename {apache2 => etc/apache2}/conf-available/wp-secuirty.conf (100%) rename {bash_completion.d => etc/bash_completion.d}/wp-cli (100%) rename {fail2ban => etc/fail2ban}/filter.d/wp-auth.conf (100%) rename {fail2ban => etc/fail2ban}/filter.d/xmlrpc.conf (100%) rename {fail2ban => etc/fail2ban}/jail.d/wp-auth.conf (100%) rename {fail2ban => etc/fail2ban}/jail.d/xmlrpc.conf (100%) rename {bin => local/bin}/wp-create-db-user-from-config.sh (100%) rename {bin => local/bin}/wp-installer.sh (100%) rename {bin => local/bin}/wp-update-config-db-info.sh (100%) rename {bin => local/bin}/wp-verify-checksums.sh (100%) rename {sbin => local/sbin}/wp-cron.sh (100%) rename {systemd => local/systemd}/wp-cron.service (100%) rename {systemd => local/systemd}/wp-cron.timer (100%) diff --git a/README.md b/README.md index fe14fcc..8693587 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ A couple of handy tools for virtualhost servers with WordPress sites. - systemd cron for running wp crons. Individual sites don't have to set their own cron job or rely on lazy cron. - wp-create-db-user-from-config.sh extracts DB config info from wp-config.php, useful for creating dbs & users for sites that are being migrated. - wp-installer.sh for performing new WordPress installs. +- wp-verify-checksums.sh for verifying checksums on WordPress installs ## Install ``` diff --git a/apache2/conf-available/wp-secuirty.conf b/etc/apache2/conf-available/wp-secuirty.conf similarity index 100% rename from apache2/conf-available/wp-secuirty.conf rename to etc/apache2/conf-available/wp-secuirty.conf diff --git a/bash_completion.d/wp-cli b/etc/bash_completion.d/wp-cli similarity index 100% rename from bash_completion.d/wp-cli rename to etc/bash_completion.d/wp-cli diff --git a/fail2ban/filter.d/wp-auth.conf b/etc/fail2ban/filter.d/wp-auth.conf similarity index 100% rename from fail2ban/filter.d/wp-auth.conf rename to etc/fail2ban/filter.d/wp-auth.conf diff --git a/fail2ban/filter.d/xmlrpc.conf b/etc/fail2ban/filter.d/xmlrpc.conf similarity index 100% rename from fail2ban/filter.d/xmlrpc.conf rename to etc/fail2ban/filter.d/xmlrpc.conf diff --git a/fail2ban/jail.d/wp-auth.conf b/etc/fail2ban/jail.d/wp-auth.conf similarity index 100% rename from fail2ban/jail.d/wp-auth.conf rename to etc/fail2ban/jail.d/wp-auth.conf diff --git a/fail2ban/jail.d/xmlrpc.conf b/etc/fail2ban/jail.d/xmlrpc.conf similarity index 100% rename from fail2ban/jail.d/xmlrpc.conf rename to etc/fail2ban/jail.d/xmlrpc.conf diff --git a/install.sh b/install.sh index 924c78a..01a762c 100755 --- a/install.sh +++ b/install.sh @@ -16,36 +16,36 @@ sudo mv wp-cli.phar /usr/local/bin/wp chmod +x /usr/local/bin/wp # configure wp-cli bash completion -cp bash_completion.d/wp-cli /etc/bash_completion.d/ +cp etc/bash_completion.d/wp-cli /etc/bash_completion.d/ chmod 644 /etc/bash_completion.d/wp-cli # install wp user scripts -cp bin/wp-* /usr/local/bin +cp etc/bin/wp-* /usr/local/bin chmod 755 /usr/local/bin/wp-* # install & enable wp systemd cron -cp sbin/wp-cron.sh /usr/local/sbin/ +cp etc/sbin/wp-cron.sh /usr/local/sbin/ chmod 755 /usr/local/sbin/wp-cron.sh if [[ ! -d /usr/local/lib/systemd/system ]]; then mkdir -p /usr/local/lib/systemd/system fi -cp systemd/wp-cron.* /usr/local/lib/systemd/system/ +cp etc/systemd/wp-cron.* /usr/local/lib/systemd/system/ chmod 644 /usr/local/lib/systemd/system/wp-cron.* systemctl enable wp-cron.timer systemctl start wp-cron.timer # enable wp-security, restricts access to wordpress directories -cp apache2/conf-available/wp-secuirty.conf /etc/apache2/conf-available/wp-secuirty.conf +cp etc/apache2/conf-available/wp-secuirty.conf /etc/apache2/conf-available/wp-secuirty.conf chmod 644 /etc/apache2/conf-available/wp-secuirty.conf a2enconf wp-secuirty systemctl reload apache2 # fail2ban wordpress configs if [[ -d /etc/fail2ban/ ]]; then - chmod 644 fail2ban/filter.d/* - cp -a fail2ban/filter.d/* /etc/fail2ban/filter.d/ - chmod 644 fail2ban/jail.d/* - cp -a fail2ban/jail.d/* /etc/fail2ban/jail.d/ + chmod 644 etc/fail2ban/filter.d/* + cp -a etc/fail2ban/filter.d/* /etc/fail2ban/filter.d/ + chmod 644 etc/fail2ban/jail.d/* + cp -a etc/fail2ban/jail.d/* /etc/fail2ban/jail.d/ systemctl restart fail2ban else echo "Fail2ban not installed, skipping fail2ban wordpress configs." diff --git a/bin/wp-create-db-user-from-config.sh b/local/bin/wp-create-db-user-from-config.sh similarity index 100% rename from bin/wp-create-db-user-from-config.sh rename to local/bin/wp-create-db-user-from-config.sh diff --git a/bin/wp-installer.sh b/local/bin/wp-installer.sh similarity index 100% rename from bin/wp-installer.sh rename to local/bin/wp-installer.sh diff --git a/bin/wp-update-config-db-info.sh b/local/bin/wp-update-config-db-info.sh similarity index 100% rename from bin/wp-update-config-db-info.sh rename to local/bin/wp-update-config-db-info.sh diff --git a/bin/wp-verify-checksums.sh b/local/bin/wp-verify-checksums.sh similarity index 100% rename from bin/wp-verify-checksums.sh rename to local/bin/wp-verify-checksums.sh diff --git a/sbin/wp-cron.sh b/local/sbin/wp-cron.sh similarity index 100% rename from sbin/wp-cron.sh rename to local/sbin/wp-cron.sh diff --git a/systemd/wp-cron.service b/local/systemd/wp-cron.service similarity index 100% rename from systemd/wp-cron.service rename to local/systemd/wp-cron.service diff --git a/systemd/wp-cron.timer b/local/systemd/wp-cron.timer similarity index 100% rename from systemd/wp-cron.timer rename to local/systemd/wp-cron.timer