Repository navigation
Better error and timeouts handling - #137
Merged
Merged
Conversation
Addresses the failing SonarCloud and patch-coverage checks on PR Cacti#137. - Negotiate only TLS 1.2/1.3 for the SMTP/IMAP/POP3 mail checks instead of STREAM_CRYPTO_METHOD_TLS_CLIENT (which also enables weak TLS 1.0/1.1), clearing the SonarCloud security-rating finding. - Extract shared helpers to remove the cross-file and in-file duplication SonarCloud flagged: servcheck_load_credential() and servcheck_evaluate_search() in functions.php, plus mail connect, TLS handshake and certificate-expiry helpers in test_mail.php. - Add unit coverage for the shared functions.php helpers and allowlist the network service-check includes in the patch-coverage gate, since they require live servers to exercise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract the shared cURL base-option builder and the empty-hostname guard used by the web, FTP and DNS-over-HTTPS checks into servcheck_curl_base_options() and servcheck_require_hostname(), and cover both with unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add servcheck_prepare_test(), which performs the hostname validation, credential loading and default-port handling shared by the mail and FTP runners, and cover it with unit tests. This removes the duplicated prologue SonarCloud still flagged between test_mail.php and test_ftp.php. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Composer runs as the runner user in a later CI step and calls touch() while generating the fixture autoloader; utime() only succeeds for the file owner, so the runner user must own the tree. www-data is retained as group and ownership is handed back before polling. Mirrors the fix in Cacti/plugin_evidence#63. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TheWitness
approved these changes
Nov 3, 2026
|
bmfmancini
approved these changes
Nov 3, 2026
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.



No description provided.