mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-08 17:38:05 -04:00
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/dutchcoders/go-clamd"
|
||||
|
||||
@@ -28,7 +29,11 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
case "clamav":
|
||||
return clamd.NewClamd(cfg.Scanner.ClamAV.Socket).Ping()
|
||||
case "icap":
|
||||
return checks.NewTCPCheck(cfg.Scanner.ICAP.URL)(ctx)
|
||||
u, err := url.Parse(cfg.Scanner.ICAP.URL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return checks.NewTCPCheck(u.Host)(ctx)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package debug
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/checks"
|
||||
"github.com/opencloud-eu/opencloud/pkg/handlers"
|
||||
@@ -17,9 +18,13 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("web reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr))
|
||||
|
||||
u, err := url.Parse(options.Config.Identity.LDAP.URI)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
readyHandlerConfiguration := healthHandlerConfiguration.
|
||||
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Endpoint)).
|
||||
WithCheck("ldap reachability", checks.NewTCPCheck(options.Config.Identity.LDAP.URI))
|
||||
WithCheck("ldap reachability", checks.NewTCPCheck(u.Host))
|
||||
|
||||
return debug.NewService(
|
||||
debug.Logger(options.Logger),
|
||||
|
||||
@@ -2,6 +2,7 @@ package debug
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/checks"
|
||||
"github.com/opencloud-eu/opencloud/pkg/handlers"
|
||||
@@ -17,8 +18,12 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("http reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr))
|
||||
|
||||
u, err := url.Parse(options.Config.Ldap.URI)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
readyHandlerConfiguration := healthHandlerConfiguration.
|
||||
WithCheck("ldap reachability", checks.NewTCPCheck(options.Config.Ldap.URI))
|
||||
WithCheck("ldap reachability", checks.NewTCPCheck(u.Host))
|
||||
|
||||
return debug.NewService(
|
||||
debug.Logger(options.Logger),
|
||||
|
||||
@@ -3,6 +3,7 @@ package debug
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/checks"
|
||||
"github.com/opencloud-eu/opencloud/pkg/handlers"
|
||||
@@ -22,7 +23,11 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Endpoint)).
|
||||
WithCheck("tika-check", func(ctx context.Context) error {
|
||||
if options.Config.Extractor.Type == "tika" {
|
||||
return checks.NewTCPCheck(options.Config.Extractor.Tika.TikaURL)(ctx)
|
||||
u, err := url.Parse(options.Config.Extractor.Tika.TikaURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return checks.NewTCPCheck(u.Host)(ctx)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user