git: cbc5a0c3e94d - main - www/nginx-module-sts: Add New Port

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Wed, 14 Oct 2026 12:33:21 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cbc5a0c3e94dc00bbd9c0194a3adfea157a72025

commit cbc5a0c3e94dc00bbd9c0194a3adfea157a72025
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-10-14 12:02:48 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-10-14 12:33:01 +0000

    www/nginx-module-sts: Add New Port
    
    Sources of the sts modules for the NGINX ports.  Two modules: one counts
    what goes through the stream subsystem and owns the shared memory, the
    other answers status requests out of it in an http server.  One without
    the other reports nothing, so both come from one source.
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                              |  1 +
 www/nginx-module-sts/Makefile             | 68 +++++++++++++++++++++++++++++++
 www/nginx-module-sts/distinfo             |  3 ++
 www/nginx-module-sts/files/pkg-message.in | 15 +++++++
 www/nginx-module-sts/pkg-descr            | 12 ++++++
 5 files changed, 99 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index dd1bc84d52a3..d5dd187a6d39 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -553,6 +553,7 @@
     SUBDIR += nginx-module-redis2
     SUBDIR += nginx-module-sflow
     SUBDIR += nginx-module-slowfs-cache
+    SUBDIR += nginx-module-sts
     SUBDIR += nginx-module-vod
     SUBDIR += nginx-module-websockify
     SUBDIR += nginx-module-zstd
diff --git a/www/nginx-module-sts/Makefile b/www/nginx-module-sts/Makefile
new file mode 100644
index 000000000000..2a58c8362360
--- /dev/null
+++ b/www/nginx-module-sts/Makefile
@@ -0,0 +1,68 @@
+PORTNAME=	nginx-module-sts
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.2.0
+CATEGORIES=	www
+
+MAINTAINER=	joneum@FreeBSD.org
+COMMENT=	Sources of the sts modules for the NGINX ports
+WWW=		https://github.com/sysadmin-labs/nginx-sts-module
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	sysadmin-labs
+GH_PROJECT=	nginx-sts-module
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+
+_MODDIR=	share/nginx/modules/${PORTNAME}
+MODULESDIR=	${PREFIX}/${_MODDIR}
+
+_MODFILES=	src/ngx_http_stream_server_traffic_status_control.c \
+		src/ngx_http_stream_server_traffic_status_control.h \
+		src/ngx_http_stream_server_traffic_status_display.c \
+		src/ngx_http_stream_server_traffic_status_display.h \
+		src/ngx_http_stream_server_traffic_status_display_json.c \
+		src/ngx_http_stream_server_traffic_status_display_json.h \
+		src/ngx_http_stream_server_traffic_status_display_prometheus.c \
+		src/ngx_http_stream_server_traffic_status_display_prometheus.h \
+		src/ngx_http_stream_server_traffic_status_filter.c \
+		src/ngx_http_stream_server_traffic_status_filter.h \
+		src/ngx_http_stream_server_traffic_status_module.c \
+		src/ngx_http_stream_server_traffic_status_module.h \
+		src/ngx_http_stream_server_traffic_status_module_html.h \
+		src/ngx_http_stream_server_traffic_status_node.c \
+		src/ngx_http_stream_server_traffic_status_node.h \
+		src/ngx_http_stream_server_traffic_status_shm.c \
+		src/ngx_http_stream_server_traffic_status_shm.h \
+		src/ngx_http_stream_server_traffic_status_string.c \
+		src/ngx_http_stream_server_traffic_status_string.h \
+		src/ngx_stream_server_traffic_status_filter.c \
+		src/ngx_stream_server_traffic_status_filter.h \
+		src/ngx_stream_server_traffic_status_limit.c \
+		src/ngx_stream_server_traffic_status_limit.h \
+		src/ngx_stream_server_traffic_status_module.c \
+		src/ngx_stream_server_traffic_status_module.h \
+		src/ngx_stream_server_traffic_status_node.c \
+		src/ngx_stream_server_traffic_status_node.h \
+		src/ngx_stream_server_traffic_status_shm.c \
+		src/ngx_stream_server_traffic_status_shm.h \
+		src/ngx_stream_server_traffic_status_string.c \
+		src/ngx_stream_server_traffic_status_string.h \
+		src/ngx_stream_server_traffic_status_variables.c \
+		src/ngx_stream_server_traffic_status_variables.h \
+		src/ngx_sts_layout_check.c
+
+PLIST_FILES=	${_MODDIR}/config \
+		${_MODFILES:S!^!${_MODDIR}/!}
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${MODULESDIR}/src
+	${INSTALL_DATA} ${WRKSRC}/config ${STAGEDIR}${MODULESDIR}
+	${INSTALL_DATA} ${_MODFILES:S!^!${WRKSRC}/!} ${STAGEDIR}${MODULESDIR}/src
+
+.include <bsd.port.mk>
diff --git a/www/nginx-module-sts/distinfo b/www/nginx-module-sts/distinfo
new file mode 100644
index 000000000000..3cd6b24639ea
--- /dev/null
+++ b/www/nginx-module-sts/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1791975376
+SHA256 (sysadmin-labs-nginx-sts-module-v0.2.0_GH0.tar.gz) = 691006957d7964012571334055948919cbe995127fd82c14fd9eb885b713ee77
+SIZE (sysadmin-labs-nginx-sts-module-v0.2.0_GH0.tar.gz) = 205389
diff --git a/www/nginx-module-sts/files/pkg-message.in b/www/nginx-module-sts/files/pkg-message.in
new file mode 100644
index 000000000000..cc47b78e5944
--- /dev/null
+++ b/www/nginx-module-sts/files/pkg-message.in
@@ -0,0 +1,15 @@
+[
+{ type: install
+  message: <<EOM
+This package contains the sources of the sts modules only.  It does not
+install loadable modules.
+
+The modules themselves are built by the nginx ports.  To use sts, build
+www/nginx, www/nginx-devel or www/freenginx with the STS option enabled.
+Those ports pick the sources up from
+%%PREFIX%%/share/nginx/modules/nginx-module-sts and produce
+ngx_stream_server_traffic_status_module.so, which counts, and
+ngx_http_stream_server_traffic_status_module.so, which answers.
+EOM
+}
+]
diff --git a/www/nginx-module-sts/pkg-descr b/www/nginx-module-sts/pkg-descr
new file mode 100644
index 000000000000..4120fd2df65d
--- /dev/null
+++ b/www/nginx-module-sts/pkg-descr
@@ -0,0 +1,12 @@
+The sts modules count what goes through nginx's stream subsystem -- per
+server, per upstream, per filter -- and serve the counters as JSON, as a
+Prometheus exposition or as an HTML page.  They are the stream side of what
+the vts module does for HTTP.
+
+Two modules are needed and both are here: one counts in the stream
+subsystem and owns the shared memory, the other answers the status
+requests out of it in an http server.  One without the other reports
+nothing.
+
+This port only installs the module sources.  The modules themselves are
+built by the nginx ports when their STS option is enabled.