Merge pull request #111 from naturallaw777/copilot/fix-wordpress-init-service
[WIP] Fix wordpress-init systemd service path issues
This commit is contained in:
@@ -60,7 +60,7 @@ lib.mkIf config.sovran_systemsOS.services.wordpress {
|
|||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
path = with pkgs; [ curl unzip wp-cli pwgen php coreutils ];
|
path = with pkgs; [ curl unzip wp-cli pwgen php coreutils shadow util-linux ];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -97,7 +97,7 @@ lib.mkIf config.sovran_systemsOS.services.wordpress {
|
|||||||
|
|
||||||
echo "Generating wp-config.php..."
|
echo "Generating wp-config.php..."
|
||||||
cd "$INSTALL_DIR"
|
cd "$INSTALL_DIR"
|
||||||
su -s /bin/sh caddy -c "
|
/run/wrappers/bin/su -s /bin/sh caddy -c "
|
||||||
wp config create \
|
wp config create \
|
||||||
--dbname='$DB_NAME' \
|
--dbname='$DB_NAME' \
|
||||||
--dbuser='$DB_USER' \
|
--dbuser='$DB_USER' \
|
||||||
@@ -108,14 +108,14 @@ lib.mkIf config.sovran_systemsOS.services.wordpress {
|
|||||||
|
|
||||||
echo "Waiting for database..."
|
echo "Waiting for database..."
|
||||||
for i in $(seq 1 30); do
|
for i in $(seq 1 30); do
|
||||||
if su -s /bin/sh caddy -c "wp db check" 2>/dev/null; then
|
if /run/wrappers/bin/su -s /bin/sh caddy -c "wp db check" 2>/dev/null; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Running WordPress core install..."
|
echo "Running WordPress core install..."
|
||||||
su -s /bin/sh caddy -c "
|
/run/wrappers/bin/su -s /bin/sh caddy -c "
|
||||||
wp core install \
|
wp core install \
|
||||||
--url='https://$DOMAIN' \
|
--url='https://$DOMAIN' \
|
||||||
--title='Sovran_SystemsOS' \
|
--title='Sovran_SystemsOS' \
|
||||||
@@ -125,7 +125,7 @@ lib.mkIf config.sovran_systemsOS.services.wordpress {
|
|||||||
--skip-email
|
--skip-email
|
||||||
"
|
"
|
||||||
|
|
||||||
su -s /bin/sh caddy -c "
|
/run/wrappers/bin/su -s /bin/sh caddy -c "
|
||||||
wp option update blogdescription 'Powered by Sovran_SystemsOS'
|
wp option update blogdescription 'Powered by Sovran_SystemsOS'
|
||||||
wp option update permalink_structure '/%postname%/'
|
wp option update permalink_structure '/%postname%/'
|
||||||
wp option update default_ping_status 'closed'
|
wp option update default_ping_status 'closed'
|
||||||
@@ -133,7 +133,7 @@ lib.mkIf config.sovran_systemsOS.services.wordpress {
|
|||||||
wp rewrite flush
|
wp rewrite flush
|
||||||
"
|
"
|
||||||
|
|
||||||
su -s /bin/sh caddy -c "
|
/run/wrappers/bin/su -s /bin/sh caddy -c "
|
||||||
wp config set DISALLOW_FILE_EDIT true --raw
|
wp config set DISALLOW_FILE_EDIT true --raw
|
||||||
wp config set WP_AUTO_UPDATE_CORE true --raw
|
wp config set WP_AUTO_UPDATE_CORE true --raw
|
||||||
wp config set FORCE_SSL_ADMIN true --raw
|
wp config set FORCE_SSL_ADMIN true --raw
|
||||||
|
|||||||
Reference in New Issue
Block a user