Commit Graph

139 Commits

Author SHA1 Message Date
Christian Marangi 4c4e49064a
nginx: drop deprecated luci.module in module.d
Since we moved to automatic loading of dynamic modules, we need to drop
the previous include luci.module or we end up with nginx failing to
start for old configurations.

Fixes: caffa410ed ("nginx: autoload dynamic modules")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-09 19:29:49 +02:00
Sean Khan 97082f12a6
nginx: QUIC: Fix SSL 3.0 deprecated function
`EVP_CIPHER_CTX_cipher()` function was deprecated in OpenSSL 3.0.
As per OpenSSL's recommendation (https://www.openssl.org/docs/manmaster/man3/EVP_CIPHER_CTX_get0_cipher.html)
switch to using `EVP_CIPHER_CTX_get0_cipher()` instead.

With this change and recent commit to nginx-util #23935. We should now
be able to build nginx + modules with fully compliant calls to OpenSSL
3.0+ with legacy features disabled.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/packages/pull/24005
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-06 23:31:34 +02:00
Christian Marangi 2750b16b47
nginx: bump to 1.25.5 release
Bump nginx to 1.25.5 release.

Patch automatically refreshed with make package/nginx/refresh.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-21 17:47:59 +02:00
Sean Khan 660aa8091f nginx: Use zst + APK style packaging for modules
Generates git tarballs in the new APK style format:

Note that `SOURCE_DATE` was added and need to be updated
as the commit date of the commit hash

Before:
```
nginx-mod-geoip2-1cabd8a1f68ea3998f94e9f3504431970f848fbf.tar.xz
nginx-mod-headers-more-bea1be3bbf6af28f6aa8cf0c01c07ee1637e2bd0.tar.xz
nginx-mod-brotli-25f86f0bac1101b6512135eac5f93c49c63609e3.tar.xz
nginx-mod-rtmp-f0ea62342a4eca504b311cd5df910d026c3ea4cf.tar.xz
nginx-mod-ts-ef2f874d95cc75747eb625a292524a702aefb0fd.tar.xz
nginx-mod-naxsi-d714f1636ea49a9a9f4f06dba14aee003e970834.tar.xz
nginx-mod-lua-c89469e920713d17d703a5f3736c9335edac22bf.tar.xz
nginx-mod-lua-resty-core-2e2b2adaa61719972fe4275fa4c3585daa0dcd84.tar.xz
nginx-mod-lua-resty-lrucache-52f5d00403c8b7aa8a4d4f3779681976b10a18c1.tar.xz
nginx-mod-dav-ext-f5e30888a256136d9c550bf1ada77d6ea78a48af.tar.xz
nginx-mod-ubus-b2d7260dcb428b2fb65540edb28d7538602b4a26.tar.xz
```

After:
```
nginx-mod-geoip2-2020.01.22~1cabd8a1.tar.zst
nginx-mod-headers-more-2022.07.17~bea1be3b.tar.zst
nginx-mod-brotli-2020.04.23~25f86f0b.tar.zst
nginx-mod-rtmp-2018.12.07~f0ea6234.tar.zst
nginx-mod-ts-2017.12.04~ef2f874d.tar.zst
nginx-mod-naxsi-2022.09.14~d714f163.tar.zst
nginx-mod-lua-2023.08.19~c89469e9.tar.zst
nginx-mod-lua-resty-core-2023.09.09~2e2b2ada.tar.zst
nginx-mod-lua-resty-lrucache-2023.08.06~52f5d004.tar.zst
nginx-mod-dav-ext-2018.12.17~f5e30888.tar.zst
nginx-mod-ubus-2020.09.06~b2d7260d.tar.zst
```

Run tested: aarch64, Dynalink DL-WRX36, Master Branch

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-18 13:11:31 +02:00
Sean Khan caffa410ed nginx: autoload dynamic modules
In current setup, dynamic modules are not autoloaded, requiring users
to create and load additional config files.

We should assume that if a user installs additional modules, they want
them 'on' by default.

This commit does the following:

1.) generates a module load config in '/etc/nginx/modules.d' with the
    format '${module_name}'.module
    (i.e. /etc/nginx/modules.d/ngx_http_geoip2.module)
2.) deletes previous module conf for 'luci'
    /etc/nginx/modules.d/luci.module if it exists, this will prevent
    'module already loaded' errors.

The following is a portion of the final output when using the
default uci template `/etc/nginx/uci.conf.template` (via nginx-util):

```
nginx -T -c '/etc/nginx/uci.conf'

load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so;

load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so;

load_module /usr/lib/nginx/modules/ngx_http_dav_ext_module.so;

load_module /usr/lib/nginx/modules/ngx_http_geoip2_module.so;

load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so;

load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;

load_module /usr/lib/nginx/modules/ngx_http_naxsi_module.so;

load_module /usr/lib/nginx/modules/ngx_http_ts_module.so;

load_module /usr/lib/nginx/modules/ngx_http_ubus_module.so;

load_module /usr/lib/nginx/modules/ngx_rtmp_module.so;

load_module /usr/lib/nginx/modules/ngx_stream_module.so;

load_module /usr/lib/nginx/modules/ngx_stream_geoip2_module.so;
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-18 13:02:42 +02:00
Sean Khan 4cc682c8a4 nginx: fix geoip2 dependency on mod ngx_stream
Since the geoip2 package contains both `http` and `stream` versions. It
requires the module `ngx_stream` be installed and loaded and produces
the error:

```
2024/04/12 18:38:18 [emerg] 4402#0: dlopen()
"/usr/lib/nginx/modules/ngx_stream_geoip2_module.so" failed (Error
relocating /usr/lib/nginx/modules/ngx_stream_geoip2_module.so:
ngx_stream_complex_value: symbol not found) in
/etc/nginx/module.d/ngx_stream_geoip2.module:1 nginx: configuration file
/etc/nginx/uci.conf test failed
```

Add dependency so it's built at build time and installed automatically
by `opkg`

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-18 13:00:20 +02:00
Christian Marangi 88fdab5d77
nginx: add patch to fix compilation error on mips targets
Add patch to fix compilation error on mips targets. This was triggered
after enabling LTO. It was discovered that -fPIC is enabled on building
dynamic modules in CFLAGS but was missing on linking them. This patch
adds the missing -fPIC also on linking.

Fixes: 3b13b08ad9 ("nginx: Fix compilation with LTO")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-06 17:02:58 +02:00
Christian Marangi 9d809674e3
nginx: drop redundant --with-cc-opt configure arg
Drop redundant --with-cc-opt configure arg to mute warning of
cc1: note: someone does not honour COPTS correctly, passed 2 times.

CFLAGS are already parsed and correctly applied without this option and
adding it just makes the CFLAGS appended twice.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-06 16:56:14 +02:00
Jan Klos ae870abc89 nginx: update to 1.25.4
Signed-off-by: Jan Klos <jan@klos.xyz>
2024-03-26 16:46:42 +01:00
Andreas Gnau 3b13b08ad9 nginx: Fix compilation with LTO
When CONFIG_USE_LTO=y, the int-size detection script will fail because a
variable gets optimised out. Mark it as volatile to fix the issue.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2024-03-20 11:36:08 -07:00
Tiago Gaspar 5f16794b5f nginx: update to 1.25.3
Update nginx to the latest version.

Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
2024-01-04 22:35:17 +01:00
Christian Marangi bb9d02be03 nginx: add option to compile STREAM REAL IP module
Add option to compile STREAM REAL IP module.

Closes: #22310
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-22 14:28:34 +02:00
Christian Marangi 32d53eae35
nginx: fix nginx lua module compilation error
Add pending patch fixing compilation error for missing pcre.h.

This is caused by a bug on their end by trying to add pcre.h even if we
are using the PCRE2 library.

Fixes: f0754531c4 ("nginx: move to PCRE2")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-13 20:35:42 +02:00
Christian Marangi 5c1bcb6133
treewide: add HAS_LUAJIT_ARCH dependency to luajit user
Add HAS_LUAJIT_ARCH dependency to any user of luajit to fix circular
dependency limitation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-25 17:42:02 +02:00
Christian Marangi 0e0b90812a
nginx: switch to real name for Ansuel maintainer
Switch to real name for Ansuel maintainer and drop nickname.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 15:54:02 +02:00
Christian Marangi 30b85f4954
nginx: bump naxsi module to latest git HEAD
Bump naxsi module to latest git HEAD to fix compilation error with pcre2
library.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 15:47:44 +02:00
Christian Marangi f0754531c4
nginx: move to PCRE2
Move nginx to PCRE2 now that lua modules supports it.
nginx ebaled PCRE2 by default so we simply revert the config to revert
it.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 14:55:02 +02:00
Christian Marangi 6bba36078e
nginx: add patches to lua modules for experimental PCRE2 support
Add patches to lua modules for experimental PCRE2 support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 14:55:02 +02:00
Christian Marangi fa1001268c
nginx: update lua modules to latest git HEAD
Update lua modules to latest git HEAD to prepare for support for PCRE2
patches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 14:55:02 +02:00
Javier Marcet 266be55d55
nginx: add required modules for Openresty lua module
Add nginx-mod-lua-resty-core and nginx-mod-lua-resty-lrucache new module
required for the lua module to correctly works.

The module are based on luajit2 from Openresty.

Signed-off-by: Javier Marcet <javier@marcet.info>
[ improve commit description/tile and fix redundant dependency ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-09-22 14:55:01 +02:00
Tiago Gaspar 7a585741e4 nginx: brotli: update to the latest version
Update brotli to the latest version.

Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
2023-09-22 13:16:27 +02:00
Tiago Gaspar c3c5018742 nginx: update nginx to 1.25.2
Update nginx to the latest version.
This brings mainly fixes to HTTP/3 (QUIC).

Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
2023-09-22 13:16:27 +02:00
Christian Marangi 3d0183e9c5
nginx: don't install all module for FULL variant
We currently have a more or less circular dependency with nginx ssl and
full variant.

FULL variant depends on every nginx module. Every nginx module depends
on nginx-ssl.

Since nginx-full depends on an nginx module, nginx-ssl is installed as
module depends on it and then the installation fails as nginx-full
conflicts with nginx-ssl.

nginx-full in it's meaning is nginx built with every config selected and
it should not have module as dependency. In fact an user should always
install them separetly as while other things, local modification to the
nginx config file are required to include the just installed module.

To fix this circular dependency problem, drop the dependency of every
nginx module for FULL variant.

Fixes: #21300
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-07 12:50:12 +02:00
Tiago Gaspar 34e73bddab nginx: add quic modue
This commit  adds support for http/3. This is an experimental version
and isn't fully supported because nginx is being built with the regular
OpenSSL and the regular one doesn't support quic.

Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
2023-07-05 21:27:16 +02:00
Tiago Gaspar f2c0fa9206 nginx: update to 1.25.1
Update nginx to 1.25.1.

    *) Feature: the "http2" directive, which enables HTTP/2 on a per-server
       basis; the "http2" parameter of the "listen" directive is now
       deprecated.

    *) Change: HTTP/2 server push support has been removed.

    *) Change: the deprecated "ssl" directive is not supported anymore.

    *) Bugfix: in HTTP/3 when using OpenSSL.

Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
[ improve commit title and add nginx changelog ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-05 21:27:16 +02:00
Javier Marcet 659fe23a90 nginx: add support for MaxMind GeoIP2 databases
Signed-off-by: Javier Marcet <javier@marcet.info>
2023-07-05 20:54:44 +02:00
Christian Marangi 9365622f27
nginx: create empty directory for module.d include
Fix a bug on installation of nginx-mod-luci where module.d directory
is not found and luci.module creation fails.
Correctly create empty directory for module.d include for dynamic module
loading by placing file in this directory.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-06-12 17:08:40 +02:00
Christian Marangi 3f080e484e
nginx: bump to new 1.25.0 release
Bump nginx to new 1.25.0 release.
Changes:

 *) Feature: experimental HTTP/3 support.

Every patch automatically refreshed.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-06-11 10:07:43 +02:00
Christian Marangi add3cbfcd3
nginx: fix problem with migration of uci conf template
Fix some problem with migration of uci conf template and include of
module.d directive.

Fix 2 case:
- uci.conf.template not versioned but with the include module.d
  resulting in double include module.d

- uci.conf.template version 1.1 with the include module.d at the end
  of the config. This is problematic for nginx as modules must be
  included before any http directive.

Handle this 2 case to restore a working uci.conf.template configuration
on migrated config.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-06-11 04:36:12 +02:00
Glen Huang 7b91373bd1 nginx: refactor Makefile
Make modules follow a naming convention, which enables:

1. Inline ADDITIONAL_MODULES into CONFIGURE_ARGS
2. Consolidate some parts of Quilt and Download for each module into
BuildModule

Signed-off-by: Glen Huang <me@glenhuang.com>
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-26 13:51:50 +02:00
Glen Huang f5d7a26531 nginx: make nginx-mod-luci depend on nginx-ssl
Change dependency from nginx virtual migration package to nginx-ssl for
nginx-mod-luci nginx module package.

Signed-off-by: Glen Huang <me@glenhuang.com>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-26 13:51:50 +02:00
Glen Huang 57eb73ae63
nginx: add configure flag --with-compat
Without it, nginx could complain about incompatible dynamic modules

Signed-off-by: Glen Huang <me@glenhuang.com>
[ fix conflict error on cherry-pick ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-20 23:18:00 +02:00
Christian Marangi 6a3cc76ea5
nginx: introduce migration for old uci conf template
Introduce support for migration of old uci conf template to new version.
Uci conf template are saved in config backup. This cause problem on config
restore as old config template might have compatibility problem with new
nginx implementation.

Add logic to migrate the template script at runtime to correctly align
to latest change from nginx and nginx-util.

Fixes: 65a676ed56 ("nginx: introduce support for dynamic modules")
Fixes: #20904
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-20 23:18:00 +02:00
Christian Marangi 8c704f2ccc
nginx: fix compilation error for nginx-full
Fix compilation error for stream module not converted to use the PACKAGE
config flag and a missing required dependency for the DAV ext module.

Drop additional config for STREAM module since they are now included and
built by default.

Fixes: 65a676ed56 ("nginx: introduce support for dynamic modules")
Fixes: #20906
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-06 07:17:25 +02:00
Christian Marangi c4b27ff6d5
nginx: rename nginx-all-module to nginx-full
Rename nginx-all-module to nginx-full to follow pattern used by other
package and other projects.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-27 06:14:58 +02:00
Christian Marangi 4611ca0b0a
nginx: update to 1.24.0 and update headers-more module
Update nginx to 1.24.0 and update headers-more module to fix compilation
error.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-27 06:14:58 +02:00
Christian Marangi cfce21ffea
nginx: update lua module to latest openresty version
Update lua module to latest openrestry version. Additional config are
required to correctly use it.

Switch it to luajit from liblua as this is what is currently supported
for the module since plain lua support was dropped from the module.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-27 06:14:58 +02:00
Christian Marangi 65a676ed56
nginx: introduce support for dynamic modules
Start building sub package that provide dynamic modules.

Each module needs to be loaded using load_modules.
Refer to nginx documentation on how to use this.

This should result in lower memory usage as only used module are loaded.

Also fix the uci-default scripts to add the required ubus module for
luci module.

-fvisibility=hidden is needed to be dropped to correctly support loading
dynamic modules.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-27 06:14:57 +02:00
Christian Marangi 8b144f0dc3
nginx: split DAV_EXT from standard nginx DAV config
Split DAV_EXT from standard nginx DAV config as additional WebDAV
methods are provided by an external module.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-20 07:45:30 +02:00
Andre Heider 35f4ef76e0 treewide: refactor to use PKG_BUILD_FLAGS:=gc-sections
See commit da370098 "treewide: add support for "gc-sections" in
PKG_BUILD_FLAGS" on the main repository.

Note: This only touches packages which use all three parts
(-ffunction-sections, -fdata-sections and -Wl,--gc-sections) enabled by
this build flag. Some packages only use a subset, and these are left
unchanged for now.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Glen Huang 230c2d5fc4 acme: update changed packages' versions
Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:48:34 +08:00
Glen Huang 7f04710579 amce: use procd to restart services
Directly calling `/etc/init.d/<service> reload` in a hotplug script can
inadvertently start a stopped service.

Signed-off-by: Glen Huang <i@glenhuang.com>
2022-10-24 10:07:06 +08:00
Jianhui Zhao 33a93e20a6 nginx: support gzip static mudule
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2022-08-23 22:19:07 -07:00
Glen Huang e84f651453 acme: use the hotplug system
Signed-off-by: Glen Huang <heyhgl@gmail.com>
2022-08-16 00:32:04 +02:00
Javier Marcet 19596a013c nginx: add scgi_params if CONFIG_NGINX_HTTP_SCGI=y
Signed-off-by: Javier Marcet <javier@marcet.info>
2021-10-30 14:59:14 -07:00
Peter Stadler 55c3bc14f7 nginx, python3-{asgiref,django-cors-headers,drf-nested-routers,sqlparse}: bump versions
Update to the newest versions and switch to $(AUTORELEASE) for the python3 packages (where I am the maintainer).

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
2021-10-30 01:12:02 -07:00
Ansuel Smith e9617f5532
nginx: bump to 1.21.1 and improve makefile
- Bump to 1.21.1
- Rework makefile to fix bad make refresh
- Refresh patch

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-22 18:49:03 +02:00
Jan Bubík 037f4ec4e4 nginx: make nginx-rtmp module BigEndian friendly
Signed-off-by: Jan Bubík <jbubik@centrum.cz>
2021-04-28 01:01:24 +02:00
Rosen Penev de176d6f6f nginx: fix compilation with BUILD_NLS
Requires nls.mk because of libxml2.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-06 14:06:19 -08:00
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00