Skip to content

Commit

Permalink
[ACA-2229] docker security fixes (Alfresco#980)
Browse files Browse the repository at this point in the history
* docker permission fixes

* remove index.html edit permissions
  • Loading branch information
DenysVuika authored and dhrn committed Apr 30, 2019
1 parent deea8de commit aa9caee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ARG GROUPID=1000
ARG USERNAME=aca
ARG USERID=33009

COPY nginx.conf /etc/nginx/nginx.conf
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/entrypoint.sh /

WORKDIR /usr/share/nginx/html
Expand All @@ -28,6 +28,7 @@ COPY --from=builder /usr/src/alfresco/licenses ./licenses

RUN addgroup -g ${GROUPID} ${GROUPNAME} && \
adduser -S -u ${USERID} -G ${GROUPNAME} -s "/bin/bash" ${USERNAME} && \
chown -R ${USERNAME}:${GROUPNAME} ./app.config.json && \
chown -R ${USERNAME}:${GROUPNAME} /var/cache/nginx && \
touch /var/run/nginx.pid && \
chown -R ${USERNAME}:${GROUPNAME} /var/run/nginx.pid && \
Expand Down
4 changes: 0 additions & 4 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ if [[ $ACSURL ]]; then
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
fi

if [[ $BASEPATH ]]; then
sed -i s%href=\"/\"%href=\""$BASEPATH"\"%g /usr/share/nginx/html/index.html
fi

if [ -n "${APP_BASE_SHARE_URL}" ];then
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
-i ./app.config.json
Expand Down
2 changes: 0 additions & 2 deletions nginx.conf → docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ http {
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

access_log off;

location / {
try_files $uri $uri/ /index.html;
}
Expand Down

0 comments on commit aa9caee

Please sign in to comment.