diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a8b1591..446e3da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,7 +29,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/go-upkeep + images: ${{ secrets.DOCKERHUB_USERNAME }}/uptop tags: | # This turns git tag "v1.0.0" into docker tag "1.0.0" type=semver,pattern={{version}} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35c6a4e..69f457d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ## Development ```sh -go run cmd/goupkeep/main.go -demo # starts with sample data +go run cmd/uptop/main.go -demo # starts with sample data ssh -p 23234 localhost # connect to TUI ``` diff --git a/README.md b/README.md index 7517786..6ac9cdc 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Go-Upkeep +# uptop 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`. -Built on the foundation of [RDGames/go-upkeep](https://github.com/RDGames/go-upkeep). +Built on the foundation of [RDGames/uptop](https://github.com/RDGames/uptop). ## What it does @@ -18,14 +18,14 @@ Built on the foundation of [RDGames/go-upkeep](https://github.com/RDGames/go-upk ## Quick start ```bash -go run cmd/goupkeep/main.go +go run cmd/uptop/main.go ssh -p 23234 localhost ``` Seed some demo data to see it in action: ```bash -go run cmd/goupkeep/main.go -demo +go run cmd/uptop/main.go -demo ``` ## Install @@ -33,14 +33,14 @@ go run cmd/goupkeep/main.go -demo ### From source ```bash -go install gitea.lerkolabs.com/lerko/uptime/cmd/goupkeep@latest +go install gitea.lerkolabs.com/lerko/uptime/cmd/uptop@latest ``` ### Docker ```bash -docker pull lerko/go-upkeep:latest -docker run -p 23234:23234 -p 8080:8080 -v ./data:/data lerko/go-upkeep +docker pull lerko/uptop:latest +docker run -p 23234:23234 -p 8080:8080 -v ./data:/data lerko/uptop ``` ### Binary @@ -52,15 +52,15 @@ Download from [Releases](https://gitea.lerkolabs.com/lerko/uptime/releases). Export your current monitors: ```bash -goupkeep export -o monitors.yaml +uptop export -o monitors.yaml ``` Apply a config file: ```bash -goupkeep apply -f monitors.yaml -goupkeep apply -f monitors.yaml --dry-run # see what would change -goupkeep apply -f monitors.yaml --prune # delete anything not in the YAML +uptop apply -f monitors.yaml +uptop apply -f monitors.yaml --dry-run # see what would change +uptop apply -f monitors.yaml --prune # delete anything not in the YAML ``` See [docs/config-as-code.md](docs/config-as-code.md) for the full reference. @@ -87,7 +87,7 @@ services: - UPKEEP_CLUSTER_SECRET=change-me ``` -First run: attach to the container (`docker attach go-upkeep`), go to the Users tab, add your SSH public key. Then detach with `Ctrl+P, Ctrl+Q` and connect normally over SSH. +First run: attach to the container (`docker attach uptop`), go to the Users tab, add your SSH public key. Then detach with `Ctrl+P, Ctrl+Q` and connect normally over SSH. ## Environment variables diff --git a/cmd/goupkeep/main.go b/cmd/uptop/main.go similarity index 95% rename from cmd/goupkeep/main.go rename to cmd/uptop/main.go index 00e389b..5e5b055 100644 --- a/cmd/goupkeep/main.go +++ b/cmd/uptop/main.go @@ -5,14 +5,14 @@ import ( "errors" "flag" "fmt" - "go-upkeep/internal/cluster" - "go-upkeep/internal/config" - "go-upkeep/internal/importer" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" - "go-upkeep/internal/server" - "go-upkeep/internal/store" - "go-upkeep/internal/tui" + "gitea.lerkolabs.com/lerko/uptop/internal/cluster" + "gitea.lerkolabs.com/lerko/uptop/internal/config" + "gitea.lerkolabs.com/lerko/uptop/internal/importer" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/server" + "gitea.lerkolabs.com/lerko/uptop/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/tui" "log" "os" "os/signal" @@ -54,9 +54,9 @@ func main() { func printVersion() { if version == "dev" { - fmt.Println("go-upkeep dev") + fmt.Println("uptop dev") } else { - fmt.Printf("go-upkeep %s (%s, %s)\n", version, commit, date) + fmt.Printf("uptop %s (%s, %s)\n", version, commit, date) } } @@ -305,7 +305,7 @@ func runServe(args []string) { fmt.Printf("Error: %v\n", err) } } else { - fmt.Println("Go-Upkeep running in HEADLESS mode") + fmt.Println("uptop running in HEADLESS mode") done := make(chan os.Signal, 1) signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) <-done diff --git a/docs/config-as-code.md b/docs/config-as-code.md index 1c9e8a1..da78a9f 100644 --- a/docs/config-as-code.md +++ b/docs/config-as-code.md @@ -7,13 +7,13 @@ Define your monitors and alerts in a YAML file. Version control them, copy them Export what you already have: ```bash -goupkeep export -o monitors.yaml +uptop export -o monitors.yaml ``` That gives you a working file you can edit and re-apply: ```bash -goupkeep apply -f monitors.yaml +uptop apply -f monitors.yaml ``` That's it. Apply only creates or updates — it won't delete anything unless you tell it to. @@ -184,31 +184,31 @@ All 9 providers work in the YAML. The `settings` map is different per type. **Export current state:** ```bash -goupkeep export -o monitors.yaml # to a file -goupkeep export # to stdout +uptop export -o monitors.yaml # to a file +uptop export # to stdout ``` **Apply a config:** ```bash -goupkeep apply -f monitors.yaml +uptop apply -f monitors.yaml ``` **See what would change first:** ```bash -goupkeep apply -f monitors.yaml --dry-run +uptop apply -f monitors.yaml --dry-run ``` **Delete monitors not in the YAML:** ```bash -goupkeep apply -f monitors.yaml --prune +uptop apply -f monitors.yaml --prune ``` Without `--prune`, apply never deletes anything. It only creates and updates. **Pointing at a different database:** ```bash -goupkeep export -db-type postgres -dsn "host=localhost dbname=upkeep sslmode=disable" -goupkeep apply -f monitors.yaml -db-type postgres -dsn "..." +uptop export -db-type postgres -dsn "host=localhost dbname=upkeep sslmode=disable" +uptop apply -f monitors.yaml -db-type postgres -dsn "..." ``` Both commands respect the `UPKEEP_DB_TYPE` and `UPKEEP_DB_DSN` environment variables too. @@ -230,15 +230,15 @@ If something fails mid-apply, just fix the issue and run it again. It picks up w ```bash # set up your monitors in the TUI first, then export -goupkeep export -o monitors.yaml +uptop export -o monitors.yaml # commit it git add monitors.yaml && git commit -m "add monitor config" # deploy to another instance scp monitors.yaml prod-server: -ssh prod-server goupkeep apply -f monitors.yaml +ssh prod-server uptop apply -f monitors.yaml # or just keep it as a backup you can restore from -goupkeep apply -f monitors.yaml +uptop apply -f monitors.yaml ``` diff --git a/go.mod b/go.mod index 38cc730..06b6111 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go-upkeep +module gitea.lerkolabs.com/lerko/uptop go 1.24.4 diff --git a/internal/alert/alert.go b/internal/alert/alert.go index 12a2f41..e80a2e7 100644 --- a/internal/alert/alert.go +++ b/internal/alert/alert.go @@ -5,7 +5,7 @@ import ( "context" "encoding/json" "fmt" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "net/http" "net/smtp" "strconv" @@ -76,7 +76,7 @@ func pagerdutyPayload(routingKey, severity string) PayloadFunc { "event_action": "trigger", "payload": map[string]string{ "summary": fmt.Sprintf("%s: %s", title, message), - "source": "go-upkeep", + "source": "uptop", "severity": severity, }, }) @@ -184,7 +184,7 @@ func (e *EmailProvider) Send(ctx context.Context, title, message string) error { } auth := smtp.PlainAuth("", e.User, e.Pass, e.Host) msg := []byte("To: " + e.To + "\r\n" + - "Subject: Go-Upkeep: " + title + "\r\n" + + "Subject: uptop: " + title + "\r\n" + "\r\n" + message + "\r\n") return smtp.SendMail(e.Host+":"+e.Port, auth, e.From, []string{e.To}, msg) diff --git a/internal/alert/alert_test.go b/internal/alert/alert_test.go index 3314d17..3668cd0 100644 --- a/internal/alert/alert_test.go +++ b/internal/alert/alert_test.go @@ -3,7 +3,7 @@ package alert import ( "context" "encoding/json" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "net/http" "net/http/httptest" "testing" diff --git a/internal/cluster/cluster.go b/internal/cluster/cluster.go index 53cf847..b10580c 100644 --- a/internal/cluster/cluster.go +++ b/internal/cluster/cluster.go @@ -3,7 +3,7 @@ package cluster import ( "context" "fmt" - "go-upkeep/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" "net/http" "strings" "time" diff --git a/internal/cluster/cluster_test.go b/internal/cluster/cluster_test.go index 63eec88..504ed35 100644 --- a/internal/cluster/cluster_test.go +++ b/internal/cluster/cluster_test.go @@ -3,8 +3,8 @@ package cluster import ( "context" "encoding/json" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" "net/http" "net/http/httptest" "sync" diff --git a/internal/cluster/probe.go b/internal/cluster/probe.go index 4a04687..70197a4 100644 --- a/internal/cluster/probe.go +++ b/internal/cluster/probe.go @@ -6,8 +6,8 @@ import ( "crypto/tls" "encoding/json" "fmt" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" "log" "net/http" "sync" diff --git a/internal/config/apply.go b/internal/config/apply.go index ca37e36..c2cf2ef 100644 --- a/internal/config/apply.go +++ b/internal/config/apply.go @@ -2,8 +2,8 @@ package config import ( "fmt" - "go-upkeep/internal/models" - "go-upkeep/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/store" "reflect" "strings" ) diff --git a/internal/config/apply_test.go b/internal/config/apply_test.go index 824fd61..275180b 100644 --- a/internal/config/apply_test.go +++ b/internal/config/apply_test.go @@ -1,8 +1,8 @@ package config import ( - "go-upkeep/internal/models" - "go-upkeep/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/store" "strings" "testing" ) diff --git a/internal/config/export.go b/internal/config/export.go index dd9bdc6..57708fb 100644 --- a/internal/config/export.go +++ b/internal/config/export.go @@ -2,8 +2,8 @@ package config import ( "fmt" - "go-upkeep/internal/models" - "go-upkeep/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/store" "os" "sort" diff --git a/internal/config/export_test.go b/internal/config/export_test.go index 16b5534..f27c811 100644 --- a/internal/config/export_test.go +++ b/internal/config/export_test.go @@ -1,7 +1,7 @@ package config import ( - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "testing" ) diff --git a/internal/importer/kuma.go b/internal/importer/kuma.go index 953e5d1..e779d93 100644 --- a/internal/importer/kuma.go +++ b/internal/importer/kuma.go @@ -3,7 +3,7 @@ package importer import ( "encoding/json" "fmt" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "os" "strings" ) diff --git a/internal/metrics/prometheus.go b/internal/metrics/prometheus.go index 6e6e39e..84929a3 100644 --- a/internal/metrics/prometheus.go +++ b/internal/metrics/prometheus.go @@ -2,8 +2,8 @@ package metrics import ( "fmt" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" "net/http" "sort" "strings" diff --git a/internal/metrics/prometheus_test.go b/internal/metrics/prometheus_test.go index 847d7cf..2e50889 100644 --- a/internal/metrics/prometheus_test.go +++ b/internal/metrics/prometheus_test.go @@ -2,8 +2,8 @@ package metrics import ( "context" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" "net/http" "net/http/httptest" "strings" diff --git a/internal/monitor/checker.go b/internal/monitor/checker.go index 0fadd5f..c3cb9da 100644 --- a/internal/monitor/checker.go +++ b/internal/monitor/checker.go @@ -2,7 +2,7 @@ package monitor import ( "context" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "net" "net/http" "strconv" diff --git a/internal/monitor/checker_test.go b/internal/monitor/checker_test.go index 39698b4..3db1324 100644 --- a/internal/monitor/checker_test.go +++ b/internal/monitor/checker_test.go @@ -2,7 +2,7 @@ package monitor import ( "crypto/tls" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "net" "net/http" "net/http/httptest" diff --git a/internal/monitor/monitor.go b/internal/monitor/monitor.go index c2b334e..a7a096b 100644 --- a/internal/monitor/monitor.go +++ b/internal/monitor/monitor.go @@ -4,9 +4,9 @@ import ( "context" "crypto/tls" "fmt" - "go-upkeep/internal/alert" - "go-upkeep/internal/models" - "go-upkeep/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/alert" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/store" "math/rand/v2" "net/http" "sync" diff --git a/internal/monitor/monitor_test.go b/internal/monitor/monitor_test.go index dd392de..f4c778b 100644 --- a/internal/monitor/monitor_test.go +++ b/internal/monitor/monitor_test.go @@ -2,7 +2,7 @@ package monitor import ( "fmt" - "go-upkeep/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/models" "sync" "testing" "time" diff --git a/internal/server/server.go b/internal/server/server.go index 2e94214..572be8a 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -4,11 +4,11 @@ import ( "crypto/subtle" "encoding/json" "fmt" - "go-upkeep/internal/importer" - "go-upkeep/internal/metrics" - "go-upkeep/internal/models" - "go-upkeep/internal/monitor" - "go-upkeep/internal/store" + "gitea.lerkolabs.com/lerko/uptop/internal/importer" + "gitea.lerkolabs.com/lerko/uptop/internal/metrics" + "gitea.lerkolabs.com/lerko/uptop/internal/models" + "gitea.lerkolabs.com/lerko/uptop/internal/monitor" + "gitea.lerkolabs.com/lerko/uptop/internal/store" "html/template" "log" "net/http" @@ -59,7 +59,7 @@ var statusTpl = template.Must(template.New("status").Parse(`
-
Powered by Go-Upkeep
+
Powered by uptop