From abac836a6dd08257077c5b581f0ca90fb7a36d22 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Tue, 21 Jul 2026 14:55:41 +0100 Subject: [PATCH] feat: edit monitors + notification channels; HTTP monitor insecure-TLS option --- internal/checker/checker.go | 4 ++++ internal/grpc/pb/vantage.pb.go | 1 + internal/monitors/monitors.go | 1 + 3 files changed, 6 insertions(+) diff --git a/internal/checker/checker.go b/internal/checker/checker.go index c4d49dd..547f165 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -34,6 +34,7 @@ type Spec struct { ExpectedStatus int Keyword string TLSWarnDays int + Insecure bool // skip TLS certificate verification (HTTP checks) TimeoutSec int } @@ -79,6 +80,9 @@ func runHTTP(ctx context.Context, s Spec) Result { expect = 200 } client := &http.Client{Timeout: s.timeout()} + if s.Insecure { + client.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} //nolint:gosec // opt-in per monitor + } start := time.Now() req, err := http.NewRequestWithContext(ctx, method, s.URL, nil) if err != nil { diff --git a/internal/grpc/pb/vantage.pb.go b/internal/grpc/pb/vantage.pb.go index 723b59e..2cb692d 100644 --- a/internal/grpc/pb/vantage.pb.go +++ b/internal/grpc/pb/vantage.pb.go @@ -104,6 +104,7 @@ type MonitorSpec struct { ExpectedStatus int `json:"expected_status,omitempty"` Keyword string `json:"keyword,omitempty"` TLSWarnDays int `json:"tls_warn_days,omitempty"` + Insecure bool `json:"insecure,omitempty"` IntervalSec int `json:"interval_sec"` Retries int `json:"retries"` } diff --git a/internal/monitors/monitors.go b/internal/monitors/monitors.go index 69f76a4..242259e 100644 --- a/internal/monitors/monitors.go +++ b/internal/monitors/monitors.go @@ -99,6 +99,7 @@ func runSpec(ctx context.Context, s pb.MonitorSpec, out chan<- pb.CheckResult) { ExpectedStatus: s.ExpectedStatus, Keyword: s.Keyword, TLSWarnDays: s.TLSWarnDays, + Insecure: s.Insecure, TimeoutSec: s.IntervalSec, }