Skip to content

Commit 2ac11e3

Browse files
authored
Always generate wp-secrets.php (#56)
wp-secrets.php is always expected to exist by wp-config, so the entrypoint should always create it if it doesn't exist. It should still only generate secrets if they are not already set by environment variables.
1 parent c766bcb commit 2ac11e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if [ ! "$(ls -A "/var/www/wp-content" 2>/dev/null)" ]; then
1212
fi
1313
# Check if wp-secrets.php exists
1414
if ! [ -f "/var/www/wp-content/wp-secrets.php" ]; then
15+
echo '<?php' > /var/www/wp-content/wp-secrets.php
1516
# Check that secrets environment variables are not set
1617
if [ ! $AUTH_KEY ] \
1718
&& [ ! $SECURE_AUTH_KEY ] \
@@ -23,7 +24,6 @@ if ! [ -f "/var/www/wp-content/wp-secrets.php" ]; then
2324
&& [ ! $NONCE_SALT ]; then
2425
echo "Generating wp-secrets.php"
2526
# Generate secrets
26-
echo '<?php' > /var/www/wp-content/wp-secrets.php
2727
curl -f https://api.wordpress.org/secret-key/1.1/salt/ >> /var/www/wp-content/wp-secrets.php
2828
fi
2929
fi

0 commit comments

Comments
 (0)