From 8f9210b451467cfef22f5d41154af4d3994be368 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:14:13 -0400 Subject: [PATCH 1/6] feat: add --version flag with build metadata injection Supports `goupkeep version`, `--version`, and `-v`. Prints version, commit hash, and build date when injected via ldflags. Shows "dev" for local builds. Dockerfile updated with ARGs for version injection. --- Dockerfile | 5 ++++- cmd/goupkeep/main.go | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ffcac62..1c0e9c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,10 @@ COPY go.mod go.sum ./ RUN go mod download COPY . . ENV CGO_ENABLED=1 -RUN go build -ldflags="-s -w" -o go-upkeep ./cmd/goupkeep/main.go +ARG VERSION=dev +ARG COMMIT=none +ARG BUILD_DATE=unknown +RUN go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${BUILD_DATE}" -o go-upkeep ./cmd/goupkeep/main.go # --- Stage 2: Runner --- FROM alpine:latest diff --git a/cmd/goupkeep/main.go b/cmd/goupkeep/main.go index 54abb8b..00e389b 100644 --- a/cmd/goupkeep/main.go +++ b/cmd/goupkeep/main.go @@ -27,6 +27,12 @@ import ( "github.com/mattn/go-isatty" ) +var ( + version = "dev" + commit = "none" + date = "unknown" +) + func main() { log.SetOutput(os.Stderr) @@ -38,11 +44,22 @@ func main() { case "export": runExport(os.Args[2:]) return + case "version", "--version", "-v": + printVersion() + return } } runServe(os.Args[1:]) } +func printVersion() { + if version == "dev" { + fmt.Println("go-upkeep dev") + } else { + fmt.Printf("go-upkeep %s (%s, %s)\n", version, commit, date) + } +} + func envOrDefault(key, fallback string) string { if v := os.Getenv(key); v != "" { return v -- 2.52.0 From 611f26846c4c7ff97dfbe2dba3a06cd5b176d72e Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:14:35 -0400 Subject: [PATCH 2/6] chore: update LICENSE with dual copyright for independent fork --- LICENSE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ddf0518..47a4518 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2026 Roman Dvořák +Copyright (c) 2024 Roman Dvořák +Copyright (c) 2026 Tyler Koenig Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- 2.52.0 From 1e0ae2244704ab3cae7387dd9bcacc11d24dfadc Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:14:57 -0400 Subject: [PATCH 3/6] docs: add CHANGELOG.md with release history --- CHANGELOG.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cb9f2a1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,46 @@ +# Changelog + +## [2026.05.2] — 2026-05-23 + +### Added +- Comprehensive test suite (94 tests across monitor, server, cluster) +- golangci-lint config with CI enforcement +- Gitea Actions CI pipeline (test + lint) +- Graceful shutdown for HTTP and SSH servers +- Context-aware alert delivery with timeout +- Request size limits on all POST endpoints +- Constant-time secret comparison +- Check interval jitter to prevent thundering herd +- `--version` flag with build metadata injection + +### Fixed +- Silent JSON unmarshal failures in alert settings +- Panic on crypto/rand failure replaced with error return +- Alert delivery errors now logged instead of swallowed +- log.Fatalf in goroutines replaced with log.Printf +- Deprecated LineUp/LineDown API calls + +### Security +- Cluster secret compared with crypto/subtle (timing-safe) +- http.MaxBytesReader on all JSON endpoints +- ReadHeaderTimeout added to HTTP server + +## [2026.05.1] — 2026-05-14 + +### Added +- Distributed probing with leader + probe nodes +- Config-as-code (YAML apply/export with dry-run, prune) +- TUI visual polish (zebra striping, sparklines, breadcrumbs) +- Incident management and maintenance windows +- 9 alert providers (Discord, Slack, Email, Ntfy, Telegram, PagerDuty, Pushover, Gotify, Webhook) + +## [2026.04.1] — Initial independent fork + +### Added +- SSH-accessible TUI (Bubble Tea + Wish) +- 6 check types (HTTP, Push, Ping, Port, DNS, Group) +- SQLite and PostgreSQL support +- HA clustering with automatic failover +- Prometheus metrics endpoint +- Public status page +- Uptime Kuma import -- 2.52.0 From deb7d017af03cb4fdff3e602dd0aac4149e507ea Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:15:11 -0400 Subject: [PATCH 4/6] docs: add CONTRIBUTING.md --- CONTRIBUTING.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..35c6a4e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +## Development + +```sh +go run cmd/goupkeep/main.go -demo # starts with sample data +ssh -p 23234 localhost # connect to TUI +``` + +## Tests + +```sh +go test ./... # unit tests +go test -race ./... # race detector +golangci-lint run ./... # linting +``` + +## Pull Requests + +- Branch from `main`, PR back to `main` +- Conventional Commits for messages (`feat:`, `fix:`, `chore:`) +- Tests must pass, linter must be clean +- One logical change per PR -- 2.52.0 From 09e1bec9a3e8139c1ee6337d86de03039e031300 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:15:25 -0400 Subject: [PATCH 5/6] docs: add SECURITY.md with disclosure policy --- SECURITY.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..d0127fb --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Reporting a Vulnerability + +If you find a security issue, please email security@lerkolabs.com rather than opening a public issue. + +Include: +- Description of the vulnerability +- Steps to reproduce +- Potential impact + +We'll acknowledge within 48 hours and aim to patch within 7 days for critical issues. + +## Scope + +- SSH server authentication +- Cluster API authentication +- Stored credentials (alert provider tokens) +- Status page information leakage -- 2.52.0 From 1fa2b1d98c92885d49069b26536aee6b928ab341 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Sun, 24 May 2026 14:16:06 -0400 Subject: [PATCH 6/6] docs: add install instructions and Kuma migration guide to README --- LICENSE | 2 +- README.md | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 47a4518..950e32a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Roman Dvořák +Copyright (c) 2026 Roman Dvořák Copyright (c) 2026 Tyler Koenig Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index 291c2de..7517786 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Self-hosted uptime monitor with a TUI you can access over SSH. No browser, no install on the client — just `ssh -p 23234 your-server`. -Originally forked from [RDGames/go-upkeep](https://github.com/RDGames/go-upkeep). This is an independent fork with significant additions. +Built on the foundation of [RDGames/go-upkeep](https://github.com/RDGames/go-upkeep). ## What it does @@ -28,6 +28,25 @@ Seed some demo data to see it in action: go run cmd/goupkeep/main.go -demo ``` +## Install + +### From source + +```bash +go install gitea.lerkolabs.com/lerko/uptime/cmd/goupkeep@latest +``` + +### Docker + +```bash +docker pull lerko/go-upkeep:latest +docker run -p 23234:23234 -p 8080:8080 -v ./data:/data lerko/go-upkeep +``` + +### Binary + +Download from [Releases](https://gitea.lerkolabs.com/lerko/uptime/releases). + ## Config as code Export your current monitors: @@ -85,6 +104,17 @@ First run: attach to the container (`docker attach go-upkeep`), go to the Users | `UPKEEP_CLUSTER_SECRET` | | Shared key for cluster + API auth | | `UPKEEP_INSECURE_SKIP_VERIFY` | `false` | Skip TLS verification for checks | +## Migrating from Uptime Kuma + +Export your Kuma backup JSON, then: + +```bash +curl -X POST http://localhost:8080/api/import/kuma \ + -H "X-Upkeep-Secret: your-secret" \ + -H "Content-Type: application/json" \ + -d @kuma-backup.json +``` + ## License MIT — see [LICENSE](LICENSE). -- 2.52.0