-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use WordPress setup default values for env variables #577
Use WordPress setup default values for env variables #577
Conversation
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 |
That sounds reasonable; should we at least restore |
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? |
https://github.com/WordPress/WordPress/blob/fb8c18e54198ad9364213d792ea39b2008d36725/wp-admin/setup-config.php#L218 corroborates (I don't know whether |
If we move to whatever upstream uses as defaults, then we can just point to that in the future (minus |
187a2bf
to
b947a7d
Compare
Just tested this version: '3.1'
services:
wordpress:
image: wordpress:test
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: ''
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_ALLOW_EMPTY_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
95ca33a
Compare
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.