feat: adds support for Hetzner and coolify deployment platform in statsreporter (#8409)

This commit is contained in:
Nageshbansal 2025-07-02 12:00:32 +05:30 committed by GitHub
parent 2a53918ebd
commit 2ac45b0174
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,6 +104,8 @@ func detectPlatform() string {
return "heroku"
case os.Getenv("RENDER") != "" || os.Getenv("RENDER_SERVICE_ID") != "":
return "render"
case os.Getenv("COOLIFY_RESOURCE_UUID") != "":
return "coolify"
}
// Try to detect cloud provider through metadata endpoints
@ -151,5 +153,16 @@ func detectPlatform() string {
}
}
// Hetzner metadata
if req, err := http.NewRequest(http.MethodGet, "http://169.254.169.254/hetzner/v1/metadata", nil); err == nil {
if resp, err := client.Do(req); err == nil {
resp.Body.Close()
if resp.StatusCode == 200 {
return "hetzner"
}
}
}
return "unknown"
}