Repository navigation
feat: reload runtime configuration on SIGHUP - #17
Merged
Merged
Conversation
Reload domain filters, authentication credentials, log level, DKIM signing, and TLS certificates without restarting listeners or delivery workers. Prepare replacements before publishing a shared runtime snapshot and reject restart-only changes without modifying active settings. Retain existing authenticated and TLS sessions, preserve valid log environment overrides, and keep shutdown signals pending during reload. Report safe component-specific failures and omit passwords from config serialization. Add rollback, policy-boundary, credential, and secret-redaction tests plus a Docker SMTP verifier covering both storage backends and SIGINT during blocked reload. Document reload behavior and limitations. Validation: 325 unit tests and one doc test pass; formatting and diff checks pass; clippy reports only nine existing warnings. End-to-end SMTP verification passes for log and fs storage.
Deploying hedwig with
|
| Latest commit: |
1eca37b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e3eefcd.hedwig-1mq.pages.dev |
| Branch Preview URL: | https://feat-config-reload.hedwig-1mq.pages.dev |
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
Remove the need to restart Hedwig for common policy changes and key rotations. On Unix, send
kill -HUP <hedwig-pid>to reread the configuration file supplied at startup.HEDWIG_LOG_LEVELoverrides and register persistent signal streams so SIGINT during reload still initiates shutdown.Configuration and compatibility
No configuration migration is required. Authentication enablement, listener addresses/count/TLS modes, storage settings, worker counts, and other startup-only fields still require a restart. DKIM may be enabled or disabled through reload. Key and certificate files are reread even when their paths are unchanged.
Verification
cargo test --workspace: 325 unit tests and one doc test passed.cargo fmt --check: passed.cargo clippy --workspace --all-targets: completed with nine pre-existing warnings in unchanged metrics/logqueue tests.git diff --check: passed.dev/verify-config-reload.py: passed against both log and filesystem storage using real SMTP delivery through the dev DNS and fake MTA.End-to-end coverage includes PLAIN/LOGIN/CRAM-MD5 credential changes, sender/recipient filters, DKIM rotation and disable/re-enable, implicit TLS and STARTTLS certificate rotation, same-path certificate replacement, log-level changes, failed-reload rollback, secret redaction, and unchanged process PID.
The SIGINT regression was reproduced against the prior binary by blocking a reload on a key-file FIFO. The fixed binary shuts down gracefully after a single SIGINT during that same blocked reload on both storage backends.