diff --git a/Dockerfile b/Dockerfile index 7bf19bb..765e1ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,6 @@ FROM scratch COPY --from=builder /checker-dummy /checker-dummy USER 65534:65534 EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD ["/checker-dummy", "-healthcheck"] ENTRYPOINT ["/checker-dummy"] diff --git a/README.md b/README.md index 712b644..6e7c166 100644 --- a/README.md +++ b/README.md @@ -43,34 +43,6 @@ Every checker does three things: A checker can run in three modes: -### Standalone HTTP Server (External Checker) - -The checker runs as its own process and exposes an HTTP API. happyDomain communicates with it over the network. This is the most flexible option: you can write your checker in any language, deploy it independently, and scale it separately. - -``` -┌─────────────┐ HTTP ┌─────────────────┐ -│ happyDomain │ ──────────► │ checker-dummy │ -│ server │ ◄────────── │ (this program) │ -└─────────────┘ └─────────────────┘ -``` - -### In-Process Plugin - -The checker is compiled as a Go plugin (`.so` file) and loaded directly into the happyDomain process. This is simpler to deploy (single binary) but requires the checker to be written in Go. - -``` -┌──────────────────────────────────────┐ -│ happyDomain server │ -│ │ -│ ┌──────────────────────────────┐ │ -│ │ checker-dummy.so (plugin) │ │ -│ │ checker-ping.so (plugin) │ │ -│ │ checker-matrix.so (plugin) │ │ -│ │ checker-....so (plugin) │ │ -│ └──────────────────────────────┘ │ -└──────────────────────────────────────┘ -``` - ### Built-in Checker The checker package can be imported directly into the happyDomain server and registered at init time: no plugin loading, no separate process. This avoids the operational burden of Go's plugin system (matching toolchain versions, CGO, `.so` distribution) entirely. @@ -94,6 +66,34 @@ This mode is reserved for checkers maintained as part of the happyDomain project **Both standalone, plugin and built-in modes use the same checker code; only the entry point differs.** +### In-Process Plugin + +The checker is compiled as a Go plugin (`.so` file) and loaded directly into the happyDomain process. This is simpler to deploy (single binary) but requires the checker to be written in Go. + +``` +┌──────────────────────────────────────┐ +│ happyDomain server │ +│ │ +│ ┌──────────────────────────────┐ │ +│ │ checker-dummy.so (plugin) │ │ +│ │ checker-ping.so (plugin) │ │ +│ │ checker-matrix.so (plugin) │ │ +│ │ checker-....so (plugin) │ │ +│ └──────────────────────────────┘ │ +└──────────────────────────────────────┘ +``` + +### Standalone HTTP Server (External Checker) + +The checker runs as its own process and exposes an HTTP API. happyDomain communicates with it over the network. This is the most flexible option: you can write your checker in any language, deploy it independently, and scale it separately. + +``` +┌─────────────┐ HTTP ┌─────────────────┐ +│ happyDomain │ ──────────► │ checker-dummy │ +│ server │ ◄────────── │ (this program) │ +└─────────────┘ └─────────────────┘ +``` + ## Repository Structure diff --git a/go.mod b/go.mod index d1b843f..1b83b1e 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module git.happydns.org/checker-dummy go 1.25.0 -require git.happydns.org/checker-sdk-go v1.3.0 +require git.happydns.org/checker-sdk-go v1.5.0 diff --git a/go.sum b/go.sum index fe4952c..c389c68 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -git.happydns.org/checker-sdk-go v1.3.0 h1:FG2kIhlJCzI0m35EhxSgn4UWc9M4ha6aZTeoChu4l7A= -git.happydns.org/checker-sdk-go v1.3.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI= +git.happydns.org/checker-sdk-go v1.5.0 h1:5uD5Cm6xJ+lwnhbJ09iCXGHbYS9zRh+Yh0NeBHkAPBY= +git.happydns.org/checker-sdk-go v1.5.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=