ngx-xss[1] is an NGINX module that adds support for "native cross-site scripting".
[1]: https://github.com/openresty/xss-nginx-module Signed-off-by: Zurab Kvachadze <zurabid2...@gmail.com> --- www-nginx/ngx-xss/Manifest | 1 + ...x-xss-0.06-add-dynamic-build-support.patch | 34 +++++++++++++++++++ .../{ngx-lua-module => ngx-xss}/metadata.xml | 10 +++--- www-nginx/ngx-xss/ngx-xss-0.06.ebuild | 24 +++++++++++++ 4 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 www-nginx/ngx-xss/Manifest create mode 100644 www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch copy www-nginx/{ngx-lua-module => ngx-xss}/metadata.xml (57%) create mode 100644 www-nginx/ngx-xss/ngx-xss-0.06.ebuild diff --git a/www-nginx/ngx-xss/Manifest b/www-nginx/ngx-xss/Manifest new file mode 100644 index 000000000000..ec20887f1122 --- /dev/null +++ b/www-nginx/ngx-xss/Manifest @@ -0,0 +1 @@ +DIST ngx-xss-0.06.tar.gz 12448 BLAKE2B 58cb1f23699e173c6fe3ac1c03ddef184238b1c3dc0471569e11b9a8f40b93250a9fa60c0bcc71222daf22769698835d1fe5515c0b55e385141c10451f347005 SHA512 b417ba5199d7147c348cd897f6294c49270f700d565b841086a5b1ecbfcea4005b6c01aac4e0e0e86cfafdc1d578107783dda718da2b9a1fd3b89676ec7b1ff4 diff --git a/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch b/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch new file mode 100644 index 000000000000..5cfd8715e569 --- /dev/null +++ b/www-nginx/ngx-xss/files/ngx-xss-0.06-add-dynamic-build-support.patch @@ -0,0 +1,34 @@ +From a45c0c645841795d124acd43ea8a5c8297754a6f Mon Sep 17 00:00:00 2001 +From: Su Yang <soulte...@users.noreply.github.com> +Date: Mon, 14 Jun 2021 11:47:03 +0800 +Subject: [PATCH 1/2] support dynamic build + +--- + config | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/config b/config +index 42ebe33..4ca7d3d 100644 +--- a/config ++++ b/config +@@ -1,5 +1,20 @@ + ngx_addon_name=ngx_http_xss_filter_module ++ + HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_xss_filter_module" + NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_xss_filter_module.c $ngx_addon_dir/src/ngx_http_xss_util.c" + NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_xss_filter_module.h $ngx_addon_dir/src/ngx_http_xss_util.h" + ++if test -n "$ngx_module_link"; then ++ ngx_module_type=HTTP_AUX_FILTER ++ ngx_module_name=$ngx_addon_name ++ ngx_module_incs= ++ ngx_module_deps="$NGX_ADDON_DEPS" ++ ngx_module_srcs="$NGX_ADDON_SRCS" ++ ngx_module_libs= ++ ++ . auto/module ++else ++ HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name" ++ NGX_ADDON_SRCS="$NGX_ADDON_SRCS" ++ NGX_ADDON_DEPS="$NGX_ADDON_DEPS" ++fi diff --git a/www-nginx/ngx-lua-module/metadata.xml b/www-nginx/ngx-xss/metadata.xml similarity index 57% copy from www-nginx/ngx-lua-module/metadata.xml copy to www-nginx/ngx-xss/metadata.xml index 42a518e970f5..005843751b17 100644 --- a/www-nginx/ngx-lua-module/metadata.xml +++ b/www-nginx/ngx-xss/metadata.xml @@ -10,12 +10,12 @@ <name>Proxy Maintainers</name> </maintainer> <longdescription> - The ngx-lua module embeds LuaJIT 2.0/2.1 into NGINX. By leveraging NGINX's subrequests, this - module allows the integration of the powerful Lua threads (known as Lua "coroutines") into - the NGINX event model. + ngx-xss adds native cross-site scripting support to NGINX. This module adds cross-site AJAX + support to nginx. Currently only cross-site GET is supported. The cross-site GET is + implemented as JSONP (or "JSON with padding"). </longdescription> <upstream> - <bugs-to>https://github.com/openresty/lua-nginx-module/issues</bugs-to> - <remote-id type="github">openresty/lua-nginx-module</remote-id> + <bugs-to>https://github.com/openresty/xss-nginx-module/issues</bugs-to> + <remote-id type="github">openresty/xss-nginx-module</remote-id> </upstream> </pkgmetadata> diff --git a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild new file mode 100644 index 000000000000..b190db7280f6 --- /dev/null +++ b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="xss-nginx-module" +NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}" + +inherit nginx-module + +DESCRIPTION="Native support for cross-site scripting (XSS) in NGINX" +HOMEPAGE="https://github.com/openresty/xss-nginx-module" +SRC_URI=" + https://github.com/openresty/xss-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz +" + +LICENSE="BSD-2" +SLOT="0" + +RESTRICT="test" + +PATCHES=( + "${FILESDIR}/${PN}-0.06-add-dynamic-build-support.patch" +) -- 2.45.3