Skip to content

Commit 173cc5e

Browse files
committed
umask: make new files group-writeable. Fixes #25
1 parent 0a490f5 commit 173cc5e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@ RUN addgroup --gid 1000 wp \
99
&& useradd -u 1000 -d /home/wp -g wp -G www-data wp \
1010
&& usermod -a -G wp www-data
1111

12+
# TODO: Leaving these here for now in case something goes wrong
1213
# All new files should be group-writable
1314
# TODO: This is likely wrong. Harmless, but wrong.
14-
RUN echo 'umask 002' >> /etc/profile.d/set-umask.sh
15+
# RUN echo 'umask 002' >> /etc/profile.d/set-umask.sh
1516

1617
# # Set global umask in /etc/bashrc
1718
# RUN echo && echo 'umask 002' >> /etc/bash.bashrc
1819

19-
# # Set umask for Apache & PHP
20-
# RUN echo >> /etc/apache2/envvars \
21-
# && echo '# Set umask so newly created files are group writeable' >> /etc/apache2/envvars \
22-
# && echo 'umask 002' >> /etc/apache2/envvars
23-
24-
# Set global Umask with pam_umask
20+
# Set global umask with pam_umask
2521
RUN echo >> /etc/pam.d/common-session \
2622
&& echo '# Set umask so newly created files are group writeable' >> /etc/pam.d/common-session \
2723
&& echo 'session optional pam_umask.so umask=002' >> /etc/pam.d/common-session
2824

25+
# Set umask for Apache & PHP so new files are group-writable
26+
RUN echo >> /etc/apache2/envvars \
27+
&& echo '# Set umask so newly created files are group writeable' >> /etc/apache2/envvars \
28+
&& echo 'umask 002' >> /etc/apache2/envvars
29+
2930
# Set Apache ServerName globally to address slowdowns
3031
RUN echo "ServerName localhost" > /etc/apache2/conf-available/server-name.conf \
3132
&& a2enconf server-name

src/wp-config-extra.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@
2525
* Useful idea from https://roots.io/
2626
*/
2727
define("WP_ENV", "development");
28+
29+
/**
30+
* Explicitly define FS_METHOD so WordPress creates group-writeable files
31+
*/
32+
define('FS_METHOD', 'direct');

0 commit comments

Comments
 (0)