-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
@wordpress/env: Set owner of wp-content to www-data #20406
@wordpress/env: Set owner of wp-content to www-data #20406
Conversation
Makes the WordPress content directories (wp-content, wp-content/plugins, wp-content/themes) owned by the www-data user. This ensures that WordPress can write to these directories. This is necessary when running wp-env with `"core": null` because Docker will automatically create these directories as the root user when binding volumes during `docker-compose up`, and `docker-compose up` doesn't support the `-u` option. See docker-library/wordpress#436.
Size Change: 0 B Total Size: 864 kB ℹ️ View Unchanged
|
This might also need to include the uploads folder - #20280 (comment) I've cherry-picked that commit to my branch, so will see if the existing change solves that. |
If #20280 is using the default I did think about including gutenberg/packages/env/lib/build-docker-compose-config.js Lines 21 to 35 in 542b7cb
|
Okey dokey. It indeed didn't make any difference. If you have any insights into why uploads might not be working in those tests that'd be great. |
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.
I tested this and it solves the issue, code looks good too (only a minor doc comment). Nice work 👍
* | ||
* See https://github.com/docker-library/wordpress/issues/436. | ||
* | ||
* @param {string} environment The environment to check. Either 'development' or 'tests'. |
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.
Minor suggestion. I've had the feedback before to document this slightly differently, I think since this was merged:
https://github.com/WordPress/gutenberg/pull/18920/files#diff-78efab576563261e860347a820aa0997R234
You can inline a bit like this or I think consider a typedef if alignment gets difficult.
* @param {string} environment The environment to check. Either 'development' or 'tests'. | |
* @param {'development'|'tests'} environment The environment to check. |
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.
Good idea! This exists in a few other places and I can spot a few other JSDoc mistakes so I'll tackle this separately.
Hi @noisysocks should this PR be backported into WordPress 5.4? If yes, feel free to add the label backport to wp core. |
I don't think we use |
Makes the WordPress content directories (wp-content, wp-content/plugins, wp-content/themes) owned by the www-data user. This ensures that WordPress can write to these directories. This is necessary when running wp-env with `"core": null` because Docker will automatically create these directories as the root user when binding volumes during `docker-compose up`, and `docker-compose up` doesn't support the `-u` option. See docker-library/wordpress#436.
Makes the WordPress content directories (wp-content, wp-content/plugins, wp-content/themes) owned by the www-data user. This ensures that WordPress can write to these directories. This is necessary when running wp-env with `"core": null` because Docker will automatically create these directories as the root user when binding volumes during `docker-compose up`, and `docker-compose up` doesn't support the `-u` option. See docker-library/wordpress#436.
Fixes bug I noticed in #20403 (comment).
Makes the WordPress content directories (
wp-content
,wp-content/plugins
,wp-content/themes
) owned by thewww-data
user. This ensures that WordPress can write to these directories.This is necessary when running wp-env with
"core": null
because Docker will automatically create these directories as the root user when binding volumes duringdocker-compose up
, anddocker-compose up
doesn't support a--user
option.See docker-library/wordpress#436.
To test:
"core": null
in your.wp-env.json
or.wp-env.override.json
packages/env/bin/wp-env start