Initial commit: mod_reqin_log Apache module

Features:
- JSON logging of HTTP requests to Unix domain socket
- Configurable HTTP headers logging (flat JSON structure)
- Header value truncation and count limits
- Automatic reconnect on socket disconnection
- Error reporting with throttling

Configuration directives:
- JsonSockLogEnabled: Enable/disable logging
- JsonSockLogSocket: Unix socket path
- JsonSockLogHeaders: List of headers to log
- JsonSockLogMaxHeaders: Maximum headers to log
- JsonSockLogMaxHeaderValueLen: Max header value length
- JsonSockLogReconnectInterval: Reconnect delay
- JsonSockLogErrorReportInterval: Error log throttle

Includes:
- Module source code (src/)
- Unit and integration tests (tests/, scripts/)
- Documentation (README.md, architecture.yml)
- Build configuration (CMakeLists.txt, Makefile)
- Packaging (deb/rpm)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-02-26 13:55:07 +01:00
commit 66549acf5c
27 changed files with 3550 additions and 0 deletions

31
scripts/test.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
#
# test.sh - Run tests for mod_reqin_log in Docker
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
IMAGE_NAME="mod_reqin_log-build"
echo "========================================"
echo "mod_reqin_log - Test Suite"
echo "========================================"
echo ""
# Build image if not exists
if ! docker images "$IMAGE_NAME" | grep -q "$IMAGE_NAME"; then
echo "Building Docker image first..."
"$SCRIPT_DIR/scripts/build.sh"
fi
echo "Running unit tests..."
echo ""
# Run unit tests in container
docker run --rm "$IMAGE_NAME" bash -c "cd build/tests && ctest --output-on-failure"
echo ""
echo "========================================"
echo "Unit tests completed"
echo "========================================"