From eb7444b4985c983759b5e357c40c1e6caaa24dde Mon Sep 17 00:00:00 2001 From: zengxs Date: Tue, 26 Nov 2024 11:07:16 +0800 Subject: [PATCH 1/2] test --- .gitmodules | 2 +- Dockerfile | 9 +++++---- {modules => njs-modules}/njs-acme | 0 3 files changed, 6 insertions(+), 5 deletions(-) rename {modules => njs-modules}/njs-acme (100%) diff --git a/.gitmodules b/.gitmodules index 5717724..b9146f0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,7 +26,7 @@ path = modules/ngx-fancyindex url = https://github.com/aperezdc/ngx-fancyindex.git [submodule "modules/njs-acme"] - path = modules/njs-acme + path = njs-modules/njs-acme url = https://github.com/nginx/njs-acme.git [submodule "modules/iconv-nginx-module"] path = modules/iconv-nginx-module diff --git a/Dockerfile b/Dockerfile index 9408ebc..edcba7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG NGINX_VERSION=1.25.2 +ARG NGINX_VERSION # ==================================================================================================== # FROM nginx:${NGINX_VERSION} AS builder @@ -111,12 +111,13 @@ RUN set -ex \ https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-Country.mmdb # ==================================================================================================== # -FROM node AS njs-acme-builder +FROM node AS njs-builder WORKDIR /app -COPY ./modules/njs-acme . +COPY ./njs-modules . RUN set -ex \ + && cd njs-acme \ && npm install \ && npm run build @@ -132,7 +133,7 @@ COPY --from=builder /opt/sregex/lib /opt/sregex/lib COPY --from=builder /usr/bin/njs /usr/bin/njs COPY --from=builder usr/src/modules/naxsi/naxsi_rules /etc/nginx/naxsi COPY --from=builder /usr/share/GeoIP /usr/share/GeoIP -COPY --from=njs-acme-builder /app/dist/acme.js /usr/lib/nginx/njs_modules/acme.js +COPY --from=njs-builder /app/njs-acme/dist/acme.js /usr/lib/nginx/njs_modules/acme.js # install runtime dependencies RUN set -ex \ diff --git a/modules/njs-acme b/njs-modules/njs-acme similarity index 100% rename from modules/njs-acme rename to njs-modules/njs-acme From 857334864e0fdf9b50f64d8843fdbc0da23f50e8 Mon Sep 17 00:00:00 2001 From: zengxs Date: Tue, 26 Nov 2024 11:39:58 +0800 Subject: [PATCH 2/2] add websockify-nginx-module --- .gitmodules | 3 +++ Dockerfile | 2 ++ modules/websockify-nginx-module | 1 + 3 files changed, 6 insertions(+) create mode 160000 modules/websockify-nginx-module diff --git a/.gitmodules b/.gitmodules index b9146f0..2a4b2ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "modules/nginx-otel"] path = modules/nginx-otel url = https://github.com/nginxinc/nginx-otel.git +[submodule "modules/websockify-nginx-module"] + path = modules/websockify-nginx-module + url = https://github.com/tg123/websockify-nginx-module.git diff --git a/Dockerfile b/Dockerfile index edcba7f..46852cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,6 +84,7 @@ RUN set -ex \ --add-dynamic-module=/usr/src/modules/ModSecurity-nginx \ --add-dynamic-module=/usr/src/modules/naxsi/naxsi_src \ --add-dynamic-module=/usr/src/modules/nginx-otel \ + --add-dynamic-module=/usr/src/modules/websockify-nginx-module \ | bash -x \ # build modules && make modules -j$(nproc) \ @@ -150,4 +151,5 @@ RUN set -ex \ libprotobuf32 \ libmodsecurity3 \ modsecurity-crs \ + && ln -s /usr/lib/nginx/modules /etc/nginx/modules \ && rm -rf /var/lib/apt/lists/* diff --git a/modules/websockify-nginx-module b/modules/websockify-nginx-module new file mode 160000 index 0000000..c11bc9a --- /dev/null +++ b/modules/websockify-nginx-module @@ -0,0 +1 @@ +Subproject commit c11bc9a3862c53b3af814c3f7d213cc3d2939641