diff --git a/.github/workflows/verifyimage.yml b/.github/workflows/verifyimage.yml index 7467a4e..9de7b95 100644 --- a/.github/workflows/verifyimage.yml +++ b/.github/workflows/verifyimage.yml @@ -78,7 +78,7 @@ jobs: - name: Verify ${{ matrix.target }} run: | [ $(docker inspect ${{ matrix.target }}-test --format='{{.State.Running}}') = 'true' ] - if grep -q "nginx <<< ${{ matrix.target }}" ; then + if grep -q "nginx "<<< "${{ matrix.target }}"; then curl -q -D headers.txt http://localhost:8080/?test=../../etc/passwd grep -q "HTTP/1.1 403 Forbidden" headers.txt grep -q "Access-Control-Allow-Origin: *" headers.txt diff --git a/nginx/Dockerfile b/nginx/Dockerfile index ced432a..98f146a 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -57,16 +57,17 @@ RUN set -eux; \ # Build modules RUN set -eux; \ + declare -a modules; \ for module in ${NGINX_DYNAMIC_MODULES}; \ do; \ - repo=$(awk -F'/' '{print $2}' <<< $module); \ + repo=$(awk -F'/' '{print $2}' <<< "${module}"); \ git clone -b master --depth 1 https://github.com/${module}.git; \ - modules=+("--add-dynamic-module=../${repo}"); \ + modules+=("--add-dynamic-module=../${repo}"); \ done; \ curl -sSL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -o nginx-${NGINX_VERSION}.tar.gz; \ tar -xzf nginx-${NGINX_VERSION}.tar.gz; \ cd ./nginx-${NGINX_VERSION}; \ - ./configure --with-compat ${modules[@]} ;\ + ./configure --with-compat ${modules[@]}; \ make modules; \ strip objs/*.so; \ cp objs/*.so /etc/nginx/modules/; \ diff --git a/nginx/Dockerfile-alpine b/nginx/Dockerfile-alpine index 2a2fc34..3d7981c 100644 --- a/nginx/Dockerfile-alpine +++ b/nginx/Dockerfile-alpine @@ -53,16 +53,17 @@ RUN set -eux; \ # Build modules RUN set -eux; \ + declare -a modules; for module in ${NGINX_DYNAMIC_MODULES}; \ do; \ - repo=$(awk -F'/' '{print $2}' <<< $module); \ + repo=$(awk -F'/' '{print $2}' <<< "${module}"); \ git clone -b master --depth 1 https://github.com/${module}.git; \ - modules=+("--add-dynamic-module=../${repo}"); \ + modules+=("--add-dynamic-module=../${repo}"); \ done; \ curl -sSL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -o nginx-${NGINX_VERSION}.tar.gz; \ tar -xzf nginx-${NGINX_VERSION}.tar.gz; \ cd ./nginx-${NGINX_VERSION}; \ - ./configure --with-compat ${modules[@]} ;\ + ./configure --with-compat ${modules[@]};\ make modules; \ strip objs/*.so; \ cp objs/*.so /etc/nginx/modules/; \