Skip to content

Commit 9526a51

Browse files
committed
Merge branch 'feature/PB-49871_Dont-overwrite-nginx-configuration-symbolic-link-in-Dockerfiles' into 'master'
PB-49871: don't overwrite nginx configuration symbolic links in Dockerfiles using sed See merge request passbolt/passbolt_docker!247
2 parents f269cdc + c20cb99 commit 9526a51

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

debian/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN apt-get update \
4747
&& rm /etc/nginx/sites-enabled/default \
4848
&& cp /usr/share/passbolt/examples/nginx-passbolt-ssl.conf /etc/nginx/snippets/passbolt-ssl.conf \
4949
&& sed -i 's,;clear_env = no,clear_env = no,' /etc/php/$PHP_VERSION/fpm/pool.d/www.conf \
50-
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-enabled/nginx-passbolt.conf \
50+
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-available/nginx-passbolt.conf \
5151
&& sed -i 's,__CERT_PATH__,/etc/ssl/certs/certificate.crt;,' /etc/nginx/snippets/passbolt-ssl.conf \
5252
&& sed -i 's,__KEY_PATH__,/etc/ssl/certs/certificate.key;,' /etc/nginx/snippets/passbolt-ssl.conf \
5353
&& sed -i 's,www-data.*$,root su -s /bin/bash -c ". /etc/environment \&\& $PASSBOLT_BASE_DIR/bin/cron" www-data >/proc/1/fd/1 2>\&1,' /etc/cron.d/$PASSBOLT_PKG \

debian/Dockerfile.openshift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ COPY conf/supervisor/php.conf /etc/supervisor/conf.d/php.conf
6969

7070
RUN rm /etc/nginx/sites-enabled/default \
7171
&& cp /usr/share/passbolt/examples/nginx-passbolt-ssl.conf /etc/nginx/snippets/passbolt-ssl.conf \
72-
&& sed -i -E 's/listen (|\[\:\:\]\:)80/listen \18080/g' /etc/nginx/sites-enabled/nginx-passbolt.conf \
72+
&& sed -i -E 's/listen (|\[\:\:\]\:)80/listen \18080/g' /etc/nginx/sites-available/nginx-passbolt.conf \
7373
&& sed -i -E 's/listen (|\[\:\:\]\:)443/listen \14433/g' /etc/nginx/snippets/passbolt-ssl.conf \
7474
&& sed -i 's,;clear_env = no,clear_env = no,' /etc/php/$PHP_VERSION/fpm/pool.d/www.conf \
75-
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-enabled/nginx-passbolt.conf \
75+
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-available/nginx-passbolt.conf \
7676
&& sed -i 's,__CERT_PATH__,/etc/passbolt/certs/certificate.crt;,' /etc/nginx/snippets/passbolt-ssl.conf \
7777
&& sed -i 's,__KEY_PATH__,/etc/passbolt/certs/certificate.key;,' /etc/nginx/snippets/passbolt-ssl.conf \
7878
&& sed -i '/user www-data;/d' /etc/nginx/nginx.conf \
7979
&& sed -i 's,/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf \
8080
&& sed -i "/^http {/a \ proxy_temp_path /tmp/proxy_temp;\n client_body_temp_path /tmp/client_temp;\n fastcgi_temp_path /tmp/fastcgi_temp;\n uwsgi_temp_path /tmp/uwsgi_temp;\n scgi_temp_path /tmp/scgi_temp;\n" /etc/nginx/nginx.conf \
8181
&& sed -i "s,listen = /run/php/php$PHP_VERSION-fpm.sock,listen = 127.0.0.1:9000," /etc/php/$PHP_VERSION/fpm/pool.d/www.conf \
82-
&& sed -i "s,unix:/run/php/php$PHP_VERSION-fpm.sock,127.0.0.1:9000," /etc/nginx/sites-enabled/nginx-passbolt.conf \
82+
&& sed -i "s,unix:/run/php/php$PHP_VERSION-fpm.sock,127.0.0.1:9000," /etc/nginx/sites-available/nginx-passbolt.conf \
8383
&& sed -i "s,pid = /run/php/php$PHP_VERSION-fpm.pid,pid = /tmp/php$PHP_VERSION-fpm.pid," /etc/php/$PHP_VERSION/fpm/php-fpm.conf \
8484
&& sed -i 's,/var/run/supervisor.sock,/tmp/supervisor.sock,' /etc/supervisor/supervisord.conf \
8585
&& chown -R www-data:0 /etc/nginx \

debian/Dockerfile.rootless

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ COPY conf/supervisor/php.conf /etc/supervisor/conf.d/php.conf
6969

7070
RUN rm /etc/nginx/sites-enabled/default \
7171
&& cp /usr/share/passbolt/examples/nginx-passbolt-ssl.conf /etc/nginx/snippets/passbolt-ssl.conf \
72-
&& sed -i -E 's/listen (|\[\:\:\]\:)80/listen \18080/g' /etc/nginx/sites-enabled/nginx-passbolt.conf \
72+
&& sed -i -E 's/listen (|\[\:\:\]\:)80/listen \18080/g' /etc/nginx/sites-available/nginx-passbolt.conf \
7373
&& sed -i -E 's/listen (|\[\:\:\]\:)443/listen \14433/g' /etc/nginx/snippets/passbolt-ssl.conf \
7474
&& sed -i 's,;clear_env = no,clear_env = no,' /etc/php/$PHP_VERSION/fpm/pool.d/www.conf \
75-
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-enabled/nginx-passbolt.conf \
75+
&& sed -i 's,# include __PASSBOLT_SSL__,include /etc/nginx/snippets/passbolt-ssl.conf;,' /etc/nginx/sites-available/nginx-passbolt.conf \
7676
&& sed -i 's,__CERT_PATH__,/etc/passbolt/certs/certificate.crt;,' /etc/nginx/snippets/passbolt-ssl.conf \
7777
&& sed -i 's,__KEY_PATH__,/etc/passbolt/certs/certificate.key;,' /etc/nginx/snippets/passbolt-ssl.conf \
7878
&& sed -i '/user www-data;/d' /etc/nginx/nginx.conf \
7979
&& sed -i 's,/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf \
8080
&& sed -i "/^http {/a \ proxy_temp_path /tmp/proxy_temp;\n client_body_temp_path /tmp/client_temp;\n fastcgi_temp_path /tmp/fastcgi_temp;\n uwsgi_temp_path /tmp/uwsgi_temp;\n scgi_temp_path /tmp/scgi_temp;\n" /etc/nginx/nginx.conf \
8181
&& sed -i "s,listen = /run/php/php$PHP_VERSION-fpm.sock,listen = 127.0.0.1:9000," /etc/php/$PHP_VERSION/fpm/pool.d/www.conf \
82-
&& sed -i "s,unix:/run/php/php$PHP_VERSION-fpm.sock,127.0.0.1:9000," /etc/nginx/sites-enabled/nginx-passbolt.conf \
82+
&& sed -i "s,unix:/run/php/php$PHP_VERSION-fpm.sock,127.0.0.1:9000," /etc/nginx/sites-available/nginx-passbolt.conf \
8383
&& sed -i "s,pid = /run/php/php$PHP_VERSION-fpm.pid,pid = /tmp/php$PHP_VERSION-fpm.pid," /etc/php/$PHP_VERSION/fpm/php-fpm.conf \
8484
&& sed -i 's,/var/run/supervisor.sock,/tmp/supervisor.sock,' /etc/supervisor/supervisord.conf \
8585
# nginx user must own the cache and etc directory to write cache and tweak the nginx config

spec/docker_image/image_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@
156156
expect(file(site_conf)).to exist
157157
end
158158

159+
it 'is a symbolic link' do
160+
expect(file(site_conf)).to be_symlink
161+
end
162+
159163
it 'has the correct permissions' do
160164
expect(file(site_conf)).to be_owned_by $root_user
161165
end

0 commit comments

Comments
 (0)