Move rule conversion and log reporting into Docker container#14
Merged
Conversation
Shift JS processing (wildcard→regex conversion, log parsing/reporting) from the host side into the container using QuickJS. This removes the Node.js dependency for rule conversion at container startup and enables structured log reporting via `docker compose exec`. - Add QuickJS to container; convert rules via stdin/stdout filter (convert-rule.mjs) called from init-haproxy-cfg - Add log parser library (lib/log-parser.mjs) shared by report.mjs and its tests - Move rules.mjs into container (docker/files/tools/lib/); extract legacy rule handling to setup/lib/legacy-rules.mjs - Pass wildcard rules as-is from setup/main.mjs to the container - Set up s6-rc producer/consumer pipeline for HAProxy logging with s6-log outputting to both stdout and file - Update report/main.mjs to consume structured JSON from container - Update CI: run QuickJS unit tests via make test_unit - Update docs/development.md directory structure
- convert-rule.mjs: catch errors and output clean message to stderr instead of exposing QuickJS stack traces - setup/main.mjs: validate rules via buildRules() so invalid patterns are reported as ::error:: annotations in GitHub Actions before attempting to start the container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
convert-rule.mjs), so rules are now passed in wildcard format and converted at container startupreport.mjs+log-parser.mjs), replacing host-side log parsing inreport/main.mjshaproxy→haproxy-log) to persist HAProxy logs to/var/log/haproxy/current, enabling direct log access viadocker execsetup/lib/legacy-rules.mjs, which now outputs wildcard-format rules instead of regexcompose.test.ymlto pass rules in wildcard format instead of pre-converted regex