Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 42773a9

Browse files
linted
1 parent a5fbec5 commit 42773a9

File tree

212 files changed

+8857
-8848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+8857
-8848
lines changed

.github/linters/.dockerfilelintrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
rules:
22
invalid_command: off
33
base_image_tag: off
4+
missing_tag: off

.github/linters/.ecrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Exclude": [
3+
"docs/lua-nginx-module/known-issues.md",
4+
"docs/lua-nginx-module/nginx-api-for-lua.md"
5+
]
6+
}

.github/linters/.hadolint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ ignored:
22
- DL3008 # Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
33
- DL3018 # Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
44
- DL3033 # Specify version with `yum install -y <package>-<version>`.
5+
- DL3006 # Always tag the version of an image explicitly

Dockerfile

+80-80
Original file line numberDiff line numberDiff line change
@@ -141,84 +141,84 @@ ENV NGX_CFLAGS=$NGX_CFLAGS
141141
ARG NGX_LDOPT="-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
142142
ENV NGX_LDOPT=$NGX_LDOPT
143143
ARG NGINX_BUILD_CONFIG="\
144-
--prefix=/etc/nginx \
145-
--sbin-path=/usr/sbin/nginx \
146-
--modules-path=/usr/lib/nginx/modules \
147-
--conf-path=/etc/nginx/nginx.conf \
148-
--error-log-path=/var/log/nginx/error.log \
149-
--http-log-path=/var/log/nginx/access.log \
150-
--pid-path=/var/run/nginx.pid \
151-
--lock-path=/var/run/nginx.lock \
152-
--http-client-body-temp-path=/var/cache/nginx/client_temp \
153-
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
154-
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
155-
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
156-
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
157-
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
158-
--user=nginx \
159-
--group=nginx \
160-
--with-compat \
161-
--with-file-aio \
162-
--with-threads \
163-
--with-http_addition_module \
164-
--with-http_auth_request_module \
165-
--with-http_dav_module \
166-
--with-http_flv_module \
167-
--with-http_gunzip_module \
168-
--with-http_gzip_static_module \
169-
--with-http_mp4_module \
170-
--with-http_random_index_module \
171-
--with-http_realip_module \
172-
--with-http_secure_link_module \
173-
--with-http_slice_module \
174-
--with-http_ssl_module \
175-
--with-http_stub_status_module \
176-
--with-http_sub_module \
177-
--with-http_v2_module \
178-
--with-mail \
179-
--with-mail_ssl_module \
180-
--with-stream \
181-
--with-stream_realip_module \
182-
--with-stream_ssl_module \
183-
--with-stream_ssl_preread_module \
184-
--add-module=/lua-nginx-module-${VER_LUA_NGINX_MODULE} \
185-
--add-module=/ngx_devel_kit-${VER_NGX_DEVEL_KIT} \
186-
--add-module=/lua-upstream-nginx-module-${VER_LUA_UPSTREAM} \
144+
--prefix=/etc/nginx \
145+
--sbin-path=/usr/sbin/nginx \
146+
--modules-path=/usr/lib/nginx/modules \
147+
--conf-path=/etc/nginx/nginx.conf \
148+
--error-log-path=/var/log/nginx/error.log \
149+
--http-log-path=/var/log/nginx/access.log \
150+
--pid-path=/var/run/nginx.pid \
151+
--lock-path=/var/run/nginx.lock \
152+
--http-client-body-temp-path=/var/cache/nginx/client_temp \
153+
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
154+
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
155+
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
156+
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
157+
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
158+
--user=nginx \
159+
--group=nginx \
160+
--with-compat \
161+
--with-file-aio \
162+
--with-threads \
163+
--with-http_addition_module \
164+
--with-http_auth_request_module \
165+
--with-http_dav_module \
166+
--with-http_flv_module \
167+
--with-http_gunzip_module \
168+
--with-http_gzip_static_module \
169+
--with-http_mp4_module \
170+
--with-http_random_index_module \
171+
--with-http_realip_module \
172+
--with-http_secure_link_module \
173+
--with-http_slice_module \
174+
--with-http_ssl_module \
175+
--with-http_stub_status_module \
176+
--with-http_sub_module \
177+
--with-http_v2_module \
178+
--with-mail \
179+
--with-mail_ssl_module \
180+
--with-stream \
181+
--with-stream_realip_module \
182+
--with-stream_ssl_module \
183+
--with-stream_ssl_preread_module \
184+
--add-module=/lua-nginx-module-${VER_LUA_NGINX_MODULE} \
185+
--add-module=/ngx_devel_kit-${VER_NGX_DEVEL_KIT} \
186+
--add-module=/lua-upstream-nginx-module-${VER_LUA_UPSTREAM} \
187187
"
188188
ENV NGINX_BUILD_CONFIG=$NGINX_BUILD_CONFIG
189189

190190
ARG BUILD_DEPS="\
191-
curl \
192-
g++ \
193-
geoip-dev \
194-
gzip \
195-
lua${VER_LUA} \
196-
lua${VER_LUA}-dev \
197-
make \
198-
openssl-dev \
199-
pcre-dev \
200-
tar \
201-
zlib-dev \
191+
curl \
192+
g++ \
193+
geoip-dev \
194+
gzip \
195+
lua${VER_LUA} \
196+
lua${VER_LUA}-dev \
197+
make \
198+
openssl-dev \
199+
pcre-dev \
200+
tar \
201+
zlib-dev \
202202
"
203203
ENV BUILD_DEPS=$BUILD_DEPS
204204

205205
ARG NGINX_BUILD_DEPS="\
206206
# NGINX
207-
alpine-sdk \
208-
bash \
209-
findutils \
210-
gcc \
211-
gd-dev \
212-
geoip-dev \
213-
libc-dev \
214-
libedit-dev \
215-
libxslt-dev \
216-
linux-headers \
217-
make \
218-
openssl-dev \
219-
pcre-dev \
220-
perl-dev \
221-
zlib-dev \
207+
alpine-sdk \
208+
bash \
209+
findutils \
210+
gcc \
211+
gd-dev \
212+
geoip-dev \
213+
libc-dev \
214+
libedit-dev \
215+
libxslt-dev \
216+
linux-headers \
217+
make \
218+
openssl-dev \
219+
pcre-dev \
220+
perl-dev \
221+
zlib-dev \
222222
"
223223
ENV NGINX_BUILD_DEPS=$NGINX_BUILD_DEPS
224224

@@ -237,10 +237,10 @@ RUN set -eux \
237237
$BUILD_DEPS \
238238
$NGINX_BUILD_DEPS \
239239
&& [ $EXTENDED_IMAGE -eq 1 ] && \
240-
NGINX_BUILD_CONFIG="${NGINX_BUILD_CONFIG} \
241-
--add-module=/headers-more-nginx-module-${VER_OPENRESTY_HEADERS} \
242-
--add-module=/stream-lua-nginx-module-${VER_OPENRESTY_STREAMLUA} \
243-
" \
240+
NGINX_BUILD_CONFIG="${NGINX_BUILD_CONFIG} \
241+
--add-module=/headers-more-nginx-module-${VER_OPENRESTY_HEADERS} \
242+
--add-module=/stream-lua-nginx-module-${VER_OPENRESTY_STREAMLUA} \
243+
" \
244244
&& make -j "$(nproc)" deps \
245245
&& make -j "$(nproc)" core \
246246
&& make -j "$(nproc)" luarocks
@@ -285,13 +285,13 @@ LABEL maintainer="Fabio Cicerchia <[email protected]>" \
285285
versions.stream-lua-nginx-module=${VER_OPENRESTY_STREAMLUA}
286286

287287
ARG PKG_DEPS="\
288-
geoip-dev \
289-
lua${VER_LUA} \
290-
lua${VER_LUA}-dev \
291-
openssl-dev \
292-
pcre-dev \
293-
unzip \
294-
zlib-dev \
288+
geoip-dev \
289+
lua${VER_LUA} \
290+
lua${VER_LUA}-dev \
291+
openssl-dev \
292+
pcre-dev \
293+
unzip \
294+
zlib-dev \
295295
"
296296
ENV PKG_DEPS=$PKG_DEPS
297297

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Lua is a lightweight, high-level, multi-paradigm programming language designed p
6161

6262
| | nginx-lua | OpenResty |
6363
|--|--|--|
64-
| nginx latest version | `1.21.0` | `1.19.x` (last tested: `1.19.9`)* |
64+
| nginx latest version | `1.21.0` | `1.19.x` (last tested: `1.19.9`)<sup>*</sup> |
6565
| Alpine supported |||
6666
| Amazon supported |||
6767
| CentOS supported |||
@@ -70,7 +70,7 @@ Lua is a lightweight, high-level, multi-paradigm programming language designed p
7070
| Ubuntu supported |||
7171
| Windows supported |||
7272

73-
* Note: Between OpenResty compatibility for `1.17.4` (28 Sep 2019) and `1.19.3` (3 Nov 2020) have passed ~10 months, and nginx 1.19.3 has been released on 29 Sep 2020.
73+
<sup>*</sup> Note: Between OpenResty compatibility for `1.17.4` (28 Sep 2019) and `1.19.3` (3 Nov 2020) have passed ~10 months, and nginx 1.19.3 has been released on 29 Sep 2020.
7474

7575
## Features
7676

@@ -183,12 +183,12 @@ Here is an example using docker-compose.yml:
183183
web:
184184
image: fabiocicerchia/nginx-lua
185185
volumes:
186-
- ./templates:/etc/nginx/templates
186+
- ./templates:/etc/nginx/templates
187187
ports:
188-
- "8080:80"
188+
- "8080:80"
189189
environment:
190-
- NGINX_HOST=foobar.com
191-
- NGINX_PORT=80
190+
- NGINX_HOST=foobar.com
191+
- NGINX_PORT=80
192192
```
193193
194194
By default, this function reads template files in `/etc/nginx/templates/*.template` and outputs the result of executing `envsubst` to `/etc/nginx/conf.d`.

bin/_common.sh

100644100755
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091,SC2086
2+
# shellcheck disable=SC1091,SC2086,SC2207
33

44
source supported_versions
55

@@ -29,7 +29,7 @@ function loop_over_nginx_with_os() {
2929
FUNC=$2
3030

3131
LEN_VER_NGINX=${#NGINX[@]}
32-
for ((I = 0; I < LEN_VER_NGINX; I++ )); do
32+
for ((I = 0; I < LEN_VER_NGINX; I++)); do
3333
NGINX_VER="${NGINX[$I]}"
3434

3535
LAST_VER_NGINX=0
@@ -52,7 +52,7 @@ function loop_over_nginx() {
5252
FUNC=$1
5353

5454
LEN_VER_NGINX=${#NGINX[@]}
55-
for ((I = 0; I < LEN_VER_NGINX; I++ )); do
55+
for ((I = 0; I < LEN_VER_NGINX; I++)); do
5656
export NGINX_VER="${NGINX[$I]}"
5757

5858
export LAST_VER_NGINX=0
@@ -89,8 +89,8 @@ function loop_over_os() {
8989
FUNC=$2
9090

9191
LEN_VER_OS=${#VERSIONS[@]}
92-
for ((J = 0; J < LEN_VER_OS; J++ )); do
93-
export OS_VER="${VERSIONS[$J]}";
92+
for ((J = 0; J < LEN_VER_OS; J++)); do
93+
export OS_VER="${VERSIONS[$J]}"
9494

9595
export LAST_VER_OS=0
9696
if [ "$((J + 1))" == "$LEN_VER_OS" ]; then

bin/docker-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091,SC2086
2+
# shellcheck disable=SC1091,SC2086,SC2207
33

44
source ./bin/_common.sh
55
source supported_versions

bin/docker-metadata.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091
2+
# shellcheck disable=SC1091,SC2207
33

44
source ./bin/_common.sh
55
source supported_versions
@@ -20,7 +20,7 @@ function metadata() {
2020
echo '```json'
2121
docker image inspect "fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER"
2222
echo '```'
23-
} >"docs/metadata/$PATCH-$OS$OS_VER.md"
23+
} >"docs/metadata/$PATCH-$OS$OS_VER.md"
2424
fi
2525
}
2626

bin/docker-push.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091
2+
# shellcheck disable=SC1091,SC2207
33

44
source ./bin/_common.sh
55
source supported_versions
66

77
function docker_push() {
88
TAG=$1
99
EXITCODE=$(
10-
docker push fabiocicerchia/nginx-lua:"$TAG" > /dev/null;
10+
docker push fabiocicerchia/nginx-lua:"$TAG" >/dev/null
1111
echo $?
1212
)
1313
if [ "$EXITCODE" -ne "0" ]; then

bin/generate-supported-versions.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ fetch_latest() {
1818
while [ "$VER" = "" ] && [ $PAGE -lt 100 ]; do
1919
VER=$(wget -q "https://hub.docker.com/v2/repositories/library/$DISTRO/tags?page=$PAGE" -O - |
2020
jq -rc '.results[] | select( .images[].digest == "'"$DIGEST"'" and .name != "latest" ) | .name' |
21-
egrep "$FILTER" | sort -Vr | head -n 1)
22-
((PAGE+=1))
21+
grep -E "$FILTER" | sort -Vr | head -n 1)
22+
((PAGE += 1))
2323
done
2424

2525
echo "$VER"

bin/test-security.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091
2+
# shellcheck disable=SC1091,SC2207
33

44
source ./bin/_common.sh
55
source supported_versions

bin/test.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# shellcheck disable=SC1091
2+
# shellcheck disable=SC1091,SC2207
33

44
source ./bin/_common.sh
55
source supported_versions
@@ -14,11 +14,12 @@ function test() {
1414
docker run -d --name nginx_lua_test -p 8080:80 -v "$PWD"/test/nginx-lua.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:"$DOCKER_TAG"
1515
COUNT=0
1616
until [ $COUNT -eq 20 ] || [ "$(
17-
curl --output /dev/null --silent --head --fail http://localhost:8080;
17+
curl --output /dev/null --silent --head --fail http://localhost:8080
1818
echo $?
1919
)" == "0" ]; do
20-
echo -n '.'; sleep 0.5;
21-
COUNT=$((COUNT+1))
20+
echo -n '.'
21+
sleep 0.5
22+
COUNT=$((COUNT + 1))
2223
done
2324
curl -v http://localhost:8080 | grep "Welcome to nginx" || exit 1
2425
curl -v http://localhost:8080/lua_content | grep "Hello world" || exit 1

bin/update-readme.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
head -n "$(grep -n START_SUPPORTED_TAGS README.md | cut -d: -f1)" README.md >README.md.tmp
44
./bin/readme-tags.sh >>README.md.tmp
5-
tail -n "$(($(wc -l < README.md)-$(grep -n END_SUPPORTED_TAGS README.md | cut -d: -f1)+1))" README.md >>README.md.tmp
5+
tail -n "$(($(wc -l <README.md) - $(grep -n END_SUPPORTED_TAGS README.md | cut -d: -f1)+1))" README.md >>README.md.tmp
66
mv README.md.tmp README.md

0 commit comments

Comments
 (0)