From 3a81ad2410ffcfd99be2059ad5424de02d08bd04 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 21 Jun 2026 17:38:22 +0200 Subject: [PATCH] readme update for healthcheck --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 0c641e9..ec9907a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ Usage of ./endlessh-go Enable prometheus -geoip_supplier string Supplier to obtain Geohash of IPs. Possible values are "off", "ip-api", "max-mind-db" (default "off") + -healthcheck + GET healthcheck_host:healthcheck_port/health and exit 1 if status is not ok or timeout is exceeded (for container healthcheck) + -healthcheck_host string + The address for container healthcheck (default "127.0.0.1") + -healthcheck_port string + HTTP port for container healthcheck; serves JSON with status and uptime at /health (default "51000") -host string SSH listening address (default "0.0.0.0") -interval_ms int @@ -121,6 +127,23 @@ The endlessh-go server stores the geohash of attackers as a label on `endlessh_c You could also use an offline GeoIP database from [MaxMind](https://www.maxmind.com) by setting `-geoip_supplier` to _max-mind-db_ and `-max_mind_db` to the path of the database file. +## Healthcheck + +The endlessh-go server exposes an HTTP health endpoint while the server is running. By default it listens on `127.0.0.1:51000` at `/health` and returns a JSON like this: + +```json +{ + "status": "ok", + "uptime": 123.456789012 +} +``` + +`status` is always "ok". + +`uptime` is the number of seconds since the server started. The host and port can be changed via `-healthcheck_host` and `-healthcheck_port`. + +The [docker image](https://hub.docker.com/r/shizunge/endlessh-go) includes a built-in `HEALTHCHECK` that runs every 30 seconds. + ## Dashboard The dashboard requires Grafana 8.2.