created build tooling, subtrees, and stub code for a new NGINX core module

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2026-04-30 02:09:57 +00:00
parent 2b63c55768
commit 300482b617
6 changed files with 4322 additions and 1 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
libmuninn.so
libmuninn.dylib
nginx/.cache

40
Makefile Normal file
View file

@ -0,0 +1,40 @@
NGINX_SOURCE_DIR = nginx
NGINX_BUILD_DIR = nginx/objs
ifeq (, $(shell which bear))
MUNIN_BEAR=make
else
MUNIN_BEAR=bear --
endif
ifeq ($(shell uname), Darwin)
NGX_MODEXT = .dylib
else
NGX_MODEXT = .so
endif
NGX_MODULE = libmuninn$(NGX_MODEXT)
ifneq ($(MUNINN_NGINX_DEBUG),)
MUNINN_NGINX_DEBUG="--with-debug"
endif
CURDIR = $(.CURDIR)
.PHONY: all clean build
all: nginx/objs/nginx
nginx/objs/Makefile:
cd $(NGINX_SOURCE_DIR) && \
./auto/configure \
$(MUNINN_NGINX_DEBUG) \
--with-http_ssl_module \
--with-compat \
--add-module=$(.CURDIR)
nginx/objs/nginx: nginx/objs/Makefile
$(MUNIN_BEAR) make -C $(NGINX_SOURCE_DIR)
clean:
make -C $(NGINX_SOURCE_DIR) clean

View file

@ -22,7 +22,7 @@ The loose plan to implement Muninn is as follows:
9. Muninn can identify as authoritatively owning a certain DN (and Peers abide).
10. Something other than logging is done for conflicts over who owns what DN
Currently Muninn is on phase 1.
Currently Muninn is on phase 2.
## Building Muninn
TODO

4246
compile_commands.json Normal file

File diff suppressed because it is too large Load diff

5
config Normal file
View file

@ -0,0 +1,5 @@
ngx_module_name=muninn
ngx_module_srcs="$ngx_addon_dir/muninn.c"
ngx_module_link=YES
. auto/module

27
muninn.c Normal file
View file

@ -0,0 +1,27 @@
#include <ngx_config.h>
#include <ngx_core.h>
static ngx_command_t ngx_muninn_commands[] = {};
static ngx_core_module_t ngx_muninn_module_ctx = {
ngx_string("muninn"),
NULL, // create conf
NULL // init conf
};
ngx_module_t ngx_muninn_core_module = {
NGX_MODULE_V1,
&ngx_muninn_module_ctx, /* module context */
ngx_muninn_commands, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};