Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b7f48a609 |
No files matched your search
@@ -12,9 +12,9 @@ It is built for teams and hosting providers: organizations with members, roles a
|
||||
|
||||
**What it does**
|
||||
|
||||
- **Checks:** HTTP(S) with keyword, JSON APIs with conditions on values, Prometheus queries, TCP, TLS certificate expiry, DNS, ICMP, and heartbeats pinged by cron jobs.
|
||||
- **Checks:** HTTP(S) with keyword, JSON APIs with conditions on values, Prometheus queries, TCP, TLS certificate expiry, DNS, ICMP; PostgreSQL, MySQL/MariaDB, SQL Server, MongoDB, Redis; MQTT, Kafka, RabbitMQ; gRPC health, SMTP, RADIUS, SNMP; Steam and Minecraft servers; Docker containers; heartbeats pinged by cron jobs, and Prometheus Alertmanager alerts. Credentials are stored encrypted. Platform admins can switch off types an installation cannot offer.
|
||||
- **Multi-region:** checkers run per region, several per region for load and failover; any number of regions per monitor.
|
||||
- **Alerting:** incidents with webhooks (signed) and email, confirmations, maintenance windows (one-off or recurring).
|
||||
- **Alerting:** incidents with webhooks (signed), email, Slack, Discord, Microsoft Teams, Google Chat, Mattermost, Rocket.Chat, Telegram, Matrix, ntfy, Gotify, Pushover, Pushbullet, Signal, PagerDuty, Opsgenie and Apprise; confirmations, maintenance windows (one-off or recurring).
|
||||
- **History:** charts and SLA from one hour to a year, per region; see what the checker saw (redirect chain, timing, certificate, response body).
|
||||
- **Status pages:** unlimited, custom domains with automatic TLS, themes, Markdown, legal notice; served from cache during outages.
|
||||
- **Organizations:** members, custom roles scoped to monitor groups or status pages, API tokens, OpenID Connect SSO per organization, enforced 2FA, audit log.
|
||||
@@ -77,6 +77,8 @@ docker run -d -e UPTIME_API_URL=https://uptime.example.com -e UPTIME_AGENT_TOKEN
|
||||
--entrypoint /usr/local/bin/checker uptimesebi
|
||||
```
|
||||
|
||||
Docker monitors ask the Docker API of the checker's host. Mount its socket read-only (`-v /var/run/docker.sock:/var/run/docker.sock:ro`) into checkers that may see private networks; shared checkers never use a socket, and installations without one can switch the Docker type off in the admin panel.
|
||||
|
||||
All settings are environment variables; [`.env.example`](.env.example) lists them with explanations. In particular:
|
||||
|
||||
- `UPTIME_SECRET_KEYS` encrypts stored secrets. Generate one with `echo "k1:$(head -c32 /dev/urandom | base64)"` and keep it safe; rotate by prepending a new key.
|
||||
|
||||
@@ -57,7 +57,7 @@ var endpoints = []endpoint{
|
||||
description: "Only monitors the caller may read; header values and heartbeat tokens only for those who may change the monitor.",
|
||||
perm: "monitors.read", resp: obj{"monitors": []monitorView{}}},
|
||||
{method: "POST", path: "/api/v1/org/monitors", tag: "Monitors", summary: "Create a monitor",
|
||||
description: "`type` is one of http, json, prometheus, tcp, tls, dns, icmp, postgres, mysql, mssql, mongodb, redis, mqtt, kafka, rabbitmq, grpc, smtp, radius, snmp, steam, minecraft, heartbeat or alertmanager (GET /api/v1/org/check-types lists those offered); `config` depends on it (see HTTPConfig, JSONConfig, PrometheusConfig, DNSConfig, TLSConfig, DBConfig, BrokerConfig, GRPCConfig, SMTPConfig, RADIUSConfig, SNMPConfig, GameConfig, HeartbeatConfig, AlertmanagerConfig). Passwords, RADIUS secrets and SNMP communities are stored encrypted and never returned: `secrets_set` names those set, and an update that leaves one empty keeps it. Heartbeat and alertmanager monitors take neither target nor regions; heartbeats return their `ping_url`.",
|
||||
description: "`type` is one of http, json, prometheus, tcp, tls, dns, icmp, postgres, mysql, mssql, mongodb, redis, mqtt, kafka, rabbitmq, grpc, smtp, radius, snmp, steam, minecraft, docker, heartbeat or alertmanager (GET /api/v1/org/check-types lists those offered); `config` depends on it (see HTTPConfig, JSONConfig, PrometheusConfig, DNSConfig, TLSConfig, DBConfig, BrokerConfig, GRPCConfig, SMTPConfig, RADIUSConfig, SNMPConfig, GameConfig, DockerConfig, HeartbeatConfig, AlertmanagerConfig). Passwords, RADIUS secrets and SNMP communities are stored encrypted and never returned: `secrets_set` names those set, and an update that leaves one empty keeps it. Heartbeat and alertmanager monitors take neither target nor regions; heartbeats return their `ping_url`.",
|
||||
perm: "monitors.write", req: monitorRequest{}, status: http.StatusCreated, resp: monitorView{}},
|
||||
{method: "PUT", path: "/api/v1/org/monitors/:id", tag: "Monitors", summary: "Change a monitor", perm: "monitors.write",
|
||||
req: monitorRequest{}, resp: monitorView{}},
|
||||
|
||||
@@ -655,6 +655,10 @@ func fillForm(f *web.MonitorForm, m store.Monitor) {
|
||||
var c check.GameConfig
|
||||
_ = json.Unmarshal(m.Config, &c)
|
||||
f.Game = web.GameForm{Edition: c.Edition, MinFreeSlots: c.MinFreeSlots}
|
||||
case check.Docker:
|
||||
var c check.DockerConfig
|
||||
_ = json.Unmarshal(m.Config, &c)
|
||||
f.DockerHost = c.Host
|
||||
case check.Alertmanager:
|
||||
var c check.AlertmanagerConfig
|
||||
_ = json.Unmarshal(m.Config, &c)
|
||||
|
||||
@@ -236,7 +236,7 @@ func buildOpenAPI(publicURL string) map[string]any {
|
||||
},
|
||||
}
|
||||
// Monitor settings travel as untyped config; their shapes per type.
|
||||
for _, c := range []any{check.HTTPConfig{}, check.JSONConfig{}, check.PrometheusConfig{}, check.DNSConfig{}, check.TLSConfig{}, check.DBConfig{}, check.BrokerConfig{}, check.GRPCConfig{}, check.SMTPConfig{}, check.RADIUSConfig{}, check.SNMPConfig{}, check.GameConfig{}, check.HeartbeatConfig{}, check.AlertmanagerConfig{}} {
|
||||
for _, c := range []any{check.HTTPConfig{}, check.JSONConfig{}, check.PrometheusConfig{}, check.DNSConfig{}, check.TLSConfig{}, check.DBConfig{}, check.BrokerConfig{}, check.GRPCConfig{}, check.SMTPConfig{}, check.RADIUSConfig{}, check.SNMPConfig{}, check.GameConfig{}, check.DockerConfig{}, check.HeartbeatConfig{}, check.AlertmanagerConfig{}} {
|
||||
b.schema(reflect.TypeOf(c))
|
||||
}
|
||||
paths := map[string]map[string]any{}
|
||||
|
||||
@@ -34,7 +34,7 @@ const (
|
||||
)
|
||||
|
||||
// Types lists every check type.
|
||||
var Types = []Type{HTTP, TCP, ICMP, DNS, TLS, JSON, Prometheus, Postgres, MySQL, MSSQL, MongoDB, Redis, MQTT, Kafka, RabbitMQ, GRPC, SMTP, RADIUS, SNMP, Steam, Minecraft, Heartbeat, Alertmanager}
|
||||
var Types = []Type{HTTP, TCP, ICMP, DNS, TLS, JSON, Prometheus, Postgres, MySQL, MSSQL, MongoDB, Redis, MQTT, Kafka, RabbitMQ, GRPC, SMTP, RADIUS, SNMP, Steam, Minecraft, Docker, Heartbeat, Alertmanager}
|
||||
|
||||
// Passive reports whether t is reported to us rather than run by checkers.
|
||||
func Passive(t Type) bool { return t == Heartbeat || t == Alertmanager }
|
||||
@@ -111,6 +111,7 @@ var impls = map[Type]impl{
|
||||
SNMP: snmpCheck{},
|
||||
Steam: gameCheck{Steam},
|
||||
Minecraft: gameCheck{Minecraft},
|
||||
Docker: dockerCheck{},
|
||||
Heartbeat: heartbeatCheck{},
|
||||
Alertmanager: alertmanagerCheck{},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/netguard"
|
||||
)
|
||||
|
||||
// Docker checks a container through the Docker Engine API.
|
||||
const Docker Type = "docker"
|
||||
|
||||
// DefaultDockerHost is the checker's own Docker socket.
|
||||
const DefaultDockerHost = "unix:///var/run/docker.sock"
|
||||
|
||||
// DockerConfig configures a container check; the target is the container
|
||||
// name or ID.
|
||||
type DockerConfig struct {
|
||||
// Host is a Unix socket ("unix:///var/run/docker.sock") or a plain
|
||||
// TCP endpoint ("tcp://docker.internal:2375").
|
||||
Host string `json:"host"`
|
||||
}
|
||||
|
||||
var containerName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}$`)
|
||||
|
||||
type dockerCheck struct{}
|
||||
|
||||
func (dockerCheck) validate(target string, config json.RawMessage) (json.RawMessage, error) {
|
||||
if !containerName.MatchString(target) {
|
||||
return nil, invalid("invalid_target")
|
||||
}
|
||||
c := DockerConfig{Host: DefaultDockerHost}
|
||||
if err := json.Unmarshal(config, &c); err != nil {
|
||||
return nil, invalid("invalid_config")
|
||||
}
|
||||
if c.Host == "" {
|
||||
c.Host = DefaultDockerHost
|
||||
}
|
||||
u, err := url.Parse(c.Host)
|
||||
switch {
|
||||
case err != nil:
|
||||
return nil, invalid("invalid_config")
|
||||
case u.Scheme == "unix" && u.Host == "" && strings.HasPrefix(u.Path, "/") && len(u.Path) < 200:
|
||||
case u.Scheme == "tcp" && validHostPort(u.Host) && (u.Path == "" || u.Path == "/"):
|
||||
default:
|
||||
return nil, invalid("invalid_config")
|
||||
}
|
||||
return encode(c), nil
|
||||
}
|
||||
|
||||
func (dockerCheck) run(ctx context.Context, s Spec) Outcome {
|
||||
c, err := decode[DockerConfig](s.Config)
|
||||
if err != nil {
|
||||
return Outcome{Error: "invalid configuration"}
|
||||
}
|
||||
u, err := url.Parse(c.Host)
|
||||
if err != nil {
|
||||
return Outcome{Error: "invalid configuration"}
|
||||
}
|
||||
d := netguard.Dialer(s.AllowPrivate, s.Timeout)
|
||||
var dial func(ctx context.Context, _, _ string) (net.Conn, error)
|
||||
if u.Scheme == "unix" {
|
||||
// The socket controls the checker's own host; shared checkers
|
||||
// may not use it.
|
||||
if !s.AllowPrivate {
|
||||
return Outcome{Error: "this checker does not allow Docker sockets"}
|
||||
}
|
||||
dial = func(ctx context.Context, _, _ string) (net.Conn, error) { return d.DialContext(ctx, "unix", u.Path) }
|
||||
} else {
|
||||
dial = func(ctx context.Context, _, _ string) (net.Conn, error) { return d.DialContext(ctx, "tcp", u.Host) }
|
||||
}
|
||||
client := &http.Client{Transport: &http.Transport{DialContext: dial, DisableKeepAlives: true}}
|
||||
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, "http://docker/containers/"+url.PathEscape(s.Target)+"/json", nil)
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
var op *net.OpError
|
||||
if errors.As(err, &op) {
|
||||
return Outcome{Error: describeNetErr(op)}
|
||||
}
|
||||
return Outcome{Error: truncate(err.Error(), 300)}
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
body, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20))
|
||||
switch {
|
||||
case resp.StatusCode == http.StatusNotFound:
|
||||
return Outcome{Error: "no container named " + s.Target}
|
||||
case resp.StatusCode != http.StatusOK:
|
||||
var e struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
_ = json.Unmarshal(body, &e)
|
||||
return Outcome{Error: fmt.Sprintf("Docker API answered %d %s", resp.StatusCode, truncate(e.Message, 200))}
|
||||
}
|
||||
var info struct {
|
||||
State struct {
|
||||
Status string `json:"Status"`
|
||||
ExitCode int `json:"ExitCode"`
|
||||
Health *struct {
|
||||
Status string `json:"Status"`
|
||||
} `json:"Health"`
|
||||
} `json:"State"`
|
||||
}
|
||||
if err := json.Unmarshal(body, &info); err != nil {
|
||||
return Outcome{Error: "not a Docker API answer"}
|
||||
}
|
||||
st := info.State
|
||||
switch {
|
||||
case st.Status == "exited":
|
||||
return Outcome{Error: fmt.Sprintf("container exited with code %d", st.ExitCode)}
|
||||
case st.Status != "running":
|
||||
return Outcome{Error: "container is " + st.Status}
|
||||
case st.Health != nil && st.Health.Status == "unhealthy":
|
||||
return Outcome{Error: "container is unhealthy"}
|
||||
}
|
||||
return Outcome{OK: true}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// dockerAPI serves container states like the Docker Engine API, on a Unix
|
||||
// socket and on TCP.
|
||||
func dockerAPI(t *testing.T) (socket, tcp string) {
|
||||
states := map[string]any{
|
||||
"web": map[string]any{"Status": "running"},
|
||||
"api": map[string]any{"Status": "running", "Health": map[string]any{"Status": "healthy"}},
|
||||
"worker": map[string]any{"Status": "running", "Health": map[string]any{"Status": "unhealthy"}},
|
||||
"migrate": map[string]any{"Status": "exited", "ExitCode": 3},
|
||||
"paused-1": map[string]any{"Status": "paused"},
|
||||
}
|
||||
h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
name := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, "/containers/"), "/json")
|
||||
st, ok := states[name]
|
||||
if !ok {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
_ = json.NewEncoder(w).Encode(map[string]string{"message": "No such container: " + name})
|
||||
return
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"Name": "/" + name, "State": st})
|
||||
})
|
||||
socket = filepath.Join(t.TempDir(), "docker.sock")
|
||||
l, err := net.Listen("unix", socket)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
srv := httptest.NewUnstartedServer(h)
|
||||
srv.Listener = l
|
||||
srv.Start()
|
||||
t.Cleanup(srv.Close)
|
||||
ts := httptest.NewServer(h)
|
||||
t.Cleanup(ts.Close)
|
||||
return socket, strings.TrimPrefix(ts.URL, "http://")
|
||||
}
|
||||
|
||||
func TestDockerCheck(t *testing.T) {
|
||||
socket, tcp := dockerAPI(t)
|
||||
for _, host := range []string{"unix://" + socket, "tcp://" + tcp} {
|
||||
cfg := `{"host":"` + host + `"}`
|
||||
for target, want := range map[string]string{
|
||||
"web": "",
|
||||
"api": "",
|
||||
"worker": "container is unhealthy",
|
||||
"migrate": "container exited with code 3",
|
||||
"paused-1": "container is paused",
|
||||
"gone": "no container named gone",
|
||||
} {
|
||||
o := runShort(t, Docker, target, cfg)
|
||||
if want == "" && !o.OK || want != "" && (o.OK || o.Error != want) {
|
||||
t.Errorf("%s %s: %+v, want %q", host, target, o, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Shared checkers may use neither their socket nor private addresses.
|
||||
for _, host := range []string{"unix://" + socket, "tcp://" + tcp} {
|
||||
c, _ := Validate(Docker, "web", []byte(`{"host":"`+host+`"}`))
|
||||
if o := Run(t.Context(), Spec{Type: Docker, Target: "web", Timeout: 2 * time.Second, Config: c}); o.OK {
|
||||
t.Errorf("%s reached by a shared checker", host)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDockerValidate(t *testing.T) {
|
||||
got, err := Validate(Docker, "web", []byte(`{}`))
|
||||
if err != nil || string(got) != `{"host":"unix:///var/run/docker.sock"}` {
|
||||
t.Errorf("default = %s, %v", got, err)
|
||||
}
|
||||
for _, tc := range []struct{ target, cfg string }{
|
||||
{"../etc", `{}`},
|
||||
{"web", `{"host":"http://docker:2375"}`},
|
||||
{"web", `{"host":"tcp://docker"}`},
|
||||
{"web", `{"host":"unix://relative.sock"}`},
|
||||
} {
|
||||
if _, err := Validate(Docker, tc.target, []byte(tc.cfg)); err == nil {
|
||||
t.Errorf("Validate(%s, %s) accepted", tc.target, tc.cfg)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ func TestDynamicFamilies(t *testing.T) {
|
||||
en := catalogKeys(t)["en"]
|
||||
families := map[string][]string{
|
||||
"status.": {"up", "degraded", "down", "unknown", "paused", "maintenance"},
|
||||
"monitors.type_": {"http", "tcp", "tls", "dns", "icmp", "json", "prometheus", "postgres", "mysql", "mssql", "mongodb", "redis", "mqtt", "kafka", "rabbitmq", "grpc", "smtp", "radius", "snmp", "steam", "minecraft", "heartbeat", "alertmanager"},
|
||||
"monitors.type_": {"http", "tcp", "tls", "dns", "icmp", "json", "prometheus", "postgres", "mysql", "mssql", "mongodb", "redis", "mqtt", "kafka", "rabbitmq", "grpc", "smtp", "radius", "snmp", "steam", "minecraft", "docker", "heartbeat", "alertmanager"},
|
||||
"channels.type_": {"webhook", "email", "slack", "discord", "teams", "googlechat", "mattermost", "rocketchat", "telegram", "matrix", "ntfy", "gotify", "pushover", "pushbullet", "signal", "pagerduty", "opsgenie", "apprise"},
|
||||
"agents.kind_": {"checker", "statuspage"},
|
||||
"page.status.": {"operational", "degraded", "outage", "unknown", "maintenance"},
|
||||
|
||||
@@ -609,6 +609,8 @@
|
||||
"monitors.dns_expect": "Erwartete Antwort (optional)",
|
||||
"monitors.dns_record": "Record-Typ",
|
||||
"monitors.dns_resolver": "Resolver (host:port, optional)",
|
||||
"monitors.docker_hint": "Ziel ist der Container-Name oder die ID. Erreichbar, solange der Container läuft und nicht unhealthy ist. Der Socket ist der Host des Checkers und funktioniert nur auf Checkern, die private Netze erreichen dürfen.",
|
||||
"monitors.docker_host": "Docker-Host (unix://-Socket oder tcp://host:2375)",
|
||||
"monitors.edit": "Monitor bearbeiten",
|
||||
"monitors.expect_status": "Erwarteter Status (z. B. 2xx, 301)",
|
||||
"monitors.follow_redirects": "Weiterleitungen folgen",
|
||||
@@ -689,13 +691,14 @@
|
||||
"monitors.stale_hours_hint": "Ein feuernder Alert, den Alertmanager nicht mehr wiederholt, gilt nach dieser Zeit als beendet. Halte sie über repeat_interval.",
|
||||
"monitors.steam_hint": "Ziel ist host:port des Query-Ports (meist der Spielport, z. B. 27015). Fragt den Server wie der Steam-Serverbrowser nach seinen Infos (A2S); funktioniert für Source- und die meisten Steam-Spiele.",
|
||||
"monitors.target": "Ziel",
|
||||
"monitors.target_hint": "URL für HTTP, host:port für TCP, TLS, Datenbanken und Broker (Kafka: mehrere, durch Komma getrennt), Hostname für DNS und ICMP.",
|
||||
"monitors.target_hint": "URL für HTTP, host:port für TCP, TLS, Datenbanken, Broker (Kafka: mehrere, durch Komma getrennt) und Spieleserver, Hostname für DNS und ICMP, Container-Name für Docker.",
|
||||
"monitors.timeout": "Timeout (ms)",
|
||||
"monitors.tls_min_days": "Mindestens Tage bis Ablauf",
|
||||
"monitors.tls_server_name": "Servername (optional)",
|
||||
"monitors.type": "Check-Typ",
|
||||
"monitors.type_alertmanager": "Alertmanager",
|
||||
"monitors.type_dns": "DNS",
|
||||
"monitors.type_docker": "Docker-Container",
|
||||
"monitors.type_grpc": "gRPC",
|
||||
"monitors.type_heartbeat": "Heartbeat",
|
||||
"monitors.type_http": "HTTP(S)",
|
||||
|
||||
@@ -609,6 +609,8 @@
|
||||
"monitors.dns_expect": "Expected answer (optional)",
|
||||
"monitors.dns_record": "Record type",
|
||||
"monitors.dns_resolver": "Resolver (host:port, optional)",
|
||||
"monitors.docker_hint": "Target is the container name or ID. Up while the container runs and is not unhealthy. The socket is the checker's own host and only works on checkers allowed to reach private networks.",
|
||||
"monitors.docker_host": "Docker host (unix:// socket or tcp://host:2375)",
|
||||
"monitors.edit": "Edit monitor",
|
||||
"monitors.expect_status": "Expected status (e.g. 2xx, 301)",
|
||||
"monitors.follow_redirects": "Follow redirects",
|
||||
@@ -689,13 +691,14 @@
|
||||
"monitors.stale_hours_hint": "A firing alert Alertmanager stops repeating counts as over after this time. Keep it above repeat_interval.",
|
||||
"monitors.steam_hint": "Target is host:port of the query port (usually the game port, e.g. 27015). Asks the server for its info like the Steam server browser (A2S); works for Source and most Steam games.",
|
||||
"monitors.target": "Target",
|
||||
"monitors.target_hint": "URL for HTTP, host:port for TCP, TLS, databases and brokers (Kafka: several, comma-separated), host name for DNS and ICMP.",
|
||||
"monitors.target_hint": "URL for HTTP, host:port for TCP, TLS, databases, brokers (Kafka: several, comma-separated) and game servers, host name for DNS and ICMP, container name for Docker.",
|
||||
"monitors.timeout": "Timeout (ms)",
|
||||
"monitors.tls_min_days": "Minimum days until expiry",
|
||||
"monitors.tls_server_name": "Server name (optional)",
|
||||
"monitors.type": "Check type",
|
||||
"monitors.type_alertmanager": "Alertmanager",
|
||||
"monitors.type_dns": "DNS",
|
||||
"monitors.type_docker": "Docker container",
|
||||
"monitors.type_grpc": "gRPC",
|
||||
"monitors.type_heartbeat": "Heartbeat",
|
||||
"monitors.type_http": "HTTP(S)",
|
||||
|
||||
@@ -495,6 +495,7 @@ type MonitorForm struct {
|
||||
Broker BrokerForm
|
||||
Proto ProtocolForm
|
||||
Game GameForm
|
||||
DockerHost string
|
||||
// Types are the check types to offer.
|
||||
Types []string
|
||||
}
|
||||
@@ -692,6 +693,10 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
|
||||
</label>
|
||||
@numberField(i18n.T(ctx, "monitors.game_min_free_slots"), "config.min_free_slots", f.Game.MinFreeSlots, 0, 10000, i18n.T(ctx, "monitors.game_min_free_slots_hint"))
|
||||
}
|
||||
@typeFields("docker", f.Type) {
|
||||
<p class="mb-4 text-xs text-muted">{ i18n.T(ctx, "monitors.docker_hint") }</p>
|
||||
@valueField(i18n.T(ctx, "monitors.docker_host"), "config.host", f.DockerHost, "unix:///var/run/docker.sock", false)
|
||||
}
|
||||
@typeFields("alertmanager", f.Type) {
|
||||
<p class="mb-4 text-xs text-muted">
|
||||
{ i18n.T(ctx, "monitors.alertmanager_hint") }
|
||||
|
||||
+1234
-1194
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user