Uh oh!
There was an error while loading. Please reload this page.
Use WordPress setup default values for env variables - #577
Conversation
tianon
commented
Mar 12, 2021
I'm actually -1 on this change -- encouraging/enabling users to use the MySQL root user or an empty password was a mistake IMO (for the same reasons as having this container opportunistically create the database -- the database user given really shouldn't have that level of privileged access 😬), and minor positive breaking changes like this are why we had this newer functionality available for users to pre-test for several months before we enabled it (and even waited for a new release of WordPress itself to do so). 😕 Additionally, for this file to even be used they'd have to be setting some I suppose one improvement we arguably should make is to update our |
yosifkit
commented
Mar 12, 2021
That sounds reasonable; should we at least restore |
tianon
commented
Mar 12, 2021
Hmmmm, good point -- I took these values from Perhaps we should look to the built-in setup wizard and match any default values it pre-fills/suggests? |
tianon
commented
Mar 12, 2021
https://github.com/WordPress/WordPress/blob/fb8c18e54198ad9364213d792ea39b2008d36725/wp-admin/setup-config.php#L218 corroborates (I don't know whether |
yosifkit
commented
Mar 13, 2021
If we move to whatever upstream uses as defaults, then we can just point to that in the future (minus |
187a2bf to
b947a7dCompareyosifkit
commented
Mar 15, 2021
Just tested this version: '3.1'services:
wordpress:
image: wordpress:testrestart: alwaysports:
- 8080:80environment:
WORDPRESS_DB_HOST: dbWORDPRESS_DB_USER: rootWORDPRESS_DB_PASSWORD: ''WORDPRESS_DB_NAME: exampledbvolumes:
- wordpress:/var/www/htmldb:
image: mysql:5.7restart: alwaysenvironment:
MYSQL_DATABASE: exampledbMYSQL_ALLOW_EMPTY_PASSWORD: '1'volumes:
- db:/var/lib/mysqlvolumes:
wordpress:
db: |
| /** MySQL database password */ | ||
| define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'password_here') ); | ||
| define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'example password') ); | ||
There was a problem hiding this comment.
Do you think there's a good place in here somewhere we could inject a link to https://github.com/WordPress/WordPress/blob/f9cc35ebad82753e9c86de322ea5c76a9001c7e2/wp-admin/setup-config.php#L216-L230 to show/remind where these defaults came from? Perhaps something generic here at the end like this?
| // Docker image fallback values above are sourced from the official WordPress installation wizard: | |
| // https://github.com/WordPress/WordPress/blob/f9cc35ebad82753e9c86de322ea5c76a9001c7e2/wp-admin/setup-config.php#L216-L230 | |
| // (However, using "example username" and "example password" in your database is strongly discouraged. Please use strong, random credentials!) | |
b947a7d to
95ca33aCompareyosifkit
commented
Mar 16, 2021
Added fix for removing newlines from |
Changes: - docker-library/wordpress@0f81a03: Merge pull request docker-library/wordpress#577 from infosiftr/restore-default-env-values - docker-library/wordpress@c313a26: Remove newlines from `_FILE` contents - docker-library/wordpress@95ca33a: Use WordPress setup default values for env variables; use empty env values
This brings back the default values from before #572 and #557Edit: Use WordPress setup defaults; also allow empty string values.