Warn on TLS skip-verify at startup and SIGHUP reload (#185)#200
Merged
Conversation
skip-verify disables MySQL server certificate validation, which is useful for development but unsafe in production. Previously the setting was accepted silently, so operators had no signal that a test-only config had shipped. The daemon now emits a prominent WARN log line for each cluster configured with skip-verify, both when initCluster runs at startup and when reloadConfigOnce handles a SIGHUP. The detection lives in a pure helper (isSkipVerify) so it is easy to unit test. Also adds an E2E test (29-tls-skip-verify-warn.sh) that runs under the TLS overlay and asserts the WARN appears on startup and is re-emitted on SIGHUP. An empty e2e/config/tls/ placeholder makes the nested bind mount from docker-compose.tls.yml succeed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #200 +/- ##
==========================================
+ Coverage 97.13% 97.14% +0.01%
==========================================
Files 50 50
Lines 8035 8066 +31
==========================================
+ Hits 7805 7836 +31
Misses 230 230 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
tls.mode: skip-verify, both wheninitClusterruns at startup and whenreloadConfigOncehandles a SIGHUP, so development-only settings cannot silently ship to productionisSkipVerify) with a separate message builder (skipVerifyWarningMessage) — unit-tested intest/PureMyHA/ConfigSpec.hs29-tls-skip-verify-warn.sh(run under the TLS overlay) that asserts the WARN appears on startup and is re-emitted on SIGHUP reloadREADME.md,docs/configuration.md,docs/features.md, andconfig/config.yaml.examplee2e/config/tls/so the nested bind mount fromdocker-compose.tls.ymlsucceeds over the base./config:/etc/puremyha:roread-only mountCloses #185.
Test plan
cabal build allcabal test— 610/610 pass (9 new cases: 5 forisSkipVerify, 4 forskipVerifyWarningMessage)e2e/run-tls.sh— test 15 (5/5) and test 29 (3/3) pass; SIGHUP WARN count transitions 1 → 2 as expectedgit log --grep 'skip-verify'shows the new commit only under this branch🤖 Generated with Claude Code