Saturday, May 09, 2026 AM03:21:24 HKT
This commit is contained in:
@@ -0,0 +1,220 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.18.0
|
||||
pkgrel=13
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb nginx-1.18.0.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,222 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.18.0
|
||||
pkgrel=15
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz
|
||||
CVE-2021-23017.patch"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb nginx-1.18.0.tar.gz
|
||||
b8ed5dedc55f4e1c60f3c0b97836096e83a9f928b13c125fe568f5d369bb35535224c7def05677f04adc9733a983ac9cc8aa2c7af94468085eb3121c1817dc45 CVE-2021-23017.patch
|
||||
"
|
||||
@@ -0,0 +1,25 @@
|
||||
Patch-Source: http://nginx.org/download/patch.2021.resolver.txt
|
||||
|
||||
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
|
||||
--- a/src/core/ngx_resolver.c
|
||||
+++ b/src/core/ngx_resolver.c
|
||||
@@ -4008,15 +4008,15 @@ done:
|
||||
n = *src++;
|
||||
|
||||
} else {
|
||||
+ if (dst != name->data) {
|
||||
+ *dst++ = '.';
|
||||
+ }
|
||||
+
|
||||
ngx_strlow(dst, src, n);
|
||||
dst += n;
|
||||
src += n;
|
||||
|
||||
n = *src++;
|
||||
-
|
||||
- if (n != 0) {
|
||||
- *dst++ = '.';
|
||||
- }
|
||||
}
|
||||
|
||||
if (n == 0) {
|
||||
@@ -0,0 +1,221 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.20.1
|
||||
pkgrel=3
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
3d9fd4bf2740eaf20fcc3c77260a3556aaf9dff2879afc2dbb5fff364dea27313ffbc51d335e9fc9c0186a2a44dac055ef60fde0d411b8cf842fdf661478c961 nginx-1.20.1.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,221 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.20.2
|
||||
pkgrel=0
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8b65e881ea4ac6162cbf32e5e95cf47a6d5418819f8763ca4a781cffa38187dd7886d4bc195d000a7046111a27121ff25800f8645405174995247e6738b4279a nginx-1.20.2.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,223 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.20.2
|
||||
pkgrel=1
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz
|
||||
CVE-2021-3618.patch"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8b65e881ea4ac6162cbf32e5e95cf47a6d5418819f8763ca4a781cffa38187dd7886d4bc195d000a7046111a27121ff25800f8645405174995247e6738b4279a nginx-1.20.2.tar.gz
|
||||
5896417268cdd4cde1cc6a4cf9ebc3aa2c82cb4b27a68c1fa4e9c1065cf4e5f0eebc13cfdb2ac3ebe29fdc5332022a61681aceefe1c72c5402ce73fab3f03f5a CVE-2021-3618.patch
|
||||
"
|
||||
@@ -0,0 +1,92 @@
|
||||
Patch-Source: https://github.com/nginx/nginx/commit/173f16f736c10eae46cd15dd861b04b82d91a37a
|
||||
commit 173f16f736c10eae46cd15dd861b04b82d91a37a
|
||||
Author: Maxim Dounin <mdounin@mdounin.ru>
|
||||
Date: Wed May 19 03:13:31 2021 +0300
|
||||
|
||||
Mail: max_errors directive.
|
||||
|
||||
Similarly to smtpd_hard_error_limit in Postfix and smtp_max_unknown_commands
|
||||
in Exim, specifies the number of errors after which the connection is closed.
|
||||
|
||||
diff --git a/src/mail/ngx_mail.h b/src/mail/ngx_mail.h
|
||||
index 07104df6..21178c3e 100644
|
||||
--- a/src/mail/ngx_mail.h
|
||||
+++ b/src/mail/ngx_mail.h
|
||||
@@ -115,6 +115,8 @@ typedef struct {
|
||||
ngx_msec_t timeout;
|
||||
ngx_msec_t resolver_timeout;
|
||||
|
||||
+ ngx_uint_t max_errors;
|
||||
+
|
||||
ngx_str_t server_name;
|
||||
|
||||
u_char *file_name;
|
||||
@@ -231,6 +233,7 @@ typedef struct {
|
||||
ngx_uint_t command;
|
||||
ngx_array_t args;
|
||||
|
||||
+ ngx_uint_t errors;
|
||||
ngx_uint_t login_attempt;
|
||||
|
||||
/* used to parse POP3/IMAP/SMTP command */
|
||||
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c
|
||||
index 40831242..115671ca 100644
|
||||
--- a/src/mail/ngx_mail_core_module.c
|
||||
+++ b/src/mail/ngx_mail_core_module.c
|
||||
@@ -85,6 +85,13 @@ static ngx_command_t ngx_mail_core_commands[] = {
|
||||
offsetof(ngx_mail_core_srv_conf_t, resolver_timeout),
|
||||
NULL },
|
||||
|
||||
+ { ngx_string("max_errors"),
|
||||
+ NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
|
||||
+ ngx_conf_set_num_slot,
|
||||
+ NGX_MAIL_SRV_CONF_OFFSET,
|
||||
+ offsetof(ngx_mail_core_srv_conf_t, max_errors),
|
||||
+ NULL },
|
||||
+
|
||||
ngx_null_command
|
||||
};
|
||||
|
||||
@@ -163,6 +170,8 @@ ngx_mail_core_create_srv_conf(ngx_conf_t *cf)
|
||||
cscf->timeout = NGX_CONF_UNSET_MSEC;
|
||||
cscf->resolver_timeout = NGX_CONF_UNSET_MSEC;
|
||||
|
||||
+ cscf->max_errors = NGX_CONF_UNSET_UINT;
|
||||
+
|
||||
cscf->resolver = NGX_CONF_UNSET_PTR;
|
||||
|
||||
cscf->file_name = cf->conf_file->file.name.data;
|
||||
@@ -182,6 +191,7 @@ ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
|
||||
30000);
|
||||
|
||||
+ ngx_conf_merge_uint_value(conf->max_errors, prev->max_errors, 5);
|
||||
|
||||
ngx_conf_merge_str_value(conf->server_name, prev->server_name, "");
|
||||
|
||||
diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c
|
||||
index 57503e9a..246ba97c 100644
|
||||
--- a/src/mail/ngx_mail_handler.c
|
||||
+++ b/src/mail/ngx_mail_handler.c
|
||||
@@ -874,7 +874,20 @@ ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c)
|
||||
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||
}
|
||||
|
||||
- if (rc == NGX_IMAP_NEXT || rc == NGX_MAIL_PARSE_INVALID_COMMAND) {
|
||||
+ if (rc == NGX_MAIL_PARSE_INVALID_COMMAND) {
|
||||
+
|
||||
+ s->errors++;
|
||||
+
|
||||
+ if (s->errors >= cscf->max_errors) {
|
||||
+ ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
+ "client sent too many invalid commands");
|
||||
+ s->quit = 1;
|
||||
+ }
|
||||
+
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
+ if (rc == NGX_IMAP_NEXT) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.22.0
|
||||
pkgrel=1
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
# --without-pcre2 - Lua module is not compatible with PCRE2 yet
|
||||
# https://github.com/openresty/lua-nginx-module/issues/1984
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--without-pcre2 \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
074782dba9cd5f8f493fbb57e20bda6dc9171814d919a47ee9f825d93f12c9f9d496e25d063c983191b55ad6a236bcef252ce16ecc1d253dc8b23433557559b1 nginx-1.22.0.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,225 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.22.1
|
||||
pkgrel=0
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
# --without-pcre2 - Lua module is not compatible with PCRE2 yet
|
||||
# https://github.com/openresty/lua-nginx-module/issues/1984
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--without-pcre2 \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
1d468dcfa9bbd348b8a5dc514ac1428a789e73a92384c039b73a51ce376785f74bf942872c5594a9fcda6bbf44758bd727ce15ac2395f1aa989c507014647dcc nginx-1.22.1.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,227 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.24.0
|
||||
pkgrel=3
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
hiredis-dev
|
||||
jansson-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
# --without-pcre2 - Lua module is not compatible with PCRE2 yet
|
||||
# https://github.com/openresty/lua-nginx-module/issues/1984
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--without-pcre2 \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
1114e37de5664a8109c99cfb2faa1f42ff8ac63c932bcf3780d645e5ed32c0b2ac446f80305b4465994c8f9430604968e176ae464fd80f632d1cb2c8f6007ff3 nginx-1.24.0.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,227 @@
|
||||
# Maintainer: Giovanni Dante Grazioli <wargio@libero.it>
|
||||
pkgname=nginx
|
||||
pkgver=1.24.0
|
||||
pkgrel=6
|
||||
pkgdesc="HTTP and reverse proxy server (stable version)"
|
||||
url="https://www.nginx.org/"
|
||||
arch="all"
|
||||
license="BSD-2-Clause"
|
||||
depends=""
|
||||
makedepends="
|
||||
brotli-dev
|
||||
gd-dev
|
||||
geoip-dev
|
||||
hiredis-dev
|
||||
jansson-dev
|
||||
libmaxminddb-dev
|
||||
libxml2-dev
|
||||
libxslt-dev
|
||||
linux-headers
|
||||
luajit-dev
|
||||
openssl-dev
|
||||
pcre-dev
|
||||
perl-dev
|
||||
pkgconf
|
||||
zeromq-dev
|
||||
zlib-dev
|
||||
"
|
||||
checkdepends="
|
||||
gd
|
||||
perl
|
||||
perl-fcgi
|
||||
perl-io-socket-ssl
|
||||
perl-net-ssleay
|
||||
perl-protocol-websocket
|
||||
tzdata
|
||||
uwsgi-python3
|
||||
"
|
||||
pkgusers="nginx"
|
||||
_grp_ngx="nginx"
|
||||
_grp_www="www-data"
|
||||
pkggroups="$_grp_ngx $_grp_www"
|
||||
install=""
|
||||
subpackages=""
|
||||
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
_modules_dir="usr/lib/$pkgname/modules"
|
||||
|
||||
# For simplicity we assume that module is hosted on GitHub.
|
||||
_add_module() {
|
||||
local name="$1" ver="$2" url="$3" subdir="$4"
|
||||
local dirname=${url##*/}-${ver#v}
|
||||
local varprefix="_${name//-/_}"
|
||||
|
||||
eval "${varprefix}_ver='$ver'; ${varprefix}_url='$url'"
|
||||
|
||||
# Don't add new flag and source if it's already there, i.e. two or more
|
||||
# modules share the same source (e.g. geoip2 that provides http-geoip2
|
||||
# and stream-geoip2).
|
||||
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
|
||||
_module_path=$(realpath ../../../$subdir)
|
||||
_extra_flags="$_extra_flags --add-dynamic-module=$_module_path"
|
||||
fi
|
||||
subpackages="$subpackages $pkgname-mod-$name:_module"
|
||||
}
|
||||
|
||||
_add_module "http-naxsi" "1.7" "https://github.com/wargio/naxsi" "naxsi_src"
|
||||
_naxsi_provides="$pkgname-naxsi" # for backward compatibility
|
||||
|
||||
prepare() {
|
||||
local file; for file in $source; do
|
||||
file=${file%%::*}
|
||||
|
||||
case $file in
|
||||
*~*.patch)
|
||||
msg $file
|
||||
cd "$srcdir"/${file%%~*}-*
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
*.patch)
|
||||
msg $file
|
||||
cd "$builddir"
|
||||
patch -p 1 -i "$srcdir/$file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
_build() {
|
||||
# --without-pcre2 - Lua module is not compatible with PCRE2 yet
|
||||
# https://github.com/openresty/lua-nginx-module/issues/1984
|
||||
./configure \
|
||||
--prefix=/var/lib/$pkgname \
|
||||
--sbin-path=/usr/sbin/$pkgname \
|
||||
--modules-path=/$_modules_dir \
|
||||
--conf-path=/etc/$pkgname/$pkgname.conf \
|
||||
--pid-path=/run/$pkgname/$pkgname.pid \
|
||||
--lock-path=/run/$pkgname/$pkgname.lock \
|
||||
--http-client-body-temp-path=/var/lib/$pkgname/tmp/client_body \
|
||||
--http-proxy-temp-path=/var/lib/$pkgname/tmp/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \
|
||||
--http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \
|
||||
--http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \
|
||||
--with-perl_modules_path=/usr/lib/perl5/vendor_perl \
|
||||
\
|
||||
--user=$pkgusers \
|
||||
--group=$_grp_ngx \
|
||||
--with-threads \
|
||||
--with-file-aio \
|
||||
\
|
||||
--without-pcre2 \
|
||||
\
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--with-http_realip_module \
|
||||
--with-http_addition_module \
|
||||
--with-http_xslt_module=dynamic \
|
||||
--with-http_image_filter_module=dynamic \
|
||||
--with-http_geoip_module=dynamic \
|
||||
--with-http_sub_module \
|
||||
--with-http_dav_module \
|
||||
--with-http_flv_module \
|
||||
--with-http_mp4_module \
|
||||
--with-http_gunzip_module \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_auth_request_module \
|
||||
--with-http_random_index_module \
|
||||
--with-http_secure_link_module \
|
||||
--with-http_degradation_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_perl_module=dynamic \
|
||||
--with-mail=dynamic \
|
||||
--with-mail_ssl_module \
|
||||
--with-stream=dynamic \
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_realip_module \
|
||||
--with-stream_geoip_module=dynamic \
|
||||
--with-stream_ssl_preread_module \
|
||||
\
|
||||
$_extra_flags \
|
||||
"$@"
|
||||
|
||||
make -j
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
|
||||
_build --with-debug
|
||||
mv objs objs-debug
|
||||
|
||||
make clean
|
||||
_build
|
||||
}
|
||||
|
||||
check() {
|
||||
msg "Ignore nginx tests..."
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
debug() {
|
||||
return
|
||||
}
|
||||
|
||||
vim() {
|
||||
return
|
||||
}
|
||||
|
||||
_module() {
|
||||
local name="${subpkgname#$pkgname-mod-}"; name="${name//-/_}"
|
||||
local ver=$(getvar _${name}_ver)
|
||||
|
||||
pkgdesc="Nginx module ${name//_/-}"
|
||||
[ "$ver" ] && pkgdesc="Nginx third-party module ${name//_/-} (version $ver)"
|
||||
|
||||
url=$(getvar "_${name}_url" "$url")
|
||||
sonames=$(getvar "_${name}_so" "ngx_${name}_module.so")
|
||||
depends="$pkgname $(getvar "_${name}_depends")"
|
||||
provides=$(getvar "_${name}_provides")
|
||||
|
||||
# Numeric prefix for the module config to ensure that modules with
|
||||
# dependencies on other modules will be loaded after their dependencies.
|
||||
# For simplicity, we don't actually resolve dependency tree. Instead,
|
||||
# we just prefix the module name with a number that reflects number of
|
||||
# the module's dependencies times ten (e.g. 10, 20, 30, ...).
|
||||
local conf_prefix="$(echo "$depends" | wc -w)0_"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_modules_dir
|
||||
mkdir -p "$subpkgdir"/etc/nginx/modules
|
||||
|
||||
cd "$subpkgdir"
|
||||
|
||||
local soname; for soname in $sonames; do
|
||||
mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname
|
||||
echo "load_module \"modules/$soname\";" >> ./etc/nginx/modules/${conf_prefix}$name.conf
|
||||
done
|
||||
|
||||
mkdir -p ./etc/nginx/naxsi/blocking/
|
||||
mkdir -p ./etc/nginx/naxsi/whitelists/
|
||||
|
||||
cd "$srcdir/.."
|
||||
case "$name" in
|
||||
http_naxsi)
|
||||
install -m644 -D ../../../naxsi_rules/naxsi_core.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/"naxsi_core.rules
|
||||
install -m644 -D ../../../naxsi_rules/blocking/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/blocking/"
|
||||
install -m644 -D ../../../naxsi_rules/whitelists/*.rules \
|
||||
"$subpkgdir/etc/nginx/naxsi/whitelists/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print value of the specified variable, or the default if empty or not defined.
|
||||
getvar() {
|
||||
eval "printf '%s\n' \"\${$1:-$2}\""
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
1114e37de5664a8109c99cfb2faa1f42ff8ac63c932bcf3780d645e5ed32c0b2ac446f80305b4465994c8f9430604968e176ae464fd80f632d1cb2c8f6007ff3 nginx-1.24.0.tar.gz
|
||||
"
|
||||
@@ -0,0 +1,65 @@
|
||||
v3.13.0/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
v3.13.1/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
v3.13.2/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
v3.13.3/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
v3.13.4/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
v3.13.5/APKBUILD 0e2793dcb53ef7eb67af9a4a2290eaec33f4e2b5
|
||||
|
||||
v3.13.6/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.7/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.8/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.9/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.10/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.11/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
v3.13.12/APKBUILD 0058fec14cef94e23e783713c762ae2dc2a8aa97
|
||||
|
||||
v3.14.0/APKBUILD dcd672113394581d9ed4713c6c31164fe6117403
|
||||
v3.14.1/APKBUILD dcd672113394581d9ed4713c6c31164fe6117403
|
||||
v3.14.2/APKBUILD dcd672113394581d9ed4713c6c31164fe6117403
|
||||
v3.14.3/APKBUILD dcd672113394581d9ed4713c6c31164fe6117403
|
||||
|
||||
v3.14.4/APKBUILD 5a25cbe63dc00436cce8eb712bbf52c592b9e530
|
||||
v3.14.5/APKBUILD 5a25cbe63dc00436cce8eb712bbf52c592b9e530
|
||||
v3.14.6/APKBUILD 5a25cbe63dc00436cce8eb712bbf52c592b9e530
|
||||
|
||||
v3.14.7/APKBUILD 7ede836bb36baf850a2e911cec1bec938715bddf
|
||||
v3.14.8/APKBUILD 7ede836bb36baf850a2e911cec1bec938715bddf
|
||||
v3.14.9/APKBUILD 7ede836bb36baf850a2e911cec1bec938715bddf
|
||||
|
||||
v3.14.10/APKBUILD 82c4a602c17a8b9dfce1fc833c968d37ce797cfe
|
||||
|
||||
v3.15.0/APKBUILD 8c79aefdcd91f96faa5166e40a0a554fba000e45
|
||||
v3.15.1/APKBUILD 8c79aefdcd91f96faa5166e40a0a554fba000e45
|
||||
v3.15.2/APKBUILD 8c79aefdcd91f96faa5166e40a0a554fba000e45
|
||||
v3.15.3/APKBUILD 8c79aefdcd91f96faa5166e40a0a554fba000e45
|
||||
v3.15.4/APKBUILD 8c79aefdcd91f96faa5166e40a0a554fba000e45
|
||||
|
||||
v3.15.5/APKBUILD 7fbd4506cd2fc7c402d96f93f955344b9661d293
|
||||
v3.15.6/APKBUILD 7fbd4506cd2fc7c402d96f93f955344b9661d293
|
||||
v3.15.7/APKBUILD 7fbd4506cd2fc7c402d96f93f955344b9661d293
|
||||
|
||||
v3.15.8/APKBUILD 934f7d64c39b23cfd0be976bda5c3c3fc8e2fb9f
|
||||
v3.15.9/APKBUILD 934f7d64c39b23cfd0be976bda5c3c3fc8e2fb9f
|
||||
|
||||
v3.16.0/APKBUILD 9d141041a3dd31d8f63d2fb9e491b36066847ab5
|
||||
|
||||
v3.16.1/APKBUILD ae51a127df402f10a3510bbb3a0db986ed3f362f
|
||||
v3.16.2/APKBUILD ae51a127df402f10a3510bbb3a0db986ed3f362f
|
||||
|
||||
v3.16.3/APKBUILD cf21abf069b99df0466109da431e257be35e5fd2
|
||||
v3.16.4/APKBUILD cf21abf069b99df0466109da431e257be35e5fd2
|
||||
|
||||
v3.16.5/APKBUILD 741f460e98d96286e3178f0892e43e4b24c105ba
|
||||
v3.16.6/APKBUILD 741f460e98d96286e3178f0892e43e4b24c105ba
|
||||
|
||||
v3.17.0/APKBUILD a454a4380d8319d944ecf689d7e4c68a3e3c3a77
|
||||
v3.17.1/APKBUILD a454a4380d8319d944ecf689d7e4c68a3e3c3a77
|
||||
v3.17.2/APKBUILD a454a4380d8319d944ecf689d7e4c68a3e3c3a77
|
||||
|
||||
v3.17.3/APKBUILD 755ae65dbf1112735fbe16c987ce0a1ee9962223
|
||||
v3.17.4/APKBUILD 755ae65dbf1112735fbe16c987ce0a1ee9962223
|
||||
|
||||
v3.18.0/APKBUILD 5ac489bf563ac1f9fd8389f5f227a6fcd260e6e4
|
||||
|
||||
v3.18.1/APKBUILD 3047d360052cbd089f7c960b7c72727b9fe1a390
|
||||
v3.18.2/APKBUILD 3047d360052cbd089f7c960b7c72727b9fe1a390
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
NAXSI_ROOT="$PWD"
|
||||
BUILD_DIR="$NAXSI_ROOT/build"
|
||||
ALPINE_VERSION=$(cat /etc/alpine-release)
|
||||
VERSION="unknown"
|
||||
|
||||
case "v$ALPINE_VERSION" in
|
||||
"v3.13.0" | "v3.13.1" | "v3.13.2" | "v3.13.3" | "v3.13.4" | "v3.13.5")
|
||||
VERSION="1.18.0-r13"
|
||||
;;
|
||||
"v3.13.6" | "v3.13.7" | "v3.13.8" | "v3.13.9" | "v3.13.10" | "v3.13.11" | "v3.13.12")
|
||||
VERSION="1.18.0-r15"
|
||||
;;
|
||||
"v3.14.0" | "v3.14.1" | "v3.14.2" | "v3.14.3")
|
||||
VERSION="1.20.1-r3"
|
||||
;;
|
||||
"v3.14.4" | "v3.14.5" | "v3.14.6" | "v3.15.0" | "v3.15.1" | "v3.15.2" | "v3.15.3" | "v3.15.4")
|
||||
VERSION="1.20.2-r0"
|
||||
;;
|
||||
"v3.14.7" | "v3.14.8" | "v3.14.9" | "v3.14.10" | "v3.15.5" | "v3.15.6" | "v3.15.7" | "v3.15.8" | "v3.15.9" | "v3.16.0")
|
||||
VERSION="1.20.2-r1"
|
||||
;;
|
||||
"v3.16.1" | "v3.16.2")
|
||||
VERSION="1.22.0-r1"
|
||||
;;
|
||||
"v3.16.3" | "v3.16.4" | "v3.16.5" | "v3.16.6" | "v3.17.0" | "v3.17.1" | "v3.17.2" | "v3.17.3" | "v3.17.4")
|
||||
VERSION="1.22.1-r0"
|
||||
;;
|
||||
"v3.18.0")
|
||||
VERSION="1.24.0-r3"
|
||||
;;
|
||||
"v3.18.1" | "v3.18.2")
|
||||
VERSION="1.24.0-r6"
|
||||
;;
|
||||
*)
|
||||
echo "error: unsupported version, please open an issue on github."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Alpine $ALPINE_VERSION, using $VERSION APKBUILD..."
|
||||
|
||||
if [ -d "$BUILD_DIR" ]; then
|
||||
rm -rf "$BUILD_DIR"
|
||||
fi
|
||||
mkdir "$BUILD_DIR"
|
||||
|
||||
echo "$BUILD_DIR/naxsi.key" | abuild-keygen -a
|
||||
cp -v "$BUILD_DIR/naxsi.key.pub" /etc/apk/keys
|
||||
|
||||
cd "$NAXSI_ROOT/distros/alpine/$VERSION"
|
||||
|
||||
SRCDEST="$BUILD_DIR" abuild -F fetch
|
||||
SRCDEST="$BUILD_DIR" abuild -F -c -r -P "$BUILD_DIR"
|
||||
|
||||
find "$BUILD_DIR" -name "*.apk" | grep naxsi | xargs -I % mv -v % "$BUILD_DIR"
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
# Maintainer: Giovanni Dante (deroad) Grazioli <deroad@libero.it>
|
||||
|
||||
pkgname=nginx-mod-naxsi-git
|
||||
pkgver=1.7
|
||||
pkgrel=1
|
||||
epoch=1
|
||||
_modname=naxsi
|
||||
pkgdesc='Nginx Anti XSS & SQL Injection'
|
||||
arch=('x86_64')
|
||||
depends=('nginx')
|
||||
makedepends=('nginx-src')
|
||||
url="https://github.com/wargio/naxsi"
|
||||
license=('GPL3')
|
||||
backup=('etc/nginx/naxsi_core.rules')
|
||||
conflicts=('nginx-mod-naxsi')
|
||||
source=(
|
||||
"$pkgname::git+https://github.com/wargio/$_modname.git"
|
||||
)
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver () {
|
||||
cd ${srcdir}/${pkgname}
|
||||
printf $(grep "NAXSI_VERSION" naxsi_src/naxsi_const.h | cut -d ' ' -f3 | sed 's/"//g')
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd ${pkgname}
|
||||
git submodule init
|
||||
git config submodule.libinjection.url "${srcdir}/${pkgname}/naxsi_src/libinjection"
|
||||
git submodule update
|
||||
|
||||
mkdir -p ${srcdir}/build
|
||||
cd ${srcdir}/build
|
||||
|
||||
ln -sf /usr/src/nginx/auto
|
||||
ln -sf /usr/src/nginx/src
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/build
|
||||
local GCC_PATH=$(which gcc)
|
||||
/usr/src/nginx/configure --with-cc="$GCC_PATH" --with-compat --add-dynamic-module="${srcdir}/${pkgname}/naxsi_src"
|
||||
make modules
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $srcdir/build/objs
|
||||
for mod in *.so; do
|
||||
install -Dm755 $mod "$pkgdir"/usr/lib/nginx/modules/$mod
|
||||
done
|
||||
|
||||
mkdir -p "$pkgdir"/etc/nginx/naxsi/whitelists
|
||||
mkdir -p "$pkgdir"/etc/nginx/naxsi/blocking
|
||||
|
||||
install -Dm644 "$srcdir/${pkgname}"/distros/nginx/naxsi_block_mode.conf "$pkgdir"/etc/nginx/naxsi/naxsi_block_mode.conf
|
||||
install -Dm644 "$srcdir/${pkgname}"/distros/nginx/naxsi_denied_url.conf "$pkgdir"/etc/nginx/naxsi/naxsi_denied_url.conf
|
||||
install -Dm644 "$srcdir/${pkgname}"/distros/nginx/naxsi_learning_mode.conf "$pkgdir"/etc/nginx/naxsi/naxsi_learning_mode.conf
|
||||
install -Dm644 "$srcdir/${pkgname}"/naxsi_rules/naxsi_core.rules "$pkgdir"/etc/nginx/naxsi/naxsi_core.rules
|
||||
|
||||
cd "$srcdir/${pkgname}"/naxsi_rules/whitelists/
|
||||
for rule in *.rules; do
|
||||
install -Dm644 $rule "$pkgdir"/etc/nginx/naxsi/whitelists/$rule
|
||||
done
|
||||
|
||||
cd "$srcdir/${pkgname}"/naxsi_rules/blocking/
|
||||
for rule in *.rules; do
|
||||
install -Dm644 $rule "$pkgdir"/etc/nginx/naxsi/blocking/$rule
|
||||
done
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
PACKAGE="libnginx-mod-http-naxsi"
|
||||
VERSION="@NAXSI_VERSION@"
|
||||
SECTION="httpd"
|
||||
ARCHITECTURE="amd64"
|
||||
DEPENDENCIES="@NGINX_PACKAGE@ (>= @NGINX_VERSION@), @LIBPCRE_PACKAGE@ (>= @LIBPCRE_VERSION@)"
|
||||
MAINTAINER_NAME="Giovanni Dante Grazioli"
|
||||
MAINTAINER_EMAIL="deroad@libero.it"
|
||||
HOMEPAGE="https://github.com/wargio/naxsi"
|
||||
DESCRIPTION="NAXSI, a web application firewall for Nginx."
|
||||
@@ -0,0 +1 @@
|
||||
load_module modules/ngx_http_naxsi_module.so;
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
# Automatically added by dh_nginx/UNDECLARED
|
||||
for confpair in mod-http-naxsi.conf:50-mod-http-naxsi.conf ; do
|
||||
from=$(echo $confpair | cut -d: -f1)
|
||||
to=$(echo $confpair | cut -d: -f2)
|
||||
|
||||
if [ -L /etc/nginx/modules-enabled/$to.removed ]; then
|
||||
rm /etc/nginx/modules-enabled/$to.removed
|
||||
removed_link=true
|
||||
else
|
||||
removed_link=false
|
||||
fi
|
||||
|
||||
# Symlink on
|
||||
# 1) Fresh installations
|
||||
# 2) Reinstalls after automatic removes (preserve admin actions)
|
||||
if [ -z "$2" -o "$removed_link" = "true" ]; then
|
||||
ln -sf /usr/share/nginx/modules-available/$from \
|
||||
/etc/nginx/modules-enabled/$to
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$1" = "configure" ] ; then
|
||||
if which dpkg-trigger >/dev/null 2>&1 ; then
|
||||
dpkg-trigger --no-await nginx-reload
|
||||
fi
|
||||
|
||||
fi
|
||||
# End automatically added section
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
# Automatically added by dh_nginx/UNDECLARED
|
||||
if [ "$1" = "purge" ] ; then
|
||||
for confpair in mod-http-naxsi.conf:50-mod-http-naxsi.conf ; do
|
||||
from=$(echo $confpair | cut -d: -f1)
|
||||
to=$(echo $confpair | cut -d: -f2)
|
||||
|
||||
if [ -L /etc/nginx/modules-enabled/$to ]; then
|
||||
rm /etc/nginx/modules-enabled/$to
|
||||
fi
|
||||
if [ -L /etc/nginx/modules-enabled/$to.removed ]; then
|
||||
rm /etc/nginx/modules-enabled/$to.removed
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$1" = "remove" ] ; then
|
||||
for confpair in mod-http-naxsi.conf:50-mod-http-naxsi.conf ; do
|
||||
from=$(echo $confpair | cut -d: -f1)
|
||||
to=$(echo $confpair | cut -d: -f2)
|
||||
|
||||
if [ -L /etc/nginx/modules-enabled/$to ]; then
|
||||
mv /etc/nginx/modules-enabled/$to /etc/nginx/modules-enabled/$to.removed
|
||||
fi
|
||||
done
|
||||
|
||||
if which dpkg-trigger >/dev/null 2>&1 ; then
|
||||
dpkg-trigger --no-await nginx-reload
|
||||
fi
|
||||
fi
|
||||
# End automatically added section
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
# Automatically added by dh_nginx/UNDECLARED
|
||||
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
|
||||
for confpair in mod-http-naxsi.conf:50-mod-http-naxsi.conf ; do
|
||||
from=$(echo $confpair | cut -d: -f1)
|
||||
to=$(echo $confpair | cut -d: -f2)
|
||||
|
||||
if [ -L /etc/nginx/modules-enabled/$to ]; then
|
||||
mv /etc/nginx/modules-enabled/$to /etc/nginx/modules-enabled/$to.removed
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# End automatically added section
|
||||
@@ -0,0 +1,15 @@
|
||||
SecRulesEnabled; #enable naxsi
|
||||
LibInjectionSql; #enable libinjection support for SQLI
|
||||
LibInjectionXss; #enable libinjection support for XSS
|
||||
|
||||
#the location where naxsi will redirect the request when it is blocked
|
||||
DeniedUrl "/NaxsiRequestDenied";
|
||||
|
||||
#the action to take when the $SQL score is superior or equal to 8
|
||||
CheckRule "$SQL >= 8" BLOCK;
|
||||
CheckRule "$RFI >= 8" BLOCK;
|
||||
CheckRule "$TRAVERSAL >= 5" BLOCK;
|
||||
CheckRule "$UPLOAD >= 5" BLOCK;
|
||||
CheckRule "$XSS >= 8" BLOCK;
|
||||
CheckRule "$UWA >= 8" BLOCK;
|
||||
CheckRule "$EVADE >= 8" BLOCK;
|
||||
@@ -0,0 +1,4 @@
|
||||
location /NaxsiRequestDenied {
|
||||
internal;
|
||||
return 418; #I'm a teapot \o/
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
SecRulesEnabled; #enable naxsi
|
||||
LearningMode; #enable learning mode
|
||||
LibInjectionSql; #enable libinjection support for SQLI
|
||||
LibInjectionXss; #enable libinjection support for XSS
|
||||
|
||||
#the location where naxsi will redirect the request when it is blocked
|
||||
DeniedUrl "/NaxsiRequestDenied";
|
||||
|
||||
#the action to take when the $SQL score is superior or equal to 8
|
||||
CheckRule "$SQL >= 8" BLOCK;
|
||||
CheckRule "$RFI >= 8" BLOCK;
|
||||
CheckRule "$TRAVERSAL >= 5" BLOCK;
|
||||
CheckRule "$UPLOAD >= 5" BLOCK;
|
||||
CheckRule "$XSS >= 8" BLOCK;
|
||||
CheckRule "$UWA >= 8" BLOCK;
|
||||
CheckRule "$EVADE >= 8" BLOCK;
|
||||
Reference in New Issue
Block a user