diff -Nru angie-1.5.0/debian/changelog angie-1.5.0/debian/changelog --- angie-1.5.0/debian/changelog 2024-03-28 00:34:25.000000000 +0000 +++ angie-1.5.0/debian/changelog 2024-04-22 12:21:52.000000000 +0000 @@ -1,11 +1,11 @@ -angie (1.5.0-4myguard2~noble) noble; urgency=medium +angie (1.5.0-4myguard3~noble) noble; urgency=medium * Full rebuild and backport with latest Mainline * Merged with the source package from Debian Trixie in november 2023 * See for more information https://deb.myguard.nl/nginx-modules/ * Changelog: https://deb.myguard.nl/forums/topic/changelog/ - -- Thijs Eilander Thu, 28 Mar 2024 01:34:25 +0100 + -- Thijs Eilander Mon, 22 Apr 2024 14:21:52 +0200 angie (1.24.0-2) unstable; urgency=medium diff -Nru angie-1.5.0/debian/modules/http-captcha/.keepalive angie-1.5.0/debian/modules/http-captcha/.keepalive --- angie-1.5.0/debian/modules/http-captcha/.keepalive 2024-02-23 20:41:45.000000000 +0000 +++ angie-1.5.0/debian/modules/http-captcha/.keepalive 2024-04-22 12:21:52.000000000 +0000 @@ -1 +1 @@ -1708542550 +1712862567 diff -Nru angie-1.5.0/debian/modules/http-geoip2/README.md angie-1.5.0/debian/modules/http-geoip2/README.md --- angie-1.5.0/debian/modules/http-geoip2/README.md 2023-11-12 16:58:05.000000000 +0000 +++ angie-1.5.0/debian/modules/http-geoip2/README.md 2024-04-22 12:21:52.000000000 +0000 @@ -18,9 +18,8 @@ ##### To build as a dynamic module (nginx 1.9.11+): ``` -./configure --add-dynamic-module=/path/to/ngx_http_geoip2_module -make -make install +./configure --with-compat --add-dynamic-module=/path/to/ngx_http_geoip2_module +make modules ``` This will produce ```objs/ngx_http_geoip2_module.so```. It can be copied to your nginx module path manually if you wish. diff -Nru angie-1.5.0/debian/modules/http-headers-more-filter/.keepalive angie-1.5.0/debian/modules/http-headers-more-filter/.keepalive --- angie-1.5.0/debian/modules/http-headers-more-filter/.keepalive 2024-02-23 20:41:46.000000000 +0000 +++ angie-1.5.0/debian/modules/http-headers-more-filter/.keepalive 2024-04-22 12:21:52.000000000 +0000 @@ -1 +1 @@ -1708196796 +1712603229 diff -Nru angie-1.5.0/debian/modules/http-lua/src/ngx_http_lua_bodyfilterby.c angie-1.5.0/debian/modules/http-lua/src/ngx_http_lua_bodyfilterby.c --- angie-1.5.0/debian/modules/http-lua/src/ngx_http_lua_bodyfilterby.c 2023-11-12 16:58:29.000000000 +0000 +++ angie-1.5.0/debian/modules/http-lua/src/ngx_http_lua_bodyfilterby.c 2024-04-22 12:21:52.000000000 +0000 @@ -532,9 +532,23 @@ if (last) { ctx->seen_last_in_filter = 1; - /* the "in" chain cannot be NULL and we set the "last_buf" or - * "last_in_chain" flag in the last buf of "in" */ + /* the "in" chain cannot be NULL except that we set arg[1] = "" + * before arg[2] = true + */ + if (in == NULL) { + in = ngx_http_lua_chain_get_free_buf(r->connection->log, + r->pool, + &ctx->free_bufs, 0); + if (in == NULL) { + return luaL_error(L, "no memory"); + } + in->buf->tag = (ngx_buf_tag_t) &ngx_http_lua_body_filter; + lmcf->body_filter_chain = in; + } + + /* we set the "last_buf" or "last_in_chain" flag + * in the last buf of "in" */ for (cl = in; cl; cl = cl->next) { if (cl->next == NULL) { if (r == r->main) { diff -Nru angie-1.5.0/debian/modules/http-lua/t/082-body-filter-2.t angie-1.5.0/debian/modules/http-lua/t/082-body-filter-2.t --- angie-1.5.0/debian/modules/http-lua/t/082-body-filter-2.t 2023-12-31 22:30:16.000000000 +0000 +++ angie-1.5.0/debian/modules/http-lua/t/082-body-filter-2.t 2024-04-22 12:21:52.000000000 +0000 @@ -225,3 +225,47 @@ [error] [alert] [crit] + + + +=== TEST 4: set resp body nil with ngx.arg[1] first +--- config + location /t { + content_by_lua_block { + ngx.say("Hello World!") + } + + body_filter_by_lua_block { + ngx.arg[1] = "" + ngx.arg[2] = true + } + } +--- request +GET /t +--- response_body +--- no_error_log +[error] +[alert] +[crit] + + + +=== TEST 5: set resp body nil with ngx.arg[2] first +--- config + location /t { + content_by_lua_block { + ngx.say("Hello World!") + } + + body_filter_by_lua_block { + ngx.arg[2] = true + ngx.arg[1] = "" + } + } +--- request +GET /t +--- response_body +--- no_error_log +[error] +[alert] +[crit] diff -Nru angie-1.5.0/debian/modules/http-modsecurity/.editorconfig angie-1.5.0/debian/modules/http-modsecurity/.editorconfig --- angie-1.5.0/debian/modules/http-modsecurity/.editorconfig 1970-01-01 00:00:00.000000000 +0000 +++ angie-1.5.0/debian/modules/http-modsecurity/.editorconfig 2024-04-22 12:21:52.000000000 +0000 @@ -0,0 +1,9 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +indent_style = space +indent_size = 4 + diff -Nru angie-1.5.0/debian/modules/http-trim-filter/config.175 angie-1.5.0/debian/modules/http-trim-filter/config.175 --- angie-1.5.0/debian/modules/http-trim-filter/config.175 1970-01-01 00:00:00.000000000 +0000 +++ angie-1.5.0/debian/modules/http-trim-filter/config.175 2024-04-22 12:21:52.000000000 +0000 @@ -0,0 +1,16 @@ +ngx_addon_name=ngx_http_trim_filter_module +HTTP_TRIM_FILTER_SRCS="$ngx_addon_dir/ngx_http_trim_filter_module.c" + +if test -n "$ngx_module_link"; then + ngx_module_type=HTTP_AUX_FILTER + ngx_module_name=ngx_http_trim_filter_module + ngx_module_incs= + ngx_module_deps= + ngx_module_srcs=$HTTP_TRIM_FILTER_SRCS + ngx_module_libs= + + . auto/module +else + HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_trim_filter_module" + NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HTTP_TRIM_FILTER_SRCS" +fi diff -Nru angie-1.5.0/debian/modules/http-trim-filter/ngx_http_trim_filter_module.c.175 angie-1.5.0/debian/modules/http-trim-filter/ngx_http_trim_filter_module.c.175 --- angie-1.5.0/debian/modules/http-trim-filter/ngx_http_trim_filter_module.c.175 1970-01-01 00:00:00.000000000 +0000 +++ angie-1.5.0/debian/modules/http-trim-filter/ngx_http_trim_filter_module.c.175 2024-04-22 12:21:52.000000000 +0000 @@ -0,0 +1,2139 @@ + +/* + * Copyright (C) 2010-2013 Alibaba Group Holding Limited + */ + + +#include +#include +#include + + +#define NGX_HTTP_TRIM_FLAG "http_trim" + +#define NGX_HTTP_TRIM_SAVE_SLASH -1 +#define NGX_HTTP_TRIM_SAVE_JSCSS -2 +#define NGX_HTTP_TRIM_SAVE_SPACE -3 +#define NGX_HTTP_TRIM_SAVE_HACKCSS -4 +#define NGX_HTTP_TRIM_SAVE_JAVASCRIPT -5 + +#define NGX_HTTP_TRIM_TAG_PRE 1 +#define NGX_HTTP_TRIM_TAG_STYLE 2 +#define NGX_HTTP_TRIM_TAG_SCRIPT 3 +#define NGX_HTTP_TRIM_TAG_TEXTAREA 4 + +typedef struct { + ngx_hash_t types; + ngx_array_t *types_keys; + + ngx_http_complex_value_t *js; + ngx_http_complex_value_t *css; + ngx_http_complex_value_t *trim; +} ngx_http_trim_loc_conf_t; + + +typedef struct { + u_char prev; + + ngx_chain_t *in; + ngx_chain_t *free; + ngx_chain_t *busy; + + size_t looked; + size_t saved_comment; + + off_t tin; + off_t tout; + + ngx_int_t tag; + ngx_int_t saved; + ngx_int_t count; + ngx_uint_t state; + + unsigned js_enable:1; + unsigned css_enable:1; +} ngx_http_trim_ctx_t; + + +typedef enum { + trim_state_text = 0, + trim_state_text_whitespace, /* \r \t ' ' */ + trim_state_tag, /* < */ + trim_state_tag_text, + trim_state_tag_attribute, + trim_state_tag_whitespace, /* \r \n \t ' ' */ + trim_state_tag_single_quote, /* ' */ + trim_state_tag_double_quote, /* " */ + trim_state_tag_s, /* */ + trim_state_tag_textarea_begin, /* "); +static ngx_str_t ngx_http_trim_comment_ie = ngx_string("[if"); +static ngx_str_t ngx_http_trim_comment_ie_end = ngx_string(""); + +static ngx_str_t ngx_http_trim_saved_html = ngx_string(" */ + ctx->saved_comment++; + continue; + case 'p': + ctx->state = trim_state_tag_pre_begin; + ctx->looked = 3; /* */ + break; + case 't': + ctx->state = trim_state_tag_textarea_begin; + ctx->looked = 3; /* */ + break; + case 's': + ctx->state = trim_state_tag_s; + break; + case '<': + break; + case '>': + ctx->state = trim_state_text; + break; + default: + if ((ch >= 'a' && ch <= 'z') || ch == '/') { + ctx->state = trim_state_tag_text; + + } else { + ctx->state = trim_state_text; + } + break; + } + + if ((size_t) (read - buf->pos) >= ctx->saved_comment) { + write = ngx_cpymem(write, ngx_http_trim_saved_html.data, + ctx->saved_comment); + + } else { + ctx->saved = ctx->saved_comment; + } + + if (ctx->state == trim_state_tag + || ctx->state == trim_state_text_whitespace) + { + ctx->prev = '<'; + continue; + } + + break; + + case trim_state_tag_text: + switch (ch) { + case '\r': + case '\n': + case '\t': + case ' ': + ctx->state = trim_state_tag_whitespace; + continue; + case '>': + ctx->state = trim_state_text; + break; + default: + break; + } + break; + + case trim_state_tag_attribute: + switch (ch) { + case '\r': + case '\n': + case '\t': + case ' ': + if (ctx->prev != '=') { + ctx->state = trim_state_tag_whitespace; + } + continue; + case '\'': + ctx->state = trim_state_tag_single_quote; + break; + case '"': + ctx->state = trim_state_tag_double_quote; + break; + case '>': + if (ctx->tag == NGX_HTTP_TRIM_TAG_PRE) { + ctx->state = trim_state_tag_pre; + + } else if (ctx->tag == NGX_HTTP_TRIM_TAG_TEXTAREA) { + ctx->state = trim_state_tag_textarea_end; + + } else if (ctx->tag == NGX_HTTP_TRIM_TAG_SCRIPT) { + if (ctx->js_enable + && ctx->looked == ngx_http_trim_script_js.len) + { + ctx->state = trim_state_tag_script_js_text; + + } else { + ctx->state = trim_state_tag_script_end; + } + + } else if (ctx->tag == NGX_HTTP_TRIM_TAG_STYLE) { + if (ctx->css_enable + && ctx->looked == ngx_http_trim_style_css.len) + { + ctx->state = trim_state_tag_style_css_text; + + } else { + ctx->state = trim_state_tag_style_end; + } + + } else { + ctx->state = trim_state_text; + } + + ctx->tag = 0; + ctx->looked = 0; + break; + default: + break; + } + break; + + case trim_state_tag_s: + switch (ch) { + case '\r': + case '\n': + case '\t': + case ' ': + ctx->state = trim_state_tag_whitespace; + continue; + case 't': + ctx->state = trim_state_tag_style_begin; + ctx->looked = 4; /* */ + break; + case 'c': + ctx->state = trim_state_tag_script_begin; + ctx->looked = 4; /* */ + break; + case '>': + ctx->state = trim_state_text; + break; + default: + ctx->state = trim_state_tag_text; + break; + } + break; + + case trim_state_comment_begin: + look = ngx_http_trim_comment.data[ctx->looked++]; + if (ch == look) { + if (ctx->looked == ngx_http_trim_comment.len - 1) { /* --> */ + ctx->state = trim_state_comment_hack_begin; + ctx->looked = 0; + } + + ctx->saved_comment++; + continue; + } + + switch (ch) { + case '\r': + case '\n': + case '\t': + case ' ': + ctx->state = trim_state_tag_whitespace; + continue; + case '>': + ctx->state = trim_state_text; + break; + default: + ctx->state = trim_state_tag_text; + break; + } + + if ((size_t) (read - buf->pos) >= ctx->saved_comment) { + write = ngx_cpymem(write, ngx_http_trim_saved_html.data, + ctx->saved_comment); + + } else { + ctx->saved = ctx->saved_comment; + } + + break; + + case trim_state_comment_hack_begin: + switch (ch) { + case '#': + ctx->state = trim_state_comment_hack_end; + ctx->looked = 0; + break; + case 'e': + ctx->state = trim_state_comment_hack_end; + ctx->looked = 0; + break; + case '[': + ctx->state = trim_state_comment_ie_begin; + ctx->looked = 1; + ctx->saved_comment++; + continue; + case '-': + ctx->state = trim_state_comment_end; + ctx->looked = 1; + continue; + default: + ctx->state = trim_state_comment_end; + ctx->looked = 0; + continue; + } + + if ((size_t) (read - buf->pos) >= ctx->saved_comment) { + write = ngx_cpymem(write, ngx_http_trim_saved_html.data, + ctx->saved_comment); + + } else { + ctx->saved = ctx->saved_comment; + } + + break; + + case trim_state_comment_ie_begin: + look = ngx_http_trim_comment_ie.data[ctx->looked++]; + if (ch == look) { + if (ctx->looked == ngx_http_trim_comment_ie.len) { /* [if */ + ctx->state = trim_state_comment_ie_end; + ctx->looked = 0; + + if ((size_t) (read - buf->pos) >= ctx->saved_comment) { + write = ngx_cpymem(write, ngx_http_trim_saved_html.data, + ctx->saved_comment); + + } else { + ctx->saved = ctx->saved_comment; + } + + break; + } + + ctx->saved_comment++; + continue; + } + + switch (ch) { + case '-': + ctx->state = trim_state_comment_end; + ctx->looked = 1; + break; + default: + ctx->state = trim_state_comment_end; + ctx->looked = 0; + break; + } + + continue; + + case trim_state_tag_pre_begin: + look = ngx_http_trim_pre.data[ctx->looked++]; /*
 */
+            if (ch == look) {
+                if (ctx->looked == ngx_http_trim_pre.len) {
+                    ctx->state = trim_state_tag_pre;
+                    ctx->count = 1;
+                    ctx->looked = 0;
+                }
+                break;
+            }
+
+            switch (ch) {
+            case '\r':
+            case '\n':
+            case '\t':
+            case ' ':
+                if (ctx->looked == ngx_http_trim_pre.len) {
+                    ctx->tag = NGX_HTTP_TRIM_TAG_PRE;
+                    ctx->count = 1;
+                }
+
+                ctx->state = trim_state_tag_whitespace;
+                ctx->looked = 0;
+                continue;
+            case '>':
+                ctx->state = trim_state_text;
+                break;
+            default:
+                ctx->state = trim_state_tag_text;
+                break;
+            }
+            break;
+
+        case trim_state_tag_textarea_begin:
+            look = ngx_http_trim_textarea.data[ctx->looked++]; /*