Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Max Leske <[email protected]>
  • Loading branch information
fzipi and theseion authored Dec 30, 2024
1 parent a7d160a commit 369b124
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verifyimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/; \
Expand Down
7 changes: 4 additions & 3 deletions nginx/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -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/; \
Expand Down

0 comments on commit 369b124

Please sign in to comment.