From 4fe24464f9ee27b6059eaf8dbede75eb88d906dd Mon Sep 17 00:00:00 2001 From: ravilock Date: Thu, 3 Jul 2025 10:44:59 -0300 Subject: [PATCH 1/5] chore: bump ngx http limit req rw module to v0.3.0 --- flavors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flavors.json b/flavors.json index d452b92..a0d1953 100644 --- a/flavors.json +++ b/flavors.json @@ -9,7 +9,7 @@ "https://github.com/openresty/echo-nginx-module.git", "https://github.com/openresty/headers-more-nginx-module.git", "https://github.com/tsuru/ngx-location-name-module.git:main", - "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:v0.2.6", + "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:v0.3.0", "https://github.com/FRiCKLE/ngx_cache_purge.git:pr-45", "https://github.com/wandenberg/nginx-push-stream-module.git", "https://github.com/vozlt/nginx-module-vts.git:v0.2.4", From 04690395bac704826e5917e36ef24a642a2af083 Mon Sep 17 00:00:00 2001 From: ravilock Date: Fri, 4 Jul 2025 12:11:32 -0300 Subject: [PATCH 2/5] chore: install msgpack-c 3.1.0 manually --- Dockerfile | 184 +++++++++++++++++++++++++++-------------------------- 1 file changed, 95 insertions(+), 89 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2602278..fe2d665 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,84 +4,90 @@ FROM nginx:${nginx_version} AS build SHELL ["/bin/bash", "-c"] RUN set -x \ - && apt-get update \ - && apt-get install -y --no-install-suggests \ - libluajit-5.1-dev libpam0g-dev zlib1g-dev libpcre3-dev libpcre2-dev \ - libexpat1-dev git curl build-essential lsb-release libxml2 libxslt1.1 libxslt1-dev autoconf libtool libssl-dev \ - unzip libmaxminddb-dev libbrotli-dev cmake pkg-config libjansson-dev libmsgpack-dev + && apt-get update \ + && apt-get install -y --no-install-suggests \ + libluajit-5.1-dev libpam0g-dev zlib1g-dev libpcre3-dev libpcre2-dev \ + libexpat1-dev git curl build-essential lsb-release libxml2 libxslt1.1 libxslt1-dev autoconf libtool libssl-dev \ + unzip libmaxminddb-dev libbrotli-dev cmake pkg-config libjansson-dev libmsgpack-dev + +RUN git clone --depth 1 --branch cpp-3.1.0 https://github.com/msgpack/msgpack-c.git /home/msgpack +RUN cd /home/msgpack \ + && cmake . \ + && make \ + && make install RUN git clone --depth 1 --branch v3.2.1 https://github.com/benmcollins/libjwt.git /home/libjwt RUN mkdir -p /home/libjwt/build && \ - cd /home/libjwt/build && \ - cmake .. && make && make install + cd /home/libjwt/build && \ + cmake .. && make && make install ARG openresty_package_version=1.27.1.1-1~bookworm1 RUN set -x \ - && curl -fsSL https://openresty.org/package/pubkey.gpg | apt-key add - \ - && echo "deb https://openresty.org/package/$(uname -m | grep -qE 'aarch64|arm64' && echo -n 'arm64/')debian $(lsb_release -sc) openresty" | tee -a /etc/apt/sources.list.d/openresty.list \ - && apt-get update \ - && apt-get install -y --no-install-suggests openresty=${openresty_package_version} \ - && cd /usr/local/openresty \ - && cp -vr ./luajit/* /usr/local/ \ - && rm -d /usr/local/share/lua/5.1 \ - && ln -sf /usr/local/lib/lua/5.1 /usr/local/share/lua/ \ - && cp -vr ./lualib/* /usr/local/lib/lua/5.1 + && curl -fsSL https://openresty.org/package/pubkey.gpg | apt-key add - \ + && echo "deb https://openresty.org/package/$(uname -m | grep -qE 'aarch64|arm64' && echo -n 'arm64/')debian $(lsb_release -sc) openresty" | tee -a /etc/apt/sources.list.d/openresty.list \ + && apt-get update \ + && apt-get install -y --no-install-suggests openresty=${openresty_package_version} \ + && cd /usr/local/openresty \ + && cp -vr ./luajit/* /usr/local/ \ + && rm -d /usr/local/share/lua/5.1 \ + && ln -sf /usr/local/lib/lua/5.1 /usr/local/share/lua/ \ + && cp -vr ./lualib/* /usr/local/lib/lua/5.1 ENV LUAJIT_LIB=/usr/local/lib \ - LUAJIT_INC=/usr/local/include/luajit-2.1 + LUAJIT_INC=/usr/local/include/luajit-2.1 ARG modules RUN set -x \ - && nginx_version=$(echo ${NGINX_VERSION} | sed 's/-.*//g') \ - && curl -fSL "https://nginx.org/download/nginx-${nginx_version}.tar.gz" \ - | tar -C /usr/local/src -xzvf- \ - && ln -s /usr/local/src/nginx-${nginx_version} /usr/local/src/nginx \ - && cd /usr/local/src/nginx \ - && configure_args=$(nginx -V 2>&1 | grep "configure arguments:" | awk -F 'configure arguments:' '{print $2}'); \ - IFS=','; \ - for module in ${modules}; do \ - module_repo=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+).*@\1@g'); \ - module_tag=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+):?([^:/]*)@\4@g'); \ - dirname=$(echo "${module_repo}" | sed -E 's@^.*/|\..*$@@g'); \ - git clone --recursive "${module_repo}"; \ - cd ${dirname}; \ - git fetch --tags; \ - if [ -n "${module_tag}" ]; then \ - if [[ "${module_tag}" =~ ^(pr-[0-9]+.*)$ ]]; then \ - pr_numbers="${BASH_REMATCH[1]//pr-/}"; \ - IFS=';'; \ - for pr_number in ${pr_numbers}; do \ - git fetch origin "pull/${pr_number}/head:pr-${pr_number}"; \ - git merge --no-commit pr-${pr_number} master; \ - done; \ - IFS=','; \ - else \ - git checkout "${module_tag}"; \ - fi; \ - fi; \ - cd ..; \ - configure_args="${configure_args} --add-dynamic-module=./${dirname}"; \ - done; unset IFS \ - && eval ./configure ${configure_args} \ - && make modules \ - && cp -v objs/*.so /usr/lib/nginx/modules/ + && nginx_version=$(echo ${NGINX_VERSION} | sed 's/-.*//g') \ + && curl -fSL "https://nginx.org/download/nginx-${nginx_version}.tar.gz" \ + | tar -C /usr/local/src -xzvf- \ + && ln -s /usr/local/src/nginx-${nginx_version} /usr/local/src/nginx \ + && cd /usr/local/src/nginx \ + && configure_args=$(nginx -V 2>&1 | grep "configure arguments:" | awk -F 'configure arguments:' '{print $2}'); \ + IFS=','; \ + for module in ${modules}; do \ + module_repo=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+).*@\1@g'); \ + module_tag=$(echo $module | sed -E 's@^(((https?|git)://)?[^:]+):?([^:/]*)@\4@g'); \ + dirname=$(echo "${module_repo}" | sed -E 's@^.*/|\..*$@@g'); \ + git clone --recursive "${module_repo}"; \ + cd ${dirname}; \ + git fetch --tags; \ + if [ -n "${module_tag}" ]; then \ + if [[ "${module_tag}" =~ ^(pr-[0-9]+.*)$ ]]; then \ + pr_numbers="${BASH_REMATCH[1]//pr-/}"; \ + IFS=';'; \ + for pr_number in ${pr_numbers}; do \ + git fetch origin "pull/${pr_number}/head:pr-${pr_number}"; \ + git merge --no-commit pr-${pr_number} master; \ + done; \ + IFS=','; \ + else \ + git checkout "${module_tag}"; \ + fi; \ + fi; \ + cd ..; \ + configure_args="${configure_args} --add-dynamic-module=./${dirname}"; \ + done; unset IFS \ + && eval ./configure ${configure_args} \ + && make modules \ + && cp -v objs/*.so /usr/lib/nginx/modules/ ARG luarocks_version=3.12.2 RUN set -x \ - && curl -fSL "https://luarocks.org/releases/luarocks-${luarocks_version}.tar.gz" \ - | tar -C /usr/local/src -xzvf- \ - && ln -s /usr/local/src/luarocks-${luarocks_version} /usr/local/src/luarocks \ - && cd /usr/local/src/luarocks \ - && ./configure && make && make install + && curl -fSL "https://luarocks.org/releases/luarocks-${luarocks_version}.tar.gz" \ + | tar -C /usr/local/src -xzvf- \ + && ln -s /usr/local/src/luarocks-${luarocks_version} /usr/local/src/luarocks \ + && cd /usr/local/src/luarocks \ + && ./configure && make && make install ARG lua_modules RUN set -x \ - && ln -s /usr/include/$(uname -m)-linux-gnu /usr/include/linux-gnu \ - && IFS=","; \ - for lua_module in ${lua_modules}; do \ - unset IFS; \ - luarocks install ${lua_module}; \ - done + && ln -s /usr/include/$(uname -m)-linux-gnu /usr/include/linux-gnu \ + && IFS=","; \ + for lua_module in ${lua_modules}; do \ + unset IFS; \ + luarocks install ${lua_module}; \ + done FROM nginx:${nginx_version} @@ -95,36 +101,36 @@ COPY --from=build /usr/local/lib/libjwt.so /usr/local/lib/libjwt.so ENV LUAJIT_LIB=/usr/local/lib \ - LUAJIT_INC=/usr/local/include/luajit-2.1 + LUAJIT_INC=/usr/local/include/luajit-2.1 RUN set -x \ - && apt-get update \ - && apt-get install -y --no-install-suggests \ - ca-certificates \ - curl \ - dnsutils \ - iputils-ping \ - libcurl4-openssl-dev \ - libyajl-dev \ - libxml2 \ - lua5.1-dev \ - net-tools \ - procps \ - tcpdump \ - rsync \ - unzip \ - vim-tiny \ - libmaxminddb0 \ - libbrotli1 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && ldconfig -v \ - && ls /etc/nginx/modules/*.so | grep -v debug \ - | xargs -I{} sh -c 'echo "load_module {};" | tee -a /etc/nginx/modules/all.conf' \ - && sed -i -E 's|listen\s+80|&80|g' /etc/nginx/conf.d/default.conf \ - && touch /var/run/nginx.pid \ - && mkdir -p /var/cache/nginx \ - && chown -R nginx:nginx /etc/nginx /var/log/nginx /var/cache/nginx /var/run/nginx.pid + && apt-get update \ + && apt-get install -y --no-install-suggests \ + ca-certificates \ + curl \ + dnsutils \ + iputils-ping \ + libcurl4-openssl-dev \ + libyajl-dev \ + libxml2 \ + lua5.1-dev \ + net-tools \ + procps \ + tcpdump \ + rsync \ + unzip \ + vim-tiny \ + libmaxminddb0 \ + libbrotli1 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && ldconfig -v \ + && ls /etc/nginx/modules/*.so | grep -v debug \ + | xargs -I{} sh -c 'echo "load_module {};" | tee -a /etc/nginx/modules/all.conf' \ + && sed -i -E 's|listen\s+80|&80|g' /etc/nginx/conf.d/default.conf \ + && touch /var/run/nginx.pid \ + && mkdir -p /var/cache/nginx \ + && chown -R nginx:nginx /etc/nginx /var/log/nginx /var/cache/nginx /var/run/nginx.pid EXPOSE 8080 8443 From 82928c67ddd97792e625ab231e77f3d225836867 Mon Sep 17 00:00:00 2001 From: ravilock Date: Thu, 10 Jul 2025 16:31:02 -0300 Subject: [PATCH 3/5] chore(deps): update build dependencies and module branch - Remove unnecessary 'libmsgpack-dev' from apt-get install in Dockerfile, as msgpack is now built from source. - Update ngx-http-limit-req-rw-module to use 'read-write-fix' branch instead of 'v0.3.0' in flavors.json for improved compatibility. --- Dockerfile | 2 +- flavors.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe2d665..b34b4ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN set -x \ && apt-get install -y --no-install-suggests \ libluajit-5.1-dev libpam0g-dev zlib1g-dev libpcre3-dev libpcre2-dev \ libexpat1-dev git curl build-essential lsb-release libxml2 libxslt1.1 libxslt1-dev autoconf libtool libssl-dev \ - unzip libmaxminddb-dev libbrotli-dev cmake pkg-config libjansson-dev libmsgpack-dev + unzip libmaxminddb-dev libbrotli-dev cmake pkg-config libjansson-dev RUN git clone --depth 1 --branch cpp-3.1.0 https://github.com/msgpack/msgpack-c.git /home/msgpack RUN cd /home/msgpack \ diff --git a/flavors.json b/flavors.json index a0d1953..97d2f91 100644 --- a/flavors.json +++ b/flavors.json @@ -9,7 +9,7 @@ "https://github.com/openresty/echo-nginx-module.git", "https://github.com/openresty/headers-more-nginx-module.git", "https://github.com/tsuru/ngx-location-name-module.git:main", - "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:v0.3.0", + "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:read-write-fix", "https://github.com/FRiCKLE/ngx_cache_purge.git:pr-45", "https://github.com/wandenberg/nginx-push-stream-module.git", "https://github.com/vozlt/nginx-module-vts.git:v0.2.4", From 8d8c7ec94ccf032d0ba68f63c5573aac1b4f9597 Mon Sep 17 00:00:00 2001 From: ravilock Date: Wed, 30 Jul 2025 10:53:27 -0300 Subject: [PATCH 4/5] fix(flavor): use main branch for limit-req-rw module Switched ngx-http-limit-req-rw-module from the 'read-write-fix' branch to the 'main' branch in flavors.json. This ensures compatibility with the latest upstream changes and simplifies future updates. --- flavors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flavors.json b/flavors.json index 97d2f91..80dd01c 100644 --- a/flavors.json +++ b/flavors.json @@ -9,7 +9,7 @@ "https://github.com/openresty/echo-nginx-module.git", "https://github.com/openresty/headers-more-nginx-module.git", "https://github.com/tsuru/ngx-location-name-module.git:main", - "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:read-write-fix", + "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:main", "https://github.com/FRiCKLE/ngx_cache_purge.git:pr-45", "https://github.com/wandenberg/nginx-push-stream-module.git", "https://github.com/vozlt/nginx-module-vts.git:v0.2.4", From 85e8c53851edb9fbd2d1bfd9468b895c3de7c065 Mon Sep 17 00:00:00 2001 From: ravilock Date: Fri, 8 Aug 2025 14:29:36 -0300 Subject: [PATCH 5/5] chore: bump ngx-http-limit-req-rw module to v0.3.2 --- flavors.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flavors.json b/flavors.json index 80dd01c..571615d 100644 --- a/flavors.json +++ b/flavors.json @@ -9,7 +9,7 @@ "https://github.com/openresty/echo-nginx-module.git", "https://github.com/openresty/headers-more-nginx-module.git", "https://github.com/tsuru/ngx-location-name-module.git:main", - "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:main", + "https://github.com/tsuru/ngx-http-limit-req-rw-module.git:v0.3.2", "https://github.com/FRiCKLE/ngx_cache_purge.git:pr-45", "https://github.com/wandenberg/nginx-push-stream-module.git", "https://github.com/vozlt/nginx-module-vts.git:v0.2.4",