fix(wordpress): use /run/wrappers/bin/su to fix su: command not found in wordpress-init service

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/24a9d2b1-6b09-41ac-bb3b-418f0ea2b2d7

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 14:46:46 +00:00
committed by GitHub
parent 9407d500c8
commit 7a1cd8a6f6

View File

@@ -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