disable about and settings by default (#1868)

* disable about and settings by default

* support docker variables

* remove comments
This commit is contained in:
Denys Vuika 2020-12-09 12:30:53 +00:00 committed by GitHub
parent 42463179b5
commit 0ed0a10471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 30 deletions

View File

@ -19,6 +19,7 @@ COPY docker/docker-entrypoint.d/* /docker-entrypoint.d/
COPY dist/$PROJECT_NAME /usr/share/nginx/html/
COPY dist/$PROJECT_NAME/app.config.json /etc/nginx/templates/app.config.json.template
COPY dist/$PROJECT_NAME/assets/app.extensions.json /etc/nginx/templates/app.extensions.json.template
COPY --from=builder /usr/src/alfresco/licenses /usr/share/nginx/html/
USER root

View File

@ -1,10 +1,6 @@
server {
listen 8080;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
root /usr/share/nginx/html;
rewrite ^([^.]*[^/])$ $1/ permanent;
@ -23,35 +19,12 @@ server {
alias ${NGINX_ENVSUBST_OUTPUT_DIR}/app.config.json;
}
#error_page 404 /404.html;
location ~ /assets/app.extensions.json {
alias ${NGINX_ENVSUBST_OUTPUT_DIR}/app.extensions.json;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
echo Running sed on "${NGINX_ENVSUBST_OUTPUT_DIR}/assets/app.extensions.json"
# modifies the "$ignoreReferenceList" property using a comma-delimited string
if [ -n "${APP_EXTENSIONS_IGNORE_REFS}" ]; then
echo "replace APP_EXTENSIONS_IGNORE_REFS"
replace="\/"
encoded=${APP_EXTENSIONS_IGNORE_REFS//\//$replace}
sed -e "s/\"$ignoreReferenceList\": \".*\"/\"$ignoreReferenceList\": \[${encoded}\]/g" \
-i "${NGINX_ENVSUBST_OUTPUT_DIR}/app.extensions.json"
fi

View File

@ -21,4 +21,5 @@ docker run --rm -it \
--env APP_CONFIG_BPM_HOST=$APP_CONFIG_BPM_HOST \
--env APP_CONFIG_ECM_HOST=$APP_CONFIG_ECM_HOST \
--env APP_BASE_SHARE_URL=$APP_BASE_SHARE_URL \
--env APP_EXTENSIONS_IGNORE_REFS=$APP_EXTENSIONS_IGNORE_REFS \
--user 1000:1000 --publish $HOST_PORT:$CONTAINER_PORT $DOCKER_IMAGE_REPO

View File

@ -8,6 +8,7 @@
"$runtime": "1.7.0",
"$description": "Core application extensions and features",
"$references": [],
"$ignoreReferenceList": ["about.plugin.json", "settings.plugin.json"],
"rules": [
{